summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-03-18 15:35:53 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-03-18 15:35:53 +0000
commit35baac4ab18a22de6c94744b450038f80eb15b27 (patch)
tree5ad1055b7111550848b9445e5d9a930769d422c3
parent31e76344368b76bcb285f3f98ed655cc7158c680 (diff)
INTEGRATION: CWS sw30bf01 (1.135.2); FILE MERGED
2008/03/06 10:16:07 hbrinkm 1.135.2.3: RESYNC: (1.136-1.137); FILE MERGED 2008/02/01 13:42:07 hbrinkm 1.135.2.2: RESYNC: (1.135-1.136); FILE MERGED 2008/01/18 10:47:33 hbrinkm 1.135.2.1: #i84879# applied patch, added length check
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c5e8874b560a..03418f543d4e 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: ww8par2.cxx,v $
*
- * $Revision: 1.138 $
+ * $Revision: 1.139 $
*
- * last change: $Author: kz $ $Date: 2008-03-05 17:18:49 $
+ * last change: $Author: vg $ $Date: 2008-03-18 16:35:53 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -4604,6 +4604,8 @@ void WW8RStyle::ImportOldFormatStyles()
stcp++;
}
+ USHORT nStyles=stcp;
+
std::vector<pxoffset> aCHPXOffsets(stcp);
sal_uInt16 cbChpx;
rSt >> cbChpx;
@@ -4629,12 +4631,17 @@ void WW8RStyle::ImportOldFormatStyles()
aCHPXOffsets[stcp].mnSize);
aConvertedChpx.push_back( ChpxToSprms(aChpx) );
- nByteCount = nByteCount+ nRemainder;
+ nByteCount += nRemainder;
}
else
aConvertedChpx.push_back( std::vector<BYTE>() );
stcp++;
+ if (stcp == nStyles)
+ {
+ rSt.SeekRel(cbChpx-nByteCount);
+ nByteCount += cbChpx-nByteCount;
+ }
}
std::vector<pxoffset> aPAPXOffsets(stcp);
@@ -4662,15 +4669,23 @@ void WW8RStyle::ImportOldFormatStyles()
aPAPXOffsets[stcp].mnSize = nRemainder;
rSt.SeekRel(nRemainder);
- nByteCount = nByteCount + nRemainder;
+ nByteCount += nRemainder;
}
stcp++;
+
+ if (stcp == nStyles)
+ {
+ rSt.SeekRel(cbPapx-nByteCount);
+ nByteCount += cbPapx-nByteCount;
+ }
}
sal_uInt16 iMac;
rSt >> iMac;
+ if (iMac > nStyles) iMac = nStyles;
+
for (stcp = 0; stcp < iMac; ++stcp)
{
sal_uInt8 stcNext, stcBase;
@@ -4704,8 +4719,10 @@ void WW8RStyle::ImportOldFormatStyles()
ImportSprms(aPAPXOffsets[stcp].mnOffset, aPAPXOffsets[stcp].mnSize,
true);
- ImportSprms(&(aConvertedChpx[stcp][0]), static_cast< short >(aConvertedChpx[stcp].size()),
- false);
+ if (aConvertedChpx[stcp].size() > 0)
+ ImportSprms(&(aConvertedChpx[stcp][0]),
+ static_cast< short >(aConvertedChpx[stcp].size()),
+ false);
PostStyle(rSI, bOldNoImp);
}