From 6c2e69fbd092dfb12c30efdaa98f5fd7a1db77c1 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 27 Apr 2011 20:38:51 +0200 Subject: fix-ppt-linespacing-import-export.diff: fix ppt import (bnc#355302) --- sd/source/filter/eppt/epptso.cxx | 2 +- sd/source/filter/eppt/pptx-text.cxx | 8 ++++++-- sd/source/ui/dlg/paragr.cxx | 14 ++++++++++++++ sd/source/ui/inc/paragr.hxx | 2 ++ 4 files changed, 23 insertions(+), 3 deletions(-) (limited to 'sd/source') diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 0466af7e6418..5b904608da9c 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -772,7 +772,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) } else { - if ( pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point + if ( !pPara->mbFixedLineSpacing && pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point nLineSpacing = nNormalSpacing; else nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 ); diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index abc9755be9af..9b2ca2925bc2 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1118,11 +1118,15 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Boo = *( (::com::sun::star::style::LineSpacing*)mAny.getValue() ); switch ( aLineSpacing.Mode ) { + case ::com::sun::star::style::LineSpacingMode::FIX : + mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) ); + mbFixedLineSpacing = sal_True; + break; case ::com::sun::star::style::LineSpacingMode::MINIMUM : case ::com::sun::star::style::LineSpacingMode::LEADING : - case ::com::sun::star::style::LineSpacingMode::FIX : mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) ); - break; + mbFixedLineSpacing = sal_False; + break; case ::com::sun::star::style::LineSpacingMode::PROP : default: diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index 75b21600b07b..36751843fb0f 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -192,4 +192,18 @@ SdParagraphDlg::SdParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) AddTabPage( RID_SVXPAGE_TABULATOR ); } +void SdParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +{ + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + switch( nId ) + { + case RID_SVXPAGE_STD_PARAGRAPH: + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, MM50/2)); + rPage.PageCreated(aSet); + break; + default: + break; + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/paragr.hxx b/sd/source/ui/inc/paragr.hxx index af801492672d..89d77c7b9d54 100644 --- a/sd/source/ui/inc/paragr.hxx +++ b/sd/source/ui/inc/paragr.hxx @@ -44,6 +44,8 @@ class SdParagraphDlg : public SfxTabDialog private: const SfxItemSet& rOutAttrs; + virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); + public: SdParagraphDlg( Window* pParent, const SfxItemSet* pAttr ); ~SdParagraphDlg() {}; -- cgit