summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-12-03 13:35:09 +0100
committerKurt Zenker <kz@openoffice.org>2009-12-03 13:35:09 +0100
commit9635c2f6f5a14ba339be3d71b7e6f078f0b0b090 (patch)
tree558f927da213622d6c7ba8a4221d01d8db0de5a7 /sw
parent5793bba02377b271116999c7248fbda7d63cf1ef (diff)
parent6a1de0e3cbf92380ba0eb2e3ea1ecb5001e3da13 (diff)
CWS-TOOLING: integrate CWS hb32showstoppers3_DEV300
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx19
1 files changed, 15 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 7342843e6b9a..5cb19358f385 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1170,6 +1170,7 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const BYTE* pS)
pS++;
short nLen = (INT16)SVBT16ToShort( pS - 2 ); // nicht schoen
+
BYTE nCols = *pS; // Anzahl der Zellen
short nOldCols = nWwCols;
@@ -1200,7 +1201,11 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const BYTE* pS)
setcelldefaults(pTCs,nCols);
}
- if( nFileCols )
+ short nColsToRead = nFileCols;
+ if (nColsToRead > nCols)
+ nColsToRead = nCols;
+
+ if( nColsToRead )
{
// lies TCs ein
@@ -1216,9 +1221,9 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const BYTE* pS)
if( bVer67 )
{
WW8_TCellVer6* pTc = (WW8_TCellVer6*)pT;
- for(i=0; i<nFileCols; i++, ++pAktTC,++pTc)
+ for(i=0; i<nColsToRead; i++, ++pAktTC,++pTc)
{
- if( i < nFileCols )
+ if( i < nColsToRead )
{ // TC aus File ?
BYTE aBits1 = SVBT8ToByte( pTc->aBits1Ver6 );
pAktTC->bFirstMerged = ( ( aBits1 & 0x01 ) != 0 );
@@ -1248,7 +1253,7 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const BYTE* pS)
else
{
WW8_TCellVer8* pTc = (WW8_TCellVer8*)pT;
- for (int k = 0; k < nFileCols; ++k, ++pAktTC, ++pTc )
+ for (int k = 0; k < nColsToRead; ++k, ++pAktTC, ++pTc )
{
UINT16 aBits1 = SVBT16ToShort( pTc->aBits1Ver8 );
pAktTC->bFirstMerged = ( ( aBits1 & 0x0001 ) != 0 );
@@ -1296,6 +1301,12 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(bool bVer67, const BYTE* pParamsTSetBRC)
BYTE nitcLim = pParamsTSetBRC[1];// (last col to be changed)+1
BYTE nFlag = *(pParamsTSetBRC+2);
+ if (nitcFirst >= nWwCols)
+ return;
+
+ if (nitcLim > nWwCols)
+ nitcLim = nWwCols;
+
bool bChangeRight = (nFlag & 0x08) ? true : false;
bool bChangeBottom = (nFlag & 0x04) ? true : false;
bool bChangeLeft = (nFlag & 0x02) ? true : false;