Kaydet (Commit) 601bfe2c authored tarafından Michael Stahl's avatar Michael Stahl

fdo#51777: add a hack for 1 twip DOUBLE borders:

Arguably such annoyingly thin double borders don't make much sense
anyway, because they're essentially 2 hairlines with ~no space between,
but unfortunately older LO versions are able to create them;
since the refactoring in 2d045cdb,
which changed the BorderWidthImpl::Get* methods to return 0 due to
rounding, they were ignored at least in the HTML import, which is a
regression.
So add a special purpose hack that essentially rounds up the first line
to 1 but not the other lines so the visual result is a hairline single
border.

Change-Id: I20ac4675bcf67ea58a6931a40bff3605390e9c0d
üst cd0046bc
...@@ -328,6 +328,10 @@ long BorderWidthImpl::GetLine1( long nWidth ) const ...@@ -328,6 +328,10 @@ long BorderWidthImpl::GetLine1( long nWidth ) const
result = std::max<long>(0, result = std::max<long>(0,
static_cast<long>((m_nRate1 * nWidth) + 0.5) static_cast<long>((m_nRate1 * nWidth) + 0.5)
- (nConstant2 + nConstantD)); - (nConstant2 + nConstantD));
if (result == 0 && m_nRate1 > 0.0 && nWidth > 0)
{ // fdo#51777: hack to essentially treat 1 twip DOUBLE border
result = 1; // as 1 twip SINGLE border
}
} }
return result; return result;
} }
......
...@@ -2072,8 +2072,7 @@ void HTMLTable::SetBorders() ...@@ -2072,8 +2072,7 @@ void HTMLTable::SetBorders()
sal_uInt16 HTMLTable::GetBorderWidth( const SvxBorderLine& rBLine, sal_uInt16 HTMLTable::GetBorderWidth( const SvxBorderLine& rBLine,
sal_Bool bWithDistance ) const sal_Bool bWithDistance ) const
{ {
sal_uInt16 nBorderWidth = rBLine.GetOutWidth() + rBLine.GetInWidth() + sal_uInt16 nBorderWidth = rBLine.GetWidth();
rBLine.GetDistance();
if( bWithDistance ) if( bWithDistance )
{ {
if( nCellPadding ) if( nCellPadding )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment