diff options
author | Noel Grandin <noel@peralex.com> | 2012-04-24 15:32:53 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-09 08:52:53 +0200 |
commit | 35be7d7574cd0f45a18ee5838dd14cb1040890d4 (patch) | |
tree | ecdae6ac1ae76f9edef27d2071d299c9aa0cfb22 | |
parent | 33fe30af79bd665e338dcf730c3d8439b6e2cb78 (diff) |
Convert SV_DECL_PTRARR(_HTMLAttrContexts) to std::vector
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlctxt.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 9 |
8 files changed, 34 insertions, 35 deletions
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index fcd77fc8cc41..170c9831df96 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -2185,7 +2185,7 @@ void SwHTMLParser::SetFrmFmtAttrs( SfxItemSet &rItemSet, _HTMLAttrContext *SwHTMLParser::PopContext( sal_uInt16 nToken, sal_uInt16 nLimit, sal_Bool bRemove ) { - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); if( nPos <= nContextStMin ) return 0; @@ -2217,7 +2217,7 @@ _HTMLAttrContext *SwHTMLParser::PopContext( sal_uInt16 nToken, sal_uInt16 nLimit { pCntxt = aContexts[nPos]; if( bRemove ) - aContexts.Remove( nPos, 1 ); + aContexts.erase( aContexts.begin() + nPos ); } return pCntxt; @@ -2228,7 +2228,7 @@ sal_Bool SwHTMLParser::GetMarginsFromContext( sal_uInt16& nLeft, short& nIndent, sal_Bool bIgnoreTopContext ) const { - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); if( bIgnoreTopContext ) { if( !nPos ) @@ -2274,7 +2274,7 @@ void SwHTMLParser::GetULSpaceFromContext( sal_uInt16& nUpper, sal_uInt16 nDfltColl = 0; String aDfltClass; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( nPos > nContextStAttrMin ) { const _HTMLAttrContext *pCntxt = aContexts[--nPos]; diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 843fc6b2e911..6c6a5016e53d 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -283,12 +283,12 @@ void SwHTMLParser::SaveDocContext( _HTMLAttrContext *pCntxt, if( (HTML_CNTXT_PROTECT_STACK & nFlags) != 0 ) { pSave->SetContextStMin( nContextStMin ); - nContextStMin = aContexts.Count(); + nContextStMin = aContexts.size(); if( (HTML_CNTXT_KEEP_ATTRS & nFlags) == 0 ) { pSave->SetContextStAttrMin( nContextStAttrMin ); - nContextStAttrMin = aContexts.Count(); + nContextStAttrMin = aContexts.size(); } } } @@ -349,7 +349,7 @@ void SwHTMLParser::EndContext( _HTMLAttrContext *pContext ) { // Alle noch offenen Kontexte beenden. Der eigene // Kontext muss bereits geloscht sein! - while( aContexts.Count() > nContextStMin ) + while( aContexts.size() > nContextStMin ) { _HTMLAttrContext *pCntxt = PopContext(); OSL_ENSURE( pCntxt != pContext, @@ -561,8 +561,8 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, // obersten Kontext, denn den veraendern wir ja gerade) ... sal_uInt16 nOldLeft = 0, nOldRight = 0; short nOldIndent = 0; - sal_Bool bIgnoreTop = aContexts.Count() > nContextStMin && - aContexts[aContexts.Count()-1] == pContext; + sal_Bool bIgnoreTop = aContexts.size() > nContextStMin && + aContexts.back() == pContext; GetMarginsFromContext( nOldLeft, nOldRight, nOldIndent, bIgnoreTop ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 2a70f7a8ec28..12e053ff9118 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -170,7 +170,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, SfxItemSet& rFrmItemSet ) { const SfxItemSet *pCntnrItemSet = 0; - sal_uInt16 i = aContexts.Count(); + sal_uInt16 i = aContexts.size(); while( !pCntnrItemSet && i > nContextStMin ) pCntnrItemSet = aContexts[--i]->GetFrmItemSet(); diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index bb4c16f4decf..831d6375b58a 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -604,7 +604,7 @@ void SwHTMLParser::EndNumBulListItem( int nToken, sal_Bool bSetColl, // Kontext zu dem Token suchen und vom Stack holen _HTMLAttrContext *pCntxt = 0; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); nToken &= ~1; while( !pCntxt && nPos>nContextStMin ) { @@ -616,7 +616,7 @@ void SwHTMLParser::EndNumBulListItem( int nToken, sal_Bool bSetColl, if( !nToken || nToken == nCntxtToken ) { pCntxt = aContexts[nPos]; - aContexts.Remove( nPos, 1 ); + aContexts.erase( aContexts.begin() + nPos ); } break; case HTML_ORDERLIST_ON: diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index e4b01f923b68..75b332ac4ee9 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -392,7 +392,7 @@ void SwHTMLParser::EndDivision( int /*nToken*/ ) // Stack-Eintrag zu dem Token suchen (weil wir noch den Div-Stack // haben unterscheiden wir erst einmal nicht zwischen DIV und CENTER _HTMLAttrContext *pCntxt = 0; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( !pCntxt && nPos>nContextStMin ) { switch( aContexts[--nPos]->GetToken() ) @@ -400,7 +400,7 @@ void SwHTMLParser::EndDivision( int /*nToken*/ ) case HTML_CENTER_ON: case HTML_DIVISION_ON: pCntxt = aContexts[nPos]; - aContexts.Remove( nPos, 1 ); + aContexts.erase( aContexts.begin() + nPos ); break; } } @@ -527,7 +527,7 @@ sal_Bool SwHTMLParser::EndSection( sal_Bool bLFStripped ) sal_Bool SwHTMLParser::EndSections( sal_Bool bLFStripped ) { sal_Bool bSectionClosed = sal_False; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( nPos>nContextStMin ) { _HTMLAttrContext *pCntxt = aContexts[--nPos]; @@ -591,7 +591,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; - sal_uInt16 i = aContexts.Count(); + sal_uInt16 i = aContexts.size(); 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 201e3e771edc..a3a75c4da01e 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -3085,7 +3085,7 @@ _SectionSaveStruct::_SectionSaveStruct( SwHTMLParser& rParser ) : // Kontext-Stack einfrieren nContextStMinSave = rParser.nContextStMin; nContextStAttrMinSave = rParser.nContextStAttrMin; - rParser.nContextStMin = rParser.aContexts.Count(); + rParser.nContextStMin = rParser.aContexts.size(); rParser.nContextStAttrMin = rParser.nContextStMin; // und noch ein par Zaehler retten @@ -3900,7 +3900,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions, // irgendwo ausserhalb von Zellen Attribute gesetzt werden. // Darf nicht frueher passieren, weil eventuell noch im // Stack gesucht wird!!! - nContextStMin = aContexts.Count(); + nContextStMin = aContexts.size(); nContextStAttrMin = nContextStMin; } @@ -4177,7 +4177,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions, // Alle noch offenen Kontexte beenden. Wir nehmen hier // AttrMin, weil nContxtStMin evtl. veraendert wurde. // Da es durch EndContext wieder restauriert wird, geht das. - while( aContexts.Count() > nContextStAttrMin+1 ) + while( aContexts.size() > nContextStAttrMin+1 ) { _HTMLAttrContext *pCntxt = PopContext(); EndContext( pCntxt ); @@ -4197,7 +4197,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions, else { // Alle noch offenen Kontexte beenden - while( aContexts.Count() > nContextStAttrMin ) + while( aContexts.size() > nContextStAttrMin ) { _HTMLAttrContext *pCntxt = PopContext(); ClearContext( pCntxt ); @@ -4994,7 +4994,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) } // Alle noch offenen Kontexte beenden - while( aContexts.Count() > nContextStAttrMin+1 ) + while( aContexts.size() > nContextStAttrMin+1 ) { _HTMLAttrContext *pCntxt = PopContext(); EndContext( pCntxt ); @@ -5389,7 +5389,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust, // ausserhalb von Zellen begonnene Kontexte beenden // muss vor(!) dem Umsetzten der Attribut Tabelle existieren, // weil die aktuelle danach nicht mehr existiert - while( aContexts.Count() > nContextStAttrMin ) + while( aContexts.size() > nContextStAttrMin ) { _HTMLAttrContext *pCntxt = PopContext(); ClearContext( pCntxt ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 7c947e6a239e..2505e262adaf 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -677,7 +677,7 @@ void SwHTMLParser::Continue( int nToken ) OSL_ENSURE( !nContextStMin, "Es gibt geschuetzte Kontexte" ); nContextStMin = 0; - while( aContexts.Count() ) + while( aContexts.size() ) { _HTMLAttrContext *pCntxt = PopContext(); if( pCntxt ) @@ -4013,7 +4013,7 @@ void SwHTMLParser::EndHeading() // Kontext zu dem Token suchen und vom Stack holen _HTMLAttrContext *pCntxt = 0; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( !pCntxt && nPos>nContextStMin ) { switch( aContexts[--nPos]->GetToken() ) @@ -4025,7 +4025,7 @@ void SwHTMLParser::EndHeading() case HTML_HEAD5_ON: case HTML_HEAD6_ON: pCntxt = aContexts[nPos]; - aContexts.Remove( nPos, 1 ); + aContexts.erase( aContexts.begin() + nPos ); break; } } @@ -4213,7 +4213,7 @@ void SwHTMLParser::NewDefList() sal_Bool bInDD = sal_False, bNotInDD = sal_False; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( !bInDD && !bNotInDD && nPos>nContextStMin ) { sal_uInt16 nCntxtToken = aContexts[--nPos]->GetToken(); @@ -4308,7 +4308,7 @@ void SwHTMLParser::NewDefListItem( int nToken ) { // festellen, ob das DD/DT in einer DL vorkommt sal_Bool bInDefList = sal_False, bNotInDefList = sal_False; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( !bInDefList && !bNotInDefList && nPos>nContextStMin ) { sal_uInt16 nCntxtToken = aContexts[--nPos]->GetToken(); @@ -4349,7 +4349,7 @@ void SwHTMLParser::EndDefListItem( int nToken, sal_Bool bSetColl, // Kontext zu dem Token suchen und vom Stack holen nToken &= ~1; _HTMLAttrContext *pCntxt = 0; - sal_uInt16 nPos = aContexts.Count(); + sal_uInt16 nPos = aContexts.size(); while( !pCntxt && nPos>nContextStMin ) { sal_uInt16 nCntxtToken = aContexts[--nPos]->GetToken(); @@ -4360,7 +4360,7 @@ void SwHTMLParser::EndDefListItem( int nToken, sal_Bool bSetColl, if( !nToken || nToken == nCntxtToken ) { pCntxt = aContexts[nPos]; - aContexts.Remove( nPos, 1 ); + aContexts.erase( aContexts.begin() + nPos ); } break; case HTML_DEFLIST_ON: @@ -4483,7 +4483,7 @@ void SwHTMLParser::SetTxtCollAttrs( _HTMLAttrContext *pContext ) short nFirstLineIndent = 0; // Abstaende sal_uInt16 i; - for( i = nContextStAttrMin; i < aContexts.Count(); i++ ) + for( i = nContextStAttrMin; i < aContexts.size(); i++ ) { const _HTMLAttrContext *pCntxt = aContexts[i]; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index d8fea60ab0cf..72b5b62ab13d 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -331,8 +331,7 @@ public: SwHTMLAppendMode GetAppendMode() const { return eAppend; } }; -typedef _HTMLAttrContext *_HTMLAttrContextPtr; -SV_DECL_PTRARR( _HTMLAttrContexts, _HTMLAttrContextPtr, 5 ) +typedef std::vector<_HTMLAttrContext *> _HTMLAttrContexts; class HTMLTable; class SwCSS1Parser; @@ -1000,13 +999,13 @@ inline sal_Bool SwHTMLParser::HasStyleOptions( const String &rStyle, inline const _HTMLAttrContext *SwHTMLParser::GetTopContext() const { - return aContexts.Count() > nContextStMin - ? aContexts[aContexts.Count()-1] : 0; + return aContexts.size() > nContextStMin + ? aContexts.back() : 0; } inline void SwHTMLParser::PushContext( _HTMLAttrContext *pCntxt ) { - aContexts.Insert( pCntxt, aContexts.Count() ); + aContexts.push_back( pCntxt ); } |