diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-02 13:37:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-04 14:07:02 +0200 |
commit | 05082326bed3aac6fe3c902a21e854fcb9813d7c (patch) | |
tree | 3686e0d7d766e5776ca8a79ca0add1389c16f1c8 /sdext/source | |
parent | a36ada7c5400735b6d03d7215a32ea7e98aacd63 (diff) |
loplugin:reducevarscope in sdext
Change-Id: I92f57e803ebf47e77b5c1990984d0dee1cdd2c73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/minimizer/optimizerdialog.cxx | 2 | ||||
-rw-r--r-- | sdext/source/pdfimport/filterdet.cxx | 6 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 5 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterScreen.cxx | 3 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideShowView.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterToolBar.cxx | 2 |
6 files changed, 8 insertions, 12 deletions
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx index 536b70974b71..ab392266e56d 100644 --- a/sdext/source/minimizer/optimizerdialog.cxx +++ b/sdext/source/minimizer/optimizerdialog.cxx @@ -348,12 +348,12 @@ void ItemListener::itemStateChanged( const ItemEvent& Event ) try { sal_Int16 nState; - OUString aControlName; Reference< XControl > xControl; Any aSource( Event.Source ); if ( aSource >>= xControl ) { Reference< XPropertySet > xPropertySet( xControl->getModel(), UNO_QUERY_THROW ); + OUString aControlName; xPropertySet->getPropertyValue( "Name" ) >>= aControlName; PPPOptimizerTokenEnum eControl( TKGet( aControlName ) ); switch( eControl ) diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index 7619f4518b89..88f617ecea89 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -87,14 +87,12 @@ FileEmitContext::FileEmitContext( const OUString& rOr m_xOut = m_xContextStream->getOutputStream(); m_xSeek.set(m_xOut, uno::UNO_QUERY_THROW ); - oslFileError aErr = osl_File_E_None; if( osl_openFile( rOrigFile.pData, &m_aReadHandle, osl_File_OpenFlag_Read ) == osl_File_E_None ) { - if( (aErr=osl_setFilePos( m_aReadHandle, - osl_Pos_End, - 0 )) == osl_File_E_None ) + oslFileError aErr = osl_setFilePos( m_aReadHandle, osl_Pos_End, 0 ); + if( aErr == osl_File_E_None ) { sal_uInt64 nFileSize = 0; if( (aErr=osl_getFilePos( m_aReadHandle, diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 281f77e59d5e..6d414d5f66ca 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -273,10 +273,9 @@ void PresenterController::GetSlides (const sal_Int32 nOffset) // Get the current slide from the slide show controller. mxCurrentSlide = nullptr; Reference<container::XIndexAccess> xIndexAccess(mxSlideShowController, UNO_QUERY); - sal_Int32 nSlideIndex = -1; try { - nSlideIndex = mxSlideShowController->getCurrentSlideIndex() + nOffset; + sal_Int32 nSlideIndex = mxSlideShowController->getCurrentSlideIndex() + nOffset; if (mxSlideShowController->isPaused()) nSlideIndex = -1; @@ -571,12 +570,12 @@ const Reference<drawing::XDrawPage>& PresenterController::GetCurrentSlide() cons bool PresenterController::HasTransition (Reference<drawing::XDrawPage> const & rxPage) { bool bTransition = false; - sal_uInt16 aTransitionType = 0; if( rxPage.is() ) { Reference<beans::XPropertySet> xSlidePropertySet (rxPage, UNO_QUERY); try { + sal_uInt16 aTransitionType = 0; xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType; if (aTransitionType > 0) { diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 25e5093bbab4..a06bf17c5a00 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -422,7 +422,6 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber ( const Reference<presentation::XPresentation2>& rxPresentation) const { sal_Int32 nScreenNumber (0); - sal_Int32 nScreenCount (1); try { if ( ! rxPresentation.is()) @@ -456,7 +455,7 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber ( // We still have to determine the number of screens to decide // whether the presenter screen may be shown at all. - nScreenCount = Application::GetScreenCount(); + sal_Int32 nScreenCount = Application::GetScreenCount(); if (nScreenCount < 2 || nDisplayNumber > nScreenCount) { diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index f4bb536d6d3e..7ad4bc207645 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -842,9 +842,9 @@ void PresenterSlideShowView::Resize() return; const awt::Rectangle aWindowBox (mxWindow->getPosSize()); - awt::Rectangle aViewWindowBox; if (aWindowBox.Height > 0) { + awt::Rectangle aViewWindowBox; const double nWindowAspectRatio ( double(aWindowBox.Width) / double(aWindowBox.Height)); if (nWindowAspectRatio > mnPageAspectRatio) diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index d36f42277da4..14f0f31d5e92 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -1478,13 +1478,13 @@ awt::Size Button::CreateBoundingSize ( widths.push_back(sal::static_int_cast<sal_Int32>(0.5 + aTextBBoxDisabled.X2 - aTextBBoxDisabled.X1)); widths.push_back(sal::static_int_cast<sal_Int32>(0.5 + aTextBBoxMouseOverSelected.X2 - aTextBBoxMouseOverSelected.X1)); - const sal_Int32 nGap (5); sal_Int32 nTextHeight (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1)); Reference<rendering::XBitmap> xBitmap; if (mpMode->mpIcon) xBitmap = mpMode->mpIcon->GetNormalBitmap(); if (xBitmap.is()) { + const sal_Int32 nGap (5); geometry::IntegerSize2D aSize (xBitmap->getSize()); return awt::Size( ::std::max(aSize.Width, *std::max_element(widths.begin(), widths.end())), |