summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-02-19 17:09:33 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-02-20 11:22:25 +0100
commitba16bb44668b9088926be759c457757c8e90dd53 (patch)
treedf390ef4b9cca9fb210a45e41b3edf0b62050140 /sw
parent769433ad93040bc81f06672c8a2c01e2b76fece3 (diff)
sw: fix unintended change in SwExtraPainter::SwExtraPainter()
nVirtPageNum was an obfuscated optional, by assigning 1 and 2 instead of 1 and 0... probably the only difference is that this saves a function call? (regression from a26c4dbd9ca17578fd5c165bd89b618751fabb3c) Change-Id: Ie8bccebd331fade9dd006da7c1b5a758946b8549 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89049 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/frmpaint.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 2f25dfed2b44..f69fdfbfc5b9 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 );
}
- bool isRightPage(false);
+ o3tl::optional<bool> oIsRightPage;
if( bLineNum )
{
/* Initializes the Members necessary for line numbering:
@@ -138,13 +138,13 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
{
if( pFrame->FindPageFrame()->OnRightPage() )
{
- isRightPage = true;
+ oIsRightPage = true;
ePos = ePos == LINENUMBER_POS_INSIDE ?
LINENUMBER_POS_LEFT : LINENUMBER_POS_RIGHT;
}
else
{
- isRightPage = false;
+ oIsRightPage = 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 (!isRightPage)
- isRightPage = pFrame->FindPageFrame()->OnRightPage();
- if (isRightPage)
+ if (!oIsRightPage)
+ oIsRightPage = pFrame->FindPageFrame()->OnRightPage();
+ if (*oIsRightPage)
eHor = eHor == text::HoriOrientation::INSIDE ? text::HoriOrientation::LEFT : text::HoriOrientation::RIGHT;
else
eHor = eHor == text::HoriOrientation::OUTSIDE ? text::HoriOrientation::LEFT : text::HoriOrientation::RIGHT;