summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-07-04 12:07:00 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-08 15:42:15 +0200
commit294194bb47ee287aa469829daed27c56083362e2 (patch)
treeb47d8c69bcc1e151c75f8de5cd61a11b9a74e583 /writerfilter
parent8fa6adb0273cbef499d1f3444eb46777efd40e3d (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> (cherry picked from commit f76b8d1cfe07e84744bc57a22e815d347f3f8f23)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx16
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx2
2 files changed, 12 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 5b7ad99166ea..f5de4506242c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1018,7 +1018,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 )
{
@@ -1040,8 +1040,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)
@@ -1164,9 +1164,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& )
{
@@ -1197,7 +1203,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 75508008d5e8..88aee8a3c1cb 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -338,7 +338,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 );
};