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 4cbde23fb6ebde6743c2cca0eeeee916e71bcb4e Author: Eike Rathke <[email protected]> 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 <[email protected]> Reviewed-by: Markus Mohrhard <[email protected]> (cherry picked from commit a8a8559a24d043b4b1180acb3a0ff60052be5fad) 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 fb1083dfee7dcbc1d29cff30d3b83a9b4af84988 Author: Szymon Kłos <[email protected]> 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 <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Tested-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/47571 Reviewed-by: Andras Timar <[email protected]> diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 0cfb9ea38d07..c4448c40c55d 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3591,11 +3591,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 8f1d96933783..4bf113d34374 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 74e55fb50291778e48423ac7e949df6d2a55df2e Author: Szymon Kłos <[email protected]> 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 <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/47579 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> 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++) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
