diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:10:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:10:08 +0100 |
commit | 931b1fb6959dcdd6b37311a5eb07dedd7e5a26d7 (patch) | |
tree | 0d3ccb589c146c1f6eb1097b3ca3703833dd334e /sw/source/uibase/uno/unodispatch.cxx | |
parent | c4de235ad38cd648c82c98235016f186eb594a32 (diff) |
New loplugin:conststringvar: sw
Change-Id: I8c2dcd34668f9f2e4bea70ea86ff57fd7b923c34
Diffstat (limited to 'sw/source/uibase/uno/unodispatch.cxx')
-rw-r--r-- | sw/source/uibase/uno/unodispatch.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index b64983cc8e25..7da8b90a90d5 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -33,11 +33,11 @@ using namespace ::com::sun::star; -static const char* cURLFormLetter = ".uno:DataSourceBrowser/FormLetter"; -static const char* cURLInsertContent = ".uno:DataSourceBrowser/InsertContent";//data into fields -static const char* cURLInsertColumns = ".uno:DataSourceBrowser/InsertColumns";//data into text -static const char* cURLDocumentDataSource = ".uno:DataSourceBrowser/DocumentDataSource";//current data source of the document -static const sal_Char* cInternalDBChangeNotification = ".uno::Writer/DataSourceChanged"; +static const char cURLFormLetter[] = ".uno:DataSourceBrowser/FormLetter"; +static const char cURLInsertContent[] = ".uno:DataSourceBrowser/InsertContent";//data into fields +static const char cURLInsertColumns[] = ".uno:DataSourceBrowser/InsertColumns";//data into text +static const char cURLDocumentDataSource[] = ".uno:DataSourceBrowser/DocumentDataSource";//current data source of the document +static const sal_Char cInternalDBChangeNotification[] = ".uno::Writer/DataSourceChanged"; SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_pView(&rVw) @@ -70,10 +70,10 @@ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch // create some dispatch ... if(m_pView && aURL.Complete.startsWith(".uno:DataSourceBrowser/")) { - if(aURL.Complete.equalsAscii(cURLFormLetter) || - aURL.Complete.equalsAscii(cURLInsertContent) || - aURL.Complete.equalsAscii(cURLInsertColumns)|| - aURL.Complete.equalsAscii(cURLDocumentDataSource)) + if(aURL.Complete == cURLFormLetter || + aURL.Complete == cURLInsertContent || + aURL.Complete == cURLInsertColumns || + aURL.Complete == cURLDocumentDataSource) { if(!m_xDispatch.is()) m_xDispatch = new SwXDispatch(*m_pView); @@ -225,17 +225,17 @@ void SwXDispatch::dispatch(const util::URL& aURL, #else SwWrtShell& rSh = m_pView->GetWrtShell(); SwDBManager* pDBManager = rSh.GetDBManager(); - if(aURL.Complete.equalsAscii(cURLInsertContent)) + if(aURL.Complete == cURLInsertContent) { svx::ODataAccessDescriptor aDescriptor(aArgs); SwMergeDescriptor aMergeDesc( DBMGR_MERGE, rSh, aDescriptor ); pDBManager->Merge(aMergeDesc); } - else if(aURL.Complete.equalsAscii(cURLInsertColumns)) + else if(aURL.Complete == cURLInsertColumns) { SwDBManager::InsertText(rSh, aArgs); } - else if(aURL.Complete.equalsAscii(cURLFormLetter)) + else if(aURL.Complete == cURLFormLetter) { SfxUsrAnyItem aDBProperties(FN_PARAM_DATABASE_PROPERTIES, uno::makeAny(aArgs)); m_pView->GetViewFrame()->GetDispatcher()->ExecuteList( @@ -244,11 +244,11 @@ void SwXDispatch::dispatch(const util::URL& aURL, { &aDBProperties }); } #endif - else if(aURL.Complete.equalsAscii(cURLDocumentDataSource)) + else if(aURL.Complete == cURLDocumentDataSource) { OSL_FAIL("SwXDispatch::dispatch: this URL is not to be dispatched!"); } - else if(aURL.Complete.equalsAscii(cInternalDBChangeNotification)) + else if(aURL.Complete == cInternalDBChangeNotification) { frame::FeatureStateEvent aEvent; aEvent.IsEnabled = true; @@ -267,7 +267,7 @@ void SwXDispatch::dispatch(const util::URL& aURL, for(aListIter = m_aListenerList.begin(); aListIter != m_aListenerList.end(); ++aListIter) { StatusStruct_Impl aStatus = *aListIter; - if(aStatus.aURL.Complete.equalsAscii(cURLDocumentDataSource)) + if(aStatus.aURL.Complete == cURLDocumentDataSource) { aEvent.FeatureURL = aStatus.aURL; aStatus.xListener->statusChanged( aEvent ); @@ -297,7 +297,7 @@ void SwXDispatch::addStatusListener( aEvent.FeatureURL = aURL; // one of the URLs requires a special state .... - if (aURL.Complete.equalsAscii(cURLDocumentDataSource)) + if (aURL.Complete == cURLDocumentDataSource) { const SwDBData& rData = m_pView->GetWrtShell().GetDBDesc(); @@ -368,7 +368,7 @@ void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::Runti { StatusStruct_Impl aStatus = *aListIter; aEvent.FeatureURL = aStatus.aURL; - if (!aStatus.aURL.Complete.equalsAscii(cURLDocumentDataSource)) + if (aStatus.aURL.Complete != cURLDocumentDataSource) // the document's data source does not depend on the selection, so it's state does not change here aStatus.xListener->statusChanged( aEvent ); } |