diff options
-rw-r--r-- | oox/source/drawingml/textcharacterpropertiescontext.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 405957c5c2cb..12362b9b036a 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -137,6 +137,10 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl case OOX_TOKEN( doc, bCs ): break; case OOX_TOKEN( doc, color ): + if (rAttribs.getInteger(OOX_TOKEN(doc, val)).has()) + { + mrTextCharacterProperties.maCharColor.setSrgbClr(rAttribs.getIntegerHex(OOX_TOKEN(doc, val)).get()); + } break; case OOX_TOKEN( doc, sz ): if (rAttribs.getInteger(OOX_TOKEN(doc, val)).has()) diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 9c6510d94ece..722317999e53 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1607,6 +1607,13 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(getShape(2), uno::UNO_QUERY); // This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox. CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); + + // Now check the top right textbox. + uno::Reference<container::XIndexAccess> xGroup(getShape(2), uno::UNO_QUERY); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "[Year]"); + CPPUNIT_ASSERT_EQUAL(48.f, getProperty<float>(getRun(xParagraph, 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); } DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") |