sw/qa/extras/ooxmlexport/data/Shape.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx      |   10 ++++++++++
 writerfilter/source/dmapper/GraphicImport.cxx |   10 ++++------
 3 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit d71d16958fad1975c17245f064d7dc32c581e220
Author: PriyankaGaikwad <priyanka.gaik...@synerzip.com>
Date:   Tue Jan 21 18:49:24 2014 +0530

    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

diff --git a/sw/qa/extras/ooxmlexport/data/Shape.docx 
b/sw/qa/extras/ooxmlexport/data/Shape.docx
new file mode 100644
index 0000000..474e6ff
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/Shape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 90a6b9c..6b72c4e 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 6087610..3dc61ba 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));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to