Bugzilla – Attachment 143854 Details for
Bug 118947
FILEOPEN:DOCX: table style is overriding para-style font size
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
debug patch: attempted fix that doesn't work because properties not seen as ::SET
tdf118947_debug.patch (text/plain), 12.65 KB, created by
Justin L
on 2018-07-31 16:31:29 UTC
(
hide
)
Description:
debug patch: attempted fix that doesn't work because properties not seen as ::SET
Filename:
MIME Type:
Creator:
Justin L
Created:
2018-07-31 16:31:29 UTC
Size:
12.65 KB
patch
obsolete
>diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx >index c1c91b365bf0..cdae8b8bb62c 100644 >--- a/sw/source/core/unocore/unoobj.cxx >+++ b/sw/source/core/unocore/unoobj.cxx >@@ -1832,6 +1832,7 @@ void SwUnoCursorHelper::SetPropertyValues( > > const uno::Any &rValue = rPropertyValues[i].Value; > // this can set some attributes in nodes' mpAttrSet >+SAL_WARN("JCL","::SwUnoCursorHelper::SetPropertyValues["<<rPropertyValues[i].Name<<"] value["<<rValue<<"] PaM["<<rPaM<<"]"); > if (!SwUnoCursorHelper::SetCursorPropertyValue(*pEntry, rValue, rPaM, aItemSet)) > rPropSet.setPropertyValue(*pEntry, rValue, aItemSet); > >diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx >index c097d53481c0..f8e0ecc1357f 100644 >--- a/sw/source/core/unocore/unoparagraph.cxx >+++ b/sw/source/core/unocore/unoparagraph.cxx >@@ -413,6 +413,7 @@ void SwXParagraph::Impl::SetPropertyValues_Impl( > aValues[nProp].Name = pPropertyNames[nProp]; > aValues[nProp].Value = pValues[nProp]; > } >+SAL_WARN("JCL","XParagraph::setPropertyValues calls UnoCursorHelper"); > SwUnoCursorHelper::SetPropertyValues(aCursor, m_rPropSet, aValues); > } > >diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx >index e12c40acf458..afa786348fec 100644 >--- a/sw/source/core/unocore/unotbl.cxx >+++ b/sw/source/core/unocore/unotbl.cxx >@@ -1044,6 +1044,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV > else > { > auto pEntry(m_pPropSet->getPropertyMap().getByName(rPropertyName)); >+SAL_WARN("JCL","XCell::setPropertyValue["<<aValue<<"] for["<<rPropertyName<<"] tableProp?["<<(pEntry ? true : false)<<"]"); > if ( !pEntry ) > { > // not a table property: if it is a paragraph/character property, consider applying it to the underlying text. >@@ -1065,6 +1066,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV > const SfxItemSet& aSet = pNd->GetSwAttrSet(); > // isPARATR: replace DEFAULT_VALUE properties only > // isCHRATR: change the base/auto SwAttr property, but don't remove the DIRECT hints >+SAL_WARN("JCL","---bHasAttrSet["<<bHasAttrSet<<"] state["<<(int)aSet.GetItemState(pEntry->nWID, /*bSrchInParent=*/false)<<"]DEFAULT["<<int(SfxItemState::DEFAULT)<<"]DIRECT["<<int(SfxItemState::SET)<<"] text["<<pNd->GetText()<<"] PaM["<<aPaM<<"]"); > if ( !bHasAttrSet || SfxItemState::DEFAULT == aSet.GetItemState(pEntry->nWID, /*bSrchInParent=*/false) ) > SwUnoCursorHelper::SetPropertyValue(aPaM, rParaPropSet, rPropertyName, aValue, SetAttrMode::DONTREPLACE); > } >diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx >index b9970f6a6b42..e1da91ac8400 100644 >--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx >+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx >@@ -98,6 +98,7 @@ public: > IntVectorPtr const & getCurrentSpans( ); > IntVectorPtr const & getCurrentCellWidths( ); > >+ const OUString& getTableStyleName() const { return m_sTableStyleName; } > /// Turn the attributes collected so far in m_aTableLook into a property and clear the container. > void finishTableLook(); > const css::uno::Sequence<css::beans::PropertyValue> getCurrentTablePosition(); >diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx >index 3a71b395acb7..8d56e0aea172 100644 >--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx >+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx >@@ -694,7 +694,7 @@ const OUString DomainMapper_Impl::GetDefaultParaStyleName() > /*------------------------------------------------------------------------- > returns the value from the current paragraph style - if available > -----------------------------------------------------------------------*/ >-uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) >+uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId, bool bCheckDocDefaults) > { > StyleSheetEntryPtr pEntry; > if( m_bInStyleSheetImport ) >@@ -709,6 +709,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) > pEntry->pProperties->getProperty(eId); > if( aProperty ) > { >+SAL_WARN("JCL","::PropertyFromStyle["<<pEntry->sStyleIdentifierD<<"] has["<<getPropertyName(aProperty->first)<<"] val["<<aProperty->second<<"]"); > return aProperty->second; > } > } >@@ -723,11 +724,13 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) > pEntry = pNewEntry; > } > // not found in style, try the document's DocDefault properties >+ if ( bCheckDocDefaults ) > { > const PropertyMapPtr& pDefaultParaProps = GetStyleSheetTable()->GetDefaultParaProps(); > if ( pDefaultParaProps ) > { > boost::optional<PropertyMap::Property> aProperty = pDefaultParaProps->getProperty(eId); >+SAL_WARN_IF(aProperty,"JCL","::PropertyFromDefPara has["<<getPropertyName(aProperty->first)<<"] val["<<aProperty->second<<"]"); > if ( aProperty ) > return aProperty->second; > } >@@ -735,6 +738,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) > if ( pDefaultCharProps ) > { > boost::optional<PropertyMap::Property> aProperty = pDefaultCharProps->getProperty(eId); >+SAL_WARN_IF(aProperty,"JCL","::PropertyFromDefChar has["<<getPropertyName(aProperty->first)<<"] val["<<aProperty->second<<"]"); > if ( aProperty ) > return aProperty->second; > } >@@ -742,15 +746,18 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) > return uno::Any(); > } > >-uno::Any DomainMapper_Impl::GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext) >+uno::Any DomainMapper_Impl::GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext, const bool bCheckDocDefaults) > { > if ( rContext ) > { > boost::optional<PropertyMap::Property> aProperty = rContext->getProperty(eId); > if ( aProperty ) >+ { >+SAL_WARN("JCL","::GetAnyProperty itself has["<<getPropertyName(aProperty->first)<<"] val["<<aProperty->second<<"]"); > return aProperty->second; >+ } > } >- return GetPropertyFromStyleSheet(eId); >+ return GetPropertyFromStyleSheet(eId, bCheckDocDefaults); > } > > ListsManager::Pointer const & DomainMapper_Impl::GetListTable() >@@ -1230,6 +1237,28 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap ) > > if (xTextAppend.is() && pParaContext && hasTableManager() && !getTableManager().isIgnore()) > { >+ // Check each property that the tableStyle will assign and pre-empt if it is a style property >+ if ( getTableManager().isInCell() ) >+ { >+ OUString sTableStyleName = getTableManager().getTableStyleName(); >+ const StyleSheetEntryPtr pStyleSheet = GetStyleSheetTable()->FindStyleSheetByISTD( sTableStyleName ); >+SAL_WARN_IF(!sTableStyleName.isEmpty(),"JCL","::finishParagraph inCell with table style["<<sTableStyleName<<"] with properties["<<( pStyleSheet && pStyleSheet->pProperties )<<"]"); >+ const PropertyMapPtr& pMergedTableProps = pStyleSheet ? pStyleSheet->GetMergedInheritedProperties(GetStyleSheetTable(), -1) : nullptr; >+ if ( pMergedTableProps) >+ { >+ for ( auto rPropId : pMergedTableProps->GetPropertyIds() ) >+ { >+ uno::Any aMergedProp = GetPropertyFromStyleSheet( rPropId, /*bCheckDocDefaults=*/false ); >+ if ( aMergedProp != uno::Any() >+ && rPropId != PROP_CHAR_THEME_ORIGINAL_COLOR >+ ) >+ { >+ SAL_WARN("JCL","insert["<<getPropertyName(rPropId)<<"] val["<<aMergedProp<<"]. Existing?["<<pParaContext->isSet(rPropId)<<"]"); >+ pParaContext->Insert( rPropId, aMergedProp, /*bOverwrite=*/false); >+ } >+ } >+ } >+ } > try > { > /*the following combinations of previous and current frame settings can occur: >diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx >index 6b6755c6fbfd..8a548be00fcc 100644 >--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx >+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx >@@ -697,9 +697,9 @@ public: > const OUString GetCurrentParaStyleName(); > const OUString GetDefaultParaStyleName(); > >- css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId); >+ css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId, bool bCheckDocDefaults = true); > // get property first from the given context, or secondly from its stylesheet >- css::uno::Any GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext); >+ css::uno::Any GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext, const bool bCheckDocDefaults = true); > void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;} > bool IsStyleSheetImport()const { return m_bInStyleSheetImport;} > void SetAnyTableImport( bool bSet ) { m_bInAnyTableImport = bSet;} >diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx >index 46b846289219..ed939bef4ef2 100644 >--- a/writerfilter/source/dmapper/PropertyMap.cxx >+++ b/writerfilter/source/dmapper/PropertyMap.cxx >@@ -62,6 +62,17 @@ using namespace com::sun::star; > namespace writerfilter { > namespace dmapper { > >+std::vector< PropertyIds > PropertyMap::GetPropertyIds() >+{ >+ std::vector< PropertyIds > vPropIds; >+ for ( const auto& rPropPair : m_vMap ) >+ { >+SAL_WARN("JCL","::GetPropertyIds adding["<<rPropPair.first<<"]["<<getPropertyName(rPropPair.first)<<"]"); >+ vPropIds.push_back(rPropPair.first); >+ } >+ return vPropIds; >+} >+ > uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues( bool bCharGrabBag ) > { > using comphelper::makePropertyValue; >diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx >index f43bb38cad77..e2f44a8a0a38 100644 >--- a/writerfilter/source/dmapper/PropertyMap.hxx >+++ b/writerfilter/source/dmapper/PropertyMap.hxx >@@ -131,6 +131,7 @@ public: > > PropertyMap() {} > >+ std::vector< PropertyIds > GetPropertyIds(); > // Sequence: Grab Bags: The CHAR_GRAB_BAG has Name "CharInteropGrabBag" and the PARA_GRAB_BAG has Name "ParaInteropGrabBag" > // the contained properties are their Value. > css::uno::Sequence< css::beans::PropertyValue > GetPropertyValues( bool bCharGrabBag = true ); >diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx >index cb188909461a..3cd29cf4fac4 100644 >--- a/writerfilter/source/dmapper/StyleSheetTable.cxx >+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx >@@ -161,7 +161,7 @@ void StyleSheetEntry::AppendInteropGrabBag(const beans::PropertyValue& rValue) > m_aInteropGrabBag.push_back(rValue); > } > >-PropertyMapPtr StyleSheetEntry::GetMergedInheritedProperties(const StyleSheetTablePtr& pStyleSheetTable) >+PropertyMapPtr StyleSheetEntry::GetMergedInheritedProperties(const StyleSheetTablePtr& pStyleSheetTable, sal_Int32 nMask) > { > PropertyMapPtr pRet; > if ( pStyleSheetTable && !sBaseStyleIdentifier.isEmpty() && sBaseStyleIdentifier != sStyleIdentifierD ) >@@ -176,6 +176,12 @@ PropertyMapPtr StyleSheetEntry::GetMergedInheritedProperties(const StyleSheetTab > > pRet->InsertProps(pProperties); > >+ if ( nMask && nStyleTypeCode == STYLE_TYPE_TABLE ) >+ { >+SAL_WARN("JCL","Adding table style properties for mask["<<nMask<<"]"); >+ pRet->InsertProps( (static_cast<TableStyleSheetEntry *>(this))->GetProperties(nMask) ); >+ } >+ > return pRet; > } > >diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx >index 686779acbd71..e1f8d88f86df 100644 >--- a/writerfilter/source/dmapper/StyleSheetTable.hxx >+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx >@@ -74,7 +74,7 @@ public: > css::beans::PropertyValues GetInteropGrabBagSeq(); ///< Used for existing styles, just a list of properties. > > // Get all properties, merged with the all of the parent's properties >- PropertyMapPtr GetMergedInheritedProperties(const StyleSheetTablePtr& pStyleSheetTable); >+ PropertyMapPtr GetMergedInheritedProperties(const StyleSheetTablePtr& pStyleSheetTable, const sal_Int32 nMask = 0 ); > > StyleSheetEntry(); > virtual ~StyleSheetEntry() override;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 118947
:
143776
|
143800
| 143854