diff options
author | Justin Luth <justin.luth@collabora.com> | 2019-11-30 12:07:11 +0300 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-12-02 11:00:25 +0100 |
commit | 749fd6508504cf3b2e3822eca52a67fa36d75fb8 (patch) | |
tree | 29e94bbe6e6e05ba5c292e79b19eca5f6b6ce2e9 | |
parent | 2244865e7b8f229c81b94c8a875414f71ba81c5a (diff) |
revert obsolete writerfilter hacks for tdf#119054 and tdf#128752
These are obsoleted in LibreOffice 6.5 by tdf#118947's
commit 6bced3c6a1bf8d4652dd6ba75e41b128ce1bfc5c
Both of these hacks were backported to 6.4, but
I have no intention of backporting my patch.
Change-Id: Ie639b9d55d90d25b58e140fba443fce98f2d7ba1
Reviewed-on: https://gerrit.libreoffice.org/84125
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
4 files changed, 0 insertions, 58 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 9fa23720ba00..fb596a983204 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -809,9 +809,6 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl // Remove properties from style/row that aren't allowed in cells pAllCellProps->Erase( PROP_HEADER_ROW_COUNT ); pAllCellProps->Erase( PROP_TBL_HEADER ); - // Remove paragraph properties from style/row that paragraph style can overwrite - pAllCellProps->Erase( PROP_PARA_BOTTOM_MARGIN ); - pAllCellProps->Erase( PROP_PARA_LINE_SPACING ); // Then add the cell properties pAllCellProps->InsertProps(*aCellIterator); @@ -984,36 +981,6 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl return aRowProperties; } -// table style has got bigger precedence than docDefault style, -// but lower precedence than the paragraph styles and direct paragraph formatting -void DomainMapperTableHandler::ApplyParaProperty(css::beans::PropertyValues aTableProperties, PropertyIds eId) -{ - OUString sPropertyName = getPropertyName(eId); - auto pTableProp = std::find_if(aTableProperties.begin(), aTableProperties.end(), - [&](const beans::PropertyValue& rProp) { return rProp.Name == sPropertyName; }); - if (pTableProp != aTableProperties.end()) - { - uno::Any aValue = pTableProp->Value; - for (const auto& rParaProp : m_rDMapper_Impl.m_aParagraphsToEndTable) - { - // there is no direct paragraph formatting - if (!rParaProp.m_pPropertyMap->isSet(eId)) - { - OUString sParaStyleName; - rParaProp.m_rPropertySet->getPropertyValue("ParaStyleName") >>= sParaStyleName; - StyleSheetEntryPtr pEntry = m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName); - uno::Any aMargin = m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, pEntry, true, true); - uno::Any aMarginDocDefault = m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, nullptr, true, true); - // use table style only when 1) both values are empty (no docDefault and paragraph style definitions) or - // 2) both non-empty values are equal (docDefault paragraph properties are copied to the base paragraph style during import) - // TODO check the case, when two parent styles modify the docDefault and the last one set back the docDefault value - if (aMargin == aMarginDocDefault) - rParaProp.m_rPropertySet->setPropertyValue(sPropertyName, aValue); - } - } - } -} - void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart) { #ifdef DBG_UTIL @@ -1111,10 +1078,6 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab } } } - - // OOXML table style may container paragraph properties, apply these now. - ApplyParaProperty(aTableInfo.aTableProperties, PROP_PARA_BOTTOM_MARGIN); - ApplyParaProperty(aTableInfo.aTableProperties, PROP_PARA_LINE_SPACING); } } catch ( const lang::IllegalArgumentException & ) @@ -1192,7 +1155,6 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab m_aCellProperties.clear(); m_aRowProperties.clear(); m_bHadFootOrEndnote = false; - m_rDMapper_Impl.m_aParagraphsToEndTable.clear(); #ifdef DBG_UTIL TagLogger::getInstance().endElement(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx index 16d2a0cc37cc..41b6339506f9 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx @@ -91,8 +91,6 @@ public: */ void startTable(const TablePropertyMapPtr& pProps); - void ApplyParaProperty(css::beans::PropertyValues aTableProperties, PropertyIds eId); - /// Handle end of table. void endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart); /** diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 49f98383801b..2238984124b1 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1707,14 +1707,6 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con css::uno::Reference<css::beans::XPropertySet> xParaProps(xTextRange, uno::UNO_QUERY); - // table style has got bigger precedence than docDefault style - // collect these pending paragraph properties to process in endTable() - if (xParaProps && m_nTableDepth > 0) - { - TableParagraph aPending{pParaContext, xParaProps}; - m_aParagraphsToEndTable.push_back(aPending); - } - // tdf#118521 set paragraph top or bottom margin based on the paragraph style // if we already set the other margin with direct formatting if (xParaProps) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 1422b747035e..507150ec4e50 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -404,13 +404,6 @@ struct SymbolData { } }; -/// Information about a paragraph to be finished after a table end. -struct TableParagraph -{ - PropertyMapPtr m_pPropertyMap; - css::uno::Reference<css::beans::XPropertySet> m_rPropertySet; -}; - class DomainMapper; class DomainMapper_Impl final { @@ -1042,9 +1035,6 @@ public: bool m_bIsActualParagraphFramed; std::vector<css::uno::Any> aFramedRedlines; - /// Table paragraph properties may need style update based on table style - std::vector<TableParagraph> m_aParagraphsToEndTable; - private: void PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType); std::vector<css::uno::Reference< css::drawing::XShape > > m_vTextFramesForChaining ; |