diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-03 14:00:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-04 07:13:58 +0000 |
commit | 7abd369964a0c7f9f80cdbc9e47c7dc120fe8257 (patch) | |
tree | 70786d0850de5212e30e5611c09cba06a2d26ac9 /vcl | |
parent | fb823544468150a2ef660095a511636be1bf6f9e (diff) |
loplugin:unusedmethods
Change-Id: Ie1f840c3ec9a2d5888f95cf05e531a8a9464bf2e
Reviewed-on: https://gerrit.libreoffice.org/30524
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/map.cxx | 54 | ||||
-rw-r--r-- | vcl/source/window/mouseevent.cxx | 30 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 12 |
3 files changed, 5 insertions, 91 deletions
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index c66565093596..55cf14f8bb64 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -1949,60 +1949,6 @@ void OutputDevice::SetPixelOffset( const Size& rOffset ) } -namespace vcl { - -long Window::ImplLogicUnitToPixelX( long nX, MapUnit eUnit ) -{ - if ( eUnit != MapUnit::MapPixel ) - { - ImplFrameData* pFrameData = mpWindowImpl->mpFrameData; - - // shift map unit, then re-calculate - if ( pFrameData->meMapUnit != eUnit ) - { - pFrameData->meMapUnit = eUnit; - ImplCalcMapResolution( MapMode( eUnit ), mnDPIX, mnDPIY, - pFrameData->maMapUnitRes ); - } - - // BigInt is not required, as this function is only used to - // convert the window position - nX = nX * mnDPIX * pFrameData->maMapUnitRes.mnMapScNumX; - nX += nX >= 0 ? (pFrameData->maMapUnitRes.mnMapScDenomX/2) : - -((pFrameData->maMapUnitRes.mnMapScDenomX-1)/2); - nX /= pFrameData->maMapUnitRes.mnMapScDenomX; - } - - return nX; -} - -long Window::ImplLogicUnitToPixelY( long nY, MapUnit eUnit ) -{ - if ( eUnit != MapUnit::MapPixel ) - { - ImplFrameData* pFrameData = mpWindowImpl->mpFrameData; - - // shift map unit, then re-calculate - if ( pFrameData->meMapUnit != eUnit ) - { - pFrameData->meMapUnit = eUnit; - ImplCalcMapResolution( MapMode( eUnit ), mnDPIX, mnDPIY, - pFrameData->maMapUnitRes ); - } - - // BigInt is not required, as this function is only used to - // convert the window position - nY = nY * mnDPIY * pFrameData->maMapUnitRes.mnMapScNumY; - nY += nY >= 0 ? (pFrameData->maMapUnitRes.mnMapScDenomY/2) : - -((pFrameData->maMapUnitRes.mnMapScDenomY-1)/2); - nY /= pFrameData->maMapUnitRes.mnMapScDenomY; - } - - return nY; -} - -} /* namespace vcl */ - DeviceCoordinate OutputDevice::LogicWidthToDeviceCoordinate( long nWidth ) const { if ( !mbMap ) diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx index 581c1643fc72..8b47d69724d6 100644 --- a/vcl/source/window/mouseevent.cxx +++ b/vcl/source/window/mouseevent.cxx @@ -23,34 +23,4 @@ #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/awt/MouseButton.hpp> -/** inits this vcl KeyEvent with all settings from the given awt event **/ -MouseEvent::MouseEvent( const css::awt::MouseEvent& rEvent ) -: maPos( rEvent.X, rEvent.Y ) -, mnMode( MouseEventModifiers::NONE ) -, mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) ) -, mnCode( 0 ) -{ - if( rEvent.Modifiers ) - { - if( (rEvent.Modifiers & css::awt::KeyModifier::SHIFT) != 0 ) - mnCode |= KEY_SHIFT; - if( (rEvent.Modifiers & css::awt::KeyModifier::MOD1) != 0 ) - mnCode |= KEY_MOD1; - if( (rEvent.Modifiers & css::awt::KeyModifier::MOD2) != 0 ) - mnCode |= KEY_MOD2; - if( (rEvent.Modifiers & css::awt::KeyModifier::MOD3) != 0 ) - mnCode |= KEY_MOD3; - } - - if( rEvent.Buttons ) - { - if( (rEvent.Buttons & css::awt::MouseButton::LEFT) != 0 ) - mnCode |= MOUSE_LEFT; - if( (rEvent.Buttons & css::awt::MouseButton::RIGHT) != 0 ) - mnCode |= MOUSE_RIGHT; - if( (rEvent.Buttons & css::awt::MouseButton::MIDDLE) != 0 ) - mnCode |= MOUSE_MIDDLE; - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 170e94665a4d..8defcd3614ea 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -2547,14 +2547,13 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE break; case SalEvent::ExternalZoom: { - ZoomEvent const * pZoomEvent = static_cast<ZoomEvent const *>(pEvent); SalWheelMouseEvent aSalWheelMouseEvent; aSalWheelMouseEvent.mnTime = tools::Time::GetSystemTicks(); - aSalWheelMouseEvent.mnX = pZoomEvent->GetCenter().getX(); - aSalWheelMouseEvent.mnY = pZoomEvent->GetCenter().getY(); + aSalWheelMouseEvent.mnX = 0; + aSalWheelMouseEvent.mnY = 0; // Pass on the scale as a percentage * 100 of current zoom factor // so to assure zoom granularity - aSalWheelMouseEvent.mnDelta = long(double(pZoomEvent->GetScale()) * double(MOBILE_ZOOM_SCALE_MULTIPLIER)); + aSalWheelMouseEvent.mnDelta = long(MOBILE_ZOOM_SCALE_MULTIPLIER); // Other SalWheelMouseEvent fields ignored when the // scaleDirectly parameter to ImplHandleWheelEvent() is // true. @@ -2563,13 +2562,12 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE break; case SalEvent::ExternalScroll: { - ScrollEvent const * pScrollEvent = static_cast<ScrollEvent const *>(pEvent); SalWheelMouseEvent aSalWheelMouseEvent; aSalWheelMouseEvent.mnTime = tools::Time::GetSystemTicks(); aSalWheelMouseEvent.mbDeltaIsPixel = true; // event location holds delta values instead - aSalWheelMouseEvent.mnX = long(pScrollEvent->GetXOffset()); - aSalWheelMouseEvent.mnY = long(pScrollEvent->GetYOffset()); + aSalWheelMouseEvent.mnX = 0; + aSalWheelMouseEvent.mnY = 0; aSalWheelMouseEvent.mnScrollLines = 0; if (aSalWheelMouseEvent.mnX != 0 || aSalWheelMouseEvent.mnY != 0) { |