oox/source/drawingml/textbodycontext.cxx | 12 +++++++ oox/source/drawingml/textcharacterpropertiescontext.cxx | 25 ++++++++++++++++ sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 ++++ 3 files changed, 44 insertions(+)
New commits: commit f7a8a5e48ae07551e0f513da57f95d81bdbab43a Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Dec 9 11:30:40 2013 +0100 drawingml import: read w:color Change-Id: I6ae7ea8b58e262e5b6226f8f789e39ebcc6077ca diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 405957c..12362b9 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 9c6510d..7223179 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") commit f6c592b5e1722bd5b77de11c08d649b352f6e620 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Dec 9 11:20:36 2013 +0100 drawingml import: read w:sz Change-Id: I40293a0b612b50d5da3d736f567310525608b308 diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index d077b4d..405957c 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -130,6 +130,27 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl case A_TOKEN( hlinkClick ): // CT_Hyperlink case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink return new HyperLinkContext( *this, rAttribs, mrTextCharacterProperties.maHyperlinkPropertyMap ); + case OOX_TOKEN( doc, rFonts ): + break; + case OOX_TOKEN( doc, b ): + break; + case OOX_TOKEN( doc, bCs ): + break; + case OOX_TOKEN( doc, color ): + break; + case OOX_TOKEN( doc, sz ): + if (rAttribs.getInteger(OOX_TOKEN(doc, val)).has()) + { + sal_Int32 nVal = rAttribs.getInteger(OOX_TOKEN(doc, val)).get(); + // wml has half points, dml has hundred points + mrTextCharacterProperties.moHeight = nVal * 50; + } + break; + case OOX_TOKEN( doc, szCs ): + break; + default: + SAL_WARN("oox", "TextCharacterPropertiesContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; } return this; commit 9b531abb6179a9f7f9cf4c745dba5060397425c6 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Dec 9 10:22:44 2013 +0100 drawingml import: read w:rPr Change-Id: I4405f9bc073b6e0b8c0426561ae9d01d91efdd59 diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 6d33fe3..d274d5a 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -135,11 +135,15 @@ ContextHandlerRef RegularTextRunContext::onCreateContext( sal_Int32 aElementToke switch( aElementToken ) { case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run. + case OOX_TOKEN( doc, rPr ): return new TextCharacterPropertiesContext( *this, rAttribs, mpRunPtr->getTextCharacterProperties() ); case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string. case OOX_TOKEN( doc, t ): mbIsInText = true; break; + default: + SAL_WARN("oox", "RegularTextRunContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; } return this; commit 9dad3de754f4ceb5c8f2cea734d353d3862b5556 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Dec 9 10:09:41 2013 +0100 drawingml import: read w:sdtContent Change-Id: I691b0ee28304659fedbe9cf8eff6ba1d757d0803 diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index a276ca1..6d33fe3 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -166,6 +166,14 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con case A_TOKEN( p ): // CT_TextParagraph case OOX_TOKEN( doc, p ): return new TextParagraphContext( *this, mrTextBody.addParagraph() ); + case OOX_TOKEN( doc, sdt ): + case OOX_TOKEN( doc, sdtContent ): + return this; + case OOX_TOKEN( doc, sdtPr ): + case OOX_TOKEN( doc, sdtEndPr ): + break; + default: + SAL_WARN("oox", "TextBodyContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); } return 0; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits