Bugzilla – Attachment 139852 Details for
Bug 106541
FILEOPEN: Numbering from custom style based on Heading 1 is not considered in this DOC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
tdf106541.diff: patch that adds re-numbering to inheriting style
tdf106541.diff (text/plain), 3.49 KB, created by
Justin L
on 2018-02-13 04:53:43 UTC
(
hide
)
Description:
tdf106541.diff: patch that adds re-numbering to inheriting style
Filename:
MIME Type:
Creator:
Justin L
Created:
2018-02-13 04:53:43 UTC
Size:
3.49 KB
patch
obsolete
>diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx >index 068c085..8b6f5e5 100644 >--- a/writerfilter/source/dmapper/DomainMapper.cxx >+++ b/writerfilter/source/dmapper/DomainMapper.cxx >@@ -3413,6 +3413,7 @@ void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t > //the same for list tables > ref->resolve( *m_pImpl->GetListTable() ); > m_pImpl->GetListTable( )->CreateNumberingRules( ); >+ m_pImpl->GetStyleSheetTable()->AdjustStyleSheets(); > } > break; > case NS_ooxml::LN_THEMETABLE: >diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx >index b947fbd..622a423 100644 >--- a/writerfilter/source/dmapper/StyleSheetTable.cxx >+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx >@@ -881,6 +881,34 @@ uno::Sequence< OUString > PropValVector::getNames() > return comphelper::containerToSequence(aRet); > } > >+void StyleSheetTable::AdjustStyleSheets () >+{ >+ std::vector< StyleSheetEntryPtr >::iterator aIt = m_pImpl->m_aStyleSheetEntries.begin(); >+ while( aIt != m_pImpl->m_aStyleSheetEntries.end() ) >+ { >+ StyleSheetPropertyMap* pProps = dynamic_cast<StyleSheetPropertyMap*>((*aIt)->pProperties.get()); >+ const OUString sParent = (*aIt)->sBaseStyleIdentifier; >+SAL_WARN("DEBUG","isChap["<<(*aIt)->bIsChapterNumbering<<"] ListId["<<pProps->GetListId()<<"] Level["<<pProps->GetListLevel()<<"] NUM_STYLE_NAME["<<(*aIt)->pProperties->isSet(PROP_NUMBERING_STYLE_NAME)<<"] NUM_RULES["<<(*aIt)->pProperties->isSet(PROP_NUMBERING_RULES)<<"] OUTLINE["<<(*aIt)->pProperties->isSet(PROP_OUTLINE_LEVEL)<<"] StyleName["<<(*aIt)->sConvertedStyleName<<"] parent["<<sParent<<"]"); >+ // LO doesn't inherit numbering from ChapterNumbering styles, so copy to inheriting style >+ if ( !sParent.isEmpty() && pProps && pProps->GetListId() == -1 ) >+ { >+ const StyleSheetEntryPtr pParent = FindParentStyleSheet( sParent ); >+ if ( pParent && pParent->bIsChapterNumbering ) >+ { >+ const StyleSheetPropertyMap* pParentProps = dynamic_cast<const StyleSheetPropertyMap*>(pParent->pProperties.get()); >+ if ( pParentProps && pParentProps->GetListLevel() > 0 ) >+ { >+// pProps->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny(OUString("Outline")), /*bOverwrite=*/false ); >+// pProps->SetListId( pParentProps->GetListId() ); >+ if ( pProps->GetListLevel() == -1 ) >+ pProps->SetListLevel( pParentProps->GetListLevel() ); >+ } >+ } >+ } >+ ++aIt; >+ } >+} >+ > void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable ) > { > if (!m_pImpl->m_bIsNewDoc) >diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx >index 767a16a..647605d 100644 >--- a/writerfilter/source/dmapper/StyleSheetTable.hxx >+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx >@@ -89,6 +89,7 @@ public: > StyleSheetTable(DomainMapper& rDMapper, css::uno::Reference<css::text::XTextDocument> const& xTextDocument, bool bIsNewDoc); > virtual ~StyleSheetTable() override; > >+ void AdjustStyleSheets(); > void ApplyStyleSheets( const FontTablePtr& rFontTable ); > const StyleSheetEntryPtr FindStyleSheetByISTD(const OUString& sIndex); > const StyleSheetEntryPtr FindStyleSheetByConvertedStyleName(const OUString& rIndex);
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 106541
:
131891
|
131892
|
131893
| 139852 |
157878
|
157879
|
157880