Hi list,

Attached is a patch that improves Writer page as described in
fdo#31251[1]. After a quick poll on various LibreOffice user it appears
that a halo on the four borders is confusing so we have a smooth shadow
on two borders.

There are still some little glitches and book mode is not fully handled
but I'd rather post the patch before Murphy's Law crashes my disk or
burn my house and to get comments before going .

If you want to do an incremental build, you'll have to build and
deliver sw and then run packimages (cd packimages && build), if all is
fine images should end up in images.zip.

Sébastien

[1] https://bugs.freedesktop.org/show_bug.cgi?id=31251
From 56bceaec5cef9593f23219b6d257e8073ec34426 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoff...@orniz.org>
Date: Sun, 27 Feb 2011 18:06:13 +0100
Subject: [PATCH] Added shadow images.

---
 default_images/sw/res/page-bottom-shadow.png      |  Bin 0 -> 193 bytes
 default_images/sw/res/page-bottomleft-shadow.png  |  Bin 0 -> 285 bytes
 default_images/sw/res/page-bottomright-shadow.png |  Bin 0 -> 289 bytes
 default_images/sw/res/page-right-shadow.png       |  Bin 0 -> 191 bytes
 default_images/sw/res/page-topright-shadow.png    |  Bin 0 -> 306 bytes
 5 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 default_images/sw/res/page-bottom-shadow.png
 create mode 100644 default_images/sw/res/page-bottomleft-shadow.png
 create mode 100644 default_images/sw/res/page-bottomright-shadow.png
 create mode 100644 default_images/sw/res/page-right-shadow.png
 create mode 100644 default_images/sw/res/page-topright-shadow.png

diff --git a/default_images/sw/res/page-bottom-shadow.png b/default_images/sw/res/page-bottom-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe881a97cc14556d3da978024cbff78912d9c1f6
GIT binary patch
literal 193
zcmeAS@N?(olHy`uVBq!ia0vp^j6lrA!3HEtFPV6O1d4;)ofy`glX(f`uqAoByD<C*
z!3BGlPX>x`7I;J!Gca%qgD@k*tT_@uLG}_)Usv|qOwv5Ef>(_TEPz6iC9V-A&iT2y
zsd*&~&PAz-C8;S2<(VZJ3hti10pX2&;y^_*o-U3d9M_X~)cpNZug1pK_S}buhv)o*
dBgJ!)7y`C&FFSDR?joQ%22WQ%mvv4FO#nZmHPrwB

literal 0
HcmV?d00001

diff --git a/default_images/sw/res/page-bottomleft-shadow.png b/default_images/sw/res/page-bottomleft-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..9e4a72b1acacb82f99f323cdaf415f39f6cf4774
GIT binary patch
literal 285
zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VN3FMcVYMs
zf(!O8p9~b?EbxddW?<kJ24O~qS#u<Sg6t)pzOL-InWTB7S!Zr$J`5C^>*?YcB5}F&
z{OP<y4m=JQjSWm3<V6A%C;tCGUuV+^^^)+FS^@J~U1bCtvtFK(`hDu#l3gpk)-)Ma
zRPYxZjMtxEEwkZZ`Z2-f8t<Cp*BD+qR^E3^??sE|Jf~ZV&olCpkMehMFTOIbsN<G_
z<K2+_h)2xad)Uuw7<d@Q-3^&*a-3)VjFP0X?)4}B-uE+f@_MIqu7b0x{^*3_{9LzP
ZOgjP$&+h*;pA+a%22WQ%mvv4FO#mOpX<PsR

literal 0
HcmV?d00001

diff --git a/default_images/sw/res/page-bottomright-shadow.png b/default_images/sw/res/page-bottomright-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..ff00470bc5f24ee6ede99cbc892430cb9cbea8c9
GIT binary patch
literal 289
zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VN3FMcVYMs
zf(!O8p9~b?EbxddW?<kJ24O~qS#u<Sg6t)pzOL-InWTB7v}5Y*eSty?JzX3_BreBZ
zu+BSdAkgyAzfpg&Q|r6>4iU{7=H=cgo*Q-C`$go~+QcL#DEz-Gx#^e1{`WtQJWbsz
zbN=3@p9h(_!*VXhm3Uoe4)2*^;J*K2&;iqcb~`@dyrnNiUYm*^_6xU_Zfj6p7G7{H
z!dAJY^HOrot8e$KxGhpIiQa!PYuDR_4b^fb{`>5L_b=)CI&J+<_3Hs@vIlMN8zg7F
dDl1%J-z5}XI&;H;3ZP>dJYD@<);T3K0RYisYEb|H

literal 0
HcmV?d00001

diff --git a/default_images/sw/res/page-right-shadow.png b/default_images/sw/res/page-right-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..7b8870ed042f72bb7da4e0c6abcc1930b778cb0f
GIT binary patch
literal 191
zcmeAS@N?(olHy`uVBq!ia0vp^AT}ch8<2ed)xHkIDGqXXVpw-h<|UBBmgMd3!tfsi
z7wla=87RV8;1OBOz`!jG!i)^F=12eq*-JcqUD<ClN%P2<%c&k|0SZZ$xJHyX=jZ08
z=9Mrw7o{eaq^2m8XO?6rxO@5rgg5eu0~JYmx;Tb#Tu<Ip^Y>3Z8(Z6R9v+_a3w~Id
a*)i}JaZe36ll2Cuiow&>&t;ucLK6Tx&@?;%

literal 0
HcmV?d00001

diff --git a/default_images/sw/res/page-topright-shadow.png b/default_images/sw/res/page-topright-shadow.png
new file mode 100644
index 0000000000000000000000000000000000000000..2603731527826eb1143d6191c4e27950b0d67d81
GIT binary patch
literal 306
zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VN3FMcVYMs
zf(!O8p9~b?EbxddW?<kJ24O~qS#u<Sg6t)pzOL-InWTB7g>%!lO#%vS@^o<wk+>Xt
z-Zt-0fPm}6^L&O++yfUWC~aou;`+9qLtJl9rv|G4M_+TWfwJPflG*0&<>y3luV0Zc
ze9-c^YOCa(Jwm5FWFxo4elFtnOR{(*&Tf-@yUe$B{nxBwzk<%<bw~L`-z|D$9DY6g
z=K-1b6^FC4QXa=|$#qvdx-`?FKl!$4I}7`pKv9v0)m+crZJrp~raipEzM*@+<g%MT
vWH0zLT=o#H`d)eF^3|m?FS#yu`N)6J*I4l5y#Ka9*E4v!`njxgN@xNA0Vi<z

literal 0
HcmV?d00001

-- 
1.7.2.3

From bbcce6e250f5bafa61aac8ed099d47bc99a4f6cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoff...@orniz.org>
Date: Sun, 27 Feb 2011 17:23:48 +0100
Subject: [PATCH 1/2] FDO#31251 - Add resources files for page shadow

---
 sw/inc/rcid.hrc                   |    5 ++++
 sw/source/core/inc/pagefrm.hrc    |   49 +++++++++++++++++++++++++++++++++++++
 sw/source/core/layout/makefile.mk |    4 +++
 sw/source/core/layout/pagefrm.src |   27 ++++++++++++++++++++
 sw/util/makefile.mk               |    1 +
 5 files changed, 86 insertions(+), 0 deletions(-)
 create mode 100644 sw/source/core/inc/pagefrm.hrc
 create mode 100644 sw/source/core/layout/pagefrm.src

diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc
index f5fe008..f06180a 100644
--- a/sw/inc/rcid.hrc
+++ b/sw/inc/rcid.hrc
@@ -79,6 +79,7 @@
 #define RC_SMARTTAG                    (RC_BASE + 3950)  // SMARTTAGS
 #define RC_UNOCORE                  (RC_BASE + 4050)
 #define RC_ANNOTATION               (RC_BASE + 4150)
+#define RC_PAGEFRM                  (RC_BASE + 4250)
 
 /*--------------------------------------------------------------------
     Beschreibung:	Bereiche ausspannen
@@ -100,6 +101,10 @@
 #define RC_ANNOTATION_BEGIN             RC_ANNOTATION
 #define RC_ANNOTATION_END               (RC_ANNOTATION_BEGIN + 99)
 
+// Page frame
+#define RC_PAGEFRM_BEGIN            RC_PAGEFRM
+#define RC_PAGEFRM_EN               (RC_PAGEFRM + 99)
+
 // SW/Web
 #define RC_WEB_BEGIN				RC_WEB
 #define RC_WEB_END                  (RC_WEB_BEGIN + 199)
diff --git a/sw/source/core/inc/pagefrm.hrc b/sw/source/core/inc/pagefrm.hrc
new file mode 100644
index 0000000..c72c212
--- /dev/null
+++ b/sw/source/core/inc/pagefrm.hrc
@@ -0,0 +1,49 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Sébastien Le Ray <sebastien-libreoff...@orniz.org>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _PAGEFRM_HRC
+#define _PAGEFRM_HRC
+
+#include "rcid.hrc"
+
+//  Bitmaps for page shadow
+#define BMP_PAGE_TOP_RIGHT_SHADOW      RC_PAGEFRM_BEGIN
+#define BMP_PAGE_RIGHT_SHADOW          RC_PAGEFRM_BEGIN + 1
+#define BMP_PAGE_BOTTOM_RIGHT_SHADOW   RC_PAGEFRM_BEGIN + 2
+#define BMP_PAGE_BOTTOM_SHADOW         RC_PAGEFRM_BEGIN + 3
+#define BMP_PAGE_BOTTOM_LEFT_SHADOW    RC_PAGEFRM_BEGIN + 4
+
+
+// If you add resources, don't forget to update this
+#define PAGEFRM_ACT_END           BMP_PAGE_BOTTOMLEFT_SHADOW
+
+// Sanity check
+#if PAGEFRM_ACT_END > RC_PAGEFRM_END
+#error Not enough room for pagefrm resource in #file:#line
+#endif
+
+#endif
diff --git a/sw/source/core/layout/makefile.mk b/sw/source/core/layout/makefile.mk
index e986ec8..6470592 100644
--- a/sw/source/core/layout/makefile.mk
+++ b/sw/source/core/layout/makefile.mk
@@ -89,6 +89,10 @@ SLOFILES =  \
     $(SLO)$/swselectionlist.obj \
     $(SLO)$/unusedf.obj
 
+SRS1NAME=$(TARGET)
+SRC1FILES =\
+    pagefrm.src
+
 .IF "$(DBG_LEVEL)">="2"
 SLOFILES +=  \
         $(SLO)$/dbg_lay.obj
diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src
new file mode 100644
index 0000000..dfa9b2b
--- /dev/null
+++ b/sw/source/core/layout/pagefrm.src
@@ -0,0 +1,27 @@
+#include "pagefrm.hrc"
+
+Bitmap BMP_PAGE_TOP_RIGHT_SHADOW
+{
+    File = "page-topright-shadow.png";
+};
+
+Bitmap BMP_PAGE_RIGHT_SHADOW
+{
+    File = "page-right-shadow.png";
+};
+
+Bitmap BMP_PAGE_BOTTOM_RIGHT_SHADOW
+{
+    File = "page-bottomright-shadow.png";
+};
+
+Bitmap BMP_PAGE_BOTTOM_SHADOW
+{
+    File = "page-bottom-shadow.png";
+};
+
+Bitmap BMP_PAGE_BOTTOM_LEFT_SHADOW
+{
+    File = "page-bottomleft-shadow.png";
+};
+
diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk
index 5539505..42132f1 100644
--- a/sw/util/makefile.mk
+++ b/sw/util/makefile.mk
@@ -53,6 +53,7 @@ sw_res_files= \
     $(SRS)$/frmdlg.srs       \
     $(SRS)$/globdoc.srs      \
     $(SRS)$/index.srs        \
+    $(SRS)$/layout.srs       \
     $(SRS)$/lingu.srs        \
     $(SRS)$/misc.srs         \
     $(SRS)$/ribbar.srs       \
-- 
1.7.2.3

From f6e5a082305f58f691e563cb5559cf83df916516 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Le=20Ray?= <sebastien-libreoff...@orniz.org>
Date: Sun, 27 Feb 2011 18:02:06 +0100
Subject: [PATCH 2/2] Draw smooth shadows around page and remove borders

---
 sw/source/core/inc/pagefrm.hxx     |   29 ---------
 sw/source/core/layout/layact.cxx   |   12 +---
 sw/source/core/layout/paintfrm.cxx |  110 +++++++++++++----------------------
 sw/source/core/view/viewsh.cxx     |   11 +--
 4 files changed, 49 insertions(+), 113 deletions(-)

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index e6b86b5..3c0c1cb 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -87,8 +87,6 @@ class SwPageFrm: public SwFtnBossFrm
     // is in progress.
     bool mbLayoutInProgress;
 
-    // #i9719#
-    static const sal_Int8 mnBorderPxWidth;
     static const sal_Int8 mnShadowPxWidth;
 
     void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
@@ -97,28 +95,6 @@ class SwPageFrm: public SwFtnBossFrm
     // Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
     void SetColMaxFtnHeight();
 
-    /** determine rectangle for page border
-
-        #i9719#
-
-        @param _rPageRect
-        input parameter - constant instance reference of the page rectangle.
-        Generally, it's the frame area of the page, but for empty pages in print
-        preview, this parameter is useful.
-
-        @param _pViewShell
-        input parameter - instance of the view shell, for which the rectangle
-        has to be generated.
-
-        @param _orBorderRect
-        output parameter - instance reference of the border rectangle for
-        the given page rectangle
-    */
-    static void GetBorderRect( const SwRect& _rPageRect,
-                               ViewShell*    _pViewShell,
-                               SwRect& _orBorderRect,
-                               bool bRightSidebar );
-
     /** determine rectangle for right page shadow
 
         #i9719#
@@ -376,11 +352,6 @@ public:
 
     virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
 
-    // #i9719#
-    inline sal_Int8 BorderPxWidth() const
-    {
-        return mnBorderPxWidth;
-    }
     inline sal_Int8 ShadowPxWidth() const
     {
         return mnShadowPxWidth;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 57af311..4479c93 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1427,8 +1427,6 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
             if ( pLay->IsPageFrm() )
             {
                 SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
-                const int nBorderWidth =
-                        pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->BorderPxWidth(), 0 ) ).Width();
                 const int nShadowWidth =
                         pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->ShadowPxWidth(), 0 ) ).Width();
 
@@ -1439,22 +1437,20 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
                 {
                     case sw::sidebarwindows::SIDEBAR_LEFT:
                     {
-                        aPaint.Left( aPaint.Left() - nBorderWidth - nSidebarWidth);
-                        aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth);
+                        aPaint.Left( aPaint.Left()  - nSidebarWidth);
+                        aPaint.Right( aPaint.Right() + nShadowWidth);
                     }
                     break;
                     case sw::sidebarwindows::SIDEBAR_RIGHT:
                     {
-                        aPaint.Left( aPaint.Left() - nBorderWidth );
-                        aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth + nSidebarWidth);
+                        aPaint.Right( aPaint.Right() + nShadowWidth + nSidebarWidth);
                     }
                     break;
                     case sw::sidebarwindows::SIDEBAR_NONE:
                         // nothing to do
                     break;
                 }
-                aPaint.Top( aPaint.Top() - nBorderWidth );
-                aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth);
+                aPaint.Bottom( aPaint.Bottom() + nShadowWidth);
             }
 
             if ( pLay->IsPageFrm() &&
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 0b8fa8b..2fa6b54 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -111,6 +111,7 @@
 
 #include <svtools/borderhelper.hxx>
 
+#include "pagefrm.hrc"
 
 using namespace ::com::sun::star;
 
@@ -5207,35 +5208,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
     }
 }
 
-const sal_Int8 SwPageFrm::mnBorderPxWidth = 1;
-const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
-
-/** determine rectangle for page border
-
-    OD 12.02.2003 for #i9719# and #105645#
-
-    @author OD
-*/
-/*static*/ void SwPageFrm::GetBorderRect( const SwRect& _rPageRect,
-                                          ViewShell*    _pViewShell,
-                                          SwRect& _orBorderRect,
-                                          bool bRightSidebar )
-{
-    SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell );
-    Rectangle aBorderPxRect =
-            _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
-
-    aBorderPxRect.Left() = aBorderPxRect.Left() - mnBorderPxWidth;
-    aBorderPxRect.Top() = aBorderPxRect.Top() - mnBorderPxWidth;
-    aBorderPxRect.Right() = aBorderPxRect.Right() + mnBorderPxWidth;
-    aBorderPxRect.Bottom() = aBorderPxRect.Bottom() + mnBorderPxWidth;
-
-    AddSidebarBorders(aBorderPxRect,_pViewShell, bRightSidebar, true);
-
-    _orBorderRect =
-            SwRect( _pViewShell->GetOut()->PixelToLogic( aBorderPxRect ) );
-}
+const sal_Int8 SwPageFrm::mnShadowPxWidth = 10;
 
 /** determine rectangle for right page shadow
 
@@ -5250,20 +5223,20 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
 {
     SwRect aAlignedPageRect( _rPageRect );
     ::SwAlignRect( aAlignedPageRect, _pViewShell );
-    Rectangle aPagePxRect =
+    SwRect aPagePxRect =
             _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+    const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0;
 
-    Rectangle aRightShadowPxRect(
-                    aPagePxRect.Right() + mnShadowPxWidth,
-                    aPagePxRect.Top() + 1,
-                    aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
-                    aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+    _orRightShadowRect.Chg(
+                    Point( aPagePxRect.Right() + 1, aPagePxRect.Top() + mnShadowPxWidth + 1 ),
+                    Size( mnShadowPxWidth, aPagePxRect.Height() - mnShadowPxWidth - 1 ) );
 
-    if ( bRightSidebar )
-        AddSidebarBorders(aRightShadowPxRect,_pViewShell, bRightSidebar, true);
+    if (bRightSidebar && pMgr && pMgr->ShowNotes() && pMgr->HasNotes())
+    {
+        _orRightShadowRect.Pos(_orRightShadowRect.Left() + pMgr->GetSidebarWidth(true)
+            + pMgr->GetSidebarBorderWidth(true), _orRightShadowRect.Top());
+    }
 
-    _orRightShadowRect =
-            SwRect( _pViewShell->GetOut()->PixelToLogic( aRightShadowPxRect ) );
 }
 
 /** determine rectangle for bottom page shadow
@@ -5279,19 +5252,15 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
 {
     SwRect aAlignedPageRect( _rPageRect );
     ::SwAlignRect( aAlignedPageRect, _pViewShell );
-    Rectangle aPagePxRect =
+    SwRect aPagePxRect =
             _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
 
-    Rectangle aBottomShadowPxRect(
-                    aPagePxRect.Left() + 1,
-                    aPagePxRect.Bottom() + mnShadowPxWidth,
-                    aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
-                    aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+    _orBottomShadowRect.Chg(
+                    Point( aPagePxRect.Left() + 1 + mnShadowPxWidth, aPagePxRect.Bottom() + 1 ),
+                    Size( aPagePxRect.Width() - 1 - mnShadowPxWidth, mnShadowPxWidth ) );
 
-    AddSidebarBorders(aBottomShadowPxRect,_pViewShell, bRightSidebar, true);
+    AddSidebarBorders( _orBottomShadowRect, _pViewShell, bRightSidebar, true);
 
-    _orBottomShadowRect =
-            SwRect( _pViewShell->GetOut()->PixelToLogic( aBottomShadowPxRect ) );
 }
 
 /** paint page border and shadow
@@ -5310,34 +5279,30 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
     SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
     // <--
 
-    // get color for page border and shadow paint
-    const Color& rColor = SwViewOption::GetFontColor();
-
-    // save current fill and line color of output device
-    Color aFill( _pViewShell->GetOut()->GetFillColor() );
-    Color aLine( _pViewShell->GetOut()->GetLineColor() );
+    BitmapEx aPageBottomShadow( SW_RES( BMP_PAGE_BOTTOM_SHADOW ) );
+    BitmapEx aPageRightShadow( SW_RES( BMP_PAGE_RIGHT_SHADOW ) );
+    BitmapEx aPageTopRightShadow( SW_RES( BMP_PAGE_TOP_RIGHT_SHADOW ) );
+    BitmapEx aPageBottomRightShadow( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW ) );
+    BitmapEx aPageBottomLeftShadow( SW_RES( BMP_PAGE_BOTTOM_LEFT_SHADOW ) );
 
-    // paint page border
-    _pViewShell->GetOut()->SetFillColor(); // OD 20.02.2003 #107369# - no fill color
-    _pViewShell->GetOut()->SetLineColor( rColor );
     SwRect aPaintRect;
-    SwPageFrm::GetBorderRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
-    _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+    OutputDevice *pOut = _pViewShell->GetOut();
 
     // paint right shadow
     if ( bPaintRightShadow )
     {
-        _pViewShell->GetOut()->SetFillColor( rColor );
         SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
-        _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+        aPageRightShadow.Scale( 1, aPaintRect.Height() );
+        pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageRightShadow );
+        pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPaintRect.Top() - mnShadowPxWidth ) ), aPageTopRightShadow );
+        pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.BottomLeft() ), aPageBottomRightShadow );
     }
 
     // paint bottom shadow
     SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
-    _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
-
-    _pViewShell->GetOut()->SetFillColor( aFill );
-    _pViewShell->GetOut()->SetLineColor( aLine );
+    pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left() - mnShadowPxWidth, aPaintRect.Top() ) ), aPageBottomLeftShadow );
+    aPageBottomShadow.Scale( aPaintRect.Width(), 1 );
+    pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageBottomShadow);
 }
 
 //mod #i6193# paint sidebar for notes
@@ -5468,14 +5433,21 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
                                                         SwRect& _orBorderAndShadowBoundRect,
                                                         bool bRightSidebar )
 {
+    SwRect aAlignedPageRect( _rPageRect );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell );
+    SwRect aPagePxRect =
+            _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+
     SwRect aTmpRect;
-    SwPageFrm::GetBorderRect( _rPageRect, _pViewShell, _orBorderAndShadowBoundRect, bRightSidebar );
     SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aTmpRect, bRightSidebar );
-    _orBorderAndShadowBoundRect.Union( aTmpRect );
+
+    aPagePxRect.Right( aTmpRect.Right() );
+
     SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aTmpRect, bRightSidebar );
-    _orBorderAndShadowBoundRect.Union( aTmpRect );
+    aPagePxRect.Bottom( aTmpRect.Bottom() );
+    aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1);
 
-    AddSidebarBorders(_orBorderAndShadowBoundRect, _pViewShell, bRightSidebar, false);
+    _orBorderAndShadowBoundRect = _pViewShell->GetOut()->PixelToLogic( aPagePxRect.SVRect() );
 }
 
 /*static*/ void SwPageFrm::AddSidebarBorders(SwRect &aRect, ViewShell* _pViewShell, bool bRightSidebar, bool bPx)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 4988770..60bfcc7 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1005,9 +1005,6 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
 
                 if ( aPageRect.IsOver( aBoth ) )
                 {
-                    // #i9719#, - consider new border and shadow width
-                    const SwTwips nBorderWidth =
-                            GetOut()->PixelToLogic( Size( pPage->BorderPxWidth(), 0 ) ).Width();
                     const SwTwips nShadowWidth =
                             GetOut()->PixelToLogic( Size( pPage->ShadowPxWidth(), 0 ) ).Width();
 
@@ -1017,14 +1014,14 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
                     {
                         case sw::sidebarwindows::SIDEBAR_LEFT:
                         {
-                            nPageLeft =  aPageRect.Left() - nBorderWidth - nSidebarWidth;
-                            nPageRight = aPageRect.Right() + nBorderWidth + nShadowWidth;
+                            nPageLeft =  aPageRect.Left() - nSidebarWidth;
+                            nPageRight = aPageRect.Right() + nShadowWidth;
                         }
                         break;
                         case sw::sidebarwindows::SIDEBAR_RIGHT:
                         {
-                            nPageLeft =  aPageRect.Left() - nBorderWidth;
-                            nPageRight = aPageRect.Right() + nBorderWidth + nShadowWidth + nSidebarWidth;
+                            nPageLeft =  aPageRect.Left();
+                            nPageRight = aPageRect.Right() + nShadowWidth + nSidebarWidth;
                         }
                         break;
                         case sw::sidebarwindows::SIDEBAR_NONE:
-- 
1.7.2.3

Attachment: signature.asc
Description: PGP signature

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to