You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2022/04/26 12:50:18 UTC

[openoffice] branch AOO42X updated: First code cleanup for removing Writer page shadows.

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO42X by this push:
     new ad09579061 First code cleanup for removing Writer page shadows.
ad09579061 is described below

commit ad09579061f4f29efe54799e71fb4494410ede7d
Author: mseidel <ms...@apache.org>
AuthorDate: Tue Apr 26 14:43:15 2022 +0200

    First code cleanup for removing Writer page shadows.
    
    Follow up for:
    https://github.com/apache/openoffice/commit/9d12c51fa1a1c1f5d69b792b73aae71e86afff00
    
    (cherry picked from commit 4a763550f709e8162c2a264ec14dcaf99eaf5fa7)
---
 main/sw/source/core/inc/pagefrm.hxx            |  5 ++--
 main/sw/source/core/layout/paintfrm.cxx        | 38 +++++++-------------------
 main/sw/source/core/view/pagepreviewlayout.cxx | 19 ++++++-------
 3 files changed, 21 insertions(+), 41 deletions(-)

diff --git a/main/sw/source/core/inc/pagefrm.hxx b/main/sw/source/core/inc/pagefrm.hxx
index bdd1c89090..3cd7503c82 100644
--- a/main/sw/source/core/inc/pagefrm.hxx
+++ b/main/sw/source/core/inc/pagefrm.hxx
@@ -339,10 +339,10 @@ public:
     void PaintMarginArea( const SwRect& _rOutputRect,
                           ViewShell* _pViewShell ) const;
 
-    /** paint page border and shadow
+    /** paint page border (shadow removed now)
 
         OD 12.02.2003 for #i9719# and #105645#
-        implement paint of page border and shadow
+        implement painting of page border
 
         @author OD
 
@@ -357,7 +357,6 @@ public:
     */
     static void PaintBorderAndShadow( const SwRect& _rPageRect,
                                       ViewShell*    _pViewShell,
-                                      bool bPaintRightShadow,
                                       bool bRightSidebar );
 
     /** get bound rectangle of border and shadow for repaints
diff --git a/main/sw/source/core/layout/paintfrm.cxx b/main/sw/source/core/layout/paintfrm.cxx
index c9f0cfbd95..240a66a099 100644
--- a/main/sw/source/core/layout/paintfrm.cxx
+++ b/main/sw/source/core/layout/paintfrm.cxx
@@ -2950,7 +2950,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
 
     while ( pPage )
     {
-        const bool bPaintRightShadow = !bBookMode || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage());
         const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT;
 
         if ( !pPage->IsEmptyPage() )
@@ -3058,7 +3057,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
                 if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() &&
                     !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() )
                 {
-                    SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bRightSidebar );
+                    SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bRightSidebar );
                     SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar);
                 }
 
@@ -3150,10 +3149,9 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
                                     TEXT_DRAW_CLIP );
 
                 pSh->GetOut()->SetFont( aOldFont );
-                // paint shadow and border for empty page
-                // OD 19.02.2003 #107369# - use new method to paint page border and
-                // shadow
-                SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bPaintRightShadow, bRightSidebar );
+                // paint border for empty page (shadow removed now)
+                // OD 19.02.2003 #107369# - use new method to paint page border
+                SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bRightSidebar );
                 SwPageFrm::PaintNotesSidebar( aEmptyPageRect, pSh, pPage->GetPhyPageNum(), bRightSidebar);
 
                 {
@@ -4877,7 +4875,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
         {
             // OD 27.09.2002 #103636# - paint shadow, if background is transparent.
             // Because of introduced transparent background for fly frame #99657#,
-            // the shadow have to be drawn if the background is transparent,
+            // the shadow has to be drawn if the background is transparent,
             // in spite the fact that the paint rectangle <rRect> lies fully
             // in the printing area.
             // NOTE to chosen solution:
@@ -5433,7 +5431,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
 // ----------------------------------------------------------------------
 
 const sal_Int8 SwPageFrm::mnBorderPxWidth = 1;
-const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
+const sal_Int8 SwPageFrm::mnShadowPxWidth = 0;
 
 /** determine rectangle for page border
 
@@ -5519,23 +5517,22 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
             SwRect( _pViewShell->GetOut()->PixelToLogic( aBottomShadowPxRect ) );
 }
 
-/** paint page border and shadow
+/** paint page border (shadow removed now)
 
     OD 12.02.2003 for #i9719# and #105645#
-    implement paint of page border and shadow
+    implement paint of page border
 
     @author OD
 */
 /*static*/ void SwPageFrm::PaintBorderAndShadow( const SwRect& _rPageRect,
                                                  ViewShell*    _pViewShell,
-                                                 bool bPaintRightShadow,
                                                  bool bRightSidebar )
 {
     // --> FME 2004-06-24 #i16816# tagged pdf support
     SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
     // <--
 
-    // get color for page border and shadow paint
+    // get color for page border
     const Color& rColor = SwViewOption::GetFontColor();
 
     // save current fill and line color of output device
@@ -5548,21 +5545,6 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
     SwRect aPaintRect;
     SwPageFrm::GetBorderRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
     _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
-
-    // paint right shadow
-//    if ( bPaintRightShadow )
-//    {
-//        _pViewShell->GetOut()->SetFillColor( rColor );
-//        SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
-//        _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
-//    }
-
-    // paint bottom shadow
-//    SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
-//    _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
-
-//    _pViewShell->GetOut()->SetFillColor( aFill );
-//    _pViewShell->GetOut()->SetLineColor( aLine );
 }
 
 //mod #i6193# paint sidebar for notes
@@ -6000,7 +5982,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
     delete pTmpBackBrush;
 
     //Jetzt noch Lower und dessen Nachbarn.
-	//Wenn ein Frn dabei die Kette verlaesst also nicht mehr Lower von mir ist
+	//Wenn ein Frm dabei die Kette verlaesst also nicht mehr Lower von mir ist
 	//so hoert der Spass auf.
 	const SwFrm *pFrm = GetLower();
     if ( pFrm )
diff --git a/main/sw/source/core/view/pagepreviewlayout.cxx b/main/sw/source/core/view/pagepreviewlayout.cxx
index c8d8dfe040..6ec805e5c2 100644
--- a/main/sw/source/core/view/pagepreviewlayout.cxx
+++ b/main/sw/source/core/view/pagepreviewlayout.cxx
@@ -1112,7 +1112,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
 
     const Font& rEmptyPgFont = SwPageFrm::GetEmptyPageFont();
 
-    Color aEmptyPgShadowBorderColor = SwViewOption::GetFontColor();
+//    Color aEmptyPgShadowBorderColor = SwViewOption::GetFontColor(); // Is this used anywhere?
 
     for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin();
           aPageIter != maPrevwPages.end();
@@ -1149,10 +1149,9 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
                                     TEXT_DRAW_CENTER |
                                     TEXT_DRAW_CLIP );
                 pOutputDev->SetFont( aOldFont );
-                // paint shadow and border for empty page
-                // OD 19.02.2003 #107369# - use new method to paint page border and
-                // shadow
-                SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, true );
+                // paint border for empty page (shadow removed now)
+                // OD 19.02.2003 #107369# - use new method to paint page border
+                SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true );
             }
             else
             {
@@ -1161,13 +1160,13 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
                 Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect );
                 mrParentViewShell.Paint( aPaintRect );
                 // --> OD 2007-08-15 #i80691#
-                // paint page border and shadow
+                // paint page border (shadow removed now)
                 {
                     SwRect aPageBorderRect;
                     SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect, true );
                     const Region aDLRegion(aPageBorderRect.SVRect());
                     mrParentViewShell.DLPrePaint2(aDLRegion);
-                    SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, true );
+                    SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true );
                     mrParentViewShell.DLPostPaint2(true);
                 }
                 // <--
@@ -1191,7 +1190,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
     // print preview layout is created during paint.
     if ( !mbNewLayoutDuringPaint )
     {
-        // update at accessiblilty interface
+        // update at accessibility interface
         mrParentViewShell.Imp()->UpdateAccessiblePreview(
                         maPrevwPages,
                         aMapMode.GetScaleX(),
@@ -1292,11 +1291,11 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
     SwRect aPageRect( _aSelectedPrevwPage->aLogicPos,
                          _aSelectedPrevwPage->aPageSize );
     // OD 19.02.2003 #107369# - use aligned page rectangle, as it is used for
-    // page border and shadow paint - see <SwPageFrm::PaintBorderAndShadow(..)>
+    // page border paint - see <SwPageFrm::PaintBorderAndShadow(..)>
     ::SwAlignRect( aPageRect, &mrParentViewShell);
     Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
 
-    // draw two rectangle
+    // draw two rectangles
     // OD 19.02.2003 #107369# - adjust position of select mark rectangle
     Rectangle aRect( aPxPageRect.Left(), aPxPageRect.Top(),
                        aPxPageRect.Right(), aPxPageRect.Bottom() );