Kaydet (Commit) 4fc2bec5 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX OLE import: inherit more properties

Change-Id: Ifa7eb3eee774266f440b313437f0decce27eedc5
üst 973b47a3
...@@ -1787,6 +1787,8 @@ DECLARE_OOXMLIMPORT_TEST(testOleAnchor, "ole-anchor.docx") ...@@ -1787,6 +1787,8 @@ DECLARE_OOXMLIMPORT_TEST(testOleAnchor, "ole-anchor.docx")
{ {
// This was AS_CHARACTER, even if the VML style explicitly contains "position:absolute". // This was AS_CHARACTER, even if the VML style explicitly contains "position:absolute".
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
// This was DYNAMIC, even if the default is THROUGHT and there is no w10:wrap element in the bugdoc.
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
} }
DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capitalization.docx") DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capitalization.docx")
......
...@@ -1233,7 +1233,18 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO ...@@ -1233,7 +1233,18 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, OLEHandlerPtr pO
uno::makeAny(xGraphic)); uno::makeAny(xGraphic));
uno::Reference<beans::XPropertySet> xReplacementProperties(pOLEHandler->getShape(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xReplacementProperties(pOLEHandler->getShape(), uno::UNO_QUERY);
if (xReplacementProperties.is()) if (xReplacementProperties.is())
xOLEProperties->setPropertyValue("AnchorType", xReplacementProperties->getPropertyValue("AnchorType")); {
OUString pProperties[] = {
OUString("AnchorType"),
OUString("Surround"),
OUString("HoriOrient"),
OUString("HoriOrientPosition"),
OUString("VertOrient"),
OUString("VertOrientPosition")
};
for (size_t i = 0; i < SAL_N_ELEMENTS(pProperties); ++i)
xOLEProperties->setPropertyValue(pProperties[i], xReplacementProperties->getPropertyValue(pProperties[i]));
}
else else
// mimic the treatment of graphics here.. it seems anchoring as character // mimic the treatment of graphics here.. it seems anchoring as character
// gives a better ( visually ) result // gives a better ( visually ) result
......
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