From 00eeb7b3f765a51f51f7911a116982fbfb83efb7 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 15 Nov 2019 11:58:01 +0100 Subject: DOCX: clean-up paragraph bottom handling of table style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert of commit 17e904ed66c3caf87e658b9d3a18d7b13f4a0b52 ("bnc#816593 DOCX filter: import paragraph spacing from table style), keeping only the working unit test. Change-Id: I735744aadb071ef2f0d939cb637d83cfc5716fe4 Reviewed-on: https://gerrit.libreoffice.org/82776 Tested-by: Jenkins Reviewed-by: László Németh --- .../source/dmapper/DomainMapperTableHandler.cxx | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index efbaf3a0ffc3..d80f4b36518d 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -19,8 +19,6 @@ #include "DomainMapperTableHandler.hxx" #include "DomainMapper_Impl.hxx" #include "StyleSheetTable.hxx" -#include -#include #include #include #include @@ -976,23 +974,6 @@ css::uno::Sequence DomainMapperTableHandler::endTabl return aRowProperties; } -// Apply paragraph property to each paragraph within a cell. -static void lcl_ApplyCellParaProps(uno::Reference const& xCell, - const uno::Any& rBottomMargin) -{ - uno::Reference xEnumerationAccess(xCell, uno::UNO_QUERY); - uno::Reference xEnumeration = xEnumerationAccess->createEnumeration(); - while (xEnumeration->hasMoreElements()) - { - uno::Reference xParagraph(xEnumeration->nextElement(), uno::UNO_QUERY); - uno::Reference xPropertyState(xParagraph, uno::UNO_QUERY); - // Don't apply in case direct formatting is already present. - // TODO: probably paragraph style has priority over table style here. - if (xPropertyState.is() && xPropertyState->getPropertyState("ParaBottomMargin") == beans::PropertyState_DEFAULT_VALUE) - xParagraph->setPropertyValue("ParaBottomMargin", rBottomMargin); - } -} - void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart) { #ifdef DBG_UTIL @@ -1096,20 +1077,9 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab [](const beans::PropertyValue& rProp) { return rProp.Name == "ParaBottomMargin"; }); if (pTableProp != aTableInfo.aTableProperties.end()) { - uno::Reference xCellRange(xTable, uno::UNO_QUERY); uno::Any aBottomMargin = pTableProp->Value; - sal_Int32 nRows = aCellProperties.getLength(); - for (const auto& rParaProp : m_rDMapper_Impl.m_aPendingParaProp ) rParaProp->setPropertyValue("ParaBottomMargin", aBottomMargin ); - - for (sal_Int32 nRow = 0; nRow < nRows; ++nRow) - { - const uno::Sequence< beans::PropertyValues > aCurrentRow = aCellProperties[nRow]; - sal_Int32 nCells = aCurrentRow.getLength(); - for (sal_Int32 nCell = 0; nCell < nCells; ++nCell) - lcl_ApplyCellParaProps(xCellRange->getCellByPosition(nCell, nRow), aBottomMargin); - } } } } -- cgit