From 9c4048b1883f1dc9fdd621ffa2bb06ff9fe19d14 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Tue, 12 May 2020 12:47:31 +0200 Subject: 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 --- sd/source/filter/eppt/epptso.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sd/source/filter/eppt/epptso.cxx') diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 51403da517cd..2b26b9602eb4 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1171,7 +1171,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; @@ -1210,7 +1209,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( ( ( rTabStops[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); + nDefaultTabs -= static_cast( convertTwipToMasterUnit(rTabStops[ nTabs - 1 ].Position) / nDefaultTabSize ); if ( static_cast(nDefaultTabs) < 0 ) nDefaultTabs = 0; @@ -1239,7 +1238,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( ( rTabStop.Position / 4.40972 ) + nTextOfs ); + sal_uInt16 nPosition = static_cast( convertTwipToMasterUnit(rTabStop.Position) ); sal_uInt16 nType; switch ( rTabStop.Alignment ) { @@ -1256,7 +1255,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u sal_uInt32 nWidth = 1; if ( nTabs ) - nWidth += static_cast( ( rTabStops[ nTabs - 1 ].Position / 4.40972 + nTextOfs ) / nDefaultTabSize ); + nWidth += static_cast( convertTwipToMasterUnit(rTabStops[ nTabs - 1 ].Position) / nDefaultTabSize ); nWidth *= nDefaultTabSize; for ( i = 0; i < nDefaultTabs; i++, nWidth += nDefaultTabSize ) pRuleOut->WriteUInt32( nWidth ); -- cgit