summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-31 12:40:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-31 13:17:54 +0000
commit06babf60ce9edd17e02930e60b9afdc12b40b553 (patch)
treebfb4b8c397d99b7aa6f1fb8670d3b48f4074d242 /svtools
parentc8b09c0024cc8fb5444ca422d2ddf729a5117d1d (diff)
loplugin:oncevar in svl..svx
Change-Id: I80b11a7b698de4b84d7a2f4c7dc62b2e4fd8bb01 Reviewed-on: https://gerrit.libreoffice.org/30438 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/accessibilityoptions.cxx40
-rw-r--r--svtools/source/config/colorcfg.cxx6
-rw-r--r--svtools/source/misc/openfiledroptargetlistener.cxx6
-rw-r--r--svtools/source/uno/unoevent.cxx6
4 files changed, 18 insertions, 40 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 0e874b0097fc..3078b11ca449 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -43,22 +43,6 @@ using namespace com::sun::star::uno;
#define HELP_TIP_TIMEOUT 0xffff // max. timeout setting to pretend a non-timeout
-namespace
-{
- const char s_sAccessibility[] = "org.openoffice.Office.Common/Accessibility";
- const char s_sIsForPagePreviews[] = "IsForPagePreviews";
- const char s_sIsHelpTipsDisappear[] = "IsHelpTipsDisappear";
- const char s_sHelpTipSeconds[] = "HelpTipSeconds";
- const char s_sIsAllowAnimatedGraphics[] = "IsAllowAnimatedGraphics";
- const char s_sIsAllowAnimatedText[] = "IsAllowAnimatedText";
- const char s_sIsAutomaticFontColor[] = "IsAutomaticFontColor";
- const char s_sIsSelectionInReadonly[] = "IsSelectionInReadonly";
- const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount";
- const char s_sEdgeBlending[] = "EdgeBlending";
- const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount";
- const char s_sPreviewUsesCheckeredBackground[] = "PreviewUsesCheckeredBackground";
-}
-
// class SvtAccessibilityOptions_Impl ---------------------------------------------
class SvtAccessibilityOptions_Impl
@@ -105,7 +89,7 @@ SvtAccessibilityOptions_Impl::SvtAccessibilityOptions_Impl()
m_xCfg.set(
::comphelper::ConfigurationHelper::openConfig(
comphelper::getProcessComponentContext(),
- s_sAccessibility,
+ "org.openoffice.Office.Common/Accessibility",
::comphelper::EConfigurationModes::Standard ),
css::uno::UNO_QUERY);
}
@@ -129,7 +113,7 @@ bool SvtAccessibilityOptions_Impl::GetIsForPagePreviews() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsForPagePreviews) >>= bRet;
+ xNode->getPropertyValue("IsForPagePreviews") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -146,7 +130,7 @@ bool SvtAccessibilityOptions_Impl::GetIsHelpTipsDisappear() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsHelpTipsDisappear) >>= bRet;
+ xNode->getPropertyValue("IsHelpTipsDisappear") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -164,7 +148,7 @@ bool SvtAccessibilityOptions_Impl::GetIsAllowAnimatedGraphics() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bRet;
+ xNode->getPropertyValue("IsAllowAnimatedGraphics") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -182,7 +166,7 @@ bool SvtAccessibilityOptions_Impl::GetIsAllowAnimatedText() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsAllowAnimatedText) >>= bRet;
+ xNode->getPropertyValue("IsAllowAnimatedText") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -200,7 +184,7 @@ bool SvtAccessibilityOptions_Impl::GetIsAutomaticFontColor() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsAutomaticFontColor) >>= bRet;
+ xNode->getPropertyValue("IsAutomaticFontColor") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -218,7 +202,7 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetHelpTipSeconds() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sHelpTipSeconds) >>= nRet;
+ xNode->getPropertyValue("HelpTipSeconds") >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -236,7 +220,7 @@ bool SvtAccessibilityOptions_Impl::IsSelectionInReadonly() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sIsSelectionInReadonly) >>= bRet;
+ xNode->getPropertyValue("IsSelectionInReadonly") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
@@ -254,7 +238,7 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetEdgeBlending() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sEdgeBlending) >>= nRet;
+ xNode->getPropertyValue("EdgeBlending") >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -272,7 +256,7 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetListBoxMaximumLineCount() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sListBoxMaximumLineCount) >>= nRet;
+ xNode->getPropertyValue("ListBoxMaximumLineCount") >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -290,7 +274,7 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sColorValueSetColumnCount) >>= nRet;
+ xNode->getPropertyValue("ColorValueSetColumnCount") >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -308,7 +292,7 @@ bool SvtAccessibilityOptions_Impl::GetPreviewUsesCheckeredBackground() const
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground) >>= bRet;
+ xNode->getPropertyValue("PreviewUsesCheckeredBackground") >>= bRet;
}
catch(const css::uno::Exception& ex)
{
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index 5546f90499bb..d48f7cca6eee 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -52,8 +52,6 @@ static const char g_sIsVisible[] = "/IsVisible";
namespace svtools
{
-static const sal_Char cColor[] = "/Color";
-static const sal_Char cColorSchemes[] = "ColorSchemes/";
sal_Int32 nColorRefCount_Impl = 0;
namespace
{
@@ -165,7 +163,7 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ RTL_CONSTASCII_USTRINGPARAM("/SQLComment"), false }
};
int nIndex = 0;
- OUString sBase = cColorSchemes
+ OUString sBase = "ColorSchemes/"
+ utl::wrapConfigurationElementName(rScheme);
const int nCount = ColorConfigEntryCount;
for(sal_Int32 i = 0; i < 4 * nCount; i+= 4)
@@ -174,7 +172,7 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
OUString sBaseName = sBase
+ OUString(cNames[nPos].cName, cNames[nPos].nLength, cNames[nPos].eEncoding);
pNames[nIndex] += sBaseName;
- pNames[nIndex++] += cColor;
+ pNames[nIndex++] += "/Color";
if(cNames[nPos].bCanBeVisible)
{
pNames[nIndex] += sBaseName;
diff --git a/svtools/source/misc/openfiledroptargetlistener.cxx b/svtools/source/misc/openfiledroptargetlistener.cxx
index efbd8b6e2dc8..8846171c1475 100644
--- a/svtools/source/misc/openfiledroptargetlistener.cxx
+++ b/svtools/source/misc/openfiledroptargetlistener.cxx
@@ -33,9 +33,6 @@
#include <osl/file.hxx>
#include <vcl/svapp.hxx>
-// Create a new task or recycle an existing one
-const char SPECIALTARGET_DEFAULT[] = "_default";
-
OpenFileDropTargetListener::OpenFileDropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::frame::XFrame >& xFrame )
: m_xContext ( xContext )
@@ -209,7 +206,8 @@ void OpenFileDropTargetListener::implts_OpenFile( const OUString& rFilePath )
xParser->parseStrict(aURL);
css::uno::Reference < css::frame::XDispatchProvider > xProvider( xTargetFrame, css::uno::UNO_QUERY );
- css::uno::Reference< css::frame::XDispatch > xDispatcher = xProvider->queryDispatch( aURL, SPECIALTARGET_DEFAULT, 0 );
+ // Create a new task or recycle an existing one
+ css::uno::Reference< css::frame::XDispatch > xDispatcher = xProvider->queryDispatch( aURL, "_default", 0 );
if ( xDispatcher.is() )
xDispatcher->dispatch( aURL, css::uno::Sequence < css::beans::PropertyValue >() );
}
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index ce3ab34dc636..c8a6a061b59b 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -35,12 +35,10 @@ using css::beans::PropertyValue;
static const char sAPI_ServiceName[] = "com.sun.star.container.XNameReplace";
-static const char sAPI_SvDetachedEventDescriptor[] = "SvDetachedEventDescriptor";
static const char sEventType[] = "EventType";
static const char sMacroName[] = "MacroName";
static const char sLibrary[] = "Library";
static const char sStarBasic[] = "StarBasic";
-static const char sJavaScript[] = "JavaScript";
static const char sScript[] = "Script";
static const char sNone[] = "None";
@@ -165,7 +163,7 @@ void getMacroFromAny(
eType = STARBASIC;
bTypeOK = true;
}
- else if (sTmp == sJavaScript)
+ else if (sTmp == "JavaScript")
{
eType = JAVASCRIPT;
bTypeOK = true;
@@ -414,7 +412,7 @@ void SvEventDescriptor::getByName(
SvDetachedEventDescriptor::SvDetachedEventDescriptor(
const SvEventDescription* pSupportedMacroItems) :
SvBaseEventDescriptor(pSupportedMacroItems),
- sImplName(sAPI_SvDetachedEventDescriptor)
+ sImplName("SvDetachedEventDescriptor")
{
// allocate aMacros
aMacros = new SvxMacro*[mnMacroItems];