From 58edb05341494dfaa3d3ce33505b97961d5f2ea9 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Sun, 10 Sep 2017 22:43:53 +0200 Subject: cppcheck: knownConditionTrueFalse 'bClip' is always true always true since initial import in year 2000 Change-Id: I66596f50580d2db29b5aee0617164a56e8635806 Reviewed-on: https://gerrit.libreoffice.org/42146 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/view/output2.cxx | 52 +++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index a5b0dfece4a9..8ac4e24845c6 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -4997,7 +4997,6 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) if (!bHidden) { - bool bClip = false; Size aClipSize( nScrX+nScrW-nStartX, nScrY+nScrH-nStartY ); // go on writing @@ -5090,33 +5089,27 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) } } - bClip = true; // always clip at the window/page border - - //Rectangle aClipRect; - if (bClip) + if ( nAttrRotate /* && eRotMode != SVX_ROTATE_MODE_STANDARD */ ) { - if ( nAttrRotate /* && eRotMode != SVX_ROTATE_MODE_STANDARD */ ) - { - // only clip rotated output text at the page border - nClipStartX = nScrX; - aClipSize.Width() = nScrW; - } + // only clip rotated output text at the page border + nClipStartX = nScrX; + aClipSize.Width() = nScrW; + } - if (bPixelToLogic) - aAreaParam.maClipRect = mpRefDevice->PixelToLogic( tools::Rectangle( - Point(nClipStartX,nClipStartY), aClipSize ) ); - else - aAreaParam.maClipRect = tools::Rectangle(Point(nClipStartX, nClipStartY), - aClipSize ); // Scale = 1 + if (bPixelToLogic) + aAreaParam.maClipRect = mpRefDevice->PixelToLogic( tools::Rectangle( + Point(nClipStartX,nClipStartY), aClipSize ) ); + else + aAreaParam.maClipRect = tools::Rectangle(Point(nClipStartX, nClipStartY), + aClipSize ); // Scale = 1 - if (bMetaFile) - { - mpDev->Push(); - mpDev->IntersectClipRegion( aAreaParam.maClipRect ); - } - else - mpDev->SetClipRegion( vcl::Region( aAreaParam.maClipRect ) ); + if (bMetaFile) + { + mpDev->Push(); + mpDev->IntersectClipRegion( aAreaParam.maClipRect ); } + else + mpDev->SetClipRegion( vcl::Region( aAreaParam.maClipRect ) ); Point aLogicStart; if (bPixelToLogic) @@ -5285,13 +5278,10 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) pEngine->Draw( mpDev, aLogicStart, (short)nOriVal ); - if (bClip) - { - if (bMetaFile) - mpDev->Pop(); - else - mpDev->SetClipRegion(); - } + if (bMetaFile) + mpDev->Pop(); + else + mpDev->SetClipRegion(); } } } -- cgit