summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docxbin0 -> 12389 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx6
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx4
3 files changed, 8 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx b/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx
new file mode 100644
index 000000000000..6acb9f383de1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf105490_negativeMargins.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 6f31ba07911f..0ffd692e4f1a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -67,6 +67,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPad
CPPUNIT_ASSERT_EQUAL( 3, getPages() );
}
+DECLARE_OOXMLEXPORT_TEST(tdf105490_negativeMargins, "tdf105490_negativeMargins.docx")
+{
+ // negative margins should change to minimal margins, not default margins.
+ CPPUNIT_ASSERT_EQUAL( 1, getPages() );
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx")
{
CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 3 );
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 7cba5a1a3a8a..354be3488b04 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1005,8 +1005,8 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
}
//now set the top/bottom margin for the follow page style
- Insert(PROP_TOP_MARGIN, uno::makeAny( nTopMargin ));
- Insert(PROP_BOTTOM_MARGIN, uno::makeAny( nBottomMargin ));
+ Insert(PROP_TOP_MARGIN, uno::makeAny( nTopMargin > 0 ? nTopMargin : 0 ));
+ Insert(PROP_BOTTOM_MARGIN, uno::makeAny( nBottomMargin > 0 ? nBottomMargin : 0 ));
}
uno::Reference<beans::XPropertySet> lcl_GetRangeProperties(bool bIsFirstSection,