summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-06 09:23:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 08:34:40 +0000
commit6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch)
treed36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /sfx2
parente1fc599eb764186e5d511ace9785463eebbc7028 (diff)
new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f Reviewed-on: https://gerrit.libreoffice.org/19815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appinit.cxx3
-rw-r--r--sfx2/source/appl/appuno.cxx6
-rw-r--r--sfx2/source/config/evntconf.cxx21
-rw-r--r--sfx2/source/dialog/filtergrouping.cxx13
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
5 files changed, 15 insertions, 34 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 4a038b5e4982..7d7ee7b410fc 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -185,8 +185,7 @@ OUString GetSpecialCharsForEdit(vcl::Window* pParent, const vcl::Font& rFont)
aMod.loadRelative(&thisModule, SVLIBRARY("cui"));
// get symbol
- OUString aSymbol( "GetSpecialCharsForEdit" );
- pfunc_getSpecialCharsForEdit = reinterpret_cast<PFunc_getSpecialCharsForEdit>(aMod.getFunctionSymbol(aSymbol));
+ pfunc_getSpecialCharsForEdit = reinterpret_cast<PFunc_getSpecialCharsForEdit>(aMod.getFunctionSymbol("GetSpecialCharsForEdit"));
DBG_ASSERT( pfunc_getSpecialCharsForEdit, "GetSpecialCharsForEdit() not found!" );
aMod.release();
#else
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 52ed0ffcf054..0bea0bdfd733 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -884,15 +884,13 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
else
{
// transform parameter "OptionsPageURL" of slot "OptionsTreeDialog"
- OUString sSlotName( "OptionsTreeDialog" );
- OUString sPropName( "OptionsPageURL" );
- if ( sSlotName == OUString( pSlot->pUnoName, strlen(pSlot->pUnoName), RTL_TEXTENCODING_UTF8 ) )
+ if ( "OptionsTreeDialog" == OUString( pSlot->pUnoName, strlen(pSlot->pUnoName), RTL_TEXTENCODING_UTF8 ) )
{
for ( sal_Int32 n = 0; n < nCount; ++n )
{
const PropertyValue& rProp = pPropsVal[n];
OUString sName( rProp.Name );
- if ( sName == sPropName )
+ if ( sName == "OptionsPageURL" )
{
OUString sURL;
if ( rProp.Value >>= sURL )
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 3005e084b756..517e1f37560f 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -159,18 +159,14 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro )
uno::Sequence < beans::PropertyValue > aProperties(3);
beans::PropertyValue *pValues = aProperties.getArray();
- OUString aType(STAR_BASIC );
- OUString aLib = pMacro->GetLibName();
- OUString aMacro = pMacro->GetMacName();
-
pValues[ 0 ].Name = PROP_EVENT_TYPE;
- pValues[ 0 ].Value <<= aType;
+ pValues[ 0 ].Value <<= OUString("STAR_BASIC");
pValues[ 1 ].Name = PROP_LIBRARY;
- pValues[ 1 ].Value <<= aLib;
+ pValues[ 1 ].Value <<= pMacro->GetLibName();
pValues[ 2 ].Name = PROP_MACRO_NAME;
- pValues[ 2 ].Value <<= aMacro;
+ pValues[ 2 ].Value <<= pMacro->GetMacName();
aEventData <<= aProperties;
}
@@ -179,14 +175,11 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro )
uno::Sequence < beans::PropertyValue > aProperties(2);
beans::PropertyValue *pValues = aProperties.getArray();
- OUString aLib = pMacro->GetLibName();
- OUString aMacro = pMacro->GetMacName();
-
pValues[ 0 ].Name = PROP_EVENT_TYPE;
- pValues[ 0 ].Value <<= aLib;
+ pValues[ 0 ].Value <<= pMacro->GetLibName();
pValues[ 1 ].Name = PROP_SCRIPT;
- pValues[ 1 ].Value <<= aMacro;
+ pValues[ 1 ].Value <<= pMacro->GetMacName();
aEventData <<= aProperties;
}
@@ -195,13 +188,11 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro )
uno::Sequence < beans::PropertyValue > aProperties(2);
beans::PropertyValue *pValues = aProperties.getArray();
- OUString aMacro = pMacro->GetMacName();
-
pValues[ 0 ].Name = PROP_EVENT_TYPE;
pValues[ 0 ].Value <<= OUString(SVX_MACRO_LANGUAGE_JAVASCRIPT);
pValues[ 1 ].Name = PROP_MACRO_NAME;
- pValues[ 1 ].Value <<= aMacro;
+ pValues[ 1 ].Value <<= pMacro->GetMacName();
aEventData <<= aProperties;
}
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index ea8da230d2f4..3fb2ff5ea7b8 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -987,11 +987,6 @@ namespace sfx2
std::vector< ExportFilter > aFilterGroup;
Reference< XFilterGroupManager > xFilterGroupManager( _rxFilterManager, UNO_QUERY );
OUString sTypeName;
- const OUString sWriterHTMLType( "generic_HTML" );
- const OUString sGraphicHTMLType( "graphic_HTML" );
- const OUString sXHTMLType( "XHTML_File" );
- const OUString sPDFType( "pdf_Portable_Document_Format" );
- const OUString sFlashType( "graphic_SWF" );
for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() )
{
@@ -1001,12 +996,12 @@ namespace sfx2
ExportFilter aExportFilter( sUIName, sExtensions );
if ( nHTMLIndex == -1 &&
- ( sTypeName.equals( sWriterHTMLType ) || sTypeName.equals( sGraphicHTMLType ) ) )
+ ( sTypeName == "generic_HTML" || sTypeName == "graphic_HTML" ) )
{
aImportantFilterGroup.insert( aImportantFilterGroup.begin(), aExportFilter );
nHTMLIndex = 0;
}
- else if ( nXHTMLIndex == -1 && sTypeName.equals( sXHTMLType ) )
+ else if ( nXHTMLIndex == -1 && sTypeName == "XHTML_File" )
{
std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin();
if ( nHTMLIndex == -1 )
@@ -1015,7 +1010,7 @@ namespace sfx2
aImportantFilterGroup.insert( ++aIter, aExportFilter );
nXHTMLIndex = 0;
}
- else if ( nPDFIndex == -1 && sTypeName.equals( sPDFType ) )
+ else if ( nPDFIndex == -1 && sTypeName == "pdf_Portable_Document_Format" )
{
std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin();
if ( nHTMLIndex != -1 )
@@ -1025,7 +1020,7 @@ namespace sfx2
aImportantFilterGroup.insert( aIter, aExportFilter );
nPDFIndex = 0;
}
- else if ( nFlashIndex == -1 && sTypeName.equals( sFlashType ) )
+ else if ( nFlashIndex == -1 && sTypeName == "graphic_SWF" )
{
std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin();
if ( nHTMLIndex != -1 )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index f6a1cd24a624..3a702be52cbd 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3488,8 +3488,6 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, Reference< container::
if ( pDoc )
{
SfxModule* pModule( pDoc->GetFactory().GetModule() );
- OUString aSlotCmd( "slot:" );
- OUString aUnoCmd( ".uno:" );
Sequence< beans::PropertyValue > aSeqPropValue;
for ( sal_Int32 i = 0; i < rToolbarDefinition->getCount(); i++ )
@@ -3500,7 +3498,7 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, Reference< container::
if ( rToolbarDefinition->getByIndex( i ) >>= aSeqPropValue )
{
GetCommandFromSequence( aCommand, nIndex, aSeqPropValue );
- if ( nIndex >= 0 && ( aCommand.startsWith( aSlotCmd ) ))
+ if ( nIndex >= 0 && aCommand.startsWith( "slot:" ) )
{
OUString aSlot( aCommand.copy( 5 ));
@@ -3508,7 +3506,7 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, Reference< container::
const SfxSlot* pSlot = pModule->GetSlotPool()->GetSlot( sal_uInt16( aSlot.toInt32() ));
if ( pSlot )
{
- OUStringBuffer aStrBuf( aUnoCmd );
+ OUStringBuffer aStrBuf( ".uno:" );
aStrBuf.appendAscii( pSlot->GetUnoName() );
aCommand = aStrBuf.makeStringAndClear();