diff options
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/data/pagebreak-source.fodt | 12 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/data/pagebreak-target.fodt | 12 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 22 |
3 files changed, 37 insertions, 9 deletions
diff --git a/sw/qa/extras/uiwriter/data/pagebreak-source.fodt b/sw/qa/extras/uiwriter/data/pagebreak-source.fodt index e09c1b447cfd..cb72fea62a85 100644 --- a/sw/qa/extras/uiwriter/data/pagebreak-source.fodt +++ b/sw/qa/extras/uiwriter/data/pagebreak-source.fodt @@ -85,7 +85,7 @@ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"> <style:text-properties/> </style:style> - <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="Standard"> + <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="WithMargin"> <style:paragraph-properties style:page-number="auto"/> </style:style> <style:style style:name="Sect1" style:family="section"> @@ -101,9 +101,17 @@ <style:header-style/> <style:footer-style/> </style:page-layout> + <style:page-layout style:name="pm2"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="10cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> </office:automatic-styles> <office:master-styles> <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + <style:master-page style:name="WithMargin" style:page-layout-name="pm2"/> </office:master-styles> <office:body> <office:text> @@ -120,4 +128,4 @@ </text:section> </office:text> </office:body> -</office:document>
\ No newline at end of file +</office:document> diff --git a/sw/qa/extras/uiwriter/data/pagebreak-target.fodt b/sw/qa/extras/uiwriter/data/pagebreak-target.fodt index f059e33f1514..1219cdd95e25 100644 --- a/sw/qa/extras/uiwriter/data/pagebreak-target.fodt +++ b/sw/qa/extras/uiwriter/data/pagebreak-target.fodt @@ -86,7 +86,7 @@ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> </office:styles> <office:automatic-styles> - <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="Standard"> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="WithMargin"> <style:paragraph-properties style:page-number="auto"/> </style:style> <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame"> @@ -104,9 +104,17 @@ <style:header-style/> <style:footer-style/> </style:page-layout> + <style:page-layout style:name="pm2"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="10cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> </office:automatic-styles> <office:master-styles> <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + <style:master-page style:name="WithMargin" style:page-layout-name="pm2"/> </office:master-styles> <office:body> <office:text> @@ -126,4 +134,4 @@ </text:section> </office:text> </office:body> -</office:document>
\ No newline at end of file +</office:document> diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 1fd0ac7cf713..b6913d4f6b53 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -383,6 +383,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) SwDoc* pDoc = getSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); + pWrtShell->SelAll(); dispatchCommand(mxComponent, ".uno:Copy", {}); @@ -395,36 +397,46 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(getParagraph(1), "PageDescName")); + CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty<OUString>(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); + // page style WithMargin is used + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); dispatchCommand(mxComponent, ".uno:Paste", {}); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(getParagraph(1), "PageDescName")); + CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty<OUString>(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetSections().size()); CPPUNIT_ASSERT_EQUAL(OUString("SourceSection"), pWrtShell->GetCurrSection()->GetSectionName()); // the problem was that there was a page break now CPPUNIT_ASSERT_EQUAL(1, getPages()); + // page style WithMargin is used + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Undo(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(getParagraph(1), "PageDescName")); + CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty<OUString>(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); + // page style WithMargin is used + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Redo(); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(getParagraph(1), "PageDescName")); + CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty<OUString>(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetSections().size()); CPPUNIT_ASSERT_EQUAL(OUString("SourceSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); + // page style WithMargin is used + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Undo(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty<OUString>(getParagraph(1), "PageDescName")); + CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty<OUString>(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); + // page style WithMargin is used + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testBookmarkCopy) |