writerfilter/source/dmapper/DomainMapper.cxx | 4 ++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +++++------ writerfilter/source/dmapper/DomainMapper_Impl.hxx | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-)
New commits: commit 36839898fadddee155fb73e70d16e1eea4f5f9f0 Author: Justin Luth <justin_l...@sil.org> Date: Wed May 9 18:43:54 2018 +0300 writerfilter NFC: save ConvertedParaStyleName, not WW8Name and rename m_sCurrentParaStyleId -> m_sCurrentParaStyleName This is prep work for tdf#117504, where the value saved in m_sCurrentParaStyleId is not accurate. Since the actual value saved inside the paragraph properties is the ConvertStyleName(), lets use the LO-version of the style name, so that FindStyleSheetByConvertedStyleName() can be used for either the paragraph's PropertyValue or m_pImpl->m_sCurrentParaStyleName. Change-Id: I8aed80094417ea91f2515e666dc05ecbb021a128 Reviewed-on: https://gerrit.libreoffice.org/54084 Reviewed-by: Justin Luth <justin_l...@sil.org> Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 41e35e0bad04..cbcce6bda2ef 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2115,9 +2115,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) break; case NS_ooxml::LN_CT_PPrBase_pStyle: { - m_pImpl->SetCurrentParaStyleId( sStringValue ); StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable(); const OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true ); + m_pImpl->SetCurrentParaStyleName( sConvertedStyleName ); if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION) { m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, uno::makeAny( sConvertedStyleName )); @@ -2947,7 +2947,7 @@ void DomainMapper::lcl_startParagraphGroup() if (!m_pImpl->IsInShape()) { m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, uno::makeAny( OUString("Standard") ) ); //ConvertedStyleName - m_pImpl->SetCurrentParaStyleId("Normal"); //WW8 name + m_pImpl->SetCurrentParaStyleName("Standard"); } if (m_pImpl->isBreakDeferred(PAGE_BREAK)) m_pImpl->GetTopContext()->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_PAGE_BEFORE)); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 99c520c30aa5..3cd7492538a5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -206,7 +206,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_sCurrentPermId(0), m_pLastSectionContext( ), m_pLastCharacterContext(), - m_sCurrentParaStyleId(), + m_sCurrentParaStyleName(), m_bInStyleSheetImport( false ), m_bInAnyTableImport( false ), m_bInHeaderFooterImport( false ), @@ -657,8 +657,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) if( m_bInStyleSheetImport ) pEntry = GetStyleSheetTable()->FindParentStyleSheet(OUString()); else - pEntry = - GetStyleSheetTable()->FindStyleSheetByISTD(GetCurrentParaStyleId()); + pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(GetCurrentParaStyleName()); while(pEntry.get( ) ) { //is there a tab stop set? @@ -1114,7 +1113,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap ) //does not specify the numbering if( pParaContext && !pParaContext->isSet(PROP_NUMBERING_RULES) ) { - const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByISTD( GetCurrentParaStyleId() ); + const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( GetCurrentParaStyleName() ); OSL_ENSURE( pEntry.get(), "no style sheet found" ); const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : nullptr); @@ -5497,10 +5496,10 @@ uno::Reference<container::XIndexAccess> DomainMapper_Impl::GetCurrentNumberingRu uno::Reference<container::XIndexAccess> xRet; try { - OUString aStyle = GetCurrentParaStyleId(); + OUString aStyle = GetCurrentParaStyleName(); if (aStyle.isEmpty()) return xRet; - const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByISTD(aStyle); + const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(aStyle); if (!pEntry) return xRet; const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry->pProperties.get()); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 7546984165ac..482300c13a4c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -474,7 +474,7 @@ private: PropertyMapPtr m_pLastCharacterContext; ::std::vector<DeletableTabStop> m_aCurrentTabStops; - OUString m_sCurrentParaStyleId; + OUString m_sCurrentParaStyleName; bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos bool m_bInHeaderFooterImport; @@ -692,8 +692,8 @@ public: void IncorporateTabStop( const DeletableTabStop &aTabStop ); css::uno::Sequence<css::style::TabStop> GetCurrentTabStopAndClear(); - void SetCurrentParaStyleId(const OUString& sStringValue) {m_sCurrentParaStyleId = sStringValue;} - const OUString& GetCurrentParaStyleId() const {return m_sCurrentParaStyleId;} + void SetCurrentParaStyleName(const OUString& sStringValue) {m_sCurrentParaStyleName = sStringValue;} + const OUString& GetCurrentParaStyleName() const {return m_sCurrentParaStyleName;} css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId); void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;} _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits