Kaydet (Commit) 3d1046cf authored tarafından Rohit Deshmukh's avatar Rohit Deshmukh Kaydeden (comit) Miklos Vajna

Fix of run properties of text box in nested group shape

	- Textbox run character properties are change after roundtrip
	- Italic case was not handled in textcharacter properties

Reviewed on:
	https://gerrit.libreoffice.org/9096

Change-Id: Ia38fcadce489ef0bfffb9bda402d13058cf6129a
üst 8b451b41
...@@ -93,7 +93,10 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c ...@@ -93,7 +93,10 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c
return new ShapeGroupContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) ) ); return new ShapeGroupContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) ) );
case XML_sp: // shape case XML_sp: // shape
case XML_wsp: case XML_wsp:
return new ShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.CustomShape" ) ) ); // Don't set default character height for WPS shapes, Writer has its
// own way to set the default, and if we don't set it here, editing
// properly inherits it.
return new ShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.CustomShape", getBaseToken(aElementToken) == XML_sp ) ) );
case XML_pic: // CT_Picture case XML_pic: // CT_Picture
return new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ); return new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) );
case XML_graphicFrame: // CT_GraphicalObjectFrame case XML_graphicFrame: // CT_GraphicalObjectFrame
......
...@@ -165,6 +165,9 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl ...@@ -165,6 +165,9 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
case OOX_TOKEN( doc, b ): case OOX_TOKEN( doc, b ):
mrTextCharacterProperties.moBold = rAttribs.getBool(OOX_TOKEN( doc, val ), true); mrTextCharacterProperties.moBold = rAttribs.getBool(OOX_TOKEN( doc, val ), true);
break; break;
case OOX_TOKEN( doc, i ):
mrTextCharacterProperties.moItalic = rAttribs.getBool(OOX_TOKEN( doc, val ), true);
break;
case OOX_TOKEN( doc, bCs ): case OOX_TOKEN( doc, bCs ):
break; break;
case OOX_TOKEN( doc, color ): case OOX_TOKEN( doc, color ):
......
...@@ -3174,6 +3174,13 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeTIF, "fdo77476.docx") ...@@ -3174,6 +3174,13 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeTIF, "fdo77476.docx")
assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tif']", "PartName", "/word/media/image1.tif"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tif']", "PartName", "/word/media/image1.tif");
} }
DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx")
{
uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
// This checks textbox textrun size of font which is in group shape.
CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight"));
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment