summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-11-23 21:55:54 +0100
committerLászló Németh <nemeth@numbertext.org>2018-11-27 14:44:59 +0100
commitf006b6339e20af6a3fbd60d97d21590d4ebf5021 (patch)
tree70f84adaaeef5dfe330d641794aa118761948bdb
parent7a581b977e7972ed893b49cbdbc6b69176f7c71b (diff)
tdf#112195 Writer: page background covers whole page
as in ODT implementation of Google Docs, and as in DOCX supporting basic requirements of creating digital and professional print media. This patch fixes DOCX import (tdf#121668) and it gives the required PDF export, too. In the case of solid color, color gradient, hatching, pattern and tiled bitmap (except stretched bitmap), this patch removes the obsolete white border around the text area, if the user modifies the page background. Note: likely the white border was good for home printing in former times, but now it forms only a serious barrier for most users to create de facto design standard whole page background formatting instead of its unacceptable poor man's version. Note 2: the OpenDocument standard refers XSL/CSS here, and browsers adapt background settings to the body margin area the same way, as Google Docs and fixed LibreOffice do. More information: tdf#112195 "(Whole-Page-Filling) - Allow page background to cover the whole page (reloaded)" tdf#33041 "Allow page background to cover the whole page, not only within page borders/margins" tdf#121668 "FILEOPEN DOCX Page Color created with Word disappears on the margins" ooo#9370 "Off-margin page background" (https://bz.apache.org/ooo/show_bug.cgi?id=9370) Change-Id: I7c6c96ceaf7102b38e3e5c1ed767db0ee63520ab Reviewed-on: https://gerrit.libreoffice.org/63914 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/qa/extras/layout/layout.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx10
2 files changed, 10 insertions, 2 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 99bf4ba29c76..304f14b40398 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2370,7 +2370,7 @@ void SwLayoutWriter::testTableExtrusion1()
xmlDocPtr pXmlDoc = dumper.dumpAndParse(*xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion", "right").toInt32();
- sal_Int32 nLeft = (nRight + getXPath(pXmlDoc, "(//rect)[1]", "right").toInt32()) / 2;
+ sal_Int32 nLeft = static_cast<sal_Int32>(nRight * 0.95);
// Expect table borders in right page margin.
const OString sXPath = "//polyline/point[@x>" + OString::number(nLeft) + " and @x<"
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 1adf941b8e46..e920046b1016 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6179,7 +6179,15 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
}
else
{
- ::lcl_CalcBorderRect( aRect, this, rAttrs, false, gProp);
+ if ( bPageFrame )
+ {
+ aRect = getFrameArea();
+ }
+ else
+ {
+ ::lcl_CalcBorderRect( aRect, this, rAttrs, false, gProp);
+ }
+
if ( (IsTextFrame() || IsTabFrame()) && GetPrev() )
{
if ( GetPrev()->GetAttrSet()->GetBackground() == GetAttrSet()->GetBackground() &&