summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-07-04 12:07:00 +0300
committerJustin Luth <justin_luth@sil.org>2016-07-04 15:32:02 +0000
commitf76b8d1cfe07e84744bc57a22e815d347f3f8f23 (patch)
tree33a88c9dac05e98aa0bbc192e88a4e8adc70c12a
parent6db7f9e673a29d88ce3509a1edf4011ab5f3ba67 (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>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docxbin0 -> 35183 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx6
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx16
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx2
4 files changed, 18 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx b/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx
new file mode 100644
index 000000000000..c76b14dccfe0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf96750_landscapeFollow.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 6e45fc4ccb9b..f2bb607e6e7f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -965,6 +965,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf96750_landscapeFollow, "tdf96750_landscapeFollow.docx")
+{
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle, "IsLandscape"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 );
};