summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-09-10 22:43:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-11 08:35:31 +0200
commit58edb05341494dfaa3d3ce33505b97961d5f2ea9 (patch)
tree48eec5811e7a990448d7104203c79b33602642fb
parentffeb750163909e15ee0dd2d16f8030bf08e66eae (diff)
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 <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/view/output2.cxx52
1 files 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();
}
}
}