summaryrefslogtreecommitdiff
path: root/sd/source/filter/eppt/epptso.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-12 12:47:31 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-14 09:59:11 +0200
commit9c4048b1883f1dc9fdd621ffa2bb06ff9fe19d14 (patch)
treedb3ffad81acdc538d6377cbb16177345399cc53c /sd/source/filter/eppt/epptso.cxx
parent68af4f050c5768ce30357cbc5f40e7bc031518c4 (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>
Diffstat (limited to 'sd/source/filter/eppt/epptso.cxx')
-rw-r--r--sd/source/filter/eppt/epptso.cxx7
1 files changed, 3 insertions, 4 deletions
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<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;
@@ -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<sal_uInt16>( ( rTabStop.Position / 4.40972 ) + nTextOfs );
+ sal_uInt16 nPosition = static_cast<sal_uInt16>( 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<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 );