[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/qa writerfilter/source

Tamás Zolnai tamas.zolnai at collabora.com
Wed Dec 21 02:06:15 UTC 2016


 sw/qa/extras/ooxmlimport/data/tdf96218.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |    5 +++++
 writerfilter/source/dmapper/DomainMapper.cxx  |    5 +++++
 writerfilter/source/dmapper/DomainMapper.hxx  |    1 +
 writerfilter/source/dmapper/GraphicImport.cxx |    2 +-
 5 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 32b1b00c4e94445610585e9c5b2ca74ec36c3173
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Wed Dec 21 01:33:49 2016 +0000

    tdf#96218: MSO DOCX image incorrectly placed when using Alignment Position
    
    layoutInCell attribute should be ignored when we are not
    in a table.
    
    Reviewed-on: https://gerrit.libreoffice.org/32253
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 36750bc977b3210b23b7822abd395b30a78af6f5)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: Ieed29c690f8516f63d0956a4f0495500908a0d27

diff --git a/sw/qa/extras/ooxmlimport/data/tdf96218.docx b/sw/qa/extras/ooxmlimport/data/tdf96218.docx
new file mode 100644
index 0000000..a6a269f
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf96218.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b70f270..1a457c3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -3265,6 +3265,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf103664, "tdf103664.docx")
     CPPUNIT_ASSERT_EQUAL(awt::CharSet::SYMBOL, getProperty<sal_Int16>(xRun, "CharFontCharSet"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf96218, "tdf96218.docx")
+{
+    // Image had a bad position because layoutInCell attribute was not ignored
+    CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), "IsFollowingTextFlow"));
+}
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index ab8948fd..7f2d246 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3624,6 +3624,11 @@ bool DomainMapper::IsInHeaderFooter() const
     return m_pImpl->IsInHeaderFooter();
 }
 
+bool DomainMapper::IsInTable() const
+{
+    return m_pImpl->hasTableManager() && m_pImpl->getTableManager().isInCell();
+}
+
 bool DomainMapper::IsStyleSheetImport() const
 {
     return m_pImpl->IsStyleSheetImport();
diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx
index 305ec87..99cbbdf 100644
--- a/writerfilter/source/dmapper/DomainMapper.hxx
+++ b/writerfilter/source/dmapper/DomainMapper.hxx
@@ -114,6 +114,7 @@ public:
     css::uno::Reference<css::drawing::XShape> PopPendingShape();
 
     bool IsInHeaderFooter() const;
+    bool IsInTable() const;
     bool IsStyleSheetImport() const;
     /**
      @see DomainMapper_Impl::processDeferredCharacterProperties()
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 947bd72..944ce4f 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1276,7 +1276,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
                 }
                 xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_SURROUND ),
                     uno::makeAny(m_pImpl->nWrap));
-                if( m_pImpl->bLayoutInCell && m_pImpl->nWrap != text::WrapTextMode_THROUGHT )
+                if( m_pImpl->rDomainMapper.IsInTable() && m_pImpl->bLayoutInCell && m_pImpl->nWrap != text::WrapTextMode_THROUGHT )
                     xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_FOLLOW_TEXT_FLOW ),
                         uno::makeAny(true));
 


More information about the Libreoffice-commits mailing list