summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-02 16:52:54 +0300
committerAndras Timar <andras.timar@collabora.com>2014-10-03 10:02:18 +0200
commit8f8f7e944a0fce6d240550453696de3a78791204 (patch)
treee0113683504179f3528dac1066c36f45dc2140e1
parent1eb1ac5c26278c312fba9ade1b1ddc2cbe433312 (diff)
bnc#657899: Paragraph vertical spacing differs from PowerPoint
We need to set the "paragraph summation" flag also for .pptx import. (As is already done for .ppt import.) This is what in the Options (Preferences) UI is called "Add spacing between paragraphs and tables (in current document)", on the LibreOffice Impress:General page. This is a setting that when set becomes local to the document. I actually don't really understand why this needs to be a user-visible option, wouldn't it be enough for it to be an internal flag that is set for documents imported from .ppt and .pptx, and is clear otherwise? (cherry picked from commit 96d210bf9ca0a99fc8256d6e0a4952207cce69e0) Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: sd/source/ui/docshell/docshel4.cxx Change-Id: I525178957276e7d587b6ac4be8ae7919fc245a27
-rw-r--r--sd/source/ui/docshell/docshel4.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 91370cba4407..66df3ed29ab5 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -24,6 +24,8 @@
#include <sfx2/progress.hxx>
#include <vcl/waitobj.hxx>
#include <svx/svxids.hrc>
+#include <editeng/editeng.hxx>
+#include <editeng/editstat.hxx>
#include <editeng/flstitem.hxx>
#include <editeng/eeitem.hxx>
#include <svl/aeitem.hxx>
@@ -380,6 +382,26 @@ sal_Bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
bool DrawDocShell::ImportFrom(SfxMedium &rMedium,
uno::Reference<text::XTextRange> const& xInsertPosition)
{
+ const OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
+ if( aFilterName == "Impress MS PowerPoint 2007 XML" ||
+ aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay" )
+ {
+ // As this is a MSFT format, we should use the "MS Compat"
+ // mode for spacing before and after paragraphs.
+
+ // This is copied from what is done for .ppt import in
+ // ImplSdPPTImport::Import() in sd/source/filter/ppt/pptin.cxx
+ // in. We need to tell both the edit engine of the draw outliner,
+ // and the document, to do "summation of paragraphs".
+ SdrOutliner& rOutl = mpDoc->GetDrawOutliner();
+ sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord();
+ nControlWord |= EE_CNTRL_ULSPACESUMMATION;
+ nControlWord &=~ EE_CNTRL_ULSPACEFIRSTPARA;
+ ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord );
+
+ mpDoc->SetSummationOfParagraphs( true );
+ }
+
const sal_Bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
SfxItemSet* pSet = rMedium.GetItemSet();