diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-05-12 12:47:31 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-05-19 23:42:06 +0200 |
commit | 3aea3d2399983c1c366ca745a9b183435f155f23 (patch) | |
tree | b544ef31b02bf170f07a7362261f92829c30d4b2 /sd | |
parent | e990859780840f431a99c7da70084c22e740ac08 (diff) |
tdf#79082 Improve ppt tab import/export
Import/export the paragraph tabs without any text offset,
tabs are relative to the text box anyway.
Change-Id: Ife3b762e7581548e65500c16259a4481cc07a88f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94101
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit 9c4048b1883f1dc9fdd621ffa2bb06ff9fe19d14)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94429
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 952a8275cbe8..14b0fe6f1959 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -29,6 +29,7 @@ #include <tools/poly.hxx> #include <tools/stream.hxx> #include <tools/fontenum.hxx> +#include <tools/UnitConversion.hxx> #include <sot/storage.hxx> #include <vcl/graph.hxx> #include <editeng/svxenum.hxx> @@ -1180,7 +1181,6 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pPara = aTextObj.GetParagraph(0); sal_uInt32 nParaFlags = 0x1f; sal_Int16 nMask, nNumberingRule[ 10 ]; - const sal_uInt32 nTextOfs = pPara->nTextOfs; const sal_uInt32 nTabs = pPara->maTabStop.getLength(); const auto& rTabStops = pPara->maTabStop; @@ -1219,7 +1219,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u const sal_uInt32 nDefaultTabSize = MapSize( awt::Size( nDefaultTabSizeSrc, 1 ) ).Width; sal_uInt32 nDefaultTabs = std::abs( maRect.GetWidth() ) / nDefaultTabSize; if ( nTabs ) - nDefaultTabs -= static_cast<sal_Int32>( ( ( rTabStops[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); + nDefaultTabs -= static_cast<sal_Int32>( convertTwipToMasterUnit(rTabStops[ nTabs - 1 ].Position) / nDefaultTabSize ); if ( static_cast<sal_Int32>(nDefaultTabs) < 0 ) nDefaultTabs = 0; @@ -1248,7 +1248,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pRuleOut->WriteUInt16( nTabCount ); for ( const css::style::TabStop& rTabStop : rTabStops ) { - sal_uInt16 nPosition = static_cast<sal_uInt16>( ( rTabStop.Position / 4.40972 ) + nTextOfs ); + sal_uInt16 nPosition = static_cast<sal_uInt16>( convertTwipToMasterUnit(rTabStop.Position) ); sal_uInt16 nType; switch ( rTabStop.Alignment ) { @@ -1265,7 +1265,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u sal_uInt32 nWidth = 1; if ( nTabs ) - nWidth += static_cast<sal_Int32>( ( rTabStops[ nTabs - 1 ].Position / 4.40972 + nTextOfs ) / nDefaultTabSize ); + nWidth += static_cast<sal_Int32>( convertTwipToMasterUnit(rTabStops[ nTabs - 1 ].Position) / nDefaultTabSize ); nWidth *= nDefaultTabSize; for ( i = 0; i < nDefaultTabs; i++, nWidth += nDefaultTabSize ) pRuleOut->WriteUInt32( nWidth ); |