Ignore sprmTFCantSplit90 in .doc file per MS spec

Microsoft's new .doc file format specification says to ignore
sprmTFCantSplit90 in favour of (the older!) sprmTFCantSplit.

This seems to have confused the OO developer who must have been trying
to reverse engineer this without documentation: the table parsing code
gets sprmTFCantSplit90 and sprmTFCantSplit the wrong way around.

This commit removes handling of sprmTFCantSplit90 according to the
instruction in the Microsoft file format specification.
http://msdn.microsoft.com/en-us/library/dd951612.aspx

Change-Id: Ic9d3dddf102d6af0a061d2e8b68de3cf5bd9bae1
Reviewed-on: https://gerrit.libreoffice.org/8885
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Luke Deller
2014-04-07 22:20:15 +10:00
committed by Caolán McNamara
parent 6a7d04a9cb
commit 72ef0d88e9

View File

@@ -1552,11 +1552,10 @@ enum wwTableSprm
{ {
sprmNil, sprmNil,
sprmTTableWidth,sprmTTextFlow, sprmTFCantSplit, sprmTFCantSplit90,sprmTJc, sprmTFBiDi, sprmTDefTable, sprmTTableWidth, sprmTTextFlow, sprmTFCantSplit, sprmTJc, sprmTFBiDi,
sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft, sprmTSetBrc, sprmTDefTable, sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft,
sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete, sprmTTableHeader, sprmTSetBrc, sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete,
sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90, sprmTTableHeader, sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90,
sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault
}; };
@@ -1571,14 +1570,10 @@ wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer)
return sprmTTableWidth; return sprmTTableWidth;
case NS_sprm::LN_TTextFlow: case NS_sprm::LN_TTextFlow:
return sprmTTextFlow; return sprmTTextFlow;
case NS_sprm::LN_TFCantSplit90:
// FIXME this code gets the names of sprmTFCantSplit and
// sprmTFCantSplit90 the wrong way around.
return sprmTFCantSplit;
case NS_sprm::LN_TTableHeader: case NS_sprm::LN_TTableHeader:
return sprmTTableHeader; return sprmTTableHeader;
case NS_sprm::LN_TFCantSplit: case NS_sprm::LN_TFCantSplit:
return sprmTFCantSplit90; return sprmTFCantSplit;
case NS_sprm::LN_TJc90: case NS_sprm::LN_TJc90:
return sprmTJc; return sprmTJc;
case NS_sprm::LN_TFBiDi: case NS_sprm::LN_TFBiDi:
@@ -1780,10 +1775,6 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
pNewBand->bCantSplit = *pParams; pNewBand->bCantSplit = *pParams;
bClaimLineFmt = true; bClaimLineFmt = true;
break; break;
case sprmTFCantSplit90:
pNewBand->bCantSplit90 = *pParams;
bClaimLineFmt = true;
break;
case sprmTTableBorders: case sprmTTableBorders:
pTableBorders = pParams; // process at end pTableBorders = pParams; // process at end
break; break;
@@ -3068,15 +3059,7 @@ void WW8TabDesc::AdjustNewBand()
//Word stores 1 for bCantSplit if the row cannot be split, we set true if //Word stores 1 for bCantSplit if the row cannot be split, we set true if
//we can split the row //we can split the row
// bCantSplit: Always true for rows containing merged cells (Word <= 2000 crashes otherwise)
// So in case bCantSplit is true, we check for bCantSplit90, which has been introduced for
// Word versions >= 2002.
// FIXME the above comment is suspect because bCantSplit and bCantSplit90
// have been populated the wrong way around.
bool bSetCantSplit = pActBand->bCantSplit; bool bSetCantSplit = pActBand->bCantSplit;
if(bSetCantSplit)
bSetCantSplit = pActBand->bCantSplit90;
pTabLine->GetFrmFmt()->SetFmtAttr(SwFmtRowSplit(!bSetCantSplit)); pTabLine->GetFrmFmt()->SetFmtAttr(SwFmtRowSplit(!bSetCantSplit));
short i; // SW-Index short i; // SW-Index