diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-09 07:44:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-13 12:27:08 +0100 |
commit | e3290499009492e39e5ddd870d314bb5df494199 (patch) | |
tree | 6ffaa7c199e74791ed1a2aa8a74a0a528509a02f /sd | |
parent | 8709c643136eed67bc8f04ab9465b4a76085747c (diff) |
loplugin singlevalfields improvement
checking for casting to void* turns out to mask useful stuff, so
remove that and just deal with a few extra false+
Change-Id: Id9700d7ceda90ba8fdb38aa870f13a7ca3acb668
Reviewed-on: https://gerrit.libreoffice.org/63145
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/Window.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/sdwindow.cxx | 43 |
4 files changed, 17 insertions, 33 deletions
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx index 8ae24c4f0a64..026a6d1a460f 100644 --- a/sd/source/ui/inc/Window.hxx +++ b/sd/source/ui/inc/Window.hxx @@ -151,7 +151,6 @@ public: void DropScroll (const Point& rMousePos); virtual void KeyInput(const KeyEvent& rKEvt) override; protected: - VclPtr< ::sd::Window> mpShareWin; Point maWinPos; Point maViewOrigin; Size maViewSize; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 7f100e66f1f6..b58f4b486247 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -480,7 +480,6 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mpDoc(pDoc) , mpParentWindow(pParentWindow) , mpShowWindow(nullptr) -, mpTimeButton(nullptr) , mnRestoreSlide(0) , maPresSize( -1, -1 ) , meAnimationMode(ANIMATIONMODE_SHOW) @@ -670,10 +669,6 @@ void SAL_CALL SlideshowImpl::disposing() } } - if( mpTimeButton ) - mpTimeButton->Hide(); - mpTimeButton.disposeAndClear(); - if( mpShowWindow ) mpShowWindow->Hide(); mpShowWindow.disposeAndClear(); diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index 7a36a8f0a0e8..e8daa04acc1b 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -330,7 +330,6 @@ private: VclPtr<vcl::Window> mpParentWindow; VclPtr<sd::ShowWindow> mpShowWindow; - VclPtr<PushButton> mpTimeButton; std::shared_ptr< AnimationSlideController > mpSlideController; diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 9519cc7f334a..f295d00cf4d1 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -61,7 +61,6 @@ namespace sd { Window::Window(vcl::Window* pParent) : vcl::Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)), DropTargetHelper( this ), - mpShareWin(nullptr), maWinPos(0, 0), // precautionary; but the values should be set maViewOrigin(0, 0), // again from the owner of the window maViewSize(1000, 1000), @@ -106,7 +105,6 @@ void Window::dispose() if (pWindowUpdater != nullptr) pWindowUpdater->UnregisterWindow (this); } - mpShareWin.clear(); DropTargetHelper::dispose(); vcl::Window::dispose(); } @@ -146,30 +144,23 @@ void Window::CalcMinZoom() // Get current zoom factor. long nZoom = GetZoom(); - if ( mpShareWin ) - { - mpShareWin->CalcMinZoom(); - mnMinZoom = mpShareWin->mnMinZoom; - } - else - { - // Get the rectangle of the output area in logical coordinates - // and calculate the scaling factors that would lead to the view - // area (also called application area) to completely fill the - // window. - Size aWinSize = PixelToLogic(GetOutputSizePixel()); - sal_uLong nX = static_cast<sal_uLong>(static_cast<double>(aWinSize.Width()) - * double(ZOOM_MULTIPLICATOR) / static_cast<double>(maViewSize.Width())); - sal_uLong nY = static_cast<sal_uLong>(static_cast<double>(aWinSize.Height()) - * double(ZOOM_MULTIPLICATOR) / static_cast<double>(maViewSize.Height())); - - // Decide whether to take the larger or the smaller factor. - sal_uLong nFact = std::min(nX, nY); - - // The factor is transformed according to the current zoom factor. - nFact = nFact * nZoom / ZOOM_MULTIPLICATOR; - mnMinZoom = std::max(sal_uInt16(MIN_ZOOM), static_cast<sal_uInt16>(nFact)); - } + // Get the rectangle of the output area in logical coordinates + // and calculate the scaling factors that would lead to the view + // area (also called application area) to completely fill the + // window. + Size aWinSize = PixelToLogic(GetOutputSizePixel()); + sal_uLong nX = static_cast<sal_uLong>(static_cast<double>(aWinSize.Width()) + * double(ZOOM_MULTIPLICATOR) / static_cast<double>(maViewSize.Width())); + sal_uLong nY = static_cast<sal_uLong>(static_cast<double>(aWinSize.Height()) + * double(ZOOM_MULTIPLICATOR) / static_cast<double>(maViewSize.Height())); + + // Decide whether to take the larger or the smaller factor. + sal_uLong nFact = std::min(nX, nY); + + // The factor is transformed according to the current zoom factor. + nFact = nFact * nZoom / ZOOM_MULTIPLICATOR; + mnMinZoom = std::max(sal_uInt16(MIN_ZOOM), static_cast<sal_uInt16>(nFact)); + // If the current zoom factor is smaller than the calculated minimal // zoom factor then set the new minimal factor as the current zoom // factor. |