[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Nov 18 09:09:25 PST 2013
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 6 +++++-
writerfilter/source/dmapper/GraphicImport.cxx | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit e7a0a1fd6c501b72838a858faaa7b515d1b89845
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Nov 18 17:46:05 2013 +0100
DOCX drawingML shape import: handle position
Change-Id: I9a0cb95d875328dab21950ead06d56c4dac8305d
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index dad6d7d..b399ef5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1508,8 +1508,12 @@ DECLARE_OOXMLIMPORT_TEST(testFdo69548, "fdo69548.docx")
DECLARE_OOXMLIMPORT_TEST(testWpsOnly, "wps-only.docx")
{
// Document has wp:anchor, not wp:inline, so handle it accordingly.
- text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType");
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(xShape, "AnchorType");
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eValue);
+
+ // Check position, it was 0. This is a shape, so use getPosition(), not a property.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(671830)), xShape->getPosition().X);
}
DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 7e1a42e..64b0561 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -999,7 +999,7 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
uno::Reference< beans::XPropertySet > xShapeProps(m_xShape, uno::UNO_QUERY_THROW);
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_CHARACTER));
- // TODO handle more properties here like HoriOrientPosition, etc.
+ m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition));
}
}
}
More information about the Libreoffice-commits
mailing list