From 72ef0d88e916b320de85fe2ebf08cb7aea28ca08 Mon Sep 17 00:00:00 2001 From: Luke Deller Date: Mon, 7 Apr 2014 22:20:15 +1000 Subject: [PATCH] Ignore sprmTFCantSplit90 in .doc file per MS spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- sw/source/filter/ww8/ww8par2.cxx | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 6b1cde9dafb4..16aabb6bedf5 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1552,11 +1552,10 @@ enum wwTableSprm { sprmNil, - sprmTTableWidth,sprmTTextFlow, sprmTFCantSplit, sprmTFCantSplit90,sprmTJc, sprmTFBiDi, sprmTDefTable, - sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft, sprmTSetBrc, - sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete, sprmTTableHeader, - sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90, - + sprmTTableWidth, sprmTTextFlow, sprmTFCantSplit, sprmTJc, sprmTFBiDi, + sprmTDefTable, sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft, + sprmTSetBrc, sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete, + sprmTTableHeader, sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90, sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault }; @@ -1571,14 +1570,10 @@ wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer) return sprmTTableWidth; case NS_sprm::LN_TTextFlow: 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: return sprmTTableHeader; case NS_sprm::LN_TFCantSplit: - return sprmTFCantSplit90; + return sprmTFCantSplit; case NS_sprm::LN_TJc90: return sprmTJc; case NS_sprm::LN_TFBiDi: @@ -1780,10 +1775,6 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : pNewBand->bCantSplit = *pParams; bClaimLineFmt = true; break; - case sprmTFCantSplit90: - pNewBand->bCantSplit90 = *pParams; - bClaimLineFmt = true; - break; case sprmTTableBorders: pTableBorders = pParams; // process at end break; @@ -3068,15 +3059,7 @@ void WW8TabDesc::AdjustNewBand() //Word stores 1 for bCantSplit if the row cannot be split, we set true if //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; - if(bSetCantSplit) - bSetCantSplit = pActBand->bCantSplit90; - pTabLine->GetFrmFmt()->SetFmtAttr(SwFmtRowSplit(!bSetCantSplit)); short i; // SW-Index