diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 13:50:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-10 08:08:45 +0200 |
commit | f4a9ba4b484480ddacc62a47f68b02e449d72880 (patch) | |
tree | 63c46455796508142a9a49a90c8f7101a1a0522c /unotools | |
parent | convert EItem to scoped enum (diff) | |
download | core-f4a9ba4b484480ddacc62a47f68b02e449d72880.tar.gz core-f4a9ba4b484480ddacc62a47f68b02e449d72880.zip |
convert ConfigNameFormat to scoped enum
and drop unused constants
CONFIG_NAME_PLAINTEXT_NAME
CONFIG_NAME_FULL_PATH
Change-Id: Ibf7e88da0ae54516cb863b8efa995201f2a95268
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/cmdoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/configitem.cxx | 53 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 2 |
3 files changed, 5 insertions, 52 deletions
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index ff2f6445424c..b569e12041a2 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -276,7 +276,7 @@ void SvtCommandOptions_Impl::EstablishFrameCallback(const css::uno::Reference< c Sequence< OUString > SvtCommandOptions_Impl::impl_GetPropertyNames() { // First get ALL names of current existing list items in configuration! - Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::CONFIG_NAME_LOCAL_PATH ); + Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::ConfigNameFormat::LocalPath ); // Expand all keys for (sal_Int32 i=0; i<lDisabledItems.getLength(); ++i ) diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index ae468e78d701..1de221b4fa19 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -575,37 +575,11 @@ static void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFor { switch (_eFormat) { - case CONFIG_NAME_LOCAL_NAME: + case ConfigNameFormat::LocalNode: // unaltered - this is our input format break; - case CONFIG_NAME_FULL_PATH: - { - Reference<XHierarchicalName> xFormatter(_xParentNode, UNO_QUERY); - if (xFormatter.is()) - { - OUString * pNames = _rNames.getArray(); - for(int i = 0; i<_rNames.getLength(); ++i) - { - try - { - pNames[i] = xFormatter->composeHierarchicalName(pNames[i]); - } - catch (css::uno::Exception & e) - { - SAL_WARN( - "unotools.config", - "Exception from composeHierarchicalName(): " - << e.Message); - } - } - break; - } - } - OSL_FAIL("Cannot create absolute paths: missing interface"); - SAL_FALLTHROUGH; // make local paths instaed - - case CONFIG_NAME_LOCAL_PATH: + case ConfigNameFormat::LocalPath: { Reference<XTemplateContainer> xTypeContainer(_xParentNode, UNO_QUERY); if (xTypeContainer.is()) @@ -634,33 +608,12 @@ static void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFor } break; - case CONFIG_NAME_PLAINTEXT_NAME: - { - Reference<XStringEscape> xEscaper(_xParentNode, UNO_QUERY); - if (xEscaper.is()) - { - OUString * pNames = _rNames.getArray(); - for(int i = 0; i<_rNames.getLength(); ++i) - try - { - pNames[i] = xEscaper->unescapeString(pNames[i]); - } - catch (css::uno::Exception & e) - { - SAL_WARN( - "unotools.config", - "Exception from unescapeString(): " << e.Message); - } - } - } - break; - } } Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode) { - ConfigNameFormat const eDefaultFormat = CONFIG_NAME_LOCAL_NAME; // CONFIG_NAME_DEFAULT; + ConfigNameFormat const eDefaultFormat = ConfigNameFormat::LocalNode; // CONFIG_NAME_DEFAULT; return GetNodeNames(rNode, eDefaultFormat); } diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 138df08a62f2..998c4312f837 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -201,7 +201,7 @@ void GlobalEventConfig_Impl::ImplCommit() void GlobalEventConfig_Impl::initBindingInfo() { // Get ALL names of current existing list items in configuration! - Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::CONFIG_NAME_LOCAL_PATH ); + Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath ); OUString aSetNode( SETNODE_BINDINGS ); aSetNode += PATHDELIMITER; |