diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-31 10:28:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-31 10:03:00 +0000 |
commit | 04bfdc0a82c306dbe16e7d79e78f2b1c8fd05475 (patch) | |
tree | 317a0e7f0e09b5160df8f965c67c4b0036597c1b /vbahelper | |
parent | eaf32cd43c4d45db6c3b284d53169c81f522744e (diff) |
loplugin:oncevar in vbahelper..writerfilter
Change-Id: Ifd7e91753d9652d6b1c535cde3cddf74757a2483
Reviewed-on: https://gerrit.libreoffice.org/30430
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 3 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentsbase.cxx | 7 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 6 |
3 files changed, 5 insertions, 11 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index fe6527217805..8bd5fb02a6b6 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -200,8 +200,7 @@ OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css: } // the customize toolbars creating during importing, should found there. - static const char sToolbarPrefix[] = "private:resource/toolbar/custom_"; - sResourceUrl = sToolbarPrefix + sName; + sResourceUrl = "private:resource/toolbar/custom_" + sName; if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 230a7f022b1d..28169927e813 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -55,9 +55,6 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -static const char aSpreadsheetDocument[] = "com.sun.star.sheet.SpreadsheetDocument"; -static const char aTextDocument[] = "com.sun.star.text.TextDocument"; - typedef std::unordered_map< OUString, sal_Int32, OUStringHash > NameIndexHash; @@ -131,8 +128,8 @@ public: { uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY ); if ( xServiceInfo.is() - && ( ( xServiceInfo->supportsService( aSpreadsheetDocument ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) - || ( xServiceInfo->supportsService( aTextDocument ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) + && ( ( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) + || ( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) { uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given m_documents.push_back( xModel ); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 76b0e7e54f55..e19c1288ef0b 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -259,11 +259,10 @@ getThisWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw uno::Reference< frame::XModel > getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const char sThisExcelDoc[] = "ThisExcelDoc"; uno::Reference< frame::XModel > xModel; try { - xModel = getCurrentDoc( sThisExcelDoc ); + xModel = getCurrentDoc( "ThisExcelDoc" ); } catch (const uno::Exception&) { @@ -275,11 +274,10 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) t uno::Reference< frame::XModel > getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const char sThisWordDoc[] = "ThisWordDoc"; uno::Reference< frame::XModel > xModel; try { - xModel = getCurrentDoc( sThisWordDoc ); + xModel = getCurrentDoc( "ThisWordDoc" ); } catch (const uno::Exception&) { |