summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyankaGaikwad <priyanka.gaikwad@synerzip.com>2014-01-21 18:49:24 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-28 09:47:52 +0100
commitd71d16958fad1975c17245f064d7dc32c581e220 (patch)
tree50142c12c0a25323740e300a2808337e1ae78e57
parent3fdbaaeebf4b03b57c5445f64888722a552de5dc (diff)
fdo#73545 Shape position is wrong
Issue: The <wp:align> is missing after roundtrip XML Difference: Original: <wp:positionH relativeFrom="page"> <wp:align> center </wp:align> </wp:positionH> Roundtrip: <wp:positionH relativeFrom="page"> <wp:posOffset> 0 </wp:posOffset> </wp:positionH> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7571 Change-Id: I3c8ef2f0ee3dd84a23fab197ab95f152b850067e
-rw-r--r--sw/qa/extras/ooxmlexport/data/Shape.docxbin0 -> 15602 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx10
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx10
3 files changed, 14 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/Shape.docx b/sw/qa/extras/ooxmlexport/data/Shape.docx
new file mode 100644
index 000000000000..474e6ffc2b11
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/Shape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 90a6b9cbcfd4..6b72c4efec58 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2624,6 +2624,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73556,"fdo73556.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(3751), tableWidth);
}
+DECLARE_OOXMLEXPORT_TEST(testAlignForShape,"Shape.docx")
+{
+ //fdo73545:Shape Horizontal and vertical orientation is wrong
+ //The wp:align tag is missing after roundtrip
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:align","1");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 6087610d167c..3dc61baef0c5 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -696,13 +696,11 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
// This needs to be AT_PARAGRAPH and not AT_CHARACTER, otherwise shape will move when the user inserts a new paragraph.
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_PARAGRAPH));
+ //only the position orientation is handled in applyPosition()
+ m_pImpl->applyPosition(xShapeProps);
+
uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW);
- if (xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
- {
- // For non-textframes, this is handled already in oox::drawingml::Shape::createAndInsert().
- m_pImpl->applyPosition(xShapeProps);
- }
- else if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
+ if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{
// Position of the groupshape should be set after children have been added.
m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition));