summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-26 08:37:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-26 11:20:07 +0200
commitc0cc59adca23580864a2e5cdadf66212246cbfcc (patch)
tree57413c8efb3ca4a59f3699592353da1c575e345d /framework
parent4bf2052e9dbdfcd32a749747c918f2d714010633 (diff)
loplugin:singlevalfields improvement
look for any kind of types, not just POD types, helps to find smart pointer fields that are only assigned nullptr Change-Id: I2d887e98db012f03b646e1023985bcc196285abc Reviewed-on: https://gerrit.libreoffice.org/62382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx4
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx8
-rw-r--r--framework/source/uielement/uicommanddescription.cxx58
3 files changed, 18 insertions, 52 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 7d2e47e942d9..d6c2201a364f 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -210,7 +210,6 @@ private:
bool m_bDisposed;
OUString m_aXMLPostfix;
OUString m_aPropUIName;
- OUString m_aPropResourceURL;
OUString m_aModuleIdentifier;
css::uno::Reference< css::embed::XTransactedObject > m_xUserRootCommit;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
@@ -834,7 +833,6 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
, m_bDisposed( false )
, m_aXMLPostfix( ".xml" )
, m_aPropUIName( "UIName" )
- , m_aPropResourceURL( "ResourceURL" )
, m_xContext( xContext )
, m_aListenerContainer( m_mutex )
{
@@ -1078,7 +1076,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ModuleUIConfigurationManager::get
impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType );
Sequence< PropertyValue > aUIElementInfo( 2 );
- aUIElementInfo[0].Name = m_aPropResourceURL;
+ aUIElementInfo[0].Name = "ResourceURL";
aUIElementInfo[1].Name = m_aPropUIName;
aElementInfoSeq.resize( aUIElementInfoCollection.size() );
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 91cca8cdff4e..75e42e4d7911 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -186,9 +186,7 @@ private:
bool m_bReadOnly;
bool m_bModified;
bool m_bDisposed;
- OUString m_aXMLPostfix;
OUString m_aPropUIName;
- OUString m_aPropResourceURL;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
osl::Mutex m_mutex;
cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
@@ -673,9 +671,7 @@ UIConfigurationManager::UIConfigurationManager( const css::uno::Reference< css::
m_bReadOnly( true )
, m_bModified( false )
, m_bDisposed( false )
- , m_aXMLPostfix( ".xml" )
, m_aPropUIName( "UIName" )
- , m_aPropResourceURL( "ResourceURL" )
, m_xContext( rxContext )
, m_aListenerContainer( m_mutex )
{
@@ -856,7 +852,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL UIConfigurationManager::getUIElem
impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType );
Sequence< PropertyValue > aUIElementInfo( 2 );
- aUIElementInfo[0].Name = m_aPropResourceURL;
+ aUIElementInfo[0].Name = "ResourceURL";
aUIElementInfo[1].Name = m_aPropUIName;
aElementInfoSeq.resize( aUIElementInfoCollection.size() );
@@ -1084,7 +1080,7 @@ void SAL_CALL UIConfigurationManager::insertSettings( const OUString& NewResourc
if ( bInsertData )
{
- pDataSettings->aName = RetrieveNameFromResourceURL( NewResourceURL ) + m_aXMLPostfix;
+ pDataSettings->aName = RetrieveNameFromResourceURL( NewResourceURL ) + ".xml";
pDataSettings->aResourceURL = NewResourceURL;
UIElementDataHashMap& rElements = rElementType.aElementsHashMap;
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 4b5734d52566..547a035b088e 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -132,21 +132,7 @@ class ConfigurationAccess_UICommand : // Order is necessary for right initializa
OUString m_aConfigCmdAccess;
OUString m_aConfigPopupAccess;
- OUString m_aPropUILabel;
- OUString m_aPropUIContextLabel;
- OUString m_aPropUIPopupLabel;
- OUString m_aPropUITooltipLabel;
- OUString m_aPropUITargetURL;
- OUString m_aPropUIIsExperimental;
- OUString m_aPropLabel;
- OUString m_aPropName;
- OUString m_aPropPopup;
- OUString m_aPropPopupLabel;
- OUString m_aPropTooltipLabel;
- OUString m_aPropTargetURL;
- OUString m_aPropIsExperimental;
OUString m_aPropProperties;
- OUString m_aPrivateResourceURL;
Reference< XNameAccess > m_xGenericUICommands;
Reference< XMultiServiceFactory > m_xConfigProvider;
Reference< XNameAccess > m_xConfigAccess;
@@ -167,21 +153,7 @@ class ConfigurationAccess_UICommand : // Order is necessary for right initializa
ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const OUString& aModuleName, const Reference< XNameAccess >& rGenericUICommands, const Reference< XComponentContext>& rxContext ) :
m_aConfigCmdAccess( CONFIGURATION_ROOT_ACCESS ),
m_aConfigPopupAccess( CONFIGURATION_ROOT_ACCESS ),
- m_aPropUILabel( "Label" ),
- m_aPropUIContextLabel( "ContextLabel" ),
- m_aPropUIPopupLabel( "PopupLabel" ),
- m_aPropUITooltipLabel( "TooltipLabel" ),
- m_aPropUITargetURL( "TargetURL" ),
- m_aPropUIIsExperimental( "IsExperimental" ),
- m_aPropLabel( "Label" ),
- m_aPropName( "Name" ),
- m_aPropPopup( "Popup" ),
- m_aPropPopupLabel( "PopupLabel" ),
- m_aPropTooltipLabel( "TooltipLabel" ),
- m_aPropTargetURL( "TargetURL" ),
- m_aPropIsExperimental( "IsExperimental" ),
m_aPropProperties( "Properties" ),
- m_aPrivateResourceURL( PRIVATE_RESOURCE_URL ),
m_xGenericUICommands( rGenericUICommands ),
m_bConfigAccessInitialized( false ),
m_bCacheFilled( false ),
@@ -220,7 +192,7 @@ Any ConfigurationAccess_UICommand::getByNameImpl( const OUString& rCommandURL )
fillCache();
}
- if ( rCommandURL.startsWith( m_aPrivateResourceURL ) )
+ if ( rCommandURL.startsWith( PRIVATE_RESOURCE_URL ) )
{
// special keys to retrieve information about a set of commands
// SAFE
@@ -292,22 +264,22 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const OUString& aComman
fillInfoFromResult( pIter->second, pIter->second.aLabel );
Sequence< PropertyValue > aPropSeq( 8 );
- aPropSeq[0].Name = m_aPropLabel;
+ aPropSeq[0].Name = "Label";
aPropSeq[0].Value = !pIter->second.aContextLabel.isEmpty() ?
makeAny( pIter->second.aContextLabel ): makeAny( pIter->second.aLabel );
- aPropSeq[1].Name = m_aPropName;
+ aPropSeq[1].Name = "Name";
aPropSeq[1].Value <<= pIter->second.aCommandName;
- aPropSeq[2].Name = m_aPropPopup;
+ aPropSeq[2].Name = "Popup";
aPropSeq[2].Value <<= pIter->second.bPopup;
aPropSeq[3].Name = m_aPropProperties;
aPropSeq[3].Value <<= pIter->second.nProperties;
- aPropSeq[4].Name = m_aPropPopupLabel;
+ aPropSeq[4].Name = "PopupLabel";
aPropSeq[4].Value <<= pIter->second.aPopupLabel;
- aPropSeq[5].Name = m_aPropTooltipLabel;
+ aPropSeq[5].Name = "TooltipLabel";
aPropSeq[5].Value <<= pIter->second.aTooltipLabel;
- aPropSeq[6].Name = m_aPropTargetURL;
+ aPropSeq[6].Name = "TargetURL";
aPropSeq[6].Value <<= pIter->second.aTargetURL;
- aPropSeq[7].Name = m_aPropIsExperimental;
+ aPropSeq[7].Name = "IsExperimental";
aPropSeq[7].Value <<= pIter->second.bIsExperimental;
return makeAny( aPropSeq );
}
@@ -333,13 +305,13 @@ void ConfigurationAccess_UICommand::impl_fill(const Reference< XNameAccess >& _x
CmdToInfoMap aCmdToInfo;
aCmdToInfo.bPopup = _bPopup;
- xNameAccess->getByName( m_aPropUILabel ) >>= aCmdToInfo.aLabel;
- xNameAccess->getByName( m_aPropUIContextLabel ) >>= aCmdToInfo.aContextLabel;
- xNameAccess->getByName( m_aPropUIPopupLabel ) >>= aCmdToInfo.aPopupLabel;
- xNameAccess->getByName( m_aPropUITooltipLabel ) >>= aCmdToInfo.aTooltipLabel;
- xNameAccess->getByName( m_aPropUITargetURL ) >>= aCmdToInfo.aTargetURL;
- xNameAccess->getByName( m_aPropUIIsExperimental ) >>= aCmdToInfo.bIsExperimental;
- xNameAccess->getByName( m_aPropProperties ) >>= aCmdToInfo.nProperties;
+ xNameAccess->getByName( "Label" ) >>= aCmdToInfo.aLabel;
+ xNameAccess->getByName( "ContextLabel" ) >>= aCmdToInfo.aContextLabel;
+ xNameAccess->getByName( "PopupLabel" ) >>= aCmdToInfo.aPopupLabel;
+ xNameAccess->getByName( "TooltipLabel" ) >>= aCmdToInfo.aTooltipLabel;
+ xNameAccess->getByName( "TargetURL" ) >>= aCmdToInfo.aTargetURL;
+ xNameAccess->getByName( "IsExperimental" ) >>= aCmdToInfo.bIsExperimental;
+ xNameAccess->getByName( m_aPropProperties ) >>= aCmdToInfo.nProperties;
m_aCmdInfoCache.emplace( aNameSeq[i], aCmdToInfo );