Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 13/08/12 15:37, Noel Grandin wrote:
Hi

These patches convert various places from using tools/list.hxx to using 
normal STL containers.

thanks, pushed to master.

patch #2 had some problems; nIdx becomes n here:
(ridiculous indentation by original code author)

-                                                                    aCharPropList.Insert( 
pNewCPS, nIdx + 1 );
+                                                                    aCharPropList.insert( 
aCharPropList.begin() + n + 1, pNewCPS );

n++ missing:

-                                                            aCharPropList.Insert( pBefCPS, n++ );
+                                                            aCharPropList.insert( 
aCharPropList.begin() + n, pBefCPS );

this is broken because the same nCurPos is used for both the paragraph
properties and the character properties, while actually a single
paragraph may have multiple character properties/text portions, so it's
necessary to have 2 independent iterators.

-PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, const PPTStyleSheet& 
rStyleSheet,
+PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, sal_uInt32 nCurPos, const 
PPTStyleSheet& rStyleSheet,
                                     sal_uInt32 nInstance, PPTTextRulerInterpreter& rRuler ) :
-    PPTParaPropSet          ( *( (PPTParaPropSet*)rPropReader.aParaPropList.GetCurObject() ) ),
+    PPTParaPropSet          ( *rPropReader.aParaPropList[nCurPos] ),
     PPTNumberFormatCreator  ( NULL ),
     PPTTextRulerInterpreter ( rRuler ),
     mrStyleSheet            ( rStyleSheet ),
@@ -5645,18 +5643,18 @@ PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, 
const PPT
     mnPortionCount          ( 0 ),
     mpPortionList           ( NULL )
 {
-    sal_uInt32 nCurPos = rPropReader.aCharPropList.GetCurPos();
-    PPTCharPropSet* pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.GetCurObject();
+    PPTCharPropSet* pCharPropSet = rPropReader.aCharPropList[nCurPos];
     if ( pCharPropSet )
     {
         sal_uInt32 nCurrentParagraph = pCharPropSet->mnParagraph;
-        for ( ; pCharPropSet && ( pCharPropSet->mnParagraph == nCurrentParagraph ); pCharPropSet 
= (PPTCharPropSet*)rPropReader.aCharPropList.Next() )
+        for ( sal_uInt32 n = nCurPos;
+              n < rPropReader.aCharPropList.size() && rPropReader.aCharPropList[n]->mnParagraph 
== nCurrentParagraph; ++n )



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.