[Libreoffice-commits] core.git: oox/source sd/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 12 10:25:35 UTC 2019
oox/source/drawingml/textcharacterproperties.cxx | 3 +++
oox/source/token/properties.txt | 1 +
sd/qa/unit/data/pptx/tdf127129.pptx |binary
sd/qa/unit/import-tests.cxx | 22 ++++++++++++++++++++++
4 files changed, 26 insertions(+)
New commits:
commit 57cfbc6830c3d8dc64107aed4a5555613415f069
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Oct 10 21:29:50 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sat Oct 12 12:24:25 2019 +0200
tdf#127129: pptx: map highlight to CharBackColor
Change-Id: I033c15db6848e96ba6b6bd7a2852c9e4d1524a8e
Reviewed-on: https://gerrit.libreoffice.org/80630
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 703e23db9c3f..e2f5cc63c0a2 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -167,6 +167,9 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty( PROP_CharUnderlineColor, maUnderlineColor.getColor( rFilter.getGraphicHelper() ));
}
// TODO If bUnderlineFillFollowText uFillTx (CT_TextUnderlineFillFollowText) is set, fill color of the underline should be the same color as the text
+
+ if( maHighlightColor.isUsed() )
+ rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() ));
}
static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues )
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 15db0c2b193e..a9e031a1ce7c 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -50,6 +50,7 @@ CellStyle
CenterHorizontally
CenterVertically
Change
+CharBackColor
CharCaseMap
CharColor
CharContoured
diff --git a/sd/qa/unit/data/pptx/tdf127129.pptx b/sd/qa/unit/data/pptx/tdf127129.pptx
new file mode 100644
index 000000000000..680fcf631be4
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf127129.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 1fd0d5ef5e8c..f46da0b2aa89 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -154,6 +154,7 @@ public:
void testBnc910045();
void testRowHeight();
void testTdf93830();
+ void testTdf127129();
void testTdf93097();
void testTdf62255();
void testTdf93124();
@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST(testBnc910045);
CPPUNIT_TEST(testRowHeight);
CPPUNIT_TEST(testTdf93830);
+ CPPUNIT_TEST(testTdf127129);
CPPUNIT_TEST(testTdf93097);
CPPUNIT_TEST(testTdf62255);
CPPUNIT_TEST(testTdf93124);
@@ -1346,6 +1348,7 @@ void SdImportTest::testRowHeight()
xDocShRef->DoClose();
}
+
void SdImportTest::testTdf93830()
{
// Text shape offset was ignored
@@ -1364,6 +1367,25 @@ void SdImportTest::testTdf93830()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf127129()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf127129.pptx"), PPTX);
+ uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ uno::Reference< text::XTextRange > xParagraph( getParagraphFromShape( 0, xShape ) );
+ uno::Reference< text::XTextRange > xRun( getRunFromParagraph( 0, xParagraph ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
+
+ sal_Int32 nCharColor;
+ xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0x000000), nCharColor );
+
+ // Without the accompanying fix in place, the highlight would be -1
+ sal_Int32 nCharBackColor;
+ xPropSet->getPropertyValue( "CharBackColor" ) >>= nCharBackColor;
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00), nCharBackColor );
+
+ xDocShRef->DoClose();
+}
void SdImportTest::testTdf93097()
{
// Throwing metadata import aborted the filter, check that metadata is now imported.
More information about the Libreoffice-commits
mailing list