[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sd/source

Tor Lillqvist tml at collabora.com
Fri Oct 3 00:57:14 PDT 2014


 sd/source/ui/docshell/docshel4.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 8f8f7e944a0fce6d240550453696de3a78791204
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 2 16:52:54 2014 +0300

    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 at collabora.com>
    
    Conflicts:
    	sd/source/ui/docshell/docshel4.cxx
    
    Change-Id: I525178957276e7d587b6ac4be8ae7919fc245a27

diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 91370cb..66df3ed 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();


More information about the Libreoffice-commits mailing list