[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source
LuboÅ¡ LuÅák
l.lunak at centrum.cz
Wed Mar 19 03:24:47 PDT 2014
sw/source/core/table/swnewtable.cxx | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
New commits:
commit e8b686149f2a9f21a7a52bb5710a8a6362cd7a35
Author: LuboÅ¡ LuÅák <l.lunak at centrum.cz>
Date: Tue Mar 18 18:57:05 2014 +0100
workaround for rounding errors when handling merged cells (fdo#38414)
Change-Id: I4d36e4b86c77a7356a8c221cbfc5735e925392ba
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 23edc85..fef95fc 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -200,10 +200,20 @@ static SwTableBox* lcl_LeftBorder2Box( long nLeft, const SwTableLine* pLine )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
OSL_ENSURE( pBox, "Missing table box" );
- if( nCurrLeft >= nLeft && pBox->GetFrmFmt()->GetFrmSize().GetWidth() )
+ if( pBox->GetFrmFmt()->GetFrmSize().GetWidth() )
{
- OSL_ENSURE( nCurrLeft == nLeft, "Wrong box found" );
- return pBox;
+ if( nCurrLeft == nLeft )
+ return pBox;
+ // HACK: It appears that rounding errors may result in positions not matching
+ // exactly, so allow a little tolerance. This happens at least with merged cells
+ // in the doc from fdo#38414 .
+ if( abs( nCurrLeft - nLeft ) <= ( nLeft / 1000 ))
+ return pBox;
+ if( nCurrLeft >= nLeft )
+ {
+ SAL_WARN( "sw.core", "Possibly wrong box found" );
+ return pBox;
+ }
}
nCurrLeft += pBox->GetFrmFmt()->GetFrmSize().GetWidth();
}
More information about the Libreoffice-commits
mailing list