Kaydet (Commit) 6220362e authored tarafından Andras Timar's avatar Andras Timar

tdf#90404 OOXML chart legend import improvement

In the bugdoc, the chart legend had 6 entries in PowerPoint, but
only 5 in Impress. I played a lot with padding and offset parameters
in layout algorithm without success. Finally I introduced this 1mm
tolerance, so the fixed legend frame can expand up to 1mm, if necessary.

Change-Id: Id1ad1df67aab41d942133cea8d16fccf0f215167
Reviewed-on: https://gerrit.libreoffice.org/15149Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 1a3c99f2
...@@ -390,7 +390,7 @@ awt::Size lcl_placeLegendEntries( ...@@ -390,7 +390,7 @@ awt::Size lcl_placeLegendEntries(
nSumHeight += aRowHeights[nR]; nSumHeight += aRowHeights[nR];
sal_Int32 nRemainingSpace = rAvailableSpace.Height - nSumHeight; sal_Int32 nRemainingSpace = rAvailableSpace.Height - nSumHeight;
if( nRemainingSpace<0 ) if( nRemainingSpace < -100 ) // 1mm tolerance for OOXML interop tdf#90404
{ {
//remove entries that are too big //remove entries that are too big
for( sal_Int32 nR=nNumberOfRows; nR--; ) for( sal_Int32 nR=nNumberOfRows; nR--; )
...@@ -418,7 +418,7 @@ awt::Size lcl_placeLegendEntries( ...@@ -418,7 +418,7 @@ awt::Size lcl_placeLegendEntries(
} }
nNumberOfRows = static_cast<sal_Int32>(aRowHeights.size()); nNumberOfRows = static_cast<sal_Int32>(aRowHeights.size());
} }
if( nRemainingSpace > 0 ) if( nRemainingSpace >= -100 ) // 1mm tolerance for OOXML interop tdf#90404
{ {
sal_Int32 nNormalSpacingHeight = 2*nYPadding+(nNumberOfRows-1)*nYOffset; sal_Int32 nNormalSpacingHeight = 2*nYPadding+(nNumberOfRows-1)*nYOffset;
if( nRemainingSpace < nNormalSpacingHeight ) if( nRemainingSpace < nNormalSpacingHeight )
......
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