diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-24 19:23:00 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-24 19:23:00 +0200 |
commit | 78e4fc15d3b4904317785c4004c26f612c49b4d2 (patch) | |
tree | 23d0a1276d57d106c102f206a3808e228bbfd3e6 | |
parent | 853bfc8f7ff406f3c13ec44d2a18f1790be82c76 (diff) | |
parent | 68b62652661bcd1afd80cd8388e3c434d30321b1 (diff) |
Merge branch 'master' into feature/gnumake4feature/gnumake4
27 files changed, 772 insertions, 641 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index ccc1eaeea3..cdb53b0bf4 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -110,7 +110,6 @@ class VirtualDevice; class SfxPrinter; class SvNumberFormatter; class SvStringsSort; -class SvUShorts; class SvxMacro; class SvxMacroTableDtor; class SwAutoCompleteWord; @@ -1568,7 +1567,7 @@ public: const SwPosition& rPos, sal_uInt16 nRows, sal_uInt16 nCols, short eAdjust, const SwTableAutoFmt* pTAFmt = 0, - const SvUShorts* pColArr = 0, + const std::vector<sal_uInt16> *pColArr = 0, sal_Bool bCalledFromShell = sal_False, sal_Bool bNewModel = sal_True ); diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index f5c2610d1d..0b8f9f7a0e 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -242,7 +242,7 @@ public: virtual sal_Bool SetAttr( const SfxPoolItem& ); virtual sal_Bool SetAttr( const SfxItemSet& rSet ); virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); - virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr ); + virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr ); virtual sal_uInt16 ResetAllAttr(); /// insert text content diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index c6c07506d0..53141d4ee6 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -452,7 +452,7 @@ public: virtual sal_Bool SetAttr( const SfxPoolItem& ); virtual sal_Bool SetAttr( const SfxItemSet& rSet ); virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); - virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr ); + virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr ); virtual sal_uInt16 ResetAllAttr(); // Obtains attribute that is not delivered via conditional style! diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 20c1dc7ca0..7828e8de48 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -201,6 +201,7 @@ public: sal_uInt16 GetRedlineAuthor(); const String& GetRedlineAuthor(sal_uInt16 nPos); sal_uInt16 InsertRedlineAuthor(const String& rAuthor); + void SetRedlineAuthor(const String& rAuthor); // for unit tests void GetInsertAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet); void GetDeletedAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet); diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx index 297bf9f3c9..10ee439180 100644 --- a/sw/qa/core/swdoc-test.cxx +++ b/sw/qa/core/swdoc-test.cxx @@ -59,6 +59,8 @@ #include "docsh.hxx" #include "shellres.hxx" #include "docufld.hxx" +#include "swcrsr.hxx" +#include "swmodule.hxx" SO2_DECL_REF(SwDocShell) SO2_IMPL_REF(SwDocShell) @@ -170,9 +172,165 @@ void SwDocTest::testFileNameFields() m_xDocShRef->DoInitNew(0); } +static int +getRand(int modulus) +{ + if (modulus <= 0) + return 0; + return rand() % modulus; +} + +static rtl::OUString +getRandString() +{ + static rtl::OUString aText( rtl::OUString::createFromAscii("AAAAA BBBB CCC DD E \n")); + int s = getRand(aText.getLength()); + int j = getRand(aText.getLength() - s); + rtl::OUString aRet(aText + s, j); + if (!getRand(5)) + aRet += rtl::OUString(sal_Unicode('\n')); +// fprintf (stderr, "rand string '%s'\n", OUStringToOString(aRet, RTL_TEXTENCODING_UTF8).getStr()); + return aRet; +} + +#ifdef COMPLEX +static SwPosition +getRandomPosition(SwDoc *pDoc, int nOffset) +{ + SwPaM aPam(pDoc->GetNodes()); + SwCursor aCrs(*aPam.Start(), 0, false); + for (int sskip = getRand(nOffset); sskip > 0; sskip--) + aCrs.GoNextSentence(); + aCrs.GoNextCell(getRand(50)); + return *aCrs.GetPoint(); +} +#endif + void SwDocTest::randomTest() { CPPUNIT_ASSERT_MESSAGE("SwDoc::IsRedlineOn()", !m_pDoc->IsRedlineOn()); + RedlineMode_t modes[] = { + nsRedlineMode_t::REDLINE_NONE, + nsRedlineMode_t::REDLINE_ON, + nsRedlineMode_t::REDLINE_SHOW_MASK, + nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_MASK, + nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE, + nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE | nsRedlineMode_t::REDLINE_SHOW_MASK, + nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT, + nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE + }; + static const char *authors[] = { + "Jim", "Bob", "JimBobina", "Helga", "Gertrude", "Spagna", "Hurtleweed" + }; + + for( sal_uInt16 rlm = 0; rlm < SAL_N_ELEMENTS(modes); rlm++) + { +#ifdef COMPLEX + m_pDoc->ClearDoc(); + + // setup redlining + m_pDoc->SetRedlineMode(modes[rlm]); + SW_MOD()->SetRedlineAuthor(rtl::OUString::createFromAscii(authors[0])); +#endif + + for( int i = 0; i < 2000; i++ ) + { +#ifdef COMPLEX + SwPaM aPam(m_pDoc->GetNodes()); + SwCursor aCrs(getRandomPosition(m_pDoc, i/20), 0, false); + aCrs.SetMark(); + aCrs.GoNextCell(getRand(30)); +#else // simple: + SwNodeIndex nNode( m_pDoc->GetNodes().GetEndOfContent(), -1 ); + SwPaM aCrs( nNode ); +#endif + + switch (getRand (i < 50 ? 3 : 6)) { + // insert ops first + case 0: { + if (!m_pDoc->InsertString(aCrs, getRandString())) + fprintf (stderr, "failed to insert string !\n"); + break; + } + case 1: + break; + case 2: { // switch author + int a = getRand(SAL_N_ELEMENTS(authors)); + SW_MOD()->SetRedlineAuthor(rtl::OUString::createFromAscii(authors[a])); + break; + } + +#ifdef COMPLEX + // movement / deletion ops later + case 3: // deletion + switch (getRand(6)) { + case 0: + m_pDoc->DelFullPara(aCrs); + break; + case 1: + m_pDoc->DeleteRange(aCrs); + break; + case 2: + m_pDoc->DeleteAndJoin(aCrs, !!getRand(1)); + break; + case 3: + default: + m_pDoc->Overwrite(aCrs, getRandString()); + break; + } + break; + case 4: { // movement + IDocumentContentOperations::SwMoveFlags nFlags = + (IDocumentContentOperations::SwMoveFlags) + (getRand(1) ? // FIXME: puterb this more ? + IDocumentContentOperations::DOC_MOVEDEFAULT : + IDocumentContentOperations::DOC_MOVEALLFLYS | + IDocumentContentOperations::DOC_CREATEUNDOOBJ | + IDocumentContentOperations::DOC_MOVEREDLINES | + IDocumentContentOperations::DOC_NO_DELFRMS); + SwPosition aTo(getRandomPosition(m_pDoc, i/10)); + m_pDoc->MoveRange(aCrs, aTo, nFlags); + break; + } +#endif + case 5: + break; + + // undo / redo ? + default: + break; + } +#ifdef COMPLEX + SwPosition start(m_pDoc->GetNodes()); + SwPosition end(m_pDoc->GetNodes().GetEndOfContent()); + CheckNodesRange(start.nNode, end.nNode, sal_True); +#endif + } + +#if 0 + fprintf (stderr, "write it !\n"); +#ifdef COMPLEX + SfxFilter aFilter(rtl::OUString::createFromAscii("writer8"), + rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), + rtl::OUString() ); +#else + SfxFilter aFilter(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text")), + rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TEXT")), rtl::OUString() ); +#endif + SfxMedium aDstMed(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///tmp/test.txt")), + STREAM_STD_READWRITE, true); + aDstMed.SetFilter(&aFilter); + m_xDocShRef->DoSaveAs(aDstMed); + m_xDocShRef->DoSaveCompleted(&aDstMed); + m_xDocShRef->DoInitNew(0); +#endif + +#ifndef COMPLEX + return; +#endif + } } SwDocTest::SwDocTest() diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 7f6a5f3dc5..7cd35a5322 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -1255,9 +1255,9 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos, } // Convert list of ranges of whichIds to a corresponding list of whichIds -SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges) +std::vector<sal_uInt16> * lcl_RangesToVector(sal_uInt16 * pRanges) { - SvUShorts * pResult = new SvUShorts(); + std::vector<sal_uInt16> * pResult = new std::vector<sal_uInt16>(); int i = 0; while (pRanges[i] != 0) @@ -1265,7 +1265,7 @@ SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges) OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges"); for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++) - pResult->Insert(j, pResult->Count()); + pResult->push_back(j); i += 2; } @@ -1423,8 +1423,8 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev ) first resetting all character attributes in first paragraph (pTxtNd). */ - SvUShorts * pShorts = - lcl_RangesToUShorts(aCharFmtSetRange); + std::vector<sal_uInt16> * pShorts = + lcl_RangesToVector(aCharFmtSetRange); pTxtNd->ResetAttr(*pShorts); delete pShorts; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 7116ed5245..1bfe62ad58 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -31,7 +31,6 @@ #define _ZFORLIST_DECLARE_TABLE -#define _SVSTDARR_USHORTS #include <hintids.hxx> #include <rtl/logfile.hxx> #include <svl/itemiter.hxx> @@ -213,7 +212,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) 0 ); const SfxItemSet* pSet = pNode->GetpSwAttrSet(); - SvUShorts aClearWhichIds; + std::vector<sal_uInt16> aClearWhichIds; // restoring all paragraph list attributes { SfxItemSet aListAttrSet( pDoc->GetAttrPool(), @@ -227,7 +226,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) const SfxPoolItem* pItem = aIter.GetCurItem(); while( pItem ) { - aClearWhichIds.Insert( pItem->Which(), aClearWhichIds.Count() ); + aClearWhichIds.push_back( pItem->Which() ); pItem = aIter.NextItem(); } } @@ -265,7 +264,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) if( bSave ) { aSet.Put( *pItem ); - aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() ); + aClearWhichIds.push_back( aSavIds[n] ); } } } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index bc7b5d1ccd..30d9d385d9 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -339,7 +339,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, const SwPosition& rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, const SwTableAutoFmt* pTAFmt, - const SvUShorts* pColArr, + const std::vector<sal_uInt16> *pColArr, sal_Bool bCalledFromShell, sal_Bool bNewModel ) { @@ -354,7 +354,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, // sollte das ColumnArray die falsche Anzahl haben wird es ignoriert! if( pColArr && - (nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->Count() ) + (size_t)(nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->size() ) pColArr = 0; } @@ -426,12 +426,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, SwTwips nWidth = USHRT_MAX; if( pColArr ) { - sal_uInt16 nSttPos = (*pColArr)[ 0 ]; - sal_uInt16 nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-1)]; + sal_uInt16 nSttPos = pColArr->front(); + sal_uInt16 nLastPos = pColArr->back(); if( text::HoriOrientation::NONE == eAdjust ) { sal_uInt16 nFrmWidth = nLastPos; - nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-2)]; + nLastPos = (*pColArr)[ pColArr->size()-2 ]; pTableFmt->SetFmtAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) ); } nWidth = nLastPos - nSttPos; @@ -531,7 +531,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, // Positionen der Spalten!! (nicht deren Breite!) if( pColArr ) { - nWidth = (*pColArr)[ sal_uInt16(i + 1) ] - (*pColArr)[ i ]; + nWidth = (*pColArr)[ i + 1 ] - (*pColArr)[ i ]; if( pBoxF->GetFrmSize().GetWidth() != nWidth ) { if( pBoxF->GetDepends() ) // neues Format erzeugen! diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 1b80f83414..b63967692e 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1561,7 +1561,7 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) } return bRet; } -sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) +sal_Bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) { if( !GetpSwAttrSet() ) return sal_False; @@ -1576,10 +1576,7 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) sal_uInt16 nDel = 0; if( IsModifyLocked() ) { - std::vector<sal_uInt16> aClearWhichIds; - for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) - aClearWhichIds.push_back( rWhichArr[ n ] ); - + std::vector<sal_uInt16> aClearWhichIds(rWhichArr); nDel = ClearItemsFromAttrSet( aClearWhichIds ); } else @@ -1587,8 +1584,9 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) - if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhichArr[ n ], &aOld, &aNew )) + std::vector<sal_uInt16>::const_iterator it; + for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it ) + if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, *it, &aOld, &aNew )) ++nDel; if( nDel ) diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 25156a12e2..cf30fef664 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -29,13 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#define _SVSTDARR_USHORTS - #include <ctype.h> #include <hintids.hxx> -#include <svl/svstdarr.hxx> - #include <unotools/charclass.hxx> #include <vcl/msgbox.hxx> @@ -660,7 +656,7 @@ sal_Bool SwAutoFormat::DoTable() xub_StrLen n = nSttPlus; const sal_Unicode* pStr = rTmp.GetBuffer() + n; - SvUShorts aPosArr( 5, 5 ); + std::vector<sal_uInt16> aPosArr; while( *pStr ) { @@ -675,7 +671,7 @@ sal_Bool SwAutoFormat::DoTable() case '+': case '|': - aPosArr.Insert( static_cast<sal_uInt16>(aInfo.GetCharPos(n)), aPosArr.Count() ); + aPosArr.push_back( static_cast<sal_uInt16>(aInfo.GetCharPos(n)) ); break; default: @@ -687,10 +683,10 @@ sal_Bool SwAutoFormat::DoTable() ++pStr; } - if( 1 < aPosArr.Count() ) + if( 1 < aPosArr.size() ) { // Ausrichtung vom Textnode besorgen: - sal_uInt16 nColCnt = aPosArr.Count() - 1; + sal_uInt16 nColCnt = aPosArr.size() - 1; SwTwips nSttPos = aPosArr[ 0 ]; sal_Int16 eHori; switch( pAktTxtNd->GetSwAttrSet().GetAdjust().GetAdjust() ) @@ -704,7 +700,7 @@ sal_Bool SwAutoFormat::DoTable() eHori = text::HoriOrientation::NONE; // dann muss als letztes noch die akt. FrameBreite // ins Array - aPosArr.Insert( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()), aPosArr.Count() ); + aPosArr.push_back( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()) ); } else eHori = text::HoriOrientation::LEFT; @@ -720,7 +716,7 @@ sal_Bool SwAutoFormat::DoTable() 0, &aPosArr ); aDelPam.GetPoint()->nNode = aIdx; } - return 1 < aPosArr.Count(); + return 1 < aPosArr.size(); } diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index be93d4af43..a661bc201a 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -30,11 +30,6 @@ #include <undobj.hxx> -#ifndef _SVSTDARR_HXX -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif - #include <vector> #include <set> #include <swtypes.hxx> @@ -63,7 +58,7 @@ class SwUndoInsTbl : public SwUndo String sTblNm; SwInsertTableOptions aInsTblOpts; SwDDEFieldType* pDDEFldType; - SvUShorts* pColWidth; + std::vector<sal_uInt16> *pColWidth; SwRedlineData* pRedlData; SwTableAutoFmt* pAutoFmt; sal_uLong nSttNode; @@ -73,7 +68,7 @@ class SwUndoInsTbl : public SwUndo public: SwUndoInsTbl( const SwPosition&, sal_uInt16 nCols, sal_uInt16 nRows, sal_uInt16 eAdjust, const SwInsertTableOptions& rInsTblOpts, - const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr, + const SwTableAutoFmt* pTAFmt, const std::vector<sal_uInt16> *pColArr, const String & rName); virtual ~SwUndoInsTbl(); diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index f493f4b875..8d914afde6 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -29,12 +29,9 @@ #define _ROLBCK_HXX #include <tools/solar.h> -#ifndef _SVSTDARR_HXX -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif #include <svl/itemset.hxx> +#include <vector> #include <set> //Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten. @@ -282,7 +279,7 @@ class SwHistoryBookmark : public SwHistoryHint class SwHistorySetAttrSet : public SwHistoryHint { SfxItemSet m_OldSet; - SvUShorts m_ResetArray; + std::vector<sal_uInt16> m_ResetArray; const sal_uLong m_nNodeIndex; public: @@ -297,7 +294,7 @@ class SwHistoryResetAttrSet : public SwHistoryHint const sal_uLong m_nNodeIndex; const xub_StrLen m_nStart; const xub_StrLen m_nEnd; - SvUShorts m_Array; + std::vector<sal_uInt16> m_Array; public: SwHistoryResetAttrSet( const SfxItemSet& rSet, sal_uLong nNode, @@ -305,7 +302,7 @@ public: xub_StrLen nEnd = STRING_MAXLEN ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - const SvUShorts& GetArr() const { return m_Array; } + const std::vector<sal_uInt16>& GetArr() const { return m_Array; } sal_uLong GetNode() const { return m_nNodeIndex; } xub_StrLen GetCntnt() const { return m_nStart; } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 4151c66894..68d83400ab 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4454,7 +4454,7 @@ namespace { const sal_uInt16 nWhich1, const sal_uInt16 nWhich2 ); HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode, - const SvUShorts& rWhichArr ); + const std::vector<sal_uInt16>& rWhichArr ); HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode ); ~HandleResetAttrAtTxtNode(); @@ -4567,7 +4567,7 @@ namespace { } HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode, - const SvUShorts& rWhichArr ) + const std::vector<sal_uInt16>& rWhichArr ) : mrTxtNode( rTxtNode ), mbListStyleOrIdReset( false ), mbUpdateListLevel( false ), @@ -4576,17 +4576,17 @@ namespace { { bool bRemoveFromList( false ); { - const sal_uInt16 nEnd = rWhichArr.Count(); - for ( sal_uInt16 n = 0; n < nEnd; ++n ) + std::vector<sal_uInt16>::const_iterator it; + for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it) { // RES_PARATR_NUMRULE and RES_PARATR_LIST_ID - if ( rWhichArr[ n ] == RES_PARATR_NUMRULE ) + if ( *it == RES_PARATR_NUMRULE ) { bRemoveFromList = bRemoveFromList || mrTxtNode.GetNumRule() != 0; mbListStyleOrIdReset = true; } - else if ( rWhichArr[ n ] == RES_PARATR_LIST_ID ) + else if ( *it == RES_PARATR_LIST_ID ) { bRemoveFromList = bRemoveFromList || ( mrTxtNode.GetpSwAttrSet() && @@ -4596,7 +4596,7 @@ namespace { } // #i70748# // RES_PARATR_OUTLINELEVEL - else if ( rWhichArr[ n ] == RES_PARATR_OUTLINELEVEL ) + else if ( *it == RES_PARATR_OUTLINELEVEL ) { mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr(); } @@ -4605,19 +4605,19 @@ namespace { { // RES_PARATR_LIST_LEVEL mbUpdateListLevel = mbUpdateListLevel || - ( rWhichArr[ n ] == RES_PARATR_LIST_LEVEL && + ( *it == RES_PARATR_LIST_LEVEL && mrTxtNode.HasAttrListLevel() ); // RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE mbUpdateListRestart = mbUpdateListRestart || - ( rWhichArr[ n ] == RES_PARATR_LIST_ISRESTART && + ( *it == RES_PARATR_LIST_ISRESTART && mrTxtNode.IsListRestart() ) || - ( rWhichArr[ n ] == RES_PARATR_LIST_RESTARTVALUE && + ( *it == RES_PARATR_LIST_RESTARTVALUE && mrTxtNode.HasAttrListRestartValue() ); // RES_PARATR_LIST_ISCOUNTED mbUpdateListCount = mbUpdateListCount || - ( rWhichArr[ n ] == RES_PARATR_LIST_ISCOUNTED && + ( *it == RES_PARATR_LIST_ISCOUNTED && !mrTxtNode.IsCountedInList() ); } } @@ -4718,7 +4718,7 @@ sal_Bool SwTxtNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) return bRet; } -sal_Bool SwTxtNode::ResetAttr( const SvUShorts& rWhichArr ) +sal_Bool SwTxtNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) { const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr ); mbInSetOrResetAttr = true; diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 27f44b0b4d..1d77c66cd2 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -729,7 +729,7 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet, do { if( !rSetArr.count( pOrigItem->Which() )) { - m_ResetArray.Insert( pOrigItem->Which(), m_ResetArray.Count() ); + m_ResetArray.push_back( pOrigItem->Which() ); m_OldSet.ClearItem( pOrigItem->Which() ); } else @@ -798,7 +798,7 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool ) if ( pNode->IsCntntNode() ) { static_cast<SwCntntNode*>(pNode)->SetAttr( m_OldSet ); - if ( m_ResetArray.Count() ) + if ( !m_ResetArray.empty() ) { static_cast<SwCntntNode*>(pNode)->ResetAttr( m_ResetArray ); } @@ -808,9 +808,9 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool ) SwFmt& rFmt = *static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt(); rFmt.SetFmtAttr( m_OldSet ); - if ( m_ResetArray.Count() ) + if ( !m_ResetArray.empty() ) { - rFmt.ResetFmtAttr( *m_ResetArray.GetData() ); + rFmt.ResetFmtAttr( m_ResetArray.front() ); } } } @@ -857,7 +857,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet, } else { - m_Array.Insert( aIter.GetCurItem()->Which(), m_Array.Count() ); + m_Array.push_back( aIter.GetCurItem()->Which() ); } if( aIter.IsAtEnd() ) @@ -868,7 +868,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet, if ( bAutoStyle ) { - m_Array.Insert( RES_TXTATR_AUTOFMT, m_Array.Count() ); + m_Array.push_back( RES_TXTATR_AUTOFMT ); } } @@ -882,22 +882,22 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool ) if (pCntntNd) { - const sal_uInt16* pArr = m_Array.GetData(); + std::vector<sal_uInt16>::iterator it; if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart ) { // no area: use ContentNode - for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr ) + for ( it = m_Array.begin(); it != m_Array.end(); ++it ) { - pCntntNd->ResetAttr( *pArr ); + pCntntNd->ResetAttr( *it ); } } else { // area: use TextNode - for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr ) + for ( it = m_Array.begin(); it != m_Array.end(); ++it ) { static_cast<SwTxtNode*>(pCntntNd)-> - DeleteAttributes( *pArr, m_nStart, m_nEnd ); + DeleteAttributes( *it, m_nStart, m_nEnd ); } } } diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index c30d924a44..5d3ab70b3d 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -29,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#define _SVSTDARR_USHORTS #include <UndoAttribute.hxx> #include <svl/itemiter.hxx> @@ -967,8 +966,8 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc ) nCntnt = pHistoryHint->GetCntnt(); if ( STRING_MAXLEN != nCntnt ) { - const SvUShorts& rArr = pHistoryHint->GetArr(); - for ( sal_uInt16 i = rArr.Count(); i; ) + const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr(); + for ( sal_uInt16 i = rArr.size(); i; ) { if ( RES_TXTATR_FTN == rArr[ --i ] ) { diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 72db55117f..f054e25334 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -240,7 +240,7 @@ sal_uInt16 aSave_BoxCntntSet[] = { SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw, sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts, const SwTableAutoFmt* pTAFmt, - const SvUShorts* pColArr, + const std::vector<sal_uInt16> *pColArr, const String & rName) : SwUndo( UNDO_INSTABLE ), aInsTblOpts( rInsTblOpts ), pDDEFldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFmt( 0 ), @@ -248,8 +248,7 @@ SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 n { if( pColArr ) { - pColWidth = new SvUShorts( 0, 1 ); - pColWidth->Insert( pColArr, 0 ); + pColWidth = new std::vector<sal_uInt16>(*pColArr); } if( pTAFmt ) pAutoFmt = new SwTableAutoFmt( *pTAFmt ); diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index ec149870fa..1b7d087323 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1723,12 +1723,12 @@ void SwHTMLParser::NewStyle() { String sType; - const HTMLOptions *pOptions2 = GetOptions(); - for( sal_uInt16 i = pOptions2->Count(); i; ) + const HTMLOptions& rOptions2 = GetOptions(); + for (size_t i = rOptions2.size(); i; ) { - const HTMLOption *pOption = (*pOptions2)[--i]; - if( HTML_O_TYPE==pOption->GetToken() ) - sType = pOption->GetString(); + const HTMLOption& rOption = rOptions2[--i]; + if( HTML_O_TYPE == rOption.GetToken() ) + sType = rOption.GetString(); } bIgnoreRawData = sType.Len() && @@ -1818,20 +1818,20 @@ void SwHTMLParser::InsertLink() { String sRel, sHRef, sType; - const HTMLOptions *pOptions2 = GetOptions(); - for( sal_uInt16 i = pOptions2->Count(); i; ) + const HTMLOptions& rOptions2 = GetOptions(); + for (size_t i = rOptions2.size(); i; ) { - const HTMLOption *pOption = (*pOptions2)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rOptions2[--i]; + switch( rOption.GetToken() ) { case HTML_O_REL: - sRel = pOption->GetString(); + sRel = rOption.GetString(); break; case HTML_O_HREF: - sHRef = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), pOption->GetString(), Link(), false ); + sHRef = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), rOption.GetString(), Link(), false ); break; case HTML_O_TYPE: - sType = pOption->GetString(); + sType = rOption.GetString(); break; } } diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 9fa931c69c..c7b615cf1a 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -294,93 +294,92 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) sal_Int16 nAmount = -6; Color aBGColor; - const HTMLOptions *pHTMLOptions = GetOptions(); - sal_uInt16 nArrLen = pHTMLOptions->Count(); - for ( sal_uInt16 i=0; i<nArrLen; i++ ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i) { - const HTMLOption *pOption = (*pHTMLOptions)[i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_BEHAVIOR: eAniKind = - (SdrTextAniKind)pOption->GetEnum( aHTMLMarqBehaviorTable, + (SdrTextAniKind)rOption.GetEnum( aHTMLMarqBehaviorTable, static_cast< sal_uInt16 >(eAniKind) ); break; case HTML_O_BGCOLOR: - pOption->GetColor( aBGColor ); + rOption.GetColor( aBGColor ); bBGColor = sal_True; break; case HTML_O_DIRECTION: eAniDir = - (SdrTextAniDirection)pOption->GetEnum( aHTMLMarqDirectionTable, + (SdrTextAniDirection)rOption.GetEnum( aHTMLMarqDirectionTable, static_cast< sal_uInt16 >(eAniDir) ); bDirection = sal_True; break; case HTML_O_LOOP: - if( pOption->GetString(). + if( rOption.GetString(). EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_LOOP_infinite) ) { nCount = 0; } else { - sal_uInt32 nLoop = pOption->GetSNumber(); + sal_uInt32 nLoop = rOption.GetSNumber(); nCount = (sal_uInt16)(nLoop>0 ? nLoop : 0 ); } break; case HTML_O_SCROLLAMOUNT: - nAmount = -((sal_Int16)pOption->GetNumber()); + nAmount = -((sal_Int16)rOption.GetNumber()); break; case HTML_O_SCROLLDELAY: - nDelay = (sal_uInt16)pOption->GetNumber(); + nDelay = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: // erstmal nur als Pixelwerte merken! - nWidth = pOption->GetNumber(); - bPrcWidth = pOption->GetString().Search('%') != STRING_NOTFOUND; + nWidth = rOption.GetNumber(); + bPrcWidth = rOption.GetString().Search('%') != STRING_NOTFOUND; if( bPrcWidth && nWidth>100 ) nWidth = 100; break; case HTML_O_HEIGHT: // erstmal nur als Pixelwerte merken! - nHeight = pOption->GetNumber(); - if( pOption->GetString().Search('%') != STRING_NOTFOUND ) + nHeight = rOption.GetNumber(); + if( rOption.GetString().Search('%') != STRING_NOTFOUND ) nHeight = 0; break; case HTML_O_HSPACE: // erstmal nur als Pixelwerte merken! - aSpace.Height() = pOption->GetNumber(); + aSpace.Height() = rOption.GetNumber(); break; case HTML_O_VSPACE: // erstmal nur als Pixelwerte merken! - aSpace.Width() = pOption->GetNumber(); + aSpace.Width() = rOption.GetNumber(); break; case HTML_O_ALIGN: eVertOri = - pOption->GetEnum( aHTMLImgVAlignTable, + rOption.GetEnum( aHTMLImgVAlignTable, text::VertOrientation::TOP ); eHoriOri = - pOption->GetEnum( aHTMLImgHAlignTable, + rOption.GetEnum( aHTMLImgHAlignTable, text::HoriOrientation::NONE ); break; } diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 0570f6a34f..81d612f9a8 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -231,35 +231,35 @@ void SwHTMLParser::NewField() String aValue, aNumFmt, aNumValue, aName; const HTMLOption *pSubOption=0, *pFmtOption=0; - const HTMLOptions *pHTMLOptions = GetOptions(); - sal_uInt16 i; + const HTMLOptions& rHTMLOptions = GetOptions(); + size_t i; - for( i = pHTMLOptions->Count(); i; ) + for ( i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_TYPE: - bKnownType = pOption->GetEnum( nType, aHTMLFldTypeTable ); + bKnownType = rOption.GetEnum( nType, aHTMLFldTypeTable ); break; case HTML_O_SUBTYPE: - pSubOption = pOption; + pSubOption = &rOption; break; case HTML_O_FORMAT: - pFmtOption = pOption; + pFmtOption = &rOption; break; case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_VALUE: - aValue = pOption->GetString(); + aValue = rOption.GetString(); break; case HTML_O_SDNUM: - aNumFmt = pOption->GetString(); + aNumFmt = rOption.GetString(); bHasNumFmt = sal_True; break; case HTML_O_SDVAL: - aNumValue = pOption->GetString(); + aNumValue = rOption.GetString(); bHasNumValue = sal_True; break; case HTML_O_SDFIXED: diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 0db2cd381b..dc88e9e1f1 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1342,30 +1342,30 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; + const HTMLOption& rOption = rHTMLOptions[--i]; ScriptType eScriptType2 = eDfltScriptType; sal_uInt16 nEvent = 0; sal_Bool bSetEvent = sal_False; - switch( pOption->GetToken() ) + switch( rOption.GetToken() ) { case HTML_O_ACTION: - aAction = pOption->GetString(); + aAction = rOption.GetString(); break; case HTML_O_METHOD: - nMethod = pOption->GetEnum( aHTMLFormMethodTable, nMethod ); + nMethod = rOption.GetEnum( aHTMLFormMethodTable, nMethod ); break; case HTML_O_ENCTYPE: - nEncType = pOption->GetEnum( aHTMLFormEncTypeTable, nEncType ); + nEncType = rOption.GetEnum( aHTMLFormEncTypeTable, nEncType ); break; case HTML_O_TARGET: - sTarget = pOption->GetString(); + sTarget = rOption.GetString(); break; case HTML_O_NAME: - sName = pOption->GetString(); + sName = rOption.GetString(); break; case HTML_O_SDONSUBMIT: @@ -1383,15 +1383,15 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) break; default: - lcl_html_getEvents( pOption->GetTokenString(), - pOption->GetString(), + lcl_html_getEvents( rOption.GetTokenString(), + rOption.GetString(), aUnoMacroTbl, aUnoMacroParamTbl ); break; } if( bSetEvent ) { - String sEvent( pOption->GetString() ); + String sEvent( rOption.GetString() ); if( sEvent.Len() ) { sEvent.ConvertLineEnd(); @@ -1516,33 +1516,33 @@ void SwHTMLParser::InsertInput() const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); sal_uInt16 nKeepCRLFToken = HTML_O_VALUE; - const HTMLOptions *pHTMLOptions = GetOptions( &nKeepCRLFToken ); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions( &nKeepCRLFToken ); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; + const HTMLOption& rOption = rHTMLOptions[--i]; ScriptType eScriptType2 = eDfltScriptType; sal_uInt16 nEvent = 0; sal_Bool bSetEvent = sal_False; - switch( pOption->GetToken() ) + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_TYPE: - eType = pOption->GetInputType(); + eType = rOption.GetInputType(); break; case HTML_O_NAME: - sName = pOption->GetString(); + sName = rOption.GetString(); break; case HTML_O_VALUE: - sText = pOption->GetString(); + sText = rOption.GetString(); bValue = sal_True; break; case HTML_O_CHECKED: @@ -1552,31 +1552,31 @@ void SwHTMLParser::InsertInput() bDisabled = sal_True; break; case HTML_O_MAXLENGTH: - nMaxLen = (sal_Int16)pOption->GetNumber(); + nMaxLen = (sal_Int16)rOption.GetNumber(); break; case HTML_O_SIZE: - nSize = (sal_uInt16)pOption->GetNumber(); + nSize = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_SRC: - sImgSrc = pOption->GetString(); + sImgSrc = rOption.GetString(); break; case HTML_O_WIDTH: // erstmal nur als Pixelwerte merken! - nWidth = pOption->GetNumber(); + nWidth = rOption.GetNumber(); break; case HTML_O_HEIGHT: // erstmal nur als Pixelwerte merken! - nHeight = pOption->GetNumber(); + nHeight = rOption.GetNumber(); break; case HTML_O_ALIGN: eVertOri = - pOption->GetEnum( aHTMLImgVAlignTable, eVertOri ); + rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = - pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri ); + rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; case HTML_O_TABINDEX: // erstmal nur als Pixelwerte merken! - nTabIndex = pOption->GetNumber(); + nTabIndex = rOption.GetNumber(); break; case HTML_O_SDONFOCUS: @@ -1615,15 +1615,15 @@ void SwHTMLParser::InsertInput() break; default: - lcl_html_getEvents( pOption->GetTokenString(), - pOption->GetString(), + lcl_html_getEvents( rOption.GetTokenString(), + rOption.GetString(), aUnoMacroTbl, aUnoMacroParamTbl ); break; } if( bSetEvent ) { - String sEvent( pOption->GetString() ); + String sEvent( rOption.GetString() ); if( sEvent.Len() ) { sEvent.ConvertLineEnd(); @@ -2007,43 +2007,43 @@ void SwHTMLParser::NewTextArea() ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; + const HTMLOption& rOption = rHTMLOptions[--i]; ScriptType eScriptType2 = eDfltScriptType; sal_uInt16 nEvent = 0; sal_Bool bSetEvent = sal_False; - switch( pOption->GetToken() ) + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_NAME: - sName = pOption->GetString(); + sName = rOption.GetString(); break; case HTML_O_DISABLED: bDisabled = sal_True; break; case HTML_O_ROWS: - nRows = (sal_uInt16)pOption->GetNumber(); + nRows = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_COLS: - nCols = (sal_uInt16)pOption->GetNumber(); + nCols = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WRAP: - nWrap = pOption->GetEnum( aHTMLTextAreaWrapTable, nWrap ); + nWrap = rOption.GetEnum( aHTMLTextAreaWrapTable, nWrap ); break; case HTML_O_TABINDEX: - nTabIndex = pOption->GetSNumber(); + nTabIndex = rOption.GetSNumber(); break; case HTML_O_SDONFOCUS: @@ -2082,15 +2082,15 @@ void SwHTMLParser::NewTextArea() break; default: - lcl_html_getEvents( pOption->GetTokenString(), - pOption->GetString(), + lcl_html_getEvents( rOption.GetTokenString(), + rOption.GetString(), aUnoMacroTbl, aUnoMacroParamTbl ); break; } if( bSetEvent ) { - String sEvent( pOption->GetString() ); + String sEvent( rOption.GetString() ); if( sEvent.Len() ) { sEvent.ConvertLineEnd(); @@ -2297,27 +2297,27 @@ void SwHTMLParser::NewSelect() ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; + const HTMLOption& rOption = rHTMLOptions[--i]; ScriptType eScriptType2 = eDfltScriptType; sal_uInt16 nEvent = 0; sal_Bool bSetEvent = sal_False; - switch( pOption->GetToken() ) + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_NAME: - sName = pOption->GetString(); + sName = rOption.GetString(); break; case HTML_O_MULTIPLE: bMultiple = sal_True; @@ -2326,11 +2326,11 @@ void SwHTMLParser::NewSelect() bDisabled = sal_True; break; case HTML_O_SIZE: - nSelectEntryCnt = (sal_uInt16)pOption->GetNumber(); + nSelectEntryCnt = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_TABINDEX: - nTabIndex = pOption->GetSNumber(); + nTabIndex = rOption.GetSNumber(); break; case HTML_O_SDONFOCUS: @@ -2362,15 +2362,15 @@ void SwHTMLParser::NewSelect() break; default: - lcl_html_getEvents( pOption->GetTokenString(), - pOption->GetString(), + lcl_html_getEvents( rOption.GetTokenString(), + rOption.GetString(), aUnoMacroTbl, aUnoMacroParamTbl ); break; } if( bSetEvent ) { - String sEvent( pOption->GetString() ); + String sEvent( rOption.GetString() ); if( sEvent.Len() ) { sEvent.ConvertLineEnd(); @@ -2601,11 +2601,11 @@ void SwHTMLParser::InsertSelectOption() bLBEntrySelected = sal_False; String aValue; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: // erstmal weglassen!!! @@ -2614,7 +2614,7 @@ void SwHTMLParser::InsertSelectOption() bLBEntrySelected = sal_True; break; case HTML_O_VALUE: - aValue = pOption->GetString(); + aValue = rOption.GetString(); if( !aValue.Len() ) aValue.AssignAscii( "$$$empty$$$" ); break; diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 5a5160d7f0..61765bd964 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -337,70 +337,70 @@ void SwHTMLParser::InsertImage() String sDfltScriptType; GetDefaultScriptType( eDfltScriptType, sDfltScriptType ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { sal_uInt16 nEvent = 0; ScriptType eScriptType2 = eDfltScriptType; - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_SRC: - sGrfNm = pOption->GetString(); + sGrfNm = rOption.GetString(); if( !InternalImgToPrivateURL(sGrfNm) ) sGrfNm = INetURLObject::GetAbsURL( sBaseURL, sGrfNm ); break; case HTML_O_ALIGN: eVertOri = - pOption->GetEnum( aHTMLImgVAlignTable, + rOption.GetEnum( aHTMLImgVAlignTable, text::VertOrientation::TOP ); eHoriOri = - pOption->GetEnum( aHTMLImgHAlignTable, + rOption.GetEnum( aHTMLImgHAlignTable, text::HoriOrientation::NONE ); break; case HTML_O_WIDTH: // erstmal nur als Pixelwerte merken! - nWidth = pOption->GetNumber(); - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); + nWidth = rOption.GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; case HTML_O_HEIGHT: // erstmal nur als Pixelwerte merken! - nHeight = pOption->GetNumber(); - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); + nHeight = rOption.GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); if( bPrcHeight && nHeight>100 ) nHeight = 100; break; case HTML_O_VSPACE: - nVSpace = pOption->GetNumber(); + nVSpace = rOption.GetNumber(); break; case HTML_O_HSPACE: - nHSpace = pOption->GetNumber(); + nHSpace = rOption.GetNumber(); break; case HTML_O_ALT: - sAltNm = pOption->GetString(); + sAltNm = rOption.GetString(); break; case HTML_O_BORDER: - nBorder = (sal_uInt16)pOption->GetNumber(); + nBorder = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ISMAP: bIsMap = sal_True; break; case HTML_O_USEMAP: - aMap = pOption->GetString(); + aMap = rOption.GetString(); break; case HTML_O_NAME: - sHTMLGrfName = pOption->GetString(); + sHTMLGrfName = rOption.GetString(); break; case HTML_O_SDONLOAD: @@ -422,7 +422,7 @@ void SwHTMLParser::InsertImage() goto IMAGE_SETEVENT; IMAGE_SETEVENT: { - String sTmp( pOption->GetString() ); + String sTmp( rOption.GetString() ); if( sTmp.Len() ) { sTmp.ConvertLineEnd(); @@ -816,36 +816,36 @@ void SwHTMLParser::InsertBodyOptions() String sDfltScriptType; GetDefaultScriptType( eDfltScriptType, sDfltScriptType ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; + const HTMLOption& rOption = rHTMLOptions[--i]; ScriptType eScriptType2 = eDfltScriptType; rtl::OUString aEvent; sal_Bool bSetEvent = sal_False; - switch( pOption->GetToken() ) + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_BACKGROUND: - aBackGround = pOption->GetString(); + aBackGround = rOption.GetString(); break; case HTML_O_BGCOLOR: - pOption->GetColor( aBGColor ); + rOption.GetColor( aBGColor ); bBGColor = sal_True; break; case HTML_O_TEXT: - pOption->GetColor( aTextColor ); + rOption.GetColor( aTextColor ); bTextColor = sal_True; break; case HTML_O_LINK: - pOption->GetColor( aLinkColor ); + rOption.GetColor( aLinkColor ); bLinkColor = sal_True; break; case HTML_O_VLINK: - pOption->GetColor( aVLinkColor ); + rOption.GetColor( aVLinkColor ); bVLinkColor = sal_True; break; @@ -881,20 +881,20 @@ void SwHTMLParser::InsertBodyOptions() break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); bTextColor = sal_True; break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } if( bSetEvent ) { - const String& rEvent = pOption->GetString(); + const String& rEvent = rOption.GetString(); if( rEvent.Len() ) InsertBasicDocEvent( aEvent, rEvent, eScriptType2, sDfltScriptType ); @@ -1050,43 +1050,43 @@ void SwHTMLParser::NewAnchor() String sDfltScriptType; GetDefaultScriptType( eDfltScriptType, sDfltScriptType ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { sal_uInt16 nEvent = 0; ScriptType eScriptType2 = eDfltScriptType; - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_HREF: - sHRef = pOption->GetString(); + sHRef = rOption.GetString(); bHasHRef = sal_True; break; case HTML_O_TARGET: - sTarget = pOption->GetString(); + sTarget = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_SDFIXED: bFixed = sal_True; break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_SDONCLICK: @@ -1108,7 +1108,7 @@ void SwHTMLParser::NewAnchor() goto ANCHOR_SETEVENT; ANCHOR_SETEVENT: { - String sTmp( pOption->GetString() ); + String sTmp( rOption.GetString() ); if( sTmp.Len() ) { sTmp.ConvertLineEnd(); diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index 7a9ed66cda..93811d2a64 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -180,23 +180,23 @@ void SwHTMLParser::NewNumBulList( int nToken ) String aId, aStyle, aClass, aBulletSrc, aLang, aDir; sal_Int16 eVertOri = text::VertOrientation::NONE; sal_uInt16 nWidth=USHRT_MAX, nHeight=USHRT_MAX; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_TYPE: - if( bNewNumFmt && pOption->GetString().Len() ) + if( bNewNumFmt && rOption.GetString().Len() ) { switch( nToken ) { case HTML_ORDERLIST_ON: bChangeNumFmt = sal_True; - switch( pOption->GetString().GetChar(0) ) + switch( rOption.GetString().GetChar(0) ) { case 'A': aNumFmt.SetNumberingType(SVX_NUM_CHARS_UPPER_LETTER); break; case 'a': aNumFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); break; @@ -207,7 +207,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) break; case HTML_UNORDERLIST_ON: - aNumFmt.SetBulletChar( (sal_Unicode)pOption->GetEnum( + aNumFmt.SetBulletChar( (sal_Unicode)rOption.GetEnum( aHTMLULTypeTable,aNumFmt.GetBulletChar() ) ); bChangeNumFmt = sal_True; break; @@ -216,7 +216,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) break; case HTML_O_START: { - sal_uInt16 nStart = (sal_uInt16)pOption->GetNumber(); + sal_uInt16 nStart = (sal_uInt16)rOption.GetNumber(); if( bNewNumFmt ) { aNumFmt.SetStart( nStart ); @@ -229,34 +229,34 @@ void SwHTMLParser::NewNumBulList( int nToken ) } break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_SRC: if( bNewNumFmt ) { - aBulletSrc = pOption->GetString(); + aBulletSrc = rOption.GetString(); if( !InternalImgToPrivateURL(aBulletSrc) ) aBulletSrc = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), aBulletSrc, Link(), false ); } break; case HTML_O_WIDTH: - nWidth = (sal_uInt16)pOption->GetNumber(); + nWidth = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_HEIGHT: - nHeight = (sal_uInt16)pOption->GetNumber(); + nHeight = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ALIGN: eVertOri = - (sal_Int16)pOption->GetEnum( aHTMLImgVAlignTable, + (sal_Int16)rOption.GetEnum( aHTMLImgVAlignTable, static_cast< sal_uInt16 >(eVertOri) ); break; } @@ -485,29 +485,29 @@ void SwHTMLParser::NewNumBulListItem( int nToken ) if( USHRT_MAX != nStart ) GetNumInfo().SetNodeStartValue( nLevel ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_VALUE: - nStart = (sal_uInt16)pOption->GetNumber(); + nStart = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index b572691e73..31f8a01793 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -313,78 +313,77 @@ void SwHTMLParser::InsertEmbed() sal_Int16 eVertOri = text::VertOrientation::NONE; sal_Int16 eHoriOri = text::HoriOrientation::NONE; SvCommandList aCmdLst; - const HTMLOptions *pHTMLOptions = GetOptions(); + const HTMLOptions& rHTMLOptions = GetOptions(); // Die Optionen werden vorwaerts gelesen, weil die Plugins sie in // dieser Reihenfolge erwarten. Trotzdem darf immer nur der erste // Wert einer Option beruecksichtigt werden. - sal_uInt16 nArrLen = pHTMLOptions->Count(); - for( sal_uInt16 i=0; i<nArrLen; i++ ) + for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i) { - const HTMLOption *pOption = (*pHTMLOptions)[i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_SRC: if( !aURL.Len() ) - aURL = pOption->GetString(); + aURL = rOption.GetString(); break; case HTML_O_ALT: - aAlt = pOption->GetString(); + aAlt = rOption.GetString(); break; case HTML_O_TYPE: if( !aType.Len() ) - aType = pOption->GetString(); + aType = rOption.GetString(); break; case HTML_O_ALIGN: if( eVertOri==text::VertOrientation::NONE && eHoriOri==text::HoriOrientation::NONE ) { - eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri ); - eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri ); + eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); + eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); } break; case HTML_O_WIDTH: if( USHRT_MAX==aSize.Width() ) { - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Width() = (long)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Width() = (long)rOption.GetNumber(); } break; case HTML_O_HEIGHT: if( USHRT_MAX==aSize.Height() ) { - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Height() = (long)pOption->GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Height() = (long)rOption.GetNumber(); } break; case HTML_O_HSPACE: if( USHRT_MAX==aSpace.Width() ) - aSpace.Width() = (long)pOption->GetNumber(); + aSpace.Width() = (long)rOption.GetNumber(); break; case HTML_O_VSPACE: if( USHRT_MAX==aSpace.Height() ) - aSpace.Height() = (long)pOption->GetNumber(); + aSpace.Height() = (long)rOption.GetNumber(); break; case HTML_O_UNKNOWN: - if( pOption->GetTokenString().EqualsIgnoreCaseAscii( OOO_STRING_SW_HTML_O_Hidden ) ) + if( rOption.GetTokenString().EqualsIgnoreCaseAscii( OOO_STRING_SW_HTML_O_Hidden ) ) bHidden = - !pOption->GetString().EqualsIgnoreCaseAscii( sHTML_O_Hidden_False ); + !rOption.GetString().EqualsIgnoreCaseAscii( sHTML_O_Hidden_False ); break; } // Es werden alle Parameter an das Plugin weitergereicht - aCmdLst.Append( pOption->GetTokenString(), pOption->GetString() ); + aCmdLst.Append( rOption.GetTokenString(), rOption.GetString() ); } SfxItemSet aItemSet( pDoc->GetAttrPool(), pCSS1Parser->GetWhichMap() ); @@ -513,26 +512,26 @@ void SwHTMLParser::NewObject() pAppletImpl = new SwApplet_Impl( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_DECLARE: bDeclare = sal_True; break; case HTML_O_CLASSID: - aClassID = pOption->GetString(); + aClassID = rOption.GetString(); break; case HTML_O_CODEBASE: break; @@ -546,30 +545,30 @@ void SwHTMLParser::NewObject() case HTML_O_UNKNOWN: break; case HTML_O_STANDBY: - aStandBy = pOption->GetString(); + aStandBy = rOption.GetString(); break; case HTML_O_WIDTH: - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Width() = (long)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Width() = (long)rOption.GetNumber(); break; case HTML_O_HEIGHT: - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Height() = (long)pOption->GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Height() = (long)rOption.GetNumber(); break; case HTML_O_ALIGN: - eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri ); - eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri ); + eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); + eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; case HTML_O_USEMAP: break; case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_HSPACE: - aSpace.Width() = (long)pOption->GetNumber(); + aSpace.Width() = (long)rOption.GetNumber(); break; case HTML_O_VSPACE: - aSpace.Height() = (long)pOption->GetNumber(); + aSpace.Height() = (long)rOption.GetNumber(); break; case HTML_O_BORDER: break; @@ -583,8 +582,8 @@ void SwHTMLParser::NewObject() break; } // Es werden alle Parameter auch an das Applet weitergereicht - pAppletImpl->AppendParam( pOption->GetTokenString(), - pOption->GetString() ); + pAppletImpl->AppendParam( rOption.GetTokenString(), + rOption.GetString() ); } @@ -682,50 +681,50 @@ void SwHTMLParser::InsertApplet() delete pAppletImpl; pAppletImpl = new SwApplet_Impl( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_CODEBASE: - aCodeBase = pOption->GetString(); + aCodeBase = rOption.GetString(); break; case HTML_O_CODE: - aCode = pOption->GetString(); + aCode = rOption.GetString(); break; case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_ALT: - aAlt = pOption->GetString(); + aAlt = rOption.GetString(); break; case HTML_O_ALIGN: - eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri ); - eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri ); + eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); + eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; case HTML_O_WIDTH: - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Width() = (long)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Width() = (long)rOption.GetNumber(); break; case HTML_O_HEIGHT: - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Height() = (long)pOption->GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Height() = (long)rOption.GetNumber(); break; case HTML_O_HSPACE: - aSpace.Width() = (long)pOption->GetNumber(); + aSpace.Width() = (long)rOption.GetNumber(); break; case HTML_O_VSPACE: - aSpace.Height() = (long)pOption->GetNumber(); + aSpace.Height() = (long)rOption.GetNumber(); break; case HTML_O_MAYSCRIPT: bMayScript = sal_True; @@ -733,8 +732,8 @@ void SwHTMLParser::InsertApplet() } // Es werden alle Parameter auch an das Applet weitergereicht - pAppletImpl->AppendParam( pOption->GetTokenString(), - pOption->GetString() ); + pAppletImpl->AppendParam( rOption.GetTokenString(), + rOption.GetString() ); } if( !aCode.Len() ) @@ -807,17 +806,17 @@ void SwHTMLParser::InsertParam() String aName, aValue; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); break; case HTML_O_VALUE: - aValue = pOption->GetString(); + aValue = rOption.GetString(); break; } } @@ -841,44 +840,43 @@ void SwHTMLParser::InsertFloatingFrame() sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; - const HTMLOptions *pHTMLOptions = GetOptions(); + const HTMLOptions& rHTMLOptions = GetOptions(); // Erstmal die Optionen f?r das Writer-Frame-Format holen - sal_uInt16 nArrLen = pHTMLOptions->Count(); - for ( sal_uInt16 i=0; i<nArrLen; i++ ) + for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i) { - const HTMLOption *pOption = (*pHTMLOptions)[i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_ALT: - aAlt = pOption->GetString(); + aAlt = rOption.GetString(); break; case HTML_O_ALIGN: - eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri ); - eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri ); + eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); + eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; case HTML_O_WIDTH: - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Width() = (long)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Width() = (long)rOption.GetNumber(); break; case HTML_O_HEIGHT: - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Height() = (long)pOption->GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Height() = (long)rOption.GetNumber(); break; case HTML_O_HSPACE: - aSpace.Width() = (long)pOption->GetNumber(); + aSpace.Width() = (long)rOption.GetNumber(); break; case HTML_O_VSPACE: - aSpace.Height() = (long)pOption->GetNumber(); + aSpace.Height() = (long)rOption.GetNumber(); break; } } @@ -886,7 +884,7 @@ void SwHTMLParser::InsertFloatingFrame() // und jetzt die fuer den SfxFrame SfxFrameDescriptor aFrameDesc; - SfxFrameHTMLParser::ParseFrameOptions( &aFrameDesc, pHTMLOptions, sBaseURL ); + SfxFrameHTMLParser::ParseFrameOptions( &aFrameDesc, rHTMLOptions, sBaseURL ); // den Floating-Frame anlegen comphelper::EmbeddedObjectContainer aCnt; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 0c10a13fad..d5f526a69d 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -73,9 +73,6 @@ using namespace ::com::sun::star; - -/* */ - void SwHTMLParser::NewDivision( int nToken ) { String aId, aHRef, aStyle, aClass, aLang, aDir; @@ -83,38 +80,38 @@ void SwHTMLParser::NewDivision( int nToken ) : SVX_ADJUST_END; sal_Bool bHeader=sal_False, bFooter=sal_False; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_ALIGN: if( HTML_DIVISION_ON==nToken ) - eAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, + eAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) ); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_HREF: - aHRef = pOption->GetString(); + aHRef = rOption.GetString(); break; case HTML_O_TYPE: { - const String& rType = pOption->GetString(); + const String& rType = rOption.GetString(); if( rType.EqualsIgnoreCaseAscii( "HEADER" ) ) bHeader = sal_True; else if( rType.EqualsIgnoreCaseAscii( "FOOTER" ) ) @@ -547,8 +544,6 @@ sal_Bool SwHTMLParser::EndSections( sal_Bool bLFStripped ) return bSectionClosed; } -/* */ - void SwHTMLParser::NewMultiCol() { String aId, aStyle, aClass, aLang, aDir; @@ -556,40 +551,38 @@ void SwHTMLParser::NewMultiCol() sal_uInt16 nCols = 0, nGutter = 10; sal_Bool bPrcWidth = sal_True; - const HTMLOptions *pHTMLOptions = GetOptions(); - sal_uInt16 i; - - for( i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_COLS: - nCols = (sal_uInt16)pOption->GetNumber(); + nCols = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: - nWidth = pOption->GetNumber(); - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); + nWidth = rOption.GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; case HTML_O_GUTTER: - nGutter = (sal_uInt16)pOption->GetNumber(); + nGutter = (sal_uInt16)rOption.GetNumber(); break; } @@ -600,7 +593,7 @@ void SwHTMLParser::NewMultiCol() //.is the multicol elememt contained in a container? That may be the // case for 5.0 documents. sal_Bool bInCntnr = sal_False; - i = aContexts.Count(); + sal_uInt16 i = aContexts.Count(); while( !bInCntnr && i > nContextStMin ) bInCntnr = 0 != aContexts[--i]->GetFrmItemSet(); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 7b2e2c6978..9c5241085b 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -86,9 +86,6 @@ static HTMLOptionEnum aHTMLTblVAlignTable[] = { 0, 0 } }; - -/* */ - // table tags options struct HTMLTableOptions @@ -116,11 +113,9 @@ struct HTMLTableOptions String aBGImage, aStyle, aId, aClass, aDir; - HTMLTableOptions( const HTMLOptions *pOptions, SvxAdjust eParentAdjust ); + HTMLTableOptions( const HTMLOptions& rOptions, SvxAdjust eParentAdjust ); }; -/* */ - class _HTMLTableContext { SwHTMLNumRuleInfo aNumRuleInfo; // Numbering valid before the table @@ -3232,71 +3227,71 @@ _CellSaveStruct::_CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, if( bReadOpt ) { - const HTMLOptions *pOptions = rParser.GetOptions(); - for( sal_uInt16 i = pOptions->Count(); i; ) + const HTMLOptions& rOptions = rParser.GetOptions(); + for (size_t i = rOptions.size(); i; ) { - const HTMLOption *pOption = (*pOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_COLSPAN: - nColSpan = (sal_uInt16)pOption->GetNumber(); + nColSpan = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ROWSPAN: - nRowSpan = (sal_uInt16)pOption->GetNumber(); + nRowSpan = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ALIGN: - eAdjust = (SvxAdjust)pOption->GetEnum( + eAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) ); break; case HTML_O_VALIGN: - eVertOri = pOption->GetEnum( + eVertOri = rOption.GetEnum( aHTMLTblVAlignTable, eVertOri ); break; case HTML_O_WIDTH: - nWidth = (sal_uInt16)pOption->GetNumber(); // nur fuer Netscape - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); + nWidth = (sal_uInt16)rOption.GetNumber(); // nur fuer Netscape + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; case HTML_O_HEIGHT: - nHeight = (sal_uInt16)pOption->GetNumber(); // nur fuer Netscape - if( pOption->GetString().Search('%') != STRING_NOTFOUND) + nHeight = (sal_uInt16)rOption.GetNumber(); // nur fuer Netscape + if( rOption.GetString().Search('%') != STRING_NOTFOUND) nHeight = 0; // keine %-Angaben beruecksichtigen break; case HTML_O_BGCOLOR: // Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netscape // ignorieren, bei allen anderen Tags *wirklich* nicht. - if( pOption->GetString().Len() ) + if( rOption.GetString().Len() ) { - pOption->GetColor( aBGColor ); + rOption.GetColor( aBGColor ); bBGColor = sal_True; } break; case HTML_O_BACKGROUND: - aBGImage = pOption->GetString(); + aBGImage = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_SDNUM: - aNumFmt = pOption->GetString(); + aNumFmt = rOption.GetString(); bHasNumFmt = sal_True; break; case HTML_O_SDVAL: bHasValue = sal_True; - aValue = pOption->GetString(); + aValue = rOption.GetString(); break; case HTML_O_NOWRAP: bNoWrap = sal_True; @@ -3979,14 +3974,14 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions, // Diese Schleife muss vorwartes sein, weil die // erste Option immer gewinnt. sal_Bool bNeedsSection = sal_False; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i=0; i<pHTMLOptions->Count(); i++ ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = 0; i < rHTMLOptions.size(); ++i) { - const HTMLOption *pOption = (*pHTMLOptions)[i]; - if( HTML_O_ALIGN==pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[i]; + if( HTML_O_ALIGN==rOption.GetToken() ) { SvxAdjust eAdjust = - (SvxAdjust)pOption->GetEnum( + (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, SVX_ADJUST_END ); bNeedsSection = SVX_ADJUST_LEFT == eAdjust || SVX_ADJUST_RIGHT == eAdjust; @@ -4278,40 +4273,40 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, sal_Bool bReadOptions, if( bReadOptions ) { - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_ALIGN: - eAdjust = (SvxAdjust)pOption->GetEnum( + eAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) ); break; case HTML_O_VALIGN: - eVertOri = pOption->GetEnum( + eVertOri = rOption.GetEnum( aHTMLTblVAlignTable, eVertOri ); break; case HTML_O_BGCOLOR: // Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netsc. // ignorieren, bei allen anderen Tags *wirklich* nicht. - if( pOption->GetString().Len() ) + if( rOption.GetString().Len() ) { - pOption->GetColor( aBGColor ); + rOption.GetColor( aBGColor ); bBGColor = sal_True; } break; case HTML_O_BACKGROUND: - aBGImage = pOption->GetString(); + aBGImage = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass= pOption->GetString(); + aClass= rOption.GetString(); break; } } @@ -4477,23 +4472,23 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable, if( bReadOptions ) { - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - InsertBookmark( pOption->GetString() ); + InsertBookmark( rOption.GetString() ); break; case HTML_O_ALIGN: pSaveStruct->eAdjust = - (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, + (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(pSaveStruct->eAdjust) ); break; case HTML_O_VALIGN: pSaveStruct->eVertOri = - pOption->GetEnum( aHTMLTblVAlignTable, + rOption.GetEnum( aHTMLTblVAlignTable, pSaveStruct->eVertOri ); break; } @@ -4665,31 +4660,31 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable, pSaveStruct = new _TblColGrpSaveStruct; if( bReadOptions ) { - const HTMLOptions *pColGrpOptions = GetOptions(); - for( sal_uInt16 i = pColGrpOptions->Count(); i; ) + const HTMLOptions& rColGrpOptions = GetOptions(); + for (size_t i = rColGrpOptions.size(); i; ) { - const HTMLOption *pColGrpOption = (*pColGrpOptions)[--i]; - switch( pColGrpOption->GetToken() ) + const HTMLOption& rOption = rColGrpOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - InsertBookmark( pColGrpOption->GetString() ); + InsertBookmark( rOption.GetString() ); break; case HTML_O_SPAN: - pSaveStruct->nColGrpSpan = (sal_uInt16)pColGrpOption->GetNumber(); + pSaveStruct->nColGrpSpan = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: - pSaveStruct->nColGrpWidth = (sal_uInt16)pColGrpOption->GetNumber(); + pSaveStruct->nColGrpWidth = (sal_uInt16)rOption.GetNumber(); pSaveStruct->bRelColGrpWidth = - (pColGrpOption->GetString().Search('*') != STRING_NOTFOUND); + (rOption.GetString().Search('*') != STRING_NOTFOUND); break; case HTML_O_ALIGN: pSaveStruct->eColGrpAdjust = - (SvxAdjust)pColGrpOption->GetEnum( aHTMLPAlignTable, + (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(pSaveStruct->eColGrpAdjust) ); break; case HTML_O_VALIGN: pSaveStruct->eColGrpVertOri = - pColGrpOption->GetEnum( aHTMLTblVAlignTable, + rOption.GetEnum( aHTMLTblVAlignTable, pSaveStruct->eColGrpVertOri ); break; } @@ -4748,31 +4743,31 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable, SvxAdjust eColAdjust = pSaveStruct->eColGrpAdjust; sal_Int16 eColVertOri = pSaveStruct->eColGrpVertOri; - const HTMLOptions *pColOptions = GetOptions(); - for( sal_uInt16 i = pColOptions->Count(); i; ) + const HTMLOptions& rColOptions = GetOptions(); + for (size_t i = rColOptions.size(); i; ) { - const HTMLOption *pColOption = (*pColOptions)[--i]; - switch( pColOption->GetToken() ) + const HTMLOption& rOption = rColOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - InsertBookmark( pColOption->GetString() ); + InsertBookmark( rOption.GetString() ); break; case HTML_O_SPAN: - nColSpan = (sal_uInt16)pColOption->GetNumber(); + nColSpan = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: - nColWidth = (sal_uInt16)pColOption->GetNumber(); + nColWidth = (sal_uInt16)rOption.GetNumber(); bRelColWidth = - (pColOption->GetString().Search('*') != STRING_NOTFOUND); + (rOption.GetString().Search('*') != STRING_NOTFOUND); break; case HTML_O_ALIGN: eColAdjust = - (SvxAdjust)pColOption->GetEnum( aHTMLPAlignTable, + (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eColAdjust) ); break; case HTML_O_VALIGN: eColVertOri = - pColOption->GetEnum( aHTMLTblVAlignTable, + rOption.GetEnum( aHTMLTblVAlignTable, eColVertOri ); break; } @@ -4893,13 +4888,13 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) } sal_Bool bTop = sal_True; - const HTMLOptions *pHTMLOptions = GetOptions(); - for ( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for ( size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - if( HTML_O_ALIGN == pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + if( HTML_O_ALIGN == rOption.GetToken() ) { - if( pOption->GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_VA_bottom)) + if( rOption.GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_VA_bottom)) bTop = sal_False; } } @@ -5105,7 +5100,7 @@ void _TblSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc } -HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions, +HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, SvxAdjust eParentAdjust ) : nCols( 0 ), nWidth( 0 ), nHeight( 0 ), @@ -5122,38 +5117,38 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions, sal_Bool bBorderColor = sal_False; sal_Bool bHasFrame = sal_False, bHasRules = sal_False; - for( sal_uInt16 i = pOptions->Count(); i; ) + for (size_t i = rOptions.size(); i; ) { - const HTMLOption *pOption = (*pOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_COLS: - nCols = (sal_uInt16)pOption->GetNumber(); + nCols = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: - nWidth = (sal_uInt16)pOption->GetNumber(); - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); + nWidth = (sal_uInt16)rOption.GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; case HTML_O_HEIGHT: - nHeight = (sal_uInt16)pOption->GetNumber(); - if( pOption->GetString().Search('%') != STRING_NOTFOUND ) + nHeight = (sal_uInt16)rOption.GetNumber(); + if( rOption.GetString().Search('%') != STRING_NOTFOUND ) nHeight = 0; // keine %-Anagben benutzen!!! break; case HTML_O_CELLPADDING: - nCellPadding = (sal_uInt16)pOption->GetNumber(); + nCellPadding = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_CELLSPACING: - nCellSpacing = (sal_uInt16)pOption->GetNumber(); + nCellSpacing = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ALIGN: { sal_uInt16 nAdjust = static_cast< sal_uInt16 >(eAdjust); - if( pOption->GetEnum( nAdjust, aHTMLPAlignTable ) ) + if( rOption.GetEnum( nAdjust, aHTMLPAlignTable ) ) { eAdjust = (SvxAdjust)nAdjust; bTableAdjust = sal_True; @@ -5161,13 +5156,13 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions, } break; case HTML_O_VALIGN: - eVertOri = pOption->GetEnum( aHTMLTblVAlignTable, eVertOri ); + eVertOri = rOption.GetEnum( aHTMLTblVAlignTable, eVertOri ); break; case HTML_O_BORDER: // BORDER und BORDER=BORDER wie BORDER=1 behandeln - if( pOption->GetString().Len() && - !pOption->GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_O_border) ) - nBorder = (sal_uInt16)pOption->GetNumber(); + if( rOption.GetString().Len() && + !rOption.GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_O_border) ) + nBorder = (sal_uInt16)rOption.GetNumber(); else nBorder = 1; @@ -5177,47 +5172,47 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions, eRules = ( nBorder ? HTML_TR_ALL : HTML_TR_NONE ); break; case HTML_O_FRAME: - eFrame = pOption->GetTableFrame(); + eFrame = rOption.GetTableFrame(); bHasFrame = sal_True; break; case HTML_O_RULES: - eRules = pOption->GetTableRules(); + eRules = rOption.GetTableRules(); bHasRules = sal_True; break; case HTML_O_BGCOLOR: // Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netscape // ignorieren, bei allen anderen Tags *wirklich* nicht. - if( pOption->GetString().Len() ) + if( rOption.GetString().Len() ) { - pOption->GetColor( aBGColor ); + rOption.GetColor( aBGColor ); bBGColor = sal_True; } break; case HTML_O_BACKGROUND: - aBGImage = pOption->GetString(); + aBGImage = rOption.GetString(); break; case HTML_O_BORDERCOLOR: - pOption->GetColor( aBorderColor ); + rOption.GetColor( aBorderColor ); bBorderColor = sal_True; break; case HTML_O_BORDERCOLORDARK: if( !bBorderColor ) - pOption->GetColor( aBorderColor ); + rOption.GetColor( aBorderColor ); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; case HTML_O_HSPACE: - nHSpace = (sal_uInt16)pOption->GetNumber(); + nHSpace = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_VSPACE: - nVSpace = (sal_uInt16)pOption->GetNumber(); + nVSpace = (sal_uInt16)rOption.GetNumber(); break; } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 1a3fa6abf0..a272dfdf58 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1302,14 +1302,14 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_BASE: { - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[ --i ]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_HREF: - sBaseURL = pOption->GetString(); + sBaseURL = rOption.GetString(); break; case HTML_O_TARGET: if( IsNewDoc() ) @@ -1324,7 +1324,7 @@ void SwHTMLParser::NextToken( int nToken ) OSL_ENSURE(xDocProps.is(),"no DocumentProperties"); if (xDocProps.is()) { xDocProps->setDefaultTarget( - pOption->GetString()); + rOption.GetString()); } } } @@ -1916,13 +1916,13 @@ void SwHTMLParser::NextToken( int nToken ) break; // don't evaluate further??? case HTML_HTML_ON: { - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[ --i ]; - if( HTML_O_DIR == pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + if( HTML_O_DIR == rOption.GetToken() ) { - const String& rDir = pOption->GetString(); + const String& rDir = rOption.GetString(); SfxItemSet aItemSet( pDoc->GetAttrPool(), pCSS1Parser->GetWhichMap() ); SvxCSS1PropertyInfo aPropInfo; @@ -3355,32 +3355,30 @@ void SwHTMLParser::InsertAttrs( _HTMLAttrs& rAttrs ) } } -/* */ - void SwHTMLParser::NewStdAttr( int nToken ) { String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -3414,26 +3412,26 @@ void SwHTMLParser::NewStdAttr( int nToken, { String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -3495,29 +3493,29 @@ void SwHTMLParser::NewBasefontAttr() String aId, aStyle, aClass, aLang, aDir; sal_uInt16 nSize = 3; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_SIZE: - nSize = (sal_uInt16)pOption->GetNumber(); + nSize = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -3592,21 +3590,21 @@ void SwHTMLParser::NewFontAttr( int nToken ) sal_uInt16 nSize = 0; // Fontgroesse in Netscape-Notation (1-7) sal_Bool bColor = sal_False; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_SIZE: - if( HTML_FONT_ON==nToken && pOption->GetString().Len() ) + if( HTML_FONT_ON==nToken && rOption.GetString().Len() ) { sal_Int32 nSSize; - if( '+' == pOption->GetString().GetChar(0) || - '-' == pOption->GetString().GetChar(0) ) - nSSize = nBaseSize + pOption->GetSNumber(); + if( '+' == rOption.GetString().GetChar(0) || + '-' == rOption.GetString().GetChar(0) ) + nSSize = nBaseSize + rOption.GetSNumber(); else - nSSize = (sal_Int32)pOption->GetNumber(); + nSSize = (sal_Int32)rOption.GetNumber(); if( nSSize < 1 ) nSSize = 1; @@ -3620,28 +3618,28 @@ void SwHTMLParser::NewFontAttr( int nToken ) case HTML_O_COLOR: if( HTML_FONT_ON==nToken ) { - pOption->GetColor( aColor ); + rOption.GetColor( aColor ); bColor = sal_True; } break; case HTML_O_FACE: if( HTML_FONT_ON==nToken ) - aFace = pOption->GetString(); + aFace = rOption.GetString(); break; case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -3815,29 +3813,29 @@ void SwHTMLParser::NewPara() eParaAdjust = SVX_ADJUST_END; String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_ALIGN: - eParaAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) ); + eParaAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) ); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -3935,29 +3933,29 @@ void SwHTMLParser::NewHeading( int nToken ) String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_ALIGN: - eParaAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) ); + eParaAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) ); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -4061,26 +4059,26 @@ void SwHTMLParser::NewTxtFmtColl( int nToken, sal_uInt16 nColl ) { String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -4190,26 +4188,26 @@ void SwHTMLParser::NewDefList() { String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -4713,26 +4711,26 @@ void SwHTMLParser::NewCharFmt( int nToken ) { String aId, aStyle, aClass, aLang, aDir; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; case HTML_O_LANG: - aLang = pOption->GetString(); + aLang = rOption.GetString(); break; case HTML_O_DIR: - aDir = pOption->GetString(); + aDir = rOption.GetString(); break; } } @@ -4785,39 +4783,39 @@ void SwHTMLParser::InsertSpacer() sal_Bool bPrcHeight = sal_False; sal_uInt16 nType = HTML_SPTYPE_HORI; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_TYPE: - pOption->GetEnum( nType, aHTMLSpacerTypeTable ); + rOption.GetEnum( nType, aHTMLSpacerTypeTable ); break; case HTML_O_ALIGN: eVertOri = - pOption->GetEnum( aHTMLImgVAlignTable, + rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = - pOption->GetEnum( aHTMLImgHAlignTable, + rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; case HTML_O_WIDTH: // erstmal nur als Pixelwerte merken! - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Width() = (long)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Width() = (long)rOption.GetNumber(); break; case HTML_O_HEIGHT: // erstmal nur als Pixelwerte merken! - bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND); - aSize.Height() = (long)pOption->GetNumber(); + bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND); + aSize.Height() = (long)rOption.GetNumber(); break; case HTML_O_SIZE: // erstmal nur als Pixelwerte merken! - nSize = pOption->GetNumber(); + nSize = rOption.GetNumber(); break; } } @@ -4990,13 +4988,13 @@ SwTwips SwHTMLParser::GetCurrentBrowseWidth() void SwHTMLParser::InsertIDOption() { String aId; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - if( HTML_O_ID==pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + if( HTML_O_ID==rOption.GetToken() ) { - aId = pOption->GetString(); + aId = rOption.GetString(); break; } } @@ -5032,15 +5030,15 @@ void SwHTMLParser::InsertLineBreak() sal_Bool bCleared = sal_False; // wurde ein CLEAR ausgefuehrt? // dann holen wir mal die Optionen - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_CLEAR: { - const String &aClear = pOption->GetString(); + const String &aClear = rOption.GetString(); if( aClear.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_all ) ) { bClearLeft = sal_True; @@ -5053,13 +5051,13 @@ void SwHTMLParser::InsertLineBreak() } break; case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_STYLE: - aStyle = pOption->GetString(); + aStyle = rOption.GetString(); break; case HTML_O_CLASS: - aClass = pOption->GetString(); + aClass = rOption.GetString(); break; } } @@ -5179,21 +5177,21 @@ void SwHTMLParser::InsertHorzRule() String aId; // dann holen wir mal die Optionen - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[--i]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_ID: - aId = pOption->GetString(); + aId = rOption.GetString(); break; case HTML_O_SIZE: - nSize = (sal_uInt16)pOption->GetNumber(); + nSize = (sal_uInt16)rOption.GetNumber(); break; case HTML_O_WIDTH: - bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND); - nWidth = (sal_uInt16)pOption->GetNumber(); + bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND); + nWidth = (sal_uInt16)rOption.GetNumber(); if( bPrcWidth && nWidth>=100 ) { // 100%-Linien sind der default-Fall (keine Attrs neotig) @@ -5203,13 +5201,13 @@ void SwHTMLParser::InsertHorzRule() break; case HTML_O_ALIGN: eAdjust = - (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) ); + (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) ); break; case HTML_O_NOSHADE: bNoShade = sal_True; break; case HTML_O_COLOR: - pOption->GetColor( aColor ); + rOption.GetColor( aColor ); bColor = sal_True; break; } @@ -5330,22 +5328,22 @@ void SwHTMLParser::ParseMoreMetaOptions() String aName, aContent; sal_Bool bHTTPEquiv = sal_False; - const HTMLOptions *pHTMLOptions = GetOptions(); - for( sal_uInt16 i = pHTMLOptions->Count(); i; ) + const HTMLOptions& rHTMLOptions = GetOptions(); + for (size_t i = rHTMLOptions.size(); i; ) { - const HTMLOption *pOption = (*pHTMLOptions)[ --i ]; - switch( pOption->GetToken() ) + const HTMLOption& rOption = rHTMLOptions[--i]; + switch( rOption.GetToken() ) { case HTML_O_NAME: - aName = pOption->GetString(); + aName = rOption.GetString(); bHTTPEquiv = sal_False; break; case HTML_O_HTTPEQUIV: - aName = pOption->GetString(); + aName = rOption.GetString(); bHTTPEquiv = sal_True; break; case HTML_O_CONTENT: - aContent = pOption->GetString(); + aContent = rOption.GetString(); break; } } diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 5677a5d01f..9c327681b4 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -427,6 +427,13 @@ sal_uInt16 SwModule::GetRedlineAuthor() return InsertRedlineAuthor( sActAuthor ); } +void SwModule::SetRedlineAuthor(const String &rAuthor) +{ + bAuthorInitialised = sal_True; + sActAuthor = rAuthor; + InsertRedlineAuthor( sActAuthor ); +} + const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) { OSL_ENSURE(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash |