[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - 3 commits - editeng/source sc/source sd/qa sd/source

Eike Rathke erack at redhat.com
Wed Jan 17 13:24:51 UTC 2018


 editeng/source/editeng/impedit2.cxx      |    7 +++--
 editeng/source/editeng/impedit3.cxx      |   38 +++++++++++++++++++------------
 sc/source/core/tool/interpr6.cxx         |    3 +-
 sd/qa/unit/data/pptx/tdf114848.pptx      |binary
 sd/qa/unit/export-tests-ooxml2.cxx       |   15 ++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |    3 ++
 6 files changed, 48 insertions(+), 18 deletions(-)

New commits:
commit d800a7a21d4d9c50ffe7fb546a42e3389fca748e
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Dec 19 16:28:04 2017 +0100

    Resolves: tdf#114539 only pop own parameters from stack
    
    ... and not another pending one..
    
    Change-Id: Ief5c27ccfb0b4121f2ba019e0fb8770dabbf60cf
    (cherry picked from commit 4b444b4c1efc2be219e6975e30048ff616fdac0f)
    Reviewed-on: https://gerrit.libreoffice.org/46801
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit a8a8559a24d043b4b1180acb3a0ff60052be5fad)
    (cherry picked from commit 4cbde23fb6ebde6743c2cca0eeeee916e71bcb4e)

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index c42f0f4545d3..cf0553b813b9 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -926,10 +926,11 @@ void ScInterpreter::ScRawSubtract()
     // Obtain the minuend.
     double fRes = GetDouble();
 
-    while (nGlobalError == FormulaError::NONE && nParamCount-- > 1)
+    while (nGlobalError == FormulaError::NONE && nParamCount > 1)
     {
         // Simple single values without matrix support.
         fRes -= GetDouble();
+        --nParamCount;
     }
     while (nParamCount-- > 0)
         PopError();
commit 2c9798106f9c6ee15ed120a0f4492c3193c54bba
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Thu Dec 21 18:02:13 2017 +0100

    tdf#114628 correct line spacing for impress
    
    * use line spacing also for the first line
    * correct spacing in case of > 100% proportional spacing
    
    * impedit2.cxx only code readability change
    
    Change-Id: I24832e7dc2fa8cfbb2f9cdfe7062eaaaa63f1729
    Reviewed-on: https://gerrit.libreoffice.org/46925
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/47571
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit fb1083dfee7dcbc1d29cff30d3b83a9b4af84988)

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index f4ab41550db3..03a965cbe29e 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3588,11 +3588,12 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion )
                 aRange.Max() += rL.GetHeight();
             }
 
-            if( ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) && rLSItem.GetPropLineSpace() &&
-                ( rLSItem.GetPropLineSpace() < 100 ) )
+            sal_uInt16 nPropLineSpace = rLSItem.GetPropLineSpace();
+            if ( ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop )
+                && nPropLineSpace && ( nPropLineSpace < 100 ) )
             {
                 const EditLine& rL = pPortion->GetLines()[nFirstInvalid];
-                long n = rL.GetTxtHeight() * ( 100L - rLSItem.GetPropLineSpace() );
+                long n = rL.GetTxtHeight() * ( 100L - nPropLineSpace );
                 n /= 100;
                 aRange.Min() -= n;
                 aRange.Max() += n;
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 0da41d7af407..3c6914a7b064 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1398,24 +1398,34 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
             }
             else if ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop )
             {
-                if ( nPara || pLine->GetStartPortion() ) // Not the very first line
+                // There are documents with PropLineSpace 0, why?
+                // (cmc: re above question :-) such documents can be seen by importing a .ppt
+                if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() < 100 ) )
                 {
-                    // There are documents with PropLineSpace 0, why?
-                    // (cmc: re above question :-) such documents can be seen by importing a .ppt
-                    if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) )
+                    // Adapted code from sw/source/core/text/itrform2.cxx
+                    sal_uInt16 nPropLineSpace = rLSItem.GetPropLineSpace();
+                    sal_uInt16 nAscent = pLine->GetMaxAscent();
+                    sal_uInt16 nNewAscent = pLine->GetTxtHeight() * nPropLineSpace / 100 * 4 / 5; // 80%
+                    if ( !nAscent || nAscent > nNewAscent )
                     {
-                        sal_uInt16 nTxtHeight = pLine->GetHeight();
-                        sal_Int32 nH = nTxtHeight;
-                        nH *= rLSItem.GetPropLineSpace();
-                        nH /= 100;
-                        // The Ascent has to be adjusted for the difference:
-                        long nDiff = pLine->GetHeight() - nH;
-                        if ( nDiff > pLine->GetMaxAscent() )
-                            nDiff = pLine->GetMaxAscent();
-                        pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() - nDiff) );
-                        pLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+                        sal_uInt16 nHeight = pLine->GetHeight() * nPropLineSpace / 100;
+                        pLine->SetHeight( nHeight, pLine->GetTxtHeight() );
+                        pLine->SetMaxAscent( nNewAscent );
                     }
                 }
+                else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) )
+                {
+                    sal_uInt16 nTxtHeight = pLine->GetHeight();
+                    sal_Int32 nH = nTxtHeight;
+                    nH *= rLSItem.GetPropLineSpace();
+                    nH /= 100;
+                    // The Ascent has to be adjusted for the difference:
+                    long nDiff = pLine->GetHeight() - nH;
+                    if ( nDiff > pLine->GetMaxAscent() )
+                        nDiff = pLine->GetMaxAscent();
+                    pLine->SetMaxAscent( (sal_uInt16)( pLine->GetMaxAscent() - nDiff ) * 4 / 5 ); // 80%
+                    pLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+                }
             }
         }
 
commit d098c5c84588028046e4898667eaebb2adab5d74
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Jan 5 18:12:08 2018 +0100

    tdf#114848 Don't save empty themes
    
    Change-Id: I7136f5c0bc884a2f9ea945b4e0bc093a5ef2d8df
    Reviewed-on: https://gerrit.libreoffice.org/47481
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/47579
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 74e55fb50291778e48423ac7e949df6d2a55df2e)

diff --git a/sd/qa/unit/data/pptx/tdf114848.pptx b/sd/qa/unit/data/pptx/tdf114848.pptx
new file mode 100644
index 000000000000..5b8b6c3fad7f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf114848.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index e20aea47770d..38bf2980746a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -123,6 +123,7 @@ public:
     void testGroupsPosition();
     void testGroupsRotatedPosition();
     void testAccentColor();
+    void testTdf114848();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -167,6 +168,7 @@ public:
     CPPUNIT_TEST(testGroupsPosition);
     CPPUNIT_TEST(testGroupsRotatedPosition);
     CPPUNIT_TEST(testAccentColor);
+    CPPUNIT_TEST(testTdf114848);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -1100,6 +1102,19 @@ void SdOOXMLExportTest2::testAccentColor()
     assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
 }
 
+void SdOOXMLExportTest2::testTdf114848()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocPtr pXmlDocTheme1 = parseExport(tempFile, "ppt/theme/theme1.xml");
+    assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+    xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+    assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index d7c449c642bc..f61d7017382e 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2515,6 +2515,9 @@ bool PowerPointExport::WriteColorSchemes(FSHelperPtr pFS, const OUString& rTheme
 
                 aGrabBag.getValue(rThemePath) >>= aCurrentTheme;
 
+                if (!aCurrentTheme.getLength())
+                    return false;
+
                 // Order is important
                 for (int nId = PredefinedClrSchemeId::dk2; nId != PredefinedClrSchemeId::Count; nId++)
                 {


More information about the Libreoffice-commits mailing list