[Libreoffice-commits] core.git: Branch 'distro/collabora/dcm-6.2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport.cxx |4 ++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 0da422c6d46a9374d6fafe1ecd11cf504575cf24 Author: Jan-Marek Glogowski AuthorDate: Fri Nov 1 10:39:47 2019 +0100 Commit: Miklos Vajna CommitDate: Fri Jul 23 17:05:15 2021 +0200 tdf#120546 fix DOCX overriding numrule format ... at least in the view. This "fixes" the import side of the exported OOXML document with multiple overridden numrule character format. This prevents the change of the shared numrule, which results in all bullets being formatted like the last overridden numrule. What is missing is a consistent way to edit the override, as the override is currently just stored in an internal attribute, the "ListAutoFormat" property. Fixing editing for good will be a larger work, as "ListAutoFormat" must be reflected in the GUI and must have a higher priority then the numrule format. Currently positioning the curser in front of the number or bullet entry lets one change the numrule format, which is applied to all bullets of the same rule. This special DOCX override mode is enabled by the import filter setting DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING to true. This should also change the edit mode, so that a change of the entry doesn't modify the rule, but the override and this must also be reflected in the GUI character settings. (cherry picked from commit 4412689b1358b5cc932f905417f23e2a3cbb494b) Change-Id: I057f7a354bc3c413b114eec772e06c7063029699 Reviewed-on: https://gerrit.libreoffice.org/81878 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 3c84ed37e97e..e8b7af256cc0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -368,9 +368,9 @@ DECLARE_OOXMLEXPORT_TEST(testPositionAndRotation, "position-and-rotation.docx") DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") { +// check that the original numrule font name is still Calibri uno::Reference xStyle(getStyles("CharacterStyles")->getByName("ListLabel 1"), uno::UNO_QUERY); -// This was Calibri, i.e. custom font of the numbering itself ("1.\t") was lost on import. -CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty(xStyle, "CharFontName")); +CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty(xStyle, "CharFontName")); } DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt") diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 716c14e8a5bf..a0d6cc58051f 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5968,6 +5968,9 @@ uno::Reference DomainMapper_Impl::GetCurrentNumberingCharSt xLevels = GetCurrentNumberingRules(); if (!xLevels.is()) { +if (IsOOXMLImport()) +return xRet; + PropertyMapPtr pContext = m_pTopContext; if (IsRTFImport() && !IsOpenField()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/dcm-6.2' - sw/qa writerfilter/source
Rebased ref, commits from common ancestor: commit 546d94f864ed866fac9ba3790950820d60991e6f Author: Szabolcs Toth AuthorDate: Thu Feb 20 10:54:19 2020 +0100 Commit: Andras Timar CommitDate: Thu Jul 8 14:05:34 2021 +0200 tdf#130799 DOCX import: fix missing inside vertical borders caused by incomplete handling of tables with 1-column rows with merged cells. Have to check the rows below current to see if they contain also one cell, therefore form a column, or more than one cell, in which case do not remove vertical borders. Regression from commit: 8a2eb40abbd52d960dd21308157186be0ca9dd3d (tdf#129442 DOCX import: fix right border of 1-column tables). Change-Id: If9ca7ccd42255e78c61b6271e19262ab5cc8e439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89081 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 3726c9022b97..b1c8c98ba8fc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1048,6 +1048,17 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); } +DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx") +{ +// tdf#130799: Inside vertical borders of a table should not be missing. + +xmlDocPtr pXmlDocument = parseExport("word/document.xml"); +if (!pXmlDocument) +return; +// Left and right borders. +assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 4cb518eb29d8..458feaa6cd96 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -836,7 +836,17 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl // Do not apply vertical borders to a one column table. else if (m_aCellProperties.size() > 1 && aRowOfCellsIterator->size() <= 1) { -rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); +bool isOneCol = true; +for (size_t i = nRow; i < m_aCellProperties.size(); i++) +{ +if (m_aCellProperties[i].size() > 1) +{ +isOneCol = false; +break; +} +} +if (isOneCol) +rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); } // Do not apply horizontal borders to a one row table. else if (m_aCellProperties.size() == 1 && aRowOfCellsIterator->size() > 1) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/dcm-6.2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx| 11 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 12 +++- 2 files changed, 22 insertions(+), 1 deletion(-) New commits: commit 23ae22b244230b42979d206943149924efc9a80c Author: Szabolcs Toth AuthorDate: Thu Feb 20 10:54:19 2020 +0100 Commit: Mike Kaganski CommitDate: Tue Jul 6 21:49:43 2021 +0300 tdf#130799 DOCX import: fix missing inside vertical borders caused by incomplete handling of tables with 1-column rows with merged cells. Have to check the rows below current to see if they contain also one cell, therefore form a column, or more than one cell, in which case do not remove vertical borders. Regression from commit: 8a2eb40abbd52d960dd21308157186be0ca9dd3d (tdf#129442 DOCX import: fix right border of 1-column tables). Change-Id: If9ca7ccd42255e78c61b6271e19262ab5cc8e439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89081 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 3726c9022b97..e2f9d6b1e14d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1050,6 +1050,17 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx") #endif +DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx") +{ +// tdf#130799: Inside vertical borders of a table should not be missing. + +xmlDocPtr pXmlDocument = parseExport("word/document.xml"); +if (!pXmlDocument) +return; +// Left and right borders. +assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 4cb518eb29d8..458feaa6cd96 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -836,7 +836,17 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl // Do not apply vertical borders to a one column table. else if (m_aCellProperties.size() > 1 && aRowOfCellsIterator->size() <= 1) { -rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); +bool isOneCol = true; +for (size_t i = nRow; i < m_aCellProperties.size(); i++) +{ +if (m_aCellProperties[i].size() > 1) +{ +isOneCol = false; +break; +} +} +if (isOneCol) +rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); } // Do not apply horizontal borders to a one row table. else if (m_aCellProperties.size() == 1 && aRowOfCellsIterator->size() > 1) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits