[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf121456.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx| 10 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++ 3 files changed, 13 insertions(+) New commits: commit bc5d04dfe4e53880bab21eff5a2071b368d918c1 Author: Serge Krot AuthorDate: Wed Mar 27 14:02:51 2019 +0100 Commit: Thorsten Behrens CommitDate: Fri Mar 29 11:24:49 2019 +0100 tdf#121456 sw: DOCX: fix loading of empty TOC title Change-Id: Ib241edd07e4c6781d80db274f73146bda310d8c0 Reviewed-on: https://gerrit.libreoffice.org/69827 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit e47a5543f4b8c9e317d1e43af8c0e5a732e461fd) Reviewed-on: https://gerrit.libreoffice.org/69903 diff --git a/sw/qa/extras/ooxmlexport/data/tdf121456.docx b/sw/qa/extras/ooxmlexport/data/tdf121456.docx new file mode 100644 index ..a65870a9b719 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121456.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index bcc136d31ef2..961d14eab848 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -93,6 +93,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitle, "tdf121456_tabsOffset.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1); } +// Related issue tdf#121561: w:sdt/w:sdtContent around TOC +DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") +{ +uno::Reference textDocument(mxComponent, uno::UNO_QUERY); +uno::Reference text(textDocument->getText(), uno::UNO_QUERY); +// -1 if the 'Y' character does not occur +CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('Y')); +CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('y')); +} + DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitleDocx, "tdf121456_tabsOffset.odt") { xmlDocPtr pXmlDoc = parseExport(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 1ee7cc8600de..ecb73bb038f4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3663,6 +3663,9 @@ void DomainMapper_Impl::handleToc { if (aTocTitle.isEmpty() || bTableOfFigures) { +// reset marker of the TOC title +m_xStdEntryStart = uno::Reference< text::XTextRange >(); + xTOC.set( m_xTextFactory->createInstance ( bTableOfFigures ? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/core/data/rtf/pass/tdf116851.rtf | 217 writerfilter/source/rtftok/rtfdispatchvalue.cxx |5 2 files changed, 222 insertions(+) New commits: commit 4bf0e6d1b8a6d0f0dc0f7251cdfc047dc8433c89 Author: Julien Nabet AuthorDate: Sun Apr 8 22:48:57 2018 +0200 Commit: Miklos Vajna CommitDate: Tue Feb 12 17:59:31 2019 +0100 tdf#116851: some rtf files provide param with "-" for "edmins" Change-Id: I2a2a189ee727a51aeef5601b39bb288d813fc8f3 Reviewed-on: https://gerrit.libreoffice.org/52610 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit c04c6c487e20730391cfc29dfe66b4558b7b4efb) Reviewed-on: https://gerrit.libreoffice.org/67708 Reviewed-by: Julien Nabet Reviewed-by: Xisco Faulí (cherry picked from commit 08c98b7aba639e0d246f3662d7950885f8a81432) Reviewed-on: https://gerrit.libreoffice.org/67723 diff --git a/sw/qa/core/data/rtf/pass/tdf116851.rtf b/sw/qa/core/data/rtf/pass/tdf116851.rtf new file mode 100644 index ..a4df5b87c9e6 --- /dev/null +++ b/sw/qa/core/data/rtf/pass/tdf116851.rtf @@ -0,0 +1,217 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff1\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} +{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;} +{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);} +{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} +{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);} +{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf14.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 11 +++ writerfilter/source/dmapper/DomainMapper_Impl.cxx |9 + 3 files changed, 20 insertions(+) New commits: commit 7798ce2e8c938b9d05a3f39e50a2737e64957197 Author: László Németh AuthorDate: Mon Jan 7 21:28:29 2019 +0100 Commit: Christian Lohmaier CommitDate: Wed Jan 16 21:06:03 2019 +0100 tdf#14 DOCX import: fix formula field syntax by removing the DOCX custom number format string which caused a syntax error message here instead of the formula calculation. Change-Id: Ia643e966440117871f6b4ddceab610100ac34138 Reviewed-on: https://gerrit.libreoffice.org/65945 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit 7209feef41c3c858476a2ae9795a7d2264c0ffc0) Reviewed-on: https://gerrit.libreoffice.org/65959 Tested-by: Xisco Faulí Reviewed-by: Xisco Faulí (cherry picked from commit b095e8f3b27331f0d646b1d33e51e17c37e43e2c) Reviewed-on: https://gerrit.libreoffice.org/66470 Reviewed-by: Christian Lohmaier diff --git a/sw/qa/extras/ooxmlimport/data/tdf14.docx b/sw/qa/extras/ooxmlimport/data/tdf14.docx new file mode 100644 index ..14518403cae1 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf14.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 833c2ed7e822..45480023495f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -240,6 +240,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf116486, "tdf116486.docx") CPPUNIT_ASSERT_EQUAL(OUString("4006"), aTop); } +DECLARE_OOXMLIMPORT_TEST(testTdf14, "tdf14.docx") +{ +uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTextTablesSupplier->getTextTables(), +uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell(xTable->getCellByName("A2"), uno::UNO_QUERY_THROW); +// This was "** Expression is faulty **", because of the unnecessary DOCX number format string +CPPUNIT_ASSERT_EQUAL(OUString("2000"), xCell->getString()); +} + // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8114600a68aa..82db1031bc88 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3217,6 +3217,15 @@ void DomainMapper_Impl::handleFieldFormula uno::Reference< beans::XPropertySet > const& xFieldProperties) { OUString command = pContext->GetCommand().trim(); + +// Remove number formatting from \# to end of command +// TODO: handle custom number formatting +sal_Int32 delimPos = command.indexOf("\\#"); +if (delimPos != -1) +{ +command = command.replaceAt(delimPos, command.getLength() - delimPos, "").trim(); +} + // command must contains = and at least another char if (command.getLength() < 2) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf120551.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |8 +++ writerfilter/source/dmapper/GraphicImport.cxx | 27 -- 3 files changed, 33 insertions(+), 2 deletions(-) New commits: commit ef5875be7d0aefcb95f878fee49d79a65cd063ea Author: Miklos Vajna AuthorDate: Mon Nov 19 21:41:07 2018 +0100 Commit: Caolán McNamara CommitDate: Wed Nov 28 16:49:03 2018 +0100 tdf#120551 DOCX import: fix position of group shape with absolute position Regression from commit af313fc149f80adb0f1680ca20e19745ccb7fede (tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option, 2017-01-06), the group shape which covers most of the single page in the document had a negative left position, while it should have a small positive one (checking the drawingML markup). This was a pre-existing problem, but now it's visible since we no longer force objects to be on the page in Word compat mode. Seeing the ODT import never positions group shapes (it's just a container for child shapes), probably the DOCX import shouldn't do that either. Start moving into this direction, first only for absolute-positioned toplevel group shapes only, which already fixes the bug. (cherry picked from commit d220e476df38e86e094066a690985c624316d37f) Change-Id: I152ba06a81a2bd09195a4c724da4b8878b0457bb Reviewed-on: https://gerrit.libreoffice.org/63710 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/ooxmlimport/data/tdf120551.docx b/sw/qa/extras/ooxmlimport/data/tdf120551.docx new file mode 100644 index ..0fc0057c4e03 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf120551.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 6b54a7991fb3..b7e75e9c28fe 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -93,6 +93,14 @@ DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx") getProperty(getRun(getParagraphOfText(1, xText), 1), "CharFontNameAsian")); } +DECLARE_OOXMLIMPORT_TEST(test120551, "tdf120551.docx") +{ +auto nHoriOrientPosition = getProperty(getShape(1), "HoriOrientPosition"); +// Without the accompanying fix in place, this test would have failed with +// 'Expected: 436, Actual : -2542'. +CPPUNIT_ASSERT_EQUAL(static_cast(436), nHoriOrientPosition); +} + DECLARE_OOXMLIMPORT_TEST(testTdf111550, "tdf111550.docx") { // The test document has following ill-formed structure: diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 45621b9c1686..c9597a25d6b3 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -65,11 +65,27 @@ #include "WrapPolygonHandler.hxx" #include "util.hxx" +using namespace css; + +namespace +{ +bool isTopGroupObj(const uno::Reference& xShape) +{ +SdrObject* pObject = GetSdrObjectFromXShape(xShape); +if (!pObject) +return false; + +if (pObject->GetUpGroup()) +return false; + +return pObject->IsGroupObject(); +} +} + namespace writerfilter { namespace dmapper { -using namespace css; class XInputStreamHelper : public cppu::WeakImplHelper { @@ -818,8 +834,15 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(0))); // Position of the groupshape should be set after children have been added. +// Long-term we should get rid of positioning group +// shapes, though. Do it for top-level ones with +// absolute page position as a start. // fdo#80555: also set position for graphic shapes here - m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); +if (!isTopGroupObj(m_xShape) +|| m_pImpl->nHoriRelation != text::RelOrientation::PAGE_FRAME +|| m_pImpl->nVertRelation != text::RelOrientation::PAGE_FRAME) +m_xShape->setPosition( +awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); if (nRotation) xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(nRotation)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/tdf119599.rtf |9 +++ sw/qa/extras/rtfimport/rtfimport.cxx |8 +++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |9 ++- writerfilter/source/rtftok/rtfsprm.cxx | 62 - writerfilter/source/rtftok/rtfsprm.hxx |2 5 files changed, 63 insertions(+), 27 deletions(-) New commits: commit 7ceebc68604e9eebc05155b2233bbadf3f4f056a Author: Miklos Vajna AuthorDate: Mon Sep 24 23:07:16 2018 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 4 11:03:24 2018 +0200 tdf#119599 RTF import: fix missing deduplication of font size Deciding when to and when not to deduplicate repeated direct formatting of paragraph / character properties is stricky, this bug is about a case when deduplication should happen and did not, since commit 1970a686273c5d4fc1eeb4430283e37085d9f647 (tdf#113408 RTF import style dedup: separate paragraph and character handling, 2017-10-31). Especially that deduplication works in both directions: it should remove properties which are duplicated and also should insert explicit default values for not repeated properties. Fix the problem by making the getDefaultSPRM() aware of the context (which style type it deals with), and then by making sure that only default properties relevant for the given style type are inserted. (cherry picked from commit 49614a9ea971ff7f370f863ce8a2735aab973cee) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx writerfilter/source/rtftok/rtfsprm.cxx Change-Id: I35b6599cc47fa51b8754fd921c61a3b31a283547 Reviewed-on: https://gerrit.libreoffice.org/61237 Tested-by: Jenkins Tested-by: Xisco Faulí Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/rtfimport/data/tdf119599.rtf b/sw/qa/extras/rtfimport/data/tdf119599.rtf new file mode 100644 index ..5a5d4654a43b --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf119599.rtf @@ -0,0 +1,9 @@ +{\rtf1\ansi +{\stylesheet +{\s0 Normal;} +{\s146\fs32 para style;} +} +\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440 +\pard\plain \s146\fs32 +hello. +\par } diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 659b422f5f1a..87fbbb51989b 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1140,6 +1140,14 @@ DECLARE_RTFIMPORT_TEST(testTdf90260Par, "hello.rtf") CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); } +DECLARE_RTFIMPORT_TEST(testTdf119599, "tdf119599.rtf") +{ +uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); +// This was beans::PropertyState_DIRECT_VALUE, changing the font size in +// the style had no effect on the rendering result. +CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, xRun->getPropertyState("CharHeight")); +} + DECLARE_RTFIMPORT_TEST(testTdf90315, "tdf90315.rtf") { uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index d48df600c34f..4094dc97dacf 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -489,8 +489,9 @@ RTFDocumentImpl::getProperties(RTFSprms& rAttributes, RTFSprms const& rSprms, Id RTFSprms aStyleSprms; RTFSprms aStyleAttributes; // Ensure the paragraph style is a flat list. -if (!nStyleType || nStyleType == NS_ooxml::LN_Value_ST_StyleType_paragraph) -lcl_copyFlatten(rProps, aStyleAttributes, aStyleSprms); +// Take paragraph style into account for character properties as well, +// as paragraph style may contain character properties. +lcl_copyFlatten(rProps, aStyleAttributes, aStyleSprms); if (itChar != m_aStyleTableEntries.end()) { @@ -502,8 +503,8 @@ RTFDocumentImpl::getProperties(RTFSprms& rAttributes, RTFSprms const& rSprms, Id } // Get rid of direct formatting what is already in the style. -RTFSprms const sprms(aSprms.cloneAndDeduplicate(aStyleSprms)); -RTFSprms const attributes(rAttributes.cloneAndDeduplicate(aStyleAttributes)); +RTFSprms const sprms(aSprms.cloneAndDeduplicate(aStyleSprms, nStyleType)); +RTFSprms const attributes(rAttributes.cloneAndDeduplicate(aStyleAttributes, nStyleType)); return std::make_shared(attributes, sprms); } diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index f768785a5cba..d63eaef70694 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -137,21 +137,36 @@ void RTFSprms::eraseLast(Id nKeyword) } } -static RTFValue::Pointer_t getDefaultSPRM(Id const id) +static RTFValue::Pointer_t
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf105444.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx|9 + sw/qa/extras/uiwriter/uiwriter.cxx| 10 +- writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +++- 4 files changed, 13 insertions(+), 10 deletions(-) New commits: commit 88188dd62d1d1e3caa1b8ee03fdf246aafdec71e Author: László Németh AuthorDate: Fri Sep 21 12:38:48 2018 +0200 Commit: Miklos Vajna CommitDate: Mon Oct 1 18:13:16 2018 +0200 tdf#105444 DOCX import: don't put extra paragraphs in comments on Win32, waiting only for \r\n instead of \n in RemoveLastParagraph(). Change-Id: I8921a6a72e8397ed04edb9f339ba3f0bf5bbb98b Reviewed-on: https://gerrit.libreoffice.org/60865 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit bdade7e3fc33c1832c6f6a472443fca8238738d2) Reviewed-on: https://gerrit.libreoffice.org/60896 diff --git a/sw/qa/extras/ooxmlexport/data/tdf105444.docx b/sw/qa/extras/ooxmlexport/data/tdf105444.docx new file mode 100644 index ..a6e0ea8732e3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf105444.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 4fda4e47a930..d7d41b1d1e36 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -762,6 +762,15 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4); } +DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx") +{ +xmlDocPtr pXmlComm = parseExport("word/comments.xml"); +if (!pXmlComm) +return; +// there is no extra paragraph on Win32, only a single one. +assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 619ba37ab9bb..6d1f2c51c684 100755 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -5399,15 +5399,7 @@ void SwUiWriterTest::testCreateDocxAnnotation() uno::Reference xField(xFields->nextElement(), uno::UNO_QUERY); // this was empty instead of "some text" -OUString aResultText = aSomeText -#ifdef WNT -// FIXME From some unclear reason, on windows we get an additional -// paragraph in the comment - please adapt this test when that gets -// fixed. -+ "\n" -#endif -; -CPPUNIT_ASSERT_EQUAL(aResultText, xField->getPropertyValue("Content").get()); +CPPUNIT_ASSERT_EQUAL(aSomeText, xField->getPropertyValue("Content").get()); } void SwUiWriterTest::testTdf107976() diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index aff0159140e6..444b19c6de6c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -432,7 +432,9 @@ void DomainMapper_Impl::RemoveLastParagraph( ) xCursor->goLeft( 1, true ); // If this is a text on a shape, possibly the text has the trailing // newline removed already. -if (xCursor->getString() == SAL_NEWLINE_STRING) +if (xCursor->getString() == SAL_NEWLINE_STRING || +// tdf#105444 comments need an exception, if SAL_NEWLINE_STRING defined as "\r\n" +(sizeof(SAL_NEWLINE_STRING)-1 == 2 && xCursor->getString() == "\n")) { uno::Reference xDocProps(GetTextDocument(), uno::UNO_QUERY); const OUString aRecordChanges("RecordChanges"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf64264.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 17 +++ writerfilter/source/dmapper/DomainMapperTableManager.cxx |2 - 3 files changed, 18 insertions(+), 1 deletion(-) New commits: commit caa2b68b9f3d686aa6f99e3e341b0f76e9e4ce46 Author: László Németh AuthorDate: Wed Sep 19 13:36:57 2018 +0200 Commit: Miklos Vajna CommitDate: Thu Sep 20 10:16:24 2018 +0200 tdf#64264 DOCX import: fix row count of repeating table header by ignoring isolated tblHeader settings, according to the standard. (OOXML 17.4.49 tblHeader (Repeat Table Row on Every New Page) "...if this row [with tblHeader property] is not contiguously connected with the first row of the table (that is, if this table row is not either the first row, or all rows between this row and the first row are not marked as header rows) then this property shall be ignored.") Note: with this fix, in a mixed environment, LibreOffice is able to fix the known problems of MS Word 2013/2016 by removing the isolated tblHeaders during DOCX import/export (such problems in MSO: missing repeating headers in a few pages or in the whole table, despite the correct settings; and non-modifiable repeat header row property in the table settings). Change-Id: I73e8394a75b77c937a4bac37d99ff747ad95a06e Reviewed-on: https://gerrit.libreoffice.org/60765 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit ace6bbf3da9ae27aca87865b6be887a3aed341fc) Reviewed-on: https://gerrit.libreoffice.org/60790 Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf64264.docx b/sw/qa/extras/ooxmlexport/data/tdf64264.docx new file mode 100644 index ..e2fea64dada7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf64264.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index f32d14ee62a0..c7dc952d2c40 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -455,6 +455,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx") CPPUNIT_ASSERT_EQUAL(OUString("Before\nAfter"), xCell->getString()); } +DECLARE_OOXMLEXPORT_TEST(testTdf64264, "tdf64264.docx") +{ +// DOCX table rows with tblHeader setting mustn't modify the count of the +// repeated table header rows, when there is rows before them without tblHeader settings. +xmlDocPtr pDump = parseLayoutDump(); +CPPUNIT_ASSERT_EQUAL(2, getPages()); + +// table starts on page 1 and finished on page 2 +// and it has got only a single repeating header line +assertXPath(pDump, "/root/page[2]/body/tab", 1); +assertXPath(pDump, "/root/page[2]/body/tab/row", 47); +CPPUNIT_ASSERT_EQUAL(OUString("Repeating Table Header"), + parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()")); +CPPUNIT_ASSERT_EQUAL(OUString("Text"), + parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 613282e39683..dffcfa7b461f 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -198,7 +198,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TrPrBase_tblHeader: // if nIntValue == 1 then the row is a repeated header line // to prevent later rows from increasing the repeating m_nHeaderRepeat is set to NULL when repeating stops -if( nIntValue > 0 && m_nHeaderRepeat >= 0 ) +if( nIntValue > 0 && m_nHeaderRepeat == static_cast(m_nRow) ) { ++m_nHeaderRepeat; TablePropertyMapPtr pPropMap( new TablePropertyMap ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf118691.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 12 writerfilter/source/ooxml/model.xml |4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) New commits: commit 8693f6fa799c43304741f465c23e827c3ceafd9d Author: László Németh AuthorDate: Mon Sep 17 13:36:09 2018 +0200 Commit: Miklos Vajna CommitDate: Tue Sep 18 13:48:38 2018 +0200 tdf#118691 DOCX import: fix table loss caused by According to the OOXML standard, (carriage return – Unicode character 000D) is equivalent to a break with null type and clear attributes, so we handle it as a , instead of endOfParagraph, fixing losing table paragraphs and tables containing . Note: It seems, MSO cannot handle carriage return characters in table cells correctly. It shows squares (unknown characters) without line break there. Copying this text to a non-table paragraph in MSO, we get the correct layout with line breaks. Copying this text with carriage return characters back to a table cell, we get squares again. With this LO fix, it will be possible to fix the bad tables edited by MS Word by using LO, because LibreOffice import/export converts all s to s (as before, but now without destroying the structure of the tables). Change-Id: Iee42f71e9a00531353582e7127c2c212ea0890d0 Reviewed-on: https://gerrit.libreoffice.org/60585 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit f63a60f56156e4ac17887e6c96d15fb865a2a8eb) Reviewed-on: https://gerrit.libreoffice.org/60655 Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf118691.docx b/sw/qa/extras/ooxmlexport/data/tdf118691.docx new file mode 100644 index ..ce6c6c5cf76d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf118691.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index df780afde73e..f32d14ee62a0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -443,6 +443,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf104797, "tdf104797.docx") CPPUNIT_ASSERT_EQUAL(false,getProperty(getRun(getParagraph(2), 5), "IsStart")); } +DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY); +// Text "Before" stays in the first cell, not removed before the table because of +// bad handling of +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Before\nAfter"), xCell->getString()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 25f8a267bb8a..7146ccbe848d 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -17927,8 +17927,8 @@ - - + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/fdo69384-paste.rtf |4 ++-- sw/qa/extras/rtfexport/rtfexport2.cxx | 13 ++--- writerfilter/source/dmapper/StyleSheetTable.cxx |7 --- 3 files changed, 12 insertions(+), 12 deletions(-) New commits: commit 634527cf866adf5cc7fb501b09e36bb3f7be89e5 Author: Caolán McNamara AuthorDate: Thu Aug 23 17:19:07 2018 +0100 Commit: Thorsten Behrens CommitDate: Thu Aug 30 02:19:25 2018 +0200 Resolves: tdf#118382 crash on paste of rtf into an existing document since commit deaa16bd24fba4a3a6b072ab2b94542a7dbd41c6 Author: Serge Krot Date: Mon Jan 29 12:17:06 2018 +0100 tdf#72942 Do not overwrite styles from the inserted doc During inserting of the text from the external document we should not change original default styles in currently opened document. because missing styles aren't created, so there's exceptons thrown on their use. I see that the m_bIsNewDoc flag is already checked for since... commit 5ebe826caf75e8d00656b385bf0bbc05cb27 Author: Miklos Vajna Date: Fri Oct 4 11:02:59 2013 +0200 fdo#69384 fix impress -> writer copy Regression from 2ade07126971b79c92f729fae5709f2e2e2b495c (fdo#62044 RTF import: don't overwrite existing styles when pasting, 2013-06-04), during paste, if existing style was found, then the intention was to skip that style, but instead we tried to create one. in the body of the following loop, which should mean that existing styles are left alone and only missing styles created if we remove this hunk of the tdf#72942 commit Change-Id: Ia4aedb5e309c991490656061aa20d11ff24f4f9e Reviewed-on: https://gerrit.libreoffice.org/59519 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 1f1e349bbee1b2bff01a850d9a7fe4d6a77c4f29) Reviewed-on: https://gerrit.libreoffice.org/59636 Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf index cbdca5be6e9c..e0a9733c7475 100644 --- a/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf +++ b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf @@ -8,10 +8,10 @@ {\s4\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext4 Object without fill;} {\s5\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext5 Object with no fill and no line;} {\s6\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext6 Text;} -{\s7\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs32\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext7 Text body;} +{\s7\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs132\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs136\fs136\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext7 Text Body;} {\s8\fi0\li0\ri0\sb0\sa0\sl200\slmult0\ql\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext8 Text body justified;}} {\*\EditEnginePoolDefaults\ltrpar\fi0\li0\ri0\fi0\li0\ri0\sb0\sa0\sl0\slmult0\ql\cf0\f0\fs48\b0\ulnone\strike0\i0\outl0\shad0\kerning0\expndtw0\f1\f2\fs48\fs48\b0\b0\i0\i0\accnone\olnone} \deftab709 { -\s27\fi0\li0\ri0\qc\cf0\f3\fs64\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs64\fs64\b0\b0\i0\i0\accnone\olnone {\f3\fs64\b0\i0 sss}\par\pard\plain +\s7\fi0\li0\ri0\qc\cf0\f3\fs64\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs64\fs64\b0\b0\i0\i0\accnone\olnone {\f3\fs64\b0\i0 sss}\par\pard\plain }} diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 64de79280e25..e5b2fd4f958b 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -655,8 +655,12 @@ DECLARE_RTFEXPORT_TEST(testFdo63428, "hello.rtf") DECLARE_RTFEXPORT_TEST(testFdo69384, "fdo69384-paste.rtf") { -// Check if the style is loaded +// Ensure non-default style is loaded getStyles("ParagraphStyles")->getByName("Text body justified"); +// Ensure default styles were modified, vs testFdo69384Inserted where it is not +uno::Reference xPropertySet( +getStyles("ParagraphStyles")->getByName("Text Body"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(68.f, getProperty(xPropertySet, "CharHeight")); } DECLARE_RTFEXPORT_TEST(testFdo69384Inserted, "hello.rtf") @@ -666,8 +670,11 @@ DECLARE_RTFEXPORT_TEST(testFdo69384Inserted, "hello.rtf") uno::Reference xEnd = xText->getEnd(); paste("rtfexport/data/fdo69384-paste.rtf", xEnd); -// During insert of the RTF document we do not insert new styles -
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/core/data/ooxml/fail/ofz9934-1.docx |binary writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) New commits: commit 4fb7390956a193e00c1b599129b89933c41f98ae Author: Caolán McNamara AuthorDate: Fri Aug 17 08:47:19 2018 +0100 Commit: Michael Stahl CommitDate: Mon Aug 20 12:16:10 2018 +0200 ofz#9934 null deref Change-Id: I6833ad8a556b561a37e468da8845914cabfac4c5 Reviewed-on: https://gerrit.libreoffice.org/59249 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/qa/core/data/ooxml/fail/ofz9934-1.docx b/sw/qa/core/data/ooxml/fail/ofz9934-1.docx new file mode 100644 index ..b97afaee8d3f Binary files /dev/null and b/sw/qa/core/data/ooxml/fail/ofz9934-1.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index d2289c25fa9b..aff0159140e6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1610,8 +1610,9 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const OLEHandler if (!m_aAnchoredStack.empty()) m_aAnchoredStack.top( ).bToRemove = true; RemoveLastParagraph(); -m_aTextAppendStack.pop(); - +SAL_WARN_IF(m_aTextAppendStack.empty(), "writerfilter.dmapper", "no text stack"); +if (!m_aTextAppendStack.empty()) +m_aTextAppendStack.pop(); appendTextContent( xOLE, uno::Sequence< beans::PropertyValue >() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/core/data/ooxml/pass/tdf119136.docx |binary writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit a0bf275c37e9ac40597cc09fde8dc1fe3a04c858 Author: Justin Luth AuthorDate: Tue Aug 7 21:10:59 2018 +0300 Commit: Miklos Vajna CommitDate: Fri Aug 10 14:29:31 2018 +0200 tdf#119136 GetPropertyFromStyleSheet infinite loop So, apparently we accept a style that has no styleId and define it as such. Due to some reworkings, this function was called instead. Since we can "find" a style without a name, now every parentless style thought it inherited from this nameless style. Change-Id: I47b4119abd37ece94a39e636ddb7798b809ccb04 Reviewed-on: https://gerrit.libreoffice.org/58717 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/data/ooxml/pass/tdf119136.docx b/sw/qa/core/data/ooxml/pass/tdf119136.docx new file mode 100644 index ..2baa624bbb53 Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/tdf119136.docx differ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index a1b34dc42865..d2289c25fa9b 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -681,7 +681,9 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) } } //search until the property is set or no parent is available -StyleSheetEntryPtr pNewEntry = GetStyleSheetTable()->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier); +StyleSheetEntryPtr pNewEntry; +if ( !pEntry->sBaseStyleIdentifier.isEmpty() ) +pNewEntry = GetStyleSheetTable()->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier); SAL_WARN_IF( pEntry == pNewEntry, "writerfilter.dmapper", "circular loop in style hierarchy?"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/tdf81943.rtf | 48 + sw/qa/extras/rtfimport/rtfimport.cxx |6 +++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 24 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 + 4 files changed, 80 insertions(+) New commits: commit 7e863504854ae8ab286b32510aba8b363a8e314b Author: Miklos Vajna AuthorDate: Mon Jul 16 22:04:02 2018 +0200 Commit: Caolán McNamara CommitDate: Tue Jul 24 17:25:25 2018 +0200 tdf#81943 sw RTF import: fix missing wrap in background for in-table shape Regression from commit 015fd55c94b7b650ed8e572cafaf3b0f903b01b9 (tdf#96275 RTF import: fix anchor of shapes inside tables, 2016-05-10), remember more context when delaying the import of a shape. (cherry picked from commit 0c91f8f839d36c8b5af272b1d3c835d2f4af6b65) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Idc02868eb3fe5b7637c9fd00c841bf71423adf2b Reviewed-on: https://gerrit.libreoffice.org/57555 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/rtfimport/data/tdf81943.rtf b/sw/qa/extras/rtfimport/data/tdf81943.rtf new file mode 100644 index ..28b3f430abce --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf81943.rtf @@ -0,0 +1,48 @@ +{\rtf1 +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue128;} +\trowd \irow0\cellx6300\cellx10800\pard\plain +{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof +{\shp +{\*\shpinst\shpleft-199\shptop-18\shpright11028\shpbottom2236\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz0\shplockanchor\shplid1026 +{\sp +{\sn shapeType} +{\sv 75} +} +{\sp +{\sn pib} +{\sv +{\pict\picscalex99\picscaley99\piccropl0\piccropr0\piccropt0\piccropb0\picw19905\pich3997\picwgoal11285\pichgoal2266\pngblip +89504e470d0a1a0a000d4948445200040004080200269309290009704859732e232e230178a53f76000774494d4507e2 +07090f031bf2645ea100144944415408d763cc63f8cf00034c0c480037070047bd01759ad735e249454e44ae426082} +} +} +{\sp +{\sn posrelh} +{\sv 1} +} +{\sp +{\sn posrelv} +{\sv 1} +} +{\sp +{\sn fBehindDocument} +{\sv 1} +} +} +} +} +{\rtlch\fcs1 \af1 \ltrch\fcs0 \cell } +\pard \ltrpar \intbl\cell +\pard\plain \ltrpar\ql \li0\ri0\intbl\aspnum \rtlch\fcs1 \af1\afs22 \ltrch\fcs0 \f39\fs18\lang1033\langfe1033\cgrid +{\rtlch\fcs1 \af1 \ltrch\fcs0 \trowd \irow0\cellx6300\cellx10800\row } +\trowd \irow1\lastrow +\cellx6300\cellx10800\pard\plain +\f42\fs40\cf8\lang1033\langfe1033\cgrid +{\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506 hello\cell} +{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1049\langfe1033 \cell } +\pard\plain +{\rtlch\fcs1 \af1 \ltrch\fcs0 \trowd \irow1\lastrow +\cellx6300\cellx10800\row } +\pard\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 10c32eb50c50..659b422f5f1a 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -173,6 +173,12 @@ DECLARE_RTFIMPORT_TEST(testTdf115715, "tdf115715.rtf") getProperty(getParagraph(2), "ParaFirstLineIndent")); } +DECLARE_RTFIMPORT_TEST(testTdf81943, "tdf81943.rtf") +{ +// The shape wasn't in background. +CPPUNIT_ASSERT_EQUAL(false, getProperty(getShape(1), "Opaque")); +} + DECLARE_RTFIMPORT_TEST(testTdf115155, "tdf115155.rtf") { auto xLevels diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 14eba29aa4a5..d48df600c34f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1065,6 +1065,13 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference(aAnchorWrapAttributes); + +if (m_aStates.top().aShape.aWrapSprm.first != 0) +// Replay of a buffered shape, wrap sprm there has priority over +// character sprms of the current state. +aAnchorSprms.set(m_aStates.top().aShape.aWrapSprm.first, + m_aStates.top().aShape.aWrapSprm.second); + aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_extent, pExtentValue); if (!aAnchorWrapAttributes.empty() && nWrap == -1) aAnchorSprms.set(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue); @@ -1633,6 +1640,11 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms, // otherwise it gets re-buffered. RTFBuffer_t* pCurrentBuffer = m_aStates.top().pCurrentBuffer; m_aStates.top().pCurrentBuffer = nullptr; + +// Set current shape during replay, needed by e.g. wrap in +// background. +
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf104797.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx| 19 +++ writerfilter/source/dmapper/DomainMapper.cxx |4 +++- writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) New commits: commit 04b53321ca56844521787563914fad21513fd58d Author: László Németh AuthorDate: Thu Jul 19 12:08:31 2018 +0200 Commit: Miklos Vajna CommitDate: Fri Jul 20 12:58:51 2018 +0200 tdf#104797 DOCX change tracking: handle moveFrom and moveTo data as deletion and insertion instead of importing them as normal (unmodified) texts (messing up document content and losing change tracking information). Change-Id: I9c0a7da83f3e8235d65d47afdb99ffe188f52704 Reviewed-on: https://gerrit.libreoffice.org/57723 Reviewed-by: László Németh Tested-by: László Németh Reviewed-on: https://gerrit.libreoffice.org/57729 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf104797.docx b/sw/qa/extras/ooxmlexport/data/tdf104797.docx new file mode 100644 index ..6e52190ce671 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf104797.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index f27c88facc67..af4fa6661907 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -401,6 +401,25 @@ DECLARE_OOXMLEXPORT_TEST(testOpenDocumentAsReadOnly, "open-as-read-only.docx") CPPUNIT_ASSERT(pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly()); } +DECLARE_OOXMLIMPORT_TEST(testTdf104797, "tdf104797.docx") +{ +// check moveFrom and moveTo +CPPUNIT_ASSERT_EQUAL( OUString( "Will this sentence be duplicated?" ), getParagraph( 1 )->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString()); +CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 2), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"),getProperty(getRun(getParagraph(1), 2), "RedlineType")); +CPPUNIT_ASSERT_EQUAL(true,getProperty(getRun(getParagraph(1), 2), "IsStart")); +CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence. Will this sentence be duplicated ADDED STUFF?" ), +getParagraph( 2 )->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence." ), getRun( getParagraph( 2 ), 1 )->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 2 )->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( " Will this sentence be duplicated ADDED STUFF?" ), getRun( getParagraph( 2 ), 3 )->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 4 )->getString()); +CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 5), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty(getRun(getParagraph(2), 5), "RedlineType")); +CPPUNIT_ASSERT_EQUAL(false,getProperty(getRun(getParagraph(2), 5), "IsStart")); +} + 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 cbcce6bda2ef..9eab98638e99 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3833,13 +3833,15 @@ void DomainMapper::HandleRedline( Sprm& rSprm ) case XML_mod: case XML_ins: case XML_del: +case XML_moveTo: +case XML_moveFrom: case XML_ParagraphFormat: case XML_tableRowInsert: case XML_tableRowDelete: case XML_tableCellInsert: case XML_tableCellDelete: break; -default: OSL_FAIL( "redline token other than mod, ins, del or table row" ); break; +default: OSL_FAIL( "redline token other than mod, ins, del, moveTo, moveFrom or table row" ); break; } m_pImpl->EndParaMarkerChange( ); m_pImpl->SetCurrentRedlineIsRead(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8a9c038d8c2f..321866daf85a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1860,9 +1860,11 @@ void DomainMapper_Impl::CreateRedline(uno::Reference const& xR case XML_mod: sType = getPropertyName( PROP_FORMAT ); break; +case XML_moveTo: case XML_ins: sType = getPropertyName( PROP_INSERT ); break; +case XML_moveFrom: case XML_del: sType = getPropertyName( PROP_DELETE ); break; ___ Libreoffice-commits mailing list
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|6 + sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |4 + writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 writerfilter/source/dmapper/PropertyMap.cxx | 32 ++ 6 files changed, 44 insertions(+) New commits: commit 37a27823ad181387943a3193236f2cca6d3ec0d6 Author: Justin Luth Date: Wed Jun 27 16:19:57 2018 +0300 tdf#118361 sw ooxmlimport: set footnote separator alignment If RTL is defined in the default (Normal) paragraph style, then the footnote separator should be right-aligned. In MSWORD, the alignment is not a property that is stored with the footnote separator definition, and it is not a page property like it is in LO. The reverse needs to happen for LTR default paragraph style. Based on my MSWORD observations, the only place where you can indirectly set RightToLeft is in the "Normal" paragraph style. That option is disabled in all of the other styles. In LibreOffice, this is typically handled by the locale properties. The default PAGE style's Footnotes - Position is RIGHT for RTL locales, but LEFT for LTR locales. It is kinda interesting that no one from a RTL locale complained about wrongly-right-aligned footnote separator from imported LTR .docx's. None of this belongs in export code, since MSO doesn't support specifying the location - it is just a consequence of the RTL/LTR settings. Change-Id: I07d26640116cb12cb9157cd1d902b4c774dbba26 Reviewed-on: https://gerrit.libreoffice.org/56532 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit 139750d7c295b84f4c42bf9409ccbdfb0c46b9f6) Reviewed-on: https://gerrit.libreoffice.org/57214 Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx b/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx new file mode 100644 index ..8545cbf253d8 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf118361_RTLfootnoteSeparator.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index e086b1998aa7..9882bb943f7b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -84,6 +84,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112694, "tdf112694.docx") CPPUNIT_ASSERT(!getProperty(aPageStyle, "HeaderIsOn")); } +DECLARE_OOXMLEXPORT_TEST(testTdf118361_RTLfootnoteSeparator, "tdf118361_RTLfootnoteSeparator.docx") +{ +uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote separator RTL", sal_Int16(2), getProperty(aPageStyle, "FootnoteLineAdjust")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf115861, "tdf115861.docx") { // Second item in the paragraph enumeration was a table, 2nd paragraph was diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 096a711d113b..347a444f1cf7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -660,6 +660,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.doc xPageStyle.set(getStyles("CharacterStyles")->getByName("Footnote anchor"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + +//tdf#118361 - in RTL locales, the footnote separator should still be left aligned. +uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote separator LTR", sal_Int16(0), getProperty(aPageStyle, "FootnoteLineAdjust")); } DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx") diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 592063a4d312..f515d5118636 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -172,6 +172,7 @@ OUString getPropertyName( PropertyIds eId ) case PROP_FOOTER_IS_SHARED :sName = "FooterIsShared"; break; case PROP_FOOTER_IS_ON :sName = "FooterIsOn"; break; case PROP_FOOTNOTE_COUNTING:sName = "FootnoteCounting"; break; +case PROP_FOOTNOTE_LINE_ADJUST :sName = "FootnoteLineAdjust"; break; case PROP_WIDTH:sName = "Width"; break; case PROP_HEIGHT :sName = "Height"; break; case
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport.cxx|4 ++ sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |4 ++ sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |8 writerfilter/source/dmapper/StyleSheetTable.cxx | 44 +++- 4 files changed, 37 insertions(+), 23 deletions(-) New commits: commit 3d9e0874becde20d901fda561633202e2e478eff Author: Justin Luth Date: Fri Jul 6 10:03:07 2018 +0300 backport combined tdf#95115 and tdf#102619: writerfilter Styles were having FollowStyle set to themselves (Heading 1), not to a defined follow (Text body). The style was being created with a FollowStyle property that identified a style which had not yet been created. And also some stylenames were not recognized since it didn't do an extended search. tdf#95114 writerfilter: follow correctly converted stylename commit ac540c1d743250062b3e71b094209ec1428872e9 tdf#102619 writerfilter: first create style, then set FollowStyle commit 39a4f21fc4a16f7c57a9b6f1ddd5ce2953781576 ~NFC related tdf#102619 writerfilter: use ConvertStyleName() commit d22bca292532ff58839bc593a7b3e1d3b6f3552c These commit were done separately to aid in regression testing in master, but logically all combine together for easy backporting. Change-Id: I77f143760c10be4b7853f16bce2b57474b70d3f1 Reviewed-on: https://gerrit.libreoffice.org/57073 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-on: https://gerrit.libreoffice.org/57175 Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 0dc6ebe65b20..3056f5a43a9a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -797,6 +797,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx") uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("docProps/custom.xml"))); } + +//tdf#102619 - setting FollowStyle with a not-yet-created style was failing. (Titre is created before Corps de texte). +uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Titre"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Corps de texte"), getProperty(properties, "FollowStyle")); } DECLARE_OOXMLEXPORT_TEST(testTdf91261, "tdf91261.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index e3ae1ffad629..66e2228fb368 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -559,6 +559,10 @@ DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx") uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + +//tdf#102619 - I would have expected this to be "Standard", but MSO 2013/2010/2003 all give FollowStyle==Date +uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Date"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Date"), getProperty(properties, "FollowStyle")); } DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 9a10e7d0f2cb..096a711d113b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -251,6 +251,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx") { CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 3 ); + +//tdf#95114 - follow style is Text Body - DOCX test +uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("annotation subject"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("annotation text"), getProperty(properties, "FollowStyle")); } DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_dontEquallyDistributeColumns.docx") @@ -270,6 +274,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt") CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 1 style inherits keeps with next", true, getProperty(getParagraph(3), "ParaKeepTogether")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 2 style disabled keep with next", false, getProperty(getParagraph(4), "ParaKeepTogether")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Text Body style toggled off keep with next", false, getProperty(getParagraph(5), "ParaKeepTogether")); + +//tdf#95114 - follow style is Text Body - ODT test +
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf117843.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 12 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) New commits: commit eb65a8c54f56abc8ba66f9cbc779cd20e4740933 Author: Miklos Vajna Date: Tue Jun 5 09:43:49 2018 +0200 tdf#117843 DOCX import: disable compat increased spacing in header/footer It's only relevant for the body text. (cherry picked from commit 09a37fe50f36ced755bc326fb6b4c1b6fdf61f86) Change-Id: Id894604ed9b2c19400eeabbd2966f104d8b34aab Reviewed-on: https://gerrit.libreoffice.org/55335 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlimport/data/tdf117843.docx b/sw/qa/extras/ooxmlimport/data/tdf117843.docx new file mode 100644 index ..501e85bfef96 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf117843.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index eb3b42a31387..3de2c9bcb097 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -151,6 +151,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf111550, "tdf111550.docx") getCell(innerTable, "A1", "[outer:A2]\n[inner:A1]"); } +DECLARE_OOXMLIMPORT_TEST(testTdf117843, "tdf117843.docx") +{ +uno::Reference xPageStyles = getStyles("PageStyles"); +uno::Reference xPageStyle(xPageStyles->getByName("Standard"), uno::UNO_QUERY); +uno::Reference xHeaderText += getProperty>(xPageStyle, "HeaderText"); +// This was 4025, increased top paragraph margin was unexpected. +CPPUNIT_ASSERT_EQUAL( +static_cast(0), +getProperty(getParagraphOfText(1, xHeaderText), "ParaTopMargin")); +} + DECLARE_OOXMLIMPORT_TEST(testTdf43017, "tdf43017.docx") { uno::Reference xParagraph = getParagraph(1); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f84f37536f93..6521a08d0445 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1349,9 +1349,11 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap ) xTextRange = xTextAppend->finishParagraph( comphelper::containerToSequence(aProperties) ); m_xPreviousParagraph.set(xTextRange, uno::UNO_QUERY); -if (!rAppendContext.m_aAnchoredObjects.empty()) +if (!rAppendContext.m_aAnchoredObjects.empty() && !IsInHeaderFooter()) { // Remember what objects are anchored to this paragraph. +// That list is only used for Word compat purposes, and +// it is only relevant for body text. AnchoredObjectInfo aInfo; aInfo.m_xParagraph = xTextRange; aInfo.m_aAnchoredObjects = rAppendContext.m_aAnchoredObjects; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits