[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sd/source

Tor Lillqvist tml at collabora.com
Fri Oct 3 00:52:30 PDT 2014


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

New commits:
commit 18b9cb260a5ec358f6a7b73362bbc306af0417b1
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?
    
    Change-Id: I525178957276e7d587b6ac4be8ae7919fc245a27
    (cherry picked from commit 96d210bf9ca0a99fc8256d6e0a4952207cce69e0)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 654d6a8..952d307 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>
@@ -378,6 +380,26 @@ 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 bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
 
     SfxItemSet* pSet = rMedium.GetItemSet();


More information about the Libreoffice-commits mailing list