diff options
author | Justin Luth <justin_luth@sil.org> | 2016-07-04 12:07:00 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2016-07-04 15:32:02 +0000 |
commit | f76b8d1cfe07e84744bc57a22e815d347f3f8f23 (patch) | |
tree | 33a88c9dac05e98aa0bbc192e88a4e8adc70c12a /writerfilter | |
parent | 6db7f9e673a29d88ce3509a1edf4011ab5f3ba67 (diff) |
tdf#96750 docx - ensure all styles are initialized
Change-Id: I50467cb2798ef81dd89006768c66aa7e93cb411c
Reviewed-on: https://gerrit.libreoffice.org/26892
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.hxx | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 37f9646fe663..efc8343b09c6 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1011,7 +1011,7 @@ uno::Reference<beans::XPropertySet> lcl_GetRangeProperties(bool bIsFirstSection, return xRangeProperties; } -void SectionPropertyMap::HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl) +void SectionPropertyMap::HandleMarginsHeaderFooter(bool bFirstPage, DomainMapper_Impl& rDM_Impl) { if( m_nDzaGutter > 0 ) { @@ -1030,8 +1030,8 @@ void SectionPropertyMap::HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl) /*** if headers/footers are available then the top/bottom margins of the header/footer are copied to the top/bottom margin of the page */ - CopyLastHeaderFooter( false, rDM_Impl ); - PrepareHeaderFooterProperties( false ); + CopyLastHeaderFooter( bFirstPage, rDM_Impl ); + PrepareHeaderFooterProperties( bFirstPage ); } bool SectionPropertyMap::FloatingTableConversion(FloatingTableInfo& rInfo) @@ -1152,9 +1152,15 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) xRangeProperties->setPropertyValue(getPropertyName(PROP_PAGE_DESC_NAME), uno::makeAny(aName)); uno::Reference<beans::XPropertySet> xPageStyle (rDM_Impl.GetPageStyles()->getByName(aName), uno::UNO_QUERY_THROW); - HandleMarginsHeaderFooter(rDM_Impl); + HandleMarginsHeaderFooter(false, rDM_Impl); + if( m_bTitlePage ) + HandleMarginsHeaderFooter(true, rDM_Impl); if (rDM_Impl.IsNewDoc()) + { ApplyProperties_(xPageStyle); + if( m_bTitlePage && m_aFollowPageStyle.is() ) + ApplyProperties_(m_aFollowPageStyle); + } } catch( const uno::Exception& ) { @@ -1185,7 +1191,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) //get the properties and create appropriate page styles uno::Reference< beans::XPropertySet > xFollowPageStyle = GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false ); - HandleMarginsHeaderFooter(rDM_Impl); + HandleMarginsHeaderFooter(/*bFirstPage=*/false, rDM_Impl); const OUString sTrayIndex = getPropertyName( PROP_PRINTER_PAPER_TRAY_INDEX ); if( m_nPaperBin >= 0 ) diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 5daf4e8c9531..f6796a6ef589 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -331,7 +331,7 @@ public: void CloseSectionGroup( DomainMapper_Impl& rDM_Impl ); /// Handling of margins, header and footer for any kind of sections breaks. - void HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl); + void HandleMarginsHeaderFooter(bool bFirstPage, DomainMapper_Impl& rDM_Impl); void ClearHeaderFooterLinkToPrevious( bool bHeader, PageType eType ); }; |