[Libreoffice-commits] .: 4 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Feb 9 00:16:55 PST 2011


 sw/source/core/inc/scriptinfo.hxx  |   69 +++++++++++++++++++-----------
 sw/source/core/layout/laycache.cxx |   44 +++++++------------
 sw/source/core/layout/layhelp.hxx  |   10 +++-
 sw/source/core/text/porlay.cxx     |   84 +++++++++++++------------------------
 4 files changed, 100 insertions(+), 107 deletions(-)

New commits:
commit 2cf14e04af1d40a7f7655217f94a0526db5f9b0c
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Tue Feb 8 16:12:13 2011 +0000

    Remove compression svArray usage from SwScriptInfo

diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index f8cf486..4a70226 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -121,10 +121,16 @@ private:
     SvXub_StrLens aKashidaInvalid;
     SvXub_StrLens aNoKashidaLine;
     SvXub_StrLens aNoKashidaLineEnd;
-    SvXub_StrLens aCompChg;
-    SvXub_StrLens aCompLen;
     SvXub_StrLens aHiddenChg;
-    SvBytes aCompType;
+    //! Records a single change in compression.
+    struct CompressionChangeInfo
+    {
+        xub_StrLen position; //!< Character position where the change occurs.
+        xub_StrLen length;   //!< Length of the segment.
+        BYTE       type;     //!< Type of compression that we change to.
+        inline CompressionChangeInfo(xub_StrLen pos, xub_StrLen len, BYTE typ) : position(pos), length(len), type(typ) {};
+    };
+    std::vector<CompressionChangeInfo> aCompressionChanges;
     xub_StrLen nInvalidityPos;
     BYTE nDefaultDir;
 
@@ -403,22 +409,22 @@ inline xub_StrLen SwScriptInfo::GetKashida( const USHORT nCnt ) const
     return aKashida[ nCnt ];
 }
 
-inline USHORT SwScriptInfo::CountCompChg() const { return aCompChg.Count(); };
+inline USHORT SwScriptInfo::CountCompChg() const { return aCompressionChanges.size(); };
 inline xub_StrLen SwScriptInfo::GetCompStart( const USHORT nCnt ) const
 {
-    OSL_ENSURE( nCnt < aCompChg.Count(),"No CompressionStart today!");
-    return aCompChg[ nCnt ];
+    OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionStart today!");
+    return aCompressionChanges[ nCnt ].position;
 }
 inline xub_StrLen SwScriptInfo::GetCompLen( const USHORT nCnt ) const
 {
-    OSL_ENSURE( nCnt < aCompChg.Count(),"No CompressionLen today!");
-    return aCompLen[ nCnt ];
+    OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionLen today!");
+    return aCompressionChanges[ nCnt ].length;
 }
 
 inline BYTE SwScriptInfo::GetCompType( const USHORT nCnt ) const
 {
-    OSL_ENSURE( nCnt < aCompChg.Count(),"No CompressionType today!");
-    return aCompType[ nCnt ];
+    OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionType today!");
+    return aCompressionChanges[ nCnt ].type;
 }
 
 inline USHORT SwScriptInfo::CountHiddenChg() const { return aHiddenChg.Count(); };
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index b7db718..8ca3535 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -931,10 +931,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
     }
 
     // remove invalid entries from compression information arrays
-    const USHORT nCompRemove = aCompChg.Count() - nCntComp;
-    aCompChg.Remove( nCntComp, nCompRemove );
-    aCompLen.Remove( nCntComp, nCompRemove );
-    aCompType.Remove( nCntComp, nCompRemove );
+    aCompressionChanges.erase(aCompressionChanges.begin() + nCntComp, aCompressionChanges.end() );
 
     // get the start of the last kashida group
     USHORT nLastKashida = nChg;
@@ -1085,10 +1082,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                         if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
                              ePrevState != KANA )
                         {
-                            aCompChg.Insert( nPrevChg, nCntComp );
-                            BYTE nTmpType = ePrevState;
-                            aCompType.Insert( nTmpType, nCntComp );
-                            aCompLen.Insert( nLastCompression - nPrevChg, nCntComp++ );
+                            aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
                         }
                     }
 
@@ -1106,10 +1100,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                 if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
                      ePrevState != KANA )
                 {
-                    aCompChg.Insert( nPrevChg, nCntComp );
-                    BYTE nTmpType = ePrevState;
-                    aCompType.Insert( nTmpType, nCntComp );
-                    aCompLen.Insert( nLastCompression - nPrevChg, nCntComp++ );
+                    aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
                 }
             }
         }
commit ba04dbe5d6077ac2beb27dbabfd6b600d29da403
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Tue Feb 8 15:05:14 2011 +0000

    Remove direction svArray usage in SwScriptInfo

diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index ef3a365..f8cf486 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -109,8 +109,14 @@ private:
     //TODO - This is sorted, so should probably be a std::set rather than vector.
     //       But we also use random access (probably unnecessarily).
     std::vector<ScriptChangeInfo> aScriptChanges;
-    SvXub_StrLens aDirChg;
-    SvBytes aDirType;
+    //! Records a single change in direction.
+    struct DirectionChangeInfo
+    {
+        xub_StrLen position; //!< Character position at which we change direction.
+        BYTE       type;     //!< Direction that we change to.
+        inline DirectionChangeInfo(xub_StrLen pos, BYTE typ) : position(pos), type(typ) {};
+    };
+    std::vector<DirectionChangeInfo> aDirectionChanges;
     SvXub_StrLens aKashida;
     SvXub_StrLens aKashidaInvalid;
     SvXub_StrLens aNoKashidaLine;
@@ -378,16 +384,16 @@ inline BYTE SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
     return aScriptChanges[nCnt].type;
 }
 
-inline USHORT SwScriptInfo::CountDirChg() const { return aDirChg.Count(); }
+inline USHORT SwScriptInfo::CountDirChg() const { return aDirectionChanges.size(); }
 inline xub_StrLen SwScriptInfo::GetDirChg( const USHORT nCnt ) const
 {
-    OSL_ENSURE( nCnt < aDirChg.Count(),"No DirChange today!");
-    return aDirChg[ nCnt ];
+    OSL_ENSURE( nCnt < aDirectionChanges.size(),"No DirChange today!");
+    return aDirectionChanges[ nCnt ].position;
 }
 inline BYTE SwScriptInfo::GetDirType( const xub_StrLen nCnt ) const
 {
-    OSL_ENSURE( nCnt < aDirChg.Count(),"No DirType today!");
-    return aDirType[ nCnt ];
+    OSL_ENSURE( nCnt < aDirectionChanges.size(),"No DirType today!");
+    return aDirectionChanges[ nCnt ].type;
 }
 
 inline USHORT SwScriptInfo::CountKashida() const { return aKashida.Count(); }
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 51d6c55..b7db718 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1304,9 +1304,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
 #endif
 
     // remove invalid entries from direction information arrays
-    const USHORT nDirRemove = aDirChg.Count();
-    aDirChg.Remove( 0, nDirRemove );
-    aDirType.Remove( 0, nDirRemove );
+    aDirectionChanges.clear();
 
     // Perform Unicode Bidi Algorithm for text direction information
     bool bPerformUBA = UBIDI_LTR != nDefaultDir;
@@ -1326,7 +1324,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
         // 1. All text in RTL runs will use the CTL font
         // #i89825# change the script type also to CTL (hennerdrewes)
         // 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!)
-        for ( USHORT nDirIdx = 0; nDirIdx < aDirChg.Count(); ++nDirIdx )
+        for ( USHORT nDirIdx = 0; nDirIdx < aDirectionChanges.size(); ++nDirIdx )
         {
             const BYTE nCurrDirType = GetDirType( nDirIdx );
                 // nStart ist start of RTL run:
@@ -1395,10 +1393,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
 void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
 {
     // remove invalid entries from direction information arrays
-    const USHORT nDirRemove = aDirChg.Count();
-    aDirChg.Remove( 0, nDirRemove );
-    aDirType.Remove( 0, nDirRemove );
-
+    aDirectionChanges.clear();
     //
     // Bidi functions from icu 2.0
     //
@@ -1413,14 +1408,10 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
     int32_t nStart = 0;
     int32_t nEnd;
     UBiDiLevel nCurrDir;
-    // counter for direction information arrays
-    USHORT nCntDir = 0;
-
     for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
     {
         ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
-        aDirChg.Insert( (USHORT)nEnd, nCntDir );
-        aDirType.Insert( (BYTE)nCurrDir, nCntDir++ );
+        aDirectionChanges.push_back( DirectionChangeInfo(nEnd, nCurrDir) );
         nStart = nEnd;
     }
 
commit 40899c887df9eee72116807fbc652d24ab8ced6f
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Tue Feb 8 14:05:29 2011 +0000

    Remove some svArray usage in SwScriptInfo

diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index 5b46b8d..ef3a365 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -99,8 +99,16 @@ public:
 class SwScriptInfo
 {
 private:
-    SvXub_StrLens aScriptChg;
-    SvBytes aScriptType;
+    //! Records a single change in script type.
+    struct ScriptChangeInfo
+    {
+        xub_StrLen position; //!< Character position at which we change script
+        BYTE       type;     //!< Script type (Latin/Asian/Complex) that we change to.
+        inline ScriptChangeInfo(xub_StrLen pos, BYTE typ) : position(pos), type(typ) {};
+    };
+    //TODO - This is sorted, so should probably be a std::set rather than vector.
+    //       But we also use random access (probably unnecessarily).
+    std::vector<ScriptChangeInfo> aScriptChanges;
     SvXub_StrLens aDirChg;
     SvBytes aDirType;
     SvXub_StrLens aKashida;
@@ -357,16 +365,17 @@ inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
     if ( nPos < nInvalidityPos )
         nInvalidityPos = nPos;
 };
-inline USHORT SwScriptInfo::CountScriptChg() const { return aScriptChg.Count(); }
+
+inline USHORT SwScriptInfo::CountScriptChg() const { return aScriptChanges.size(); }
 inline xub_StrLen SwScriptInfo::GetScriptChg( const USHORT nCnt ) const
 {
-    OSL_ENSURE( nCnt < aScriptChg.Count(),"No ScriptChange today!");
-    return aScriptChg[ nCnt ];
+    OSL_ENSURE( nCnt < aScriptChanges.size(),"No ScriptChange today!");
+    return aScriptChanges[nCnt].position;
 }
 inline BYTE SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
 {
-    OSL_ENSURE( nCnt < aScriptChg.Count(),"No ScriptType today!");
-    return aScriptType[ nCnt ];
+    OSL_ENSURE( nCnt < aScriptChanges.size(),"No ScriptType today!");
+    return aScriptChanges[nCnt].type;
 }
 
 inline USHORT SwScriptInfo::CountDirChg() const { return aDirChg.Count(); }
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7c6a4b3..51d6c55 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -915,9 +915,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
     //
 
     // remove invalid entries from script information arrays
-    const USHORT nScriptRemove = aScriptChg.Count() - nCnt;
-    aScriptChg.Remove( nCnt, nScriptRemove );
-    aScriptType.Remove( nCnt, nScriptRemove );
+    aScriptChanges.erase( aScriptChanges.begin() + nCnt, aScriptChanges.end() );
 
     // get the start of the last compression group
     USHORT nLastCompression = nChg;
@@ -981,8 +979,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
 
         if ( nScript != nNextScript )
         {
-            aScriptChg.Insert( nEnd, nCnt );
-            aScriptType.Insert( nScript, nCnt++ );
+            aScriptChanges.push_back( ScriptChangeInfo(nEnd, nScript) );
+            nCnt++;
             nScript = nNextScript;
         }
     }
@@ -991,7 +989,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
     // UPDATE THE SCRIPT INFO ARRAYS:
     //
 
-    while ( nChg < rTxt.Len() || ( !aScriptChg.Count() && !rTxt.Len() ) )
+    while ( nChg < rTxt.Len() || ( !aScriptChanges.empty() && !rTxt.Len() ) )
     {
         OSL_ENSURE( i18n::ScriptType::WEAK != nScript,
                 "Inserting WEAK into SwScriptInfo structure" );
@@ -1032,18 +1030,18 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
             if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
                 nType == U_COMBINING_SPACING_MARK )
             {
-                aScriptChg.Insert( nChg - 1, nCnt );
+                aScriptChanges.push_back( ScriptChangeInfo(nChg-1, nScript) );
             }
             else
             {
-                aScriptChg.Insert( nChg, nCnt );
+                aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) );
             }
         }
         else
         {
-            aScriptChg.Insert( nChg, nCnt );
+            aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) );
         }
-        aScriptType.Insert( nScript, nCnt++ );
+        ++nCnt;
 
         // if current script is asian, we search for compressable characters
         // in this range
@@ -1360,37 +1358,33 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                 // we have to insert a new script change:
                 if ( nStart > 0 && nStartPosOfGroup < nStart )
                 {
-                    aScriptChg.Insert( nStart, nScriptIdx );
-                    aScriptType.Insert( nScriptTypeOfGroup, nScriptIdx );
+                    aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
+                                          ScriptChangeInfo(nStart, nScriptTypeOfGroup) );
                     ++nScriptIdx;
                 }
 
                 // Remove entries in ScriptArray which end inside the RTL run:
-                while ( nScriptIdx < aScriptChg.Count() && GetScriptChg( nScriptIdx ) <= nEnd )
+                while ( nScriptIdx < aScriptChanges.size() && GetScriptChg( nScriptIdx ) <= nEnd )
                 {
-                    aScriptChg.Remove( nScriptIdx, 1 );
-                    aScriptType.Remove( nScriptIdx, 1 );
+                    aScriptChanges.erase(aScriptChanges.begin() + nScriptIdx);
                 }
 
                 // Insert a new entry in ScriptArray for the end of the RTL run:
-                aScriptChg.Insert( nEnd, nScriptIdx );
-                aScriptType.Insert( i18n::ScriptType::COMPLEX, nScriptIdx );
+                aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
+                                      ScriptChangeInfo(nEnd, i18n::ScriptType::COMPLEX) );
 
 #if OSL_DEBUG_LEVEL > 1
-                BYTE nScriptType;
-                BYTE nLastScriptType = i18n::ScriptType::WEAK;
-                xub_StrLen nScriptChg;
-                xub_StrLen nLastScriptChg = 0;
-                (void) nLastScriptChg;
-                (void) nLastScriptType;
-
-                for ( USHORT i2 = 0; i2 < aScriptChg.Count(); ++i2 )
+                // Check that ScriptChangeInfos are in increasing order of
+                // position and that we don't have "empty" changes.
+                BYTE nLastTyp = i18n::ScriptType::WEAK;
+                xub_StrLen nLastPos = 0;
+                for (aScriptChanges::const_iterator i2 = aScriptChanges.begin(); i2 < aScriptChanges.end(); ++i2)
                 {
-                    nScriptChg = GetScriptChg( i2 );
-                    nScriptType = GetScriptType( i2 );
-                    OSL_ENSURE( nLastScriptType != nScriptType &&
-                            nLastScriptChg < nScriptChg,
+                    OSL_ENSURE( nLastTyp != i2->type &&
+                            nLastPos < i2->position,
                             "Heavy InitScriptType() confusion" );
+                    nLastPos = i2->position;
+                    nLastTyp = i2->type;
                 }
 #endif
             }
commit 43d6c01ba9eb01be8fcdd6ff6537a96bbaafde7d
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Thu Feb 3 16:09:53 2011 +0000

    Remove svArrays from SwLayCacheIoImpl

diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index a2ec1d2..89620a9 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -1186,13 +1186,10 @@ SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, BOOL bWrtMd ) :
 BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
 {
     BOOL bRes = TRUE;
-    UINT16 nLvl = aRecTypes.Count();
-    OSL_ENSURE( nLvl == aRecSizes.Count(), "OpenRec: Level" );
     UINT32 nPos = pStream->Tell();
     if( bWriteMode )
     {
-        aRecTypes.Insert( cType, nLvl );
-        aRecSizes.Insert( nPos, nLvl );
+        aRecords.push_back( RecTypeSize(cType, nPos) );
         *pStream << (UINT32) 0;
     }
     else
@@ -1200,20 +1197,20 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
         UINT32 nVal;
         *pStream >> nVal;
         BYTE cRecTyp = (BYTE)nVal;
-        aRecTypes.Insert( cRecTyp, nLvl );
-        sal_uInt32 nSize = nVal >> 8;
-        aRecSizes.Insert( nPos + nSize, nLvl );
         if( !nVal || cRecTyp != cType ||
             pStream->GetErrorCode() != SVSTREAM_OK || pStream->IsEof() )
         {
             OSL_ENSURE( nVal, "OpenRec: Record-Header is 0" );
-            OSL_ENSURE( cRecTyp == cType,
-                    "OpenRec: Wrong Record Type" );
-            aRecTypes[nLvl] = 0;
-            aRecSizes[nLvl] = pStream->Tell();
+            OSL_ENSURE( cRecTyp == cType, "OpenRec: Wrong Record Type" );
+            aRecords.push_back( RecTypeSize(0, pStream->Tell()) );
             bRes = sal_False;
             bError = TRUE;
         }
+        else
+        {
+            sal_uInt32 nSize = nVal >> 8;
+            aRecords.push_back( RecTypeSize(cRecTyp, nPos+nSize) );
+        }
     }
     return bRes;
 }
@@ -1223,19 +1220,16 @@ BOOL SwLayCacheIoImpl::OpenRec( BYTE cType )
 BOOL SwLayCacheIoImpl::CloseRec( BYTE )
 {
     BOOL bRes = TRUE;
-    UINT16 nLvl = aRecTypes.Count();
-    OSL_ENSURE( nLvl == aRecSizes.Count(), "CloseRec: wrong Level" );
-    OSL_ENSURE( nLvl, "CloseRec: no levels" );
-    if( nLvl )
+    OSL_ENSURE( !aRecords.empty(), "CloseRec: no levels" );
+    if( !aRecords.empty() )
     {
-        nLvl--;
         UINT32 nPos = pStream->Tell();
         if( bWriteMode )
         {
-            UINT32 nBgn = aRecSizes[nLvl];
+            UINT32 nBgn = aRecords.back().size;
             pStream->Seek( nBgn );
             UINT32 nSize = nPos - nBgn;
-            UINT32 nVal = ( nSize << 8 ) | aRecTypes[nLvl];
+            UINT32 nVal = ( nSize << 8 ) | aRecords.back().type;
             *pStream << nVal;
             pStream->Seek( nPos );
             if( pStream->GetError() != SVSTREAM_OK )
@@ -1243,7 +1237,7 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE )
         }
         else
         {
-            UINT32 n = aRecSizes[nLvl];
+            UINT32 n = aRecords.back().size;
             OSL_ENSURE( n >= nPos, "CloseRec: to much data read" );
             if( n != nPos )
             {
@@ -1254,9 +1248,7 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE )
             if( pStream->GetErrorCode() != SVSTREAM_OK )
                 bRes = FALSE;
         }
-
-        aRecTypes.Remove( nLvl, 1 );
-        aRecSizes.Remove( nLvl, 1 );
+        aRecords.pop_back();
     }
 
     if( !bRes )
@@ -1267,16 +1259,14 @@ BOOL SwLayCacheIoImpl::CloseRec( BYTE )
 
 UINT32 SwLayCacheIoImpl::BytesLeft()
 {
-    UINT16 nLvl = aRecSizes.Count();
     UINT32 n = 0;
-    if( !bError && nLvl )
+    if( !bError && !aRecords.empty() )
     {
-        UINT32 nEndPos = aRecSizes[ nLvl-1 ];
+        UINT32 nEndPos = aRecords.back().size;
         UINT32 nPos = pStream->Tell();
         if( nEndPos > nPos )
             n = nEndPos - nPos;
     }
-
     return n;
 }
 
@@ -1301,7 +1291,7 @@ void SwLayCacheIoImpl::SkipRec()
 {
     BYTE c = Peek();
     OpenRec( c );
-    pStream->Seek( aRecSizes[aRecSizes.Count()-1] );
+    pStream->Seek( aRecords.back().size );
     CloseRec( c );
 }
 
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 71f74a2..009e462 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -35,6 +35,7 @@
 #include <svl/svstdarr.hxx>
 #endif
 #include <swrect.hxx>
+#include <vector>
 
 class SwDoc;
 class SwFrm;
@@ -167,8 +168,13 @@ public:
 
 class SwLayCacheIoImpl
 {
-    SvBytes		   	aRecTypes;
-    SvULongs		aRecSizes;
+private:
+    struct RecTypeSize {
+        BYTE  type;
+        ULONG size;
+        RecTypeSize(BYTE typ, ULONG siz) : type(typ), size(siz) {}
+    };
+    std::vector<RecTypeSize> aRecords;
 
     SvStream       	*pStream;
 


More information about the Libreoffice-commits mailing list