diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-05-12 12:47:31 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-05-20 16:06:51 +0200 |
commit | 13a65ac084d124fb22aee9f48797fa4f8588cd55 (patch) | |
tree | d5e5151803b028a32e955211b46c300b02ae9a5f /filter | |
parent | 2cc4d1a77641bea22aa05a4a61dafbe9551c12d2 (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 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index de39c837fe3a..48e96ef5b4ad 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -105,6 +105,7 @@ #include <svx/sxekitm.hxx> #include <editeng/flditem.hxx> #include <tools/zcodec.hxx> +#include <tools/UnitConversion.hxx> #include <filter/msfilter/svxmsbas.hxx> #include <sfx2/objsh.hxx> #include <editeng/brushitem.hxx> @@ -6316,13 +6317,11 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& sal_uInt32 nLatestManTab = 0; GetAttrib( PPT_ParaAttr_TextOfs, nTextOfs2, nDestinationInstance ); GetAttrib( PPT_ParaAttr_BulletOfs, nTab, nDestinationInstance ); - GetAttrib( PPT_ParaAttr_BulletOn, i, nDestinationInstance ); GetAttrib( PPT_ParaAttr_DefaultTab, nDefaultTab, nDestinationInstance ); + SvxTabStopItem aTabItem( 0, 0, SvxTabAdjust::Default, EE_PARA_TABS ); if ( GetTabCount() ) { - //paragraph offset = MIN(first_line_offset, hanging_offset) - sal_uInt32 nParaOffset = std::min(nTextOfs2, nTab); for ( i = 0; i < GetTabCount(); i++ ) { SvxTabAdjust eTabAdjust; @@ -6334,8 +6333,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& case 3 : eTabAdjust = SvxTabAdjust::Decimal; break; default : eTabAdjust = SvxTabAdjust::Left; } - if ( nTab > nParaOffset )//If tab stop greater than paragraph offset - aTabItem.Insert( SvxTabStop( ( ( (long( nTab - nTextOfs2 )) * 2540 ) / 576 ), eTabAdjust ) ); + aTabItem.Insert(SvxTabStop(convertMasterUnitToTwip(nTab), eTabAdjust)); } nLatestManTab = nTab; } @@ -6348,7 +6346,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& nTab = nDefaultTab * ( 1 + nTab ); for ( i = 0; ( i < 20 ) && ( nTab < 0x1b00 ); i++ ) { - aTabItem.Insert( SvxTabStop( static_cast<sal_uInt16>( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ) ) ); + aTabItem.Insert( SvxTabStop( convertMasterUnitToTwip(nTab))); nTab += nDefaultTab; } } |