summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 08:23:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 14:47:12 +0200
commitbf9f0b2973138652946f2480ede72c54602b854a (patch)
treefd79d9281c3d7661ade8d50ed49769184e581804 /framework
parent04112bce506c60254cb1cb8536f942c8adb5c7d6 (diff)
loplugin:sequentialassign in framework
Change-Id: I98da731a0f6b72ea0cb890dae2f25992c75a0984 Reviewed-on: https://gerrit.libreoffice.org/70701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/macros/registration.hxx3
-rw-r--r--framework/source/accelerators/presethandler.cxx4
-rw-r--r--framework/source/dispatch/oxt_handler.cxx4
-rw-r--r--framework/source/dispatch/popupmenudispatcher.cxx3
-rw-r--r--framework/source/fwe/classes/addonsoptions.cxx12
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx3
-rw-r--r--framework/source/fwe/xml/xmlnamespaces.cxx3
-rw-r--r--framework/source/loadenv/loadenv.cxx4
-rw-r--r--framework/source/recording/dispatchrecorder.cxx3
-rw-r--r--framework/source/services/substitutepathvars.cxx3
-rw-r--r--framework/source/uiconfiguration/globalsettings.cxx3
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx4
-rw-r--r--framework/source/uielement/menubarmerger.cxx4
-rw-r--r--framework/source/uielement/menubarwrapper.cxx3
-rw-r--r--framework/source/uielement/statusbarmanager.cxx4
-rw-r--r--framework/source/uielement/subtoolbarcontroller.cxx4
16 files changed, 19 insertions, 45 deletions
diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx
index a413e8a2964e..4d41818a9321 100644
--- a/framework/inc/macros/registration.hxx
+++ b/framework/inc/macros/registration.hxx
@@ -65,8 +65,7 @@ ________________________________________________________________________________
{ \
/* Define variables which are used in following macros. */ \
css::uno::Reference< css::uno::XInterface > xFactory; \
- css::uno::Reference< css::lang::XMultiServiceFactory > xServiceManager; \
- xServiceManager = static_cast< css::lang::XMultiServiceFactory* >( pServiceManager ); \
+ css::uno::Reference< css::lang::XMultiServiceFactory > xServiceManager = static_cast< css::lang::XMultiServiceFactory* >( pServiceManager ); \
/* These parameter will expand to */ \
/* "IF_NAME_CREATECOMPONENTFACTORY(a) */ \
/* else */ \
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index fc5f0a19ca30..156f1d0b91b7 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -743,9 +743,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::impl_openLocalizedPat
// it doesn't matter, if there is a locale fallback or not
// If creation of storages is allowed, we do it anyway.
// Otherwise we have no acc config at all, which can make other trouble.
- OUString sLocalizedPath;
- sLocalizedPath = sPath;
- sLocalizedPath += "/";
+ OUString sLocalizedPath = sPath + "/";
if (pLocaleFolder != lSubFolders.end())
sLocalizedPath += *pLocaleFolder;
else
diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx
index 10c7da5049dc..6795671d6927 100644
--- a/framework/source/dispatch/oxt_handler.cxx
+++ b/framework/source/dispatch/oxt_handler.cxx
@@ -102,9 +102,7 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL,
css::uno::Sequence< css::uno::Any > lParams(1);
lParams[0] <<= aURL.Main;
- css::uno::Reference< css::uno::XInterface > xService;
-
- xService = m_xFactory->createInstanceWithArguments( sServiceName, lParams );
+ css::uno::Reference< css::uno::XInterface > xService = m_xFactory->createInstanceWithArguments( sServiceName, lParams );
css::uno::Reference< css::task::XJobExecutor > xExecuteable( xService, css::uno::UNO_QUERY );
if ( xExecuteable.is() )
xExecuteable->trigger( OUString() );
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 2463890e16b1..3222745966c3 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -307,8 +307,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
if ( xLayoutManager.is() )
{
- css::uno::Reference< css::ui::XUIElement > xMenuBar;
- xMenuBar = xLayoutManager->getElement( "private:resource/menubar/menubar" );
+ css::uno::Reference< css::ui::XUIElement > xMenuBar = xLayoutManager->getElement( "private:resource/menubar/menubar" );
m_xPopupCtrlQuery.set( xMenuBar, css::uno::UNO_QUERY );
}
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index a9822bc3f110..b9463e47e69f 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -1032,9 +1032,8 @@ bool AddonsOptions_Impl::ReadStatusBarItem(
bool bResult( false );
OUString aURL;
OUString aAddonStatusbarItemTreeNode( aStatusarItemNodeName + m_aPathDelimiter );
- Sequence< Any > aStatusbarItemNodePropValues;
- aStatusbarItemNodePropValues = GetProperties( GetPropertyNamesStatusbarItem( aAddonStatusbarItemTreeNode ) );
+ Sequence< Any > aStatusbarItemNodePropValues = GetProperties( GetPropertyNamesStatusbarItem( aAddonStatusbarItemTreeNode ) );
// Command URL is required
if (( aStatusbarItemNodePropValues[ OFFSET_STATUSBARITEM_URL ] >>= aURL ) && aURL.getLength() > 0 )
@@ -1063,9 +1062,8 @@ bool AddonsOptions_Impl::ReadMenuItem( const OUString& aMenuNodeName, Sequence<
bool bResult = false;
OUString aStrValue;
OUString aAddonMenuItemTreeNode( aMenuNodeName + m_aPathDelimiter );
- Sequence< Any > aMenuItemNodePropValues;
- aMenuItemNodePropValues = GetProperties( GetPropertyNamesMenuItem( aAddonMenuItemTreeNode ) );
+ Sequence< Any > aMenuItemNodePropValues = GetProperties( GetPropertyNamesMenuItem( aAddonMenuItemTreeNode ) );
if (( aMenuItemNodePropValues[ OFFSET_MENUITEM_TITLE ] >>= aStrValue ) && !aStrValue.isEmpty() )
{
aMenuItem[ OFFSET_MENUITEM_TITLE ].Value <<= aStrValue;
@@ -1134,9 +1132,8 @@ bool AddonsOptions_Impl::ReadPopupMenu( const OUString& aPopupMenuNodeName, Sequ
bool bResult = false;
OUString aStrValue;
OUString aAddonPopupMenuTreeNode( aPopupMenuNodeName + m_aPathDelimiter );
- Sequence< Any > aPopupMenuNodePropValues;
- aPopupMenuNodePropValues = GetProperties( GetPropertyNamesPopupMenu( aAddonPopupMenuTreeNode ) );
+ Sequence< Any > aPopupMenuNodePropValues = GetProperties( GetPropertyNamesPopupMenu( aAddonPopupMenuTreeNode ) );
if (( aPopupMenuNodePropValues[ OFFSET_POPUPMENU_TITLE ] >>= aStrValue ) &&
!aStrValue.isEmpty() )
{
@@ -1189,9 +1186,8 @@ bool AddonsOptions_Impl::ReadToolBarItem( const OUString& aToolBarItemNodeName,
OUString aTitle;
OUString aURL;
OUString aAddonToolBarItemTreeNode( aToolBarItemNodeName + m_aPathDelimiter );
- Sequence< Any > aToolBarItemNodePropValues;
- aToolBarItemNodePropValues = GetProperties( GetPropertyNamesToolBarItem( aAddonToolBarItemTreeNode ) );
+ Sequence< Any > aToolBarItemNodePropValues = GetProperties( GetPropertyNamesToolBarItem( aAddonToolBarItemTreeNode ) );
// A toolbar item must have a command URL
if (( aToolBarItemNodePropValues[ OFFSET_TOOLBARITEM_URL ] >>= aURL ) && !aURL.isEmpty() )
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index c15098ed8901..35fb1a4f6b92 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -505,8 +505,7 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram
}
// <- SYNCHRONIZED
- css::uno::Reference< css::uno::XInterface > xComponent;
- xComponent = xFrame->getController ();
+ css::uno::Reference< css::uno::XInterface > xComponent = xFrame->getController ();
if ( ! xComponent.is ())
xComponent = xFrame->getComponentWindow ();
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index d56f92d4ca6a..07f5d22fa9be 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -135,8 +135,7 @@ OUString const & XMLNamespaces::getNamespaceValue( const OUString& aNamespace )
return m_aDefaultNamespace;
else
{
- NamespaceMap::const_iterator p;
- p = m_aNamespaceMap.find( aNamespace );
+ NamespaceMap::const_iterator p = m_aNamespaceMap.find( aNamespace );
if ( p == m_aNamespaceMap.end() )
{
// namespace not defined => throw exception!
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index a5b2f36f38e2..7855a5cd2072 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1211,9 +1211,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
// Ignore any loader, which makes trouble :-)
::comphelper::SequenceAsHashMap lLoaderProps(xSet->nextElement());
OUString sLoader = lLoaderProps.getUnpackedValueOrDefault(PROP_NAME, OUString());
- css::uno::Reference< css::uno::XInterface > xLoader;
-
- xLoader = xLoaderFactory->createInstance(sLoader);
+ css::uno::Reference< css::uno::XInterface > xLoader = xLoaderFactory->createInstance(sLoader);
if (xLoader.is())
return xLoader;
}
diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx
index a395cef82978..7f67daae3315 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -288,9 +288,8 @@ void DispatchRecorder::implts_recordMacro( const OUString& aURL,
bool bAsComment, OUStringBuffer& aScriptBuffer )
{
OUStringBuffer aArgumentBuffer(1000);
- OUString sArrayName;
// this value is used to name the arrays of aArgumentBuffer
- sArrayName = "args" + OUString::number(m_nRecordingID);
+ OUString sArrayName = "args" + OUString::number(m_nRecordingID);
aScriptBuffer.append("rem ----------------------------------------------------------------------\n");
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 13dc84760517..87885f64072e 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -353,10 +353,9 @@ OUString SubstitutePathVariables::impl_substituteVariable( const OUString& rText
sal_Int32 nReplaceLength = 0;
OUString aReplacement;
OUString aSubString = aWorkText.copy( nPosition, nLength );
- OUString aSubVarString;
// Path variables are not case sensitive!
- aSubVarString = aSubString.toAsciiLowerCase();
+ OUString aSubVarString = aSubString.toAsciiLowerCase();
VarNameToIndexMap::const_iterator pNTOIIter = m_aPreDefVarMap.find( aSubVarString );
if ( pNTOIIter != m_aPreDefVarMap.end() )
{
diff --git a/framework/source/uiconfiguration/globalsettings.cxx b/framework/source/uiconfiguration/globalsettings.cxx
index 0663339f3dac..73bc3effb7e7 100644
--- a/framework/source/uiconfiguration/globalsettings.cxx
+++ b/framework/source/uiconfiguration/globalsettings.cxx
@@ -164,8 +164,7 @@ bool GlobalSettings_Access::GetToolbarStateInfo( GlobalSettings::StateInfo eStat
{
try
{
- css::uno::Any a;
- a = m_xConfigAccess->getByName( m_aNodeRefStates );
+ css::uno::Any a = m_xConfigAccess->getByName( m_aNodeRefStates );
css::uno::Reference< css::container::XNameAccess > xNameAccess;
if ( a >>= xNameAccess )
{
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index eb3381ce6a04..9cdcfeb838db 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -296,9 +296,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
}
else
{
- ::cppu::OWeakObject* pController = nullptr;
-
- pController = ToolBarMerger::CreateController( m_xContext, m_xFrame, m_pToolBar, aURL, nId, nWidth, aControlType );
+ ::cppu::OWeakObject* pController = ToolBarMerger::CreateController( m_xContext, m_xFrame, m_pToolBar, aURL, nId, nWidth, aControlType );
xController.set( pController, UNO_QUERY );
}
diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx
index a28e8aa53415..6d702488ac5b 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -258,9 +258,7 @@ bool MenuBarMerger::RemoveMenuItems(
const OUString& rMergeCommandParameter )
{
const sal_uInt16 nParam( sal_uInt16( rMergeCommandParameter.toInt32() ));
- sal_uInt16 nCount( 1 );
-
- nCount = std::max( nParam, nCount );
+ sal_uInt16 nCount = std::max( nParam, sal_uInt16(1) );
sal_uInt16 i = 0;
while (( nPos < pMenu->GetItemCount() ) && ( i < nCount ))
diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx
index fe49c42d8acf..36abce496d54 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -279,8 +279,7 @@ Any SAL_CALL MenuBarWrapper::getByName(
if ( pIter == m_aPopupControllerCache.end() )
throw container::NoSuchElementException();
- uno::Reference< frame::XDispatchProvider > xDispatchProvider;
- xDispatchProvider = pIter->second.m_xDispatchProvider;
+ uno::Reference< frame::XDispatchProvider > xDispatchProvider = pIter->second.m_xDispatchProvider;
return uno::makeAny( xDispatchProvider );
}
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index 82394d2748a9..9c4a6c7b8496 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -354,10 +354,8 @@ void StatusBarManager::CreateControllers()
if ( !xController.is() )
{
- svt::StatusbarController* pController( nullptr );
-
// 2) Old SFX2 Statusbar controllers
- pController = CreateStatusBarController( m_xFrame, m_pStatusBar, nId, aCommandURL );
+ svt::StatusbarController* pController = CreateStatusBarController( m_xFrame, m_pStatusBar, nId, aCommandURL );
if ( !pController )
{
// 3) Is Add-on? Generic statusbar controller
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx
index 610b2685897b..2eb1897b8069 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -200,9 +200,7 @@ css::uno::Reference< css::awt::XWindow > SubToolBarController::createPopupWindow
// create element with factory
static css::uno::WeakReference< css::ui::XUIElementFactoryManager > xWeakUIElementFactory;
css::uno::Reference< css::ui::XUIElement > xUIElement;
- css::uno::Reference< css::ui::XUIElementFactoryManager > xUIElementFactory;
-
- xUIElementFactory = xWeakUIElementFactory;
+ css::uno::Reference< css::ui::XUIElementFactoryManager > xUIElementFactory = xWeakUIElementFactory;
if ( !xUIElementFactory.is() )
{
xUIElementFactory = css::ui::theUIElementFactoryManager::get( m_xContext );