[Libreoffice-commits] core.git: 2 commits - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 19 15:49:57 UTC 2020


 sw/source/core/layout/laycache.cxx |    5 -----
 sw/source/core/text/frmpaint.cxx   |   12 ++++++------
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 925c2c9842e548ab31fc3bed6c6d2840d1260861
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Feb 18 19:20:56 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed Feb 19 16:49:29 2020 +0100

    sw: remove dead code in SwLayHelper::CheckInsertPage()
    
    If SwFormatPageDesc is inited like that GetNumOffset() cannot have
    value.
    
    Change-Id: I4f303148c82541ef9d8fa6284018cfba35f20524
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88980
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index a5da72128614..8cee8dd31fc2 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -656,11 +656,6 @@ bool SwLayHelper::CheckInsertPage()
         if ( !pDesc )
         {
             pDesc = mrpPage->GetPageDesc()->GetFollow();
-
-            SwFormatPageDesc aFollowDesc( pDesc );
-            oPgNum = aFollowDesc.GetNumOffset();
-            if ( oPgNum )
-                static_cast<SwRootFrame*>(mrpPage->GetUpper())->SetVirtPageNum(true);
         }
         else
         {
commit a26c4dbd9ca17578fd5c165bd89b618751fabb3c
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Feb 18 18:35:05 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed Feb 19 16:49:06 2020 +0100

    sw: replace confusing nVirtPageNum that is actually physical page
    
    ... in SwExtraPainter::SwExtraPainter().
    
    Change-Id: Iac8a849b5fab25c80e81c61b267100a3fc3e2d26
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88979
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index ea617b08bf51..2f25dfed2b44 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -112,7 +112,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
         if( m_aRect.Bottom() > nBottom )
             m_aRect.Bottom( nBottom );
     }
-    int nVirtPageNum = 0;
+    bool isRightPage(false);
     if( bLineNum )
     {
         /* Initializes the Members necessary for line numbering:
@@ -138,13 +138,13 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
         {
             if( pFrame->FindPageFrame()->OnRightPage() )
             {
-                nVirtPageNum = 1;
+                isRightPage = true;
                 ePos = ePos == LINENUMBER_POS_INSIDE ?
                         LINENUMBER_POS_LEFT : LINENUMBER_POS_RIGHT;
             }
             else
             {
-                nVirtPageNum = 2;
+                isRightPage = false;
                 ePos = ePos == LINENUMBER_POS_OUTSIDE ?
                         LINENUMBER_POS_LEFT : LINENUMBER_POS_RIGHT;
             }
@@ -164,9 +164,9 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
     {
         if( text::HoriOrientation::INSIDE == eHor || text::HoriOrientation::OUTSIDE == eHor )
         {
-            if( !nVirtPageNum )
-                nVirtPageNum = pFrame->FindPageFrame()->OnRightPage() ? 1 : 2;
-            if( nVirtPageNum % 2 )
+            if (!isRightPage)
+                isRightPage = pFrame->FindPageFrame()->OnRightPage();
+            if (isRightPage)
                 eHor = eHor == text::HoriOrientation::INSIDE ? text::HoriOrientation::LEFT : text::HoriOrientation::RIGHT;
             else
                 eHor = eHor == text::HoriOrientation::OUTSIDE ? text::HoriOrientation::LEFT : text::HoriOrientation::RIGHT;


More information about the Libreoffice-commits mailing list