summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/table/swnewtable.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 23edc85fee3f..fef95fcc8a72 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();
}