summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-05-19 14:37:36 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2021-05-26 10:14:57 +0200
commit1cd26a9ab64482daf4de08f5bb7730d0a991bbce (patch)
tree0c89df535ab628423c84a1fd557d83f9f2b7d42b /sd
parent39276660f862b8d534db971d53490450f8ec5d9e (diff)
tdf#96061 Unset the highlight property
When we have highlight property on specific part of the text the following texts were highligthing. To prevent this we unset the highlight property when we have not highlight property anymore. Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf96061.pptxbin0 -> 21022 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx36
2 files changed, 36 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index 000000000000..c6e6aa5ae16f
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf96061.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 6c12ac08928c..973503cc3b80 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -212,6 +212,7 @@ public:
void testTdf128213ShapeRot();
void testTdf125560_textDeflate();
void testTdf125560_textInflateTop();
+ void testTdf96061_textHighlight();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -338,6 +339,7 @@ public:
CPPUNIT_TEST(testTdf128213ShapeRot);
CPPUNIT_TEST(testTdf125560_textDeflate);
CPPUNIT_TEST(testTdf125560_textInflateTop);
+ CPPUNIT_TEST(testTdf96061_textHighlight);
CPPUNIT_TEST_SUITE_END();
@@ -3191,6 +3193,40 @@ void SdOOXMLExportTest2::testTdf125560_textInflateTop()
assertXPath(pXmlDocRels, "/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape/draw:enhanced-geometry", "type", "mso-spt164");
}
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
+ uno::Reference<text::XTextRange> const xParagraph1(getParagraphFromShape(0, xShape));
+ uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
+ uno::Reference< beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY_THROW);
+ sal_Int32 aColor;
+ xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+ uno::Reference<text::XTextRange> const xParagraph2(getParagraphFromShape(1, xShape));
+ uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
+ uno::Reference< beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY_THROW);
+ xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+ uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(0, 0, xDocShRef));
+ uno::Reference<text::XTextRange> const xParagraph3(getParagraphFromShape(0, xShape2));
+ uno::Reference<text::XTextRange> xRun3(getRunFromParagraph(0, xParagraph3));
+ uno::Reference< beans::XPropertySet> xPropSet3(xRun3, uno::UNO_QUERY_THROW);
+ xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+ uno::Reference<text::XTextRange> const xParagraph4(getParagraphFromShape(1, xShape2));
+ uno::Reference<text::XTextRange> xRun4(getRunFromParagraph(0, xParagraph4));
+ uno::Reference< beans::XPropertySet> xPropSet4(xRun4, uno::UNO_QUERY_THROW);
+ xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();