From 894a01640a838c9affed7cccccc7378a452139b5 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 13 Nov 2021 09:40:09 +0200 Subject: tdf#137438 drawingml: separate outline from text import By ignoring the a:ln group, the contents in that group (like transparency) were being applied to the text. Well, it should only apply to a line around the text, which LO isn't doing. [Well, LO can do this as Fontwork, but perhaps that doesn't match so well with text in shapes generally?] At any rate, don't allow one group's settings to override the others. Keep them separate and then apply a bit of merging logic to try to achieve the best look. So emulate a little bit. If the outline is not very transparent (less transparent than the main text) then it may (if thick or opaque enough) dominate the text. For simplicity (and because there is no right answer overall) I just compared transparency and used the more opaque colour. Unit tests potentially affected: -export-tests-ooxml1.cxx: tdf100348_FontworkBitmapFill.odp -> PPTX -now imports black instead of yellow (MSO sees gradient colors) -so previously completely wrong, and now perhaps even more wrong? -export-tests-ooxml3.cxx: tdf114848.pptx -shows blue text regardless - defined by area. -can't see where this is set in MSO2016. Perhaps illegal? - : tdf125573_FontWorkScaleX.pptx -no visual difference. Same as tdf100348, but with black outline. - : tdf119087.pptx -should be green, not purple. [Added test for that.] - : tdf143315-WordartWithoutBullet.ppt -no visual difference (COL_AUTO outline?) -import-tests2.cxx: tdf129686.pptx -poor test usage (but also weird transparent default). -no visual change. -ooxmlimport2.cx: tdf143476_lockedCanvas_position.docx -no visual difference. Irrelevant since we can't RT Change-Id: Iff0d95506dd64825444a99e62a6c2bd5e1dc122f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125300 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- sd/qa/unit/export-tests-ooxml3.cxx | 13 +++++++++++++ sd/qa/unit/import-tests2.cxx | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'sd/qa/unit') diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 4fc288f116c0..a9a740eb4588 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -1551,6 +1551,19 @@ void SdOOXMLExportTest3::testTdf119087() = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf119087.pptx"), PPTX); xDocShRef = saveAndReload(xDocShRef.get(), PPTX); // This would fail both on export validation, and reloading the saved pptx file. + + // Get first paragraph of the text + uno::Reference xShape(getShapeFromPage(0, 0, xDocShRef)); + uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); + // Get first run of the paragraph + uno::Reference xRun(getRunFromParagraph(0, xParagraph)); + uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW); + + Color nColor = COL_AUTO; + xPropSet->getPropertyValue("CharColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(Color(0x00B050), nColor); + + xDocShRef->DoClose(); } void SdOOXMLExportTest3::testTdf131554() diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index c8f8c764aa71..9a5021f533b6 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -562,8 +562,8 @@ void SdImportTest2::testTdf129686() sal_Int16 nTransparency = 0; xPropSet->getPropertyValue("CharTransparence") >>= nTransparency; - // 100 = no transparency - CPPUNIT_ASSERT_EQUAL(static_cast(100), nTransparency); + // 0 = no transparency, 100 (default) = completely transparent (unless COL_AUTO) + CPPUNIT_ASSERT_EQUAL(static_cast(0), nTransparency); xDocShRef->DoClose(); } -- cgit