diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-08-05 19:32:51 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-08-05 19:32:51 +0200 |
commit | ff41179619156a1ffaf6026489e68b06b7e0f46d (patch) | |
tree | a40694ec8d17ef6c3dc6bead0f7864e4ff94105a | |
parent | 4a95e1a9c212a45408f9a7407ab283eca221378d (diff) |
Only use logic mapping during paint for col/rowbars.
Change-Id: I12e59b94f73eea18d0d407d9898c59b8d68eb4a2
-rw-r--r-- | sc/source/ui/view/hdrcont.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 234547344173..c25f66150959 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -271,7 +271,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) } ScViewData& rViewData = pViewSh->GetViewData(); - MapMode aMapMode( GetMapMode() ); + const MapMode aOriginalMapMode = GetMapMode(); + MapMode aMapMode = aOriginalMapMode; aMapMode.SetMapUnit( MAP_TWIP ); aMapMode.SetScaleX( rViewData.GetZoomX() * Fraction(0.96) ); aMapMode.SetScaleY( rViewData.GetZoomY() * Fraction(0.96) ); @@ -592,10 +593,10 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) aTxtPos = LogicToPixel( aTxtPos ); // Text is in pixels, so easiest just to map that way // only here. - const MapMode aOriginalMapMode( GetMapMode() ); - SetMapMode( MapMode( MAP_PIXEL ) ); - DrawText( aTxtPos, aString ); + const MapMode aCurrentMode( GetMapMode() ); SetMapMode( aOriginalMapMode ); + DrawText( aTxtPos, aString ); + SetMapMode( aCurrentMode ); } break; } @@ -611,6 +612,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) aGrid.Flush(); } + + SetMapMode( aOriginalMapMode ); } SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const @@ -620,9 +623,10 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) SCCOLROW nHitNo = nPos; SCCOLROW nEntryNo = 1 + nPos; long nScrPos; - long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X(); + long nMousePos = bVertical ? PixelToLogic(rMEvt.GetPosPixel()).Y() : + PixelToLogic(rMEvt.GetPosPixel()).X(); long nDif; - Size aSize = GetOutputSizePixel(); + Size aSize = PixelToLogic(GetOutputSizePixel()); long nWinSize = bVertical ? aSize.Height() : aSize.Width(); bool bLayoutRTL = IsLayoutRTL(); |