[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf105143.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |8 writerfilter/source/filter/WriterFilter.cxx |1 + 3 files changed, 9 insertions(+) New commits: commit 3753e2010d0acd5f4ff25e2cb75a33cb580d310f Author: Miklos VajnaDate: Fri Jan 6 13:49:06 2017 +0100 tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option Because that's what Word does to show only part of the shape in the bugdoc. Conflicts: writerfilter/source/filter/WriterFilter.cxx Change-Id: Ic5cb84cace9237671d71eda0c64e9dadfe244cb9 Reviewed-on: https://gerrit.libreoffice.org/32782 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlimport/data/tdf105143.docx b/sw/qa/extras/ooxmlimport/data/tdf105143.docx new file mode 100644 index 000..aa4bf40 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf105143.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 097b749..7168d17 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1740,6 +1740,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf105127, "tdf105127.docx") CPPUNIT_ASSERT_EQUAL(static_cast(3257), aPolyPolygon.Coordinates[0][0].Y); } +DECLARE_OOXMLIMPORT_TEST(testTdf105143, "tdf105143.docx") +{ +OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top"); +// This was 6272, i.e. the shape was moved up (incorrect position) to be +// inside the page rectangle. +CPPUNIT_ASSERT_EQUAL(OUString("6674"), aTop); +} + DECLARE_OOXMLIMPORT_TEST(testfdo76583, "fdo76583.docx") { // The problem was that the floating table was imported as a non-floating one. diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 1ab28c2..0b95b45 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -300,6 +300,7 @@ void WriterFilter::setTargetDocument(const uno::Reference< lang::XComponent >& x xSettings->setPropertyValue("BackgroundParaOverDrawings", uno::makeAny(sal_True)); xSettings->setPropertyValue("TabOverMargin", uno::makeAny(sal_True)); xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::makeAny(sal_True)); +xSettings->setPropertyValue("DoNotCaptureDrawObjsOnPage", uno::makeAny(sal_True)); } void WriterFilter::setSourceDocument(const uno::Reference< lang::XComponent >& xDoc) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/qa writerfilter/source
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 ZolnaiDate: Wed Dec 21 01:33:49 2016 + 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 Tested-by: Tamás Zolnai (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 000..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(xRun, "CharFontCharSet")); } +DECLARE_OOXMLIMPORT_TEST(testTdf96218, "tdf96218.docx") +{ +// Image had a bad position because layoutInCell attribute was not ignored +CPPUNIT_ASSERT(!getProperty(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 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)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf103664.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 20 writerfilter/source/dmapper/DomainMapper.cxx |2 ++ 3 files changed, 22 insertions(+) New commits: commit 630f06d222c339e86ca3133123931b9262264e3a Author: Tamás ZolnaiDate: Sat Nov 5 12:30:20 2016 + tdf#103664: FILEOPEN: DOCX: Wingdings symbols are imported as rectangles Reviewed-on: https://gerrit.libreoffice.org/30575 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit 5ef66db91e87ef84724be22977acf4c9c472ad6b) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Ifd9ff26f2460e5570ec1b736308d48acdb3e56a8 diff --git a/sw/qa/extras/ooxmlimport/data/tdf103664.docx b/sw/qa/extras/ooxmlimport/data/tdf103664.docx new file mode 100644 index 000..4d299a6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf103664.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index c3c4728..b70f270 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -81,6 +81,7 @@ #include #include #include +#include #include @@ -3246,6 +3247,25 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99074, "tdf99074.docx") CPPUNIT_ASSERT(getProperty(xSettings, "InBrowseMode")); } +DECLARE_OOXMLIMPORT_TEST(testTdf103664, "tdf103664.docx") +{ +// Wingdings symbols was displayed as rectangles +uno::Reference xPara(getParagraph(1)); +CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf020), xPara->getString()[0] ); +CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fc), xPara->getString()[1] ); +CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0dc), xPara->getString()[2] ); +CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf081), xPara->getString()[3] ); + +uno::Reference xRun(getRun(xPara,1), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty(xRun, "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty(xRun, "CharFontNameAsian")); +CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty(xRun, "CharFontNameComplex")); + +// Make sure these special characters imported as symbols +CPPUNIT_ASSERT_EQUAL(awt::CharSet::SYMBOL, getProperty(xRun, "CharFontCharSet")); +} + + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ae201aa..ab8948fd 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -2635,6 +2636,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) rContext->Insert(PROP_CHAR_FONT_NAME, aVal); rContext->Insert(PROP_CHAR_FONT_NAME_ASIAN, aVal); rContext->Insert(PROP_CHAR_FONT_NAME_COMPLEX, aVal); +rContext->Insert(PROP_CHAR_FONT_CHAR_SET, uno::makeAny(awt::CharSet::SYMBOL)); utext( reinterpret_cast < const sal_uInt8 * >( &(aSymbolData.cSymbol) ), 1 ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits