From ba16bb44668b9088926be759c457757c8e90dd53 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 19 Feb 2020 17:09:33 +0100 Subject: 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 --- sw/source/core/text/frmpaint.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sw') 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 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; -- cgit