Bugzilla – Attachment 141724 Details for
Bug 117297
FILEOPEN: DOCX: table style properties are being ignored
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
117297_debugging.diff: debugging patch with fix ideas. Use with SW_DEBUG_WRITERFILTER=1
117297_debugging.diff (text/plain), 11.53 KB, created by
Justin L
on 2018-04-27 19:01:49 UTC
(
hide
)
Description:
117297_debugging.diff: debugging patch with fix ideas. Use with SW_DEBUG_WRITERFILTER=1
Filename:
MIME Type:
Creator:
Justin L
Created:
2018-04-27 19:01:49 UTC
Size:
11.53 KB
patch
obsolete
>diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx >index fd22a4f..ae08af0 100644 >--- a/svl/source/items/itemprop.cxx >+++ b/svl/source/items/itemprop.cxx >@@ -275,6 +275,7 @@ PropertyState SfxItemPropertySet::getPropertyState(const OUString& rName, cons > > // Get item state > SfxItemState eState = rSet.GetItemState(nWhich, false); >+SAL_WARN("JCL","::getProperty["<<rName<<"]State["<<(int)eState<<"]SET["<<(int)SfxItemState::SET<<"]DEF["<<(int)SfxItemState::DEFAULT<<"] Wid["<<nWhich<<"]"); > // Return item value as UnoAny > if(eState == SfxItemState::DEFAULT) > eRet = PropertyState_DEFAULT_VALUE; >diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx >index 5505597b..a391a52 100644 >--- a/sw/source/core/unocore/unoobj.cxx >+++ b/sw/source/core/unocore/unoobj.cxx >@@ -1943,9 +1943,12 @@ SwUnoCursorHelper::GetPropertyStates( > if (!pSetParent) > { > pSetParent = pSet->Clone( false ); >+SAL_WARN("JCL","DIRECT_VALUE["<<pNames[i]<<"]["<<pEntry->nWID<<"], but try to find if it is inherited. pSet->Count["<<pSet->Count()<<"]"); >+SAL_WARN_IF(pSetParent,"JCL","---count1["<<pSetParent->Count()<<"]["<<pSet->Count()<<"]"); > // #i63870# > SwUnoCursorHelper::GetCursorAttr( > rPaM, *pSetParent, true, false ); >+SAL_WARN_IF(pSetParent,"JCL","---count2["<<pSetParent->Count()<<"]["<<pSet->Count()<<"]"); > } > > pStates[i] = ( pSetParent->Count() ) >diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx >index 6d01370..ad38e70 100644 >--- a/sw/source/core/unocore/unotext.cxx >+++ b/sw/source/core/unocore/unotext.cxx >@@ -29,6 +29,7 @@ > #include <com/sun/star/text/TableColumnSeparator.hpp> > #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> > #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> >+#include <com/sun/star/style/LineSpacing.hpp> > > #include <vcl/svapp.hxx> > #include <comphelper/profilezone.hxx> >@@ -2050,12 +2051,42 @@ lcl_ApplyCellProperties( > try > { > const beans::PropertyState state = xCellTextPropState->getPropertyState(rName); >+ const uno::Reference< beans::XPropertySet > xCellTextProp(xCellCurs, uno::UNO_QUERY); >+ style::LineSpacing aSpacing; >+SAL_WARN("JCL","Exception adding ["<<rName<<"] val["<<rValue<<"] state["<<(int)state<<"]DIRECT["<<(int)beans::PropertyState_DIRECT_VALUE<<"]DEFAULT["<<(int)beans::PropertyState_DEFAULT_VALUE<<"]AMBIG["<<(int)beans::PropertyState_AMBIGUOUS_VALUE<<"] current value["<<xCellTextProp->getPropertyValue(rName)<<"] text["<<xCellText->getString()<<"]"); >+ if ( rValue >>= aSpacing ) >+ { >+SAL_WARN("JCL","--- REPLACE WITH spacing Height["<<aSpacing.Height<<"] mode["<<(int)aSpacing.Mode<<"]"); >+ } >+ if ( xCellTextProp->getPropertyValue(rName) >>= aSpacing ) >+ { >+SAL_WARN("JCL","--- CELL PROPERTY spacing Height["<<aSpacing.Height<<"] mode["<<(int)aSpacing.Mode<<"]"); >+ } > if (state == beans::PropertyState_DEFAULT_VALUE) > { > const uno::Reference< beans::XPropertySet > > xCellTextProps(xCellCurs, uno::UNO_QUERY); > xCellTextProps->setPropertyValue(rName, rValue); > } >+ else if ( state == beans::PropertyState_AMBIGUOUS_VALUE ) >+ { >+ uno::Reference<container::XEnumerationAccess> xEnumerationAccess(xCell, uno::UNO_QUERY); >+ uno::Reference<container::XEnumeration> xEnumeration = xEnumerationAccess->createEnumeration(); >+ while (xEnumeration->hasMoreElements()) >+ { >+ uno::Reference<beans::XPropertySet> xParagraph(xEnumeration->nextElement(), uno::UNO_QUERY); >+ uno::Reference<beans::XPropertyState> 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. >+SAL_WARN_IF(xPropertyState.is(),"JCL","AMBIGUOUS["<<rName<<"] val["<<rValue<<"] state["<<(int)xPropertyState->getPropertyState(rName)<<"]"); >+ if ( xParagraph->getPropertyValue(rName) >>= aSpacing ) >+ { >+ SAL_WARN("JCL","---spacing Height["<<aSpacing.Height<<"] mode["<<(int)aSpacing.Mode<<"]"); >+ } >+ if (xPropertyState.is() && xPropertyState->getPropertyState(rName) == beans::PropertyState_DEFAULT_VALUE) >+ xParagraph->setPropertyValue(rName, rValue); >+ } >+ } > } > catch (const uno::Exception& e) > { >diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx >index c600e00..dd2e7e9 100644 >--- a/writerfilter/source/dmapper/DomainMapper.cxx >+++ b/writerfilter/source/dmapper/DomainMapper.cxx >@@ -457,6 +457,8 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) > // direct formatting is applied for table cell data > TablePropertyMapPtr pTblCellWithDirectFormatting(new TablePropertyMap); > pTblCellWithDirectFormatting->Insert(PROP_PARA_LINE_SPACING, uno::makeAny( aSpacing ), false); >+SAL_WARN("JCL","direct formatting. H["<<aSpacing.Height<<"]M["<<(int)aSpacing.Mode<<"] TopContext["<<pTopContext<<"] type["<<(int)m_pImpl->GetTopContextType()<<"]CHAR["<<(int)CONTEXT_CHARACTER<<"]PARA["<<(int)CONTEXT_PARAGRAPH<<"]SECT["<<(int)CONTEXT_SECTION<<"]STYLE["<<CONTEXT_STYLESHEET<<"]LIST["<<CONTEXT_LIST<<"]"); >+// if ( !pTopContext ) > m_pImpl->getTableManager().cellProps(pTblCellWithDirectFormatting); > } > } >@@ -498,6 +500,8 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) > // after lineRule as well. > TablePropertyMapPtr pTblCellWithDirectFormatting(new TablePropertyMap); > pTblCellWithDirectFormatting->Insert(PROP_PARA_LINE_SPACING, uno::makeAny(aSpacing), false); >+SAL_WARN("JCL","#2direct formatting. H["<<aSpacing.Height<<"]M["<<(int)aSpacing.Mode<<"] TopContext["<<pTopContext<<"] type["<<(int)m_pImpl->GetTopContextType()<<"]CHAR["<<(int)CONTEXT_CHARACTER<<"]PARA["<<(int)CONTEXT_PARAGRAPH<<"]SECT["<<(int)CONTEXT_SECTION<<"]STYLE["<<CONTEXT_STYLESHEET<<"]LIST["<<CONTEXT_LIST<<"]"); >+ // if ( !pTopContext ) > m_pImpl->getTableManager().cellProps(pTblCellWithDirectFormatting); > } > } >diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >index 2a701dc..85ea516 100644 >--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >@@ -443,6 +443,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo > } > > // Set the table default attributes for the cells >+SAL_WARN("JCL","calling InsertProps - dropping this kills the tableGrid properties"); >+m_aTableProperties->printProperties(); > rInfo.pTableDefaults->InsertProps(m_aTableProperties); > > #ifdef DEBUG_WRITERFILTER >@@ -698,6 +700,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl > //aCellIterator points to a PropertyMapPtr; > if( *aCellIterator ) > { >+SAL_WARN("JCL","---Adding table default properties"); >+if ( rInfo.pTableDefaults) rInfo.pTableDefaults->printProperties(); > pAllCellProps->InsertProps(rInfo.pTableDefaults); > > sal_Int32 nCellStyleMask = 0; >@@ -786,6 +790,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl > pAllCellProps->Erase( PROP_TBL_HEADER ); > > // Then add the cell properties >+SAL_WARN("JCL","---Adding cell properties"); >+(*aCellIterator)->printProperties(); > pAllCellProps->InsertProps(*aCellIterator); > std::swap(*(*aCellIterator), *pAllCellProps ); > >@@ -845,6 +851,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl > #ifdef DEBUG_WRITERFILTER > TagLogger::getInstance().endElement(); > #endif >+SAL_WARN("JCL","Final CellIterator properties"); >+(*aCellIterator)->printProperties(); > } > ++nCell; > ++aCellIterator; >@@ -1195,6 +1203,7 @@ void DomainMapperTableHandler::startCell(const css::uno::Reference< css::text::X > TagLogger::getInstance().startElement("table.cell.start"); > TagLogger::getInstance().chars(XTextRangeToString(start)); > TagLogger::getInstance().endElement(); >+SAL_WARN_IF(pProps.get(),"JCL","["<<nRow<<"]::startCell with these properties["<<pProps<<"] ?INSTEAD? of the table defaults?..."); > if (pProps.get()) > pProps->printProperties(); > #endif >diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx >index ca2042b..68c4cd9 100644 >--- a/writerfilter/source/dmapper/PropertyMap.cxx >+++ b/writerfilter/source/dmapper/PropertyMap.cxx >@@ -34,6 +34,7 @@ > #include <com/sun/star/container/XEnumerationAccess.hpp> > #include <com/sun/star/container/XNameContainer.hpp> > #include <com/sun/star/style/BreakType.hpp> >+#include <com/sun/star/style/LineSpacing.hpp> > #include <com/sun/star/style/PageStyleLayout.hpp> > #include <com/sun/star/style/XStyle.hpp> > #include <com/sun/star/table/ShadowFormat.hpp> >@@ -343,6 +344,11 @@ void PropertyMap::printProperties() > > table::BorderLine2 aLine; > sal_Int32 nColor; >+ style::LineSpacing aSpacing; >+ if ( rPropPair.second.getValue() >>= aSpacing ) >+ { >+ SAL_WARN("JCL","["<<m_vMap.size()<<"]::printProperties -------- ["<<getPropertyName( rPropPair.first )<<"] Height["<<aSpacing.Height<<"] mode["<<(int)aSpacing.Mode<<"]"); >+ } > if ( rPropPair.second.getValue() >>= aLine ) > { > TagLogger::getInstance().startElement( "borderline" ); >diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx >index a3614b9..20240d0 100644 >--- a/writerfilter/source/dmapper/TableData.hxx >+++ b/writerfilter/source/dmapper/TableData.hxx >@@ -74,6 +74,8 @@ public: > */ > void insertProperties(TablePropertyMapPtr pProps) > { >+SAL_WARN("JCL","::insertProperties["<<pProps<<"]? into a cell"); >+if ( pProps ) pProps->printProperties(); > if( mpProps.get() ) > mpProps->InsertProps(pProps); > else >@@ -220,6 +222,7 @@ public: > */ > TablePropertyMapPtr const & getCellProperties(unsigned int i) const > { >+SAL_WARN("JCL","getCell["<<i<<"]Properties"); > return mCells[i]->getProperties(); > } > >diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx >index cd5c9f9..1ea0074 100644 >--- a/writerfilter/source/dmapper/TableManager.hxx >+++ b/writerfilter/source/dmapper/TableManager.hxx >@@ -112,6 +112,8 @@ class TableManager > > void setCellProps(TablePropertyMapPtr pProps) > { >+SAL_WARN("JCL","::setCellProps ["<<pProps<<"]"); >+if ( pProps) pProps->printProperties(); > mpCellProps = pProps; > } >
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 117297
:
141721
|
141722
| 141724 |
141780