summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-05-19 14:37:36 +0300
committerAndras Timar <andras.timar@collabora.com>2021-05-29 23:32:40 +0200
commite61bdbf41cf925147eee7f92142089f8adf0a237 (patch)
treefa9db18f2d87af8766c03397fd1e95db568dcb4c
parent672044c7e5eb4d1b506593de0b843d31c9ec0780 (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116176 Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116333 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx2
-rw-r--r--sd/qa/unit/data/pptx/tdf96061.pptxbin0 -> 21022 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx35
3 files changed, 37 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index de47058e60ca..6b55c5326455 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -178,6 +178,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( maHighlightColor.isUsed() )
rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() ));
+ else
+ rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
}
static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues )
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 399bd4657861..27d42132557f 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -188,6 +188,7 @@ public:
void testTdf131554();
void testTdf132282();
void testTdf128213ShapeRot();
+ void testTdf96061_textHighlight();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -294,6 +295,7 @@ public:
CPPUNIT_TEST(testTdf131554);
CPPUNIT_TEST(testTdf132282);
CPPUNIT_TEST(testTdf128213ShapeRot);
+ CPPUNIT_TEST(testTdf96061_textHighlight);
CPPUNIT_TEST_SUITE_END();
@@ -2752,6 +2754,39 @@ void SdOOXMLExportTest2::testTdf128213ShapeRot()
assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", "rev", "5400000");
}
+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);