[Libreoffice-commits] core.git: sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 20 10:23:16 UTC 2020
sw/source/core/text/frmpaint.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit ba16bb44668b9088926be759c457757c8e90dd53
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Feb 19 17:09:33 2020 +0100
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Feb 20 11:22:25 2020 +0100
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 at cib.de>
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;
More information about the Libreoffice-commits
mailing list