dev/null                                         |binary
 oox/source/drawingml/textcharacterproperties.cxx |    7 ---
 sd/qa/unit/data/pptx/tdf129686.pptx              |binary
 sd/qa/unit/import-tests.cxx                      |   44 +++++++++++------------
 4 files changed, 23 insertions(+), 28 deletions(-)

New commits:
commit 8bf3e3fbdb708a75237a120d4f6fc46fe67dbbb9
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri May 22 19:53:27 2020 +0200
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Fri May 22 21:03:42 2020 +0200

    tdf#129686: Revert "tdf#118776: pptx import: draw char noFill as 
transparent"
    
    Revert it for now towards LibreOffice 7.0 and add unittest
    
    This reverts commit e01df3488abe6d319c6874ca870afb82a3ad9b1e.
    
    Change-Id: Ic6aba5948f9c6e55199def0476918fbd496321bf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94704
    Tested-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 19c55794b3d8..20965e33abb1 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -112,12 +112,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
         Color aColor = maFillProperties.getBestSolidColor();
         rPropMap.setProperty(PROP_CharColor, 
aColor.getColor(rFilter.getGraphicHelper()));
 
-        if( maFillProperties.moFillType.get() == XML_noFill )
-        {
-            // noFill doesn't exist for characters. Map noFill to 99% 
transparency
-            rPropMap.setProperty(PROP_CharTransparence, sal_Int16((MAX_PERCENT 
- 1) / PER_PERCENT) );
-        }
-        else if (aColor.hasTransparency())
+        if (aColor.hasTransparency())
         {
             rPropMap.setProperty(PROP_CharTransparence, 
aColor.getTransparency());
         }
diff --git a/sd/qa/unit/data/pptx/tdf118776.pptx 
b/sd/qa/unit/data/pptx/tdf118776.pptx
deleted file mode 100644
index 8df94522ab29..000000000000
Binary files a/sd/qa/unit/data/pptx/tdf118776.pptx and /dev/null differ
diff --git a/sd/qa/unit/data/pptx/tdf129686.pptx 
b/sd/qa/unit/data/pptx/tdf129686.pptx
new file mode 100644
index 000000000000..9aeb396f6f19
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf129686.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 6d8ff3e3904d..32e0d68f8dbe 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -179,9 +179,9 @@ public:
     void testAoo124143();
     void testTdf103567();
     void testTdf103792();
-    void testTdf118776();
     void testTdf103876();
     void testTdf79007();
+    void testTdf129686();
     void testTdf104015();
     void testTdf104201();
     void testTdf103477();
@@ -286,9 +286,9 @@ public:
     CPPUNIT_TEST(testAoo124143);
     CPPUNIT_TEST(testTdf103567);
     CPPUNIT_TEST(testTdf103792);
-    CPPUNIT_TEST(testTdf118776);
     CPPUNIT_TEST(testTdf103876);
     CPPUNIT_TEST(testTdf79007);
+    CPPUNIT_TEST(testTdf129686);
     CPPUNIT_TEST(testTdf104015);
     CPPUNIT_TEST(testTdf104201);
     CPPUNIT_TEST(testTdf103477);
@@ -1840,26 +1840,6 @@ void SdImportTest::testTdf103792()
     xDocShRef->DoClose();
 }
 
-void SdImportTest::testTdf118776()
-{
-    sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf118776.pptx"), 
PPTX);
-    uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, 
xDocShRef ) );
-
-    // Get first paragraph of the text
-    uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 
0, xShape ) );
-
-    // Get first run of the paragraph
-    uno::Reference<text::XTextRange> xRun( getRunFromParagraph (0, xParagraph 
) );
-    uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW 
);
-    sal_Int16 nTransparency = 0;
-    xPropSet->getPropertyValue("CharTransparence") >>= nTransparency;
-
-    // Import noFill color as 99% transparency
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(99), nTransparency);
-
-    xDocShRef->DoClose();
-}
-
 void SdImportTest::testTdf103876()
 {
     // Title text shape's placeholder text did not inherit the corresponding 
text properties
@@ -1934,6 +1914,26 @@ void SdImportTest::testTdf79007()
     xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf129686()
+{
+    sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf129686.pptx"), 
PPTX);
+    uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, 
xDocShRef ) );
+
+    // Get first paragraph of the text
+    uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 
0, xShape ) );
+
+    // Get first run of the paragraph
+    uno::Reference<text::XTextRange> xRun( getRunFromParagraph (0, xParagraph 
) );
+    uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW 
);
+    sal_Int16 nTransparency = 0;
+    xPropSet->getPropertyValue("CharTransparence") >>= nTransparency;
+
+    // 100 = no transparency
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(100), nTransparency);
+
+    xDocShRef->DoClose();
+}
+
 void SdImportTest::testTdf104015()
 {
     // Shape fill, line and effect properties were not inherited from master 
slide shape
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to