summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf82824.docxbin0 -> 24581 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx5
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx16
3 files changed, 20 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf82824.docx b/sw/qa/extras/ooxmlimport/data/tdf82824.docx
new file mode 100644
index 000000000000..65e5d4bc6aa2
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf82824.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 975cae23eee0..1e9a5e62b34d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1266,6 +1266,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf103664, "tdf103664.docx")
CPPUNIT_ASSERT_EQUAL(awt::CharSet::SYMBOL, getProperty<sal_Int16>(xRun, "CharFontCharSet"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf82824, "tdf82824.docx")
+{
+ // This was text::TextContentAnchorType_AS_CHARACTER, <wp:anchor> wasn't handled on import for the chart.
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
+}
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 0c3a1442c64b..983b27c8cb55 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4787,7 +4787,21 @@ void DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties
// Update the shape properties if it is embedded object.
if(m_xEmbedded.is()){
- UpdateEmbeddedShapeProps(m_pGraphicImport->GetXShapeObject());
+ uno::Reference<drawing::XShape> xShape = m_pGraphicImport->GetXShapeObject();
+ UpdateEmbeddedShapeProps(xShape);
+ if (eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
+ {
+ uno::Reference<beans::XPropertySet> xEmbeddedProps(m_xEmbedded, uno::UNO_QUERY);
+ text::TextContentAnchorType eAnchorType = text::TextContentAnchorType_AT_CHARACTER;
+ xEmbeddedProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType));
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ xEmbeddedProps->setPropertyValue("HoriOrient", xShapeProps->getPropertyValue("HoriOrient"));
+ xEmbeddedProps->setPropertyValue("HoriOrientPosition", xShapeProps->getPropertyValue("HoriOrientPosition"));
+ xEmbeddedProps->setPropertyValue("HoriOrientRelation", xShapeProps->getPropertyValue("HoriOrientRelation"));
+ xEmbeddedProps->setPropertyValue("VertOrient", xShapeProps->getPropertyValue("VertOrient"));
+ xEmbeddedProps->setPropertyValue("VertOrientPosition", xShapeProps->getPropertyValue("VertOrientPosition"));
+ xEmbeddedProps->setPropertyValue("VertOrientRelation", xShapeProps->getPropertyValue("VertOrientRelation"));
+ }
}
//insert it into the document at the current cursor position
OSL_ENSURE( xTextContent.is(), "DomainMapper_Impl::ImportGraphic");