diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-25 21:42:57 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-26 14:06:22 +0200 |
commit | ef2e9b19a52e04ae0ed45900bcf64bf375a910ef (patch) | |
tree | 84ed81f6c7c56618623c4b38512287916065b184 /oox/inc | |
parent | 616fc7a79f35f4db65b58d34ff6d6e806ff9a6ef (diff) |
tdf#112647: Fixed line spacing is saved incorrectly to PPTX
The values were not converted to the right unit. Also the
spcPts attribute means an exact value not a minimum one.
Change-Id: Ia49683e66153611e96a830f821e3a2487adec505
Reviewed-on: https://gerrit.libreoffice.org/42763
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox/inc')
-rw-r--r-- | oox/inc/drawingml/textspacing.hxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/oox/inc/drawingml/textspacing.hxx b/oox/inc/drawingml/textspacing.hxx index d1ed9a988169..ed5f9b3be8d0 100644 --- a/oox/inc/drawingml/textspacing.hxx +++ b/oox/inc/drawingml/textspacing.hxx @@ -38,16 +38,19 @@ namespace oox { namespace drawingml { Percent }; TextSpacing() - : nUnit( Unit::Points ), nValue( 0 ), bHasValue( false ) + : nUnit( Unit::Points ), nValue( 0 ), bHasValue( false ), bExactValue( false ) { } - TextSpacing( sal_Int32 nPoints ) : nUnit( Unit::Points ), nValue( nPoints ), bHasValue( true ){}; + TextSpacing( sal_Int32 nPoints ) : nUnit( Unit::Points ), nValue( nPoints ), bHasValue( true ), bExactValue ( false ){}; css::style::LineSpacing toLineSpacing() const { css::style::LineSpacing aSpacing; - aSpacing.Mode = ( nUnit == Unit::Percent - ? css::style::LineSpacingMode::PROP - : css::style::LineSpacingMode::MINIMUM ); + if (nUnit == Unit::Percent) + aSpacing.Mode = css::style::LineSpacingMode::PROP; + else if (bExactValue) + aSpacing.Mode = css::style::LineSpacingMode::FIX; + else + aSpacing.Mode = css::style::LineSpacingMode::MINIMUM; aSpacing.Height = static_cast< sal_Int16 >( nUnit == Unit::Percent ? nValue / 1000 : nValue ); return aSpacing; } @@ -61,6 +64,7 @@ namespace oox { namespace drawingml { Unit nUnit; sal_Int32 nValue; bool bHasValue; + bool bExactValue; }; } } |