diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-06 14:49:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 09:57:24 +0200 |
commit | 4250b25c6ae361359300ab6ccde27230f8e01039 (patch) | |
tree | 916a8420282928a92ede0760d696997550ae0840 /framework | |
parent | 2ed9a2b641682d8612b5404bd3978ed049aa0266 (diff) |
teach unnecessaryparen loplugin about identifiers
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b
Reviewed-on: https://gerrit.libreoffice.org/39737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 17 | ||||
-rw-r--r-- | framework/source/accelerators/presethandler.cxx | 2 | ||||
-rw-r--r-- | framework/source/dispatch/closedispatcher.cxx | 10 | ||||
-rw-r--r-- | framework/source/fwe/interaction/preventduplicateinteraction.cxx | 10 | ||||
-rw-r--r-- | framework/source/helper/persistentwindowstate.cxx | 7 | ||||
-rw-r--r-- | framework/source/helper/titlebarupdate.cxx | 15 | ||||
-rw-r--r-- | framework/source/inc/pattern/window.hxx | 5 | ||||
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 5 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 10 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 20 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 5 |
11 files changed, 23 insertions, 83 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index b09042600d45..ed13cb13cdad 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -458,10 +458,7 @@ AcceleratorCache& XMLBasedAcceleratorConfiguration::impl_getCFG(bool bWriteAcces //create copy of our readonly-cache, if write access is forced ... but //not still possible! - if ( - (bWriteAccessRequested) && - (!m_pWriteCache ) - ) + if ( bWriteAccessRequested && !m_pWriteCache ) { m_pWriteCache = new AcceleratorCache(m_aReadCache); } @@ -730,7 +727,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g if (pPreferredKey != lKeys.end ()) { css::uno::Any& rAny = lPreferredOnes[i]; - rAny <<= *(pPreferredKey); + rAny <<= *pPreferredKey; } } @@ -1333,10 +1330,7 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(bool bPreferred, { //create copy of our readonly-cache, if write access is forced ... but //not still possible! - if ( - (bWriteAccessRequested) && - (!m_pPrimaryWriteCache ) - ) + if ( bWriteAccessRequested && !m_pPrimaryWriteCache ) { m_pPrimaryWriteCache = new AcceleratorCache(m_aPrimaryReadCache); } @@ -1353,10 +1347,7 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(bool bPreferred, { //create copy of our readonly-cache, if write access is forced ... but //not still possible! - if ( - (bWriteAccessRequested) && - (!m_pSecondaryWriteCache ) - ) + if ( bWriteAccessRequested && !m_pSecondaryWriteCache ) { m_pSecondaryWriteCache = new AcceleratorCache(m_aSecondaryReadCache); } diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index 13034b7ede1e..f1126d7c2afd 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -365,7 +365,7 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType // b) inside user layer we can (SOFT mode!) but sometimes we should not (HARD mode!) // create new empty structures. We should preferr using of any existing structure. sal_Int32 eShareMode = (css::embed::ElementModes::READ | css::embed::ElementModes::NOCREATE); - sal_Int32 eUserMode = (css::embed::ElementModes::READWRITE ); + sal_Int32 eUserMode = css::embed::ElementModes::READWRITE; OUStringBuffer sRelPathBuf(1024); OUString sRelPathShare; diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 38cb7f3e53eb..7302507ebbe5 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -401,10 +401,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void) else if (bTerminateApp) bSuccess = implts_terminateApplication(); - if ( - ( ! bSuccess ) && - ( bControllerSuspended ) - ) + if ( ! bSuccess && bControllerSuspended ) { css::uno::Reference< css::frame::XController > xController = xCloseFrame->getController(); if (xController.is()) @@ -596,10 +593,7 @@ css::uno::Reference< css::frame::XFrame > CloseDispatcher::static_impl_searchRig // a simple XWindow using the toolkit only .-( SolarMutexGuard aSolarLock; VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); - if ( - (pWindow ) && - (pWindow->IsSystemWindow()) - ) + if ( pWindow && pWindow->IsSystemWindow() ) return xTarget; } diff --git a/framework/source/fwe/interaction/preventduplicateinteraction.cxx b/framework/source/fwe/interaction/preventduplicateinteraction.cxx index a019094d1484..910c0891f077 100644 --- a/framework/source/fwe/interaction/preventduplicateinteraction.cxx +++ b/framework/source/fwe/interaction/preventduplicateinteraction.cxx @@ -103,10 +103,7 @@ void SAL_CALL PreventDuplicateInteraction::handle(const css::uno::Reference< css aLock.clear(); // <- SAFE - if ( - (bHandleIt ) && - (xHandler.is()) - ) + if ( bHandleIt && xHandler.is() ) { xHandler->handle(xRequest); } @@ -158,10 +155,7 @@ sal_Bool SAL_CALL PreventDuplicateInteraction::handleInteractionRequest( const c aLock.clear(); // <- SAFE - if ( - (bHandleIt ) && - (xHandler.is()) - ) + if ( bHandleIt && xHandler.is() ) { return xHandler->handleInteractionRequest(xRequest); } diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index 30e3290cdbd2..60810826c941 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -211,12 +211,9 @@ OUString PersistentWindowState::implst_getWindowStateFromWindow(const css::uno:: VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is necessary to guarantee correct pointer cast! - if ( - (pWindow ) && - (pWindow->IsSystemWindow()) - ) + if ( pWindow && pWindow->IsSystemWindow() ) { - WindowStateMask const nMask = WindowStateMask::All & ~(WindowStateMask::Minimized); + WindowStateMask const nMask = WindowStateMask::All & ~WindowStateMask::Minimized; sWindowState = OStringToOUString( static_cast<SystemWindow*>(pWindow.get())->GetWindowState(nMask), RTL_TEXTENCODING_UTF8); diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index ea8120050863..c6d916a60f19 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -164,10 +164,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr SolarMutexGuard aSolarGuard; VclPtr<vcl::Window> pWindow = (VCLUnoHelper::GetWindow( xWindow )); - if ( - ( pWindow ) && - ( pWindow->GetType() == WindowType::WORKWINDOW ) - ) + if ( pWindow && pWindow->GetType() == WindowType::WORKWINDOW ) { WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get()); pWorkWindow->SetApplicationID( sApplicationID ); @@ -281,10 +278,7 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra SolarMutexGuard aSolarGuard; VclPtr<vcl::Window> pWindow = (VCLUnoHelper::GetWindow( xWindow )); - if ( - ( pWindow ) && - ( pWindow->GetType() == WindowType::WORKWINDOW ) - ) + if ( pWindow && ( pWindow->GetType() == WindowType::WORKWINDOW ) ) { WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get()); pWorkWindow->SetIcon( (sal_uInt16)nIcon ); @@ -315,10 +309,7 @@ void TitleBarUpdate::impl_updateTitle(const css::uno::Reference< css::frame::XFr SolarMutexGuard aSolarGuard; VclPtr<vcl::Window> pWindow = (VCLUnoHelper::GetWindow( xWindow )); - if ( - ( pWindow ) && - ( pWindow->GetType() == WindowType::WORKWINDOW ) - ) + if ( pWindow && ( pWindow->GetType() == WindowType::WORKWINDOW ) ) { WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get()); pWorkWindow->SetText( sTitle ); diff --git a/framework/source/inc/pattern/window.hxx b/framework/source/inc/pattern/window.hxx index 2f2b21b21761..54ddce6e4119 100644 --- a/framework/source/inc/pattern/window.hxx +++ b/framework/source/inc/pattern/window.hxx @@ -54,10 +54,7 @@ static bool isTopWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) // a simple XWindow using the toolkit only .-( SolarMutexGuard aSolarGuard; VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); - if ( - (pWindow ) && - (pWindow->IsSystemWindow()) - ) + if ( pWindow && pWindow->IsSystemWindow() ) return true; } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index c6fd863a4968..0bff7d4127ef 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1286,10 +1286,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // They will be used as "last chance" if there is no visible frame pointing to the same model. // Safe the result but continue with current loop might be looking for other visible frames. bool bIsHidden = lOldDocDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false); - if ( - ( bIsHidden ) && - ( ! xHiddenTask.is()) - ) + if ( bIsHidden && ! xHiddenTask.is() ) { xHiddenTask = xTask; xTask.clear (); diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 3a9fdfdb546a..78237387d428 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1154,10 +1154,7 @@ void CacheLockGuard::lock(bool bLockForAddRemoveVectorItems) // operation. On the other side a crash reasoned by an invalid stl iterator // will have the same effect .-) - if ( - (m_rCacheLock > 0 ) && - (bLockForAddRemoveVectorItems) - ) + if ( (m_rCacheLock > 0) && bLockForAddRemoveVectorItems ) { OSL_FAIL("Re-entrance problem detected. Using of an stl structure in combination with iteration, adding, removing of elements etcpp."); throw css::uno::RuntimeException( @@ -1483,10 +1480,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) /* SAFE */ { osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); m_eJob = E_NO_JOB; - if ( - (bAllowAutoSaveReactivation) && - (bWasAutoSaveActive ) - ) + if ( bAllowAutoSaveReactivation && bWasAutoSaveActive ) { m_eJob |= AutoRecovery::E_AUTO_SAVE; diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index e96224815441..090c109318d6 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -271,10 +271,7 @@ sal_Bool SAL_CALL Desktop::terminate() bool bTerminate = false; try { - if( - ( bAskQuickStart ) && - ( xQuickLauncher.is() ) - ) + if( bAskQuickStart && xQuickLauncher.is() ) { xQuickLauncher->queryTermination( aEvent ); lCalledTerminationListener.push_back( xQuickLauncher ); @@ -334,10 +331,7 @@ sal_Bool SAL_CALL Desktop::terminate() Scheduler::ProcessEventsToIdle(); } - if( - ( bAskQuickStart ) && - ( xQuickLauncher.is() ) - ) + if( bAskQuickStart && xQuickLauncher.is() ) { xQuickLauncher->notifyTermination( aEvent ); } @@ -1724,10 +1718,7 @@ bool Desktop::impl_closeFrames(bool bAllowUI) // Use it in case it was allowed from outside only. bool bSuspended = false; css::uno::Reference< css::frame::XController > xController( xFrame->getController(), css::uno::UNO_QUERY ); - if ( - ( bAllowUI ) && - ( xController.is() ) - ) + if ( bAllowUI && xController.is() ) { bSuspended = xController->suspend( true ); if ( ! bSuspended ) @@ -1760,10 +1751,7 @@ bool Desktop::impl_closeFrames(bool bAllowUI) // It can happen that XController.suspend() returned true ... but a registered close listener // throwed these veto exception. Then the controller has to be reactivated. Otherwise // these document doesn't work any more. - if ( - (bSuspended ) && - (xController.is()) - ) + if ( bSuspended && xController.is()) xController->suspend(false); } diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index a4e21ae052b8..76dddcafd4f8 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -1528,10 +1528,7 @@ sal_Bool SAL_CALL Frame::setComponent(const css::uno::Reference< css::awt::XWind // A new component window doesn't know anything about current active/focus states. // Set this information on it! - if ( - (bHadFocus ) && - (xComponentWindow.is()) - ) + if ( bHadFocus && xComponentWindow.is() ) { xComponentWindow->setFocus(); } |