summaryrefslogtreecommitdiff
path: root/filter/source/config/cache
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-01-19 17:22:04 -0200
committerOlivier Hallot <olivier.hallot@alta.org.br>2013-01-21 23:23:21 +0000
commitc870545523a84c10a0f8ca909bb696fab2869ab6 (patch)
treee49f2c450a6a563ff8903b70ca43231e5697272a /filter/source/config/cache
parent188c2d34422936a6a19dcbb7ffc3e77bfebaee33 (diff)
Remove more STRINGPARAM macros from filter
Also, remove some chained appends, and sanitize some functions call. Change-Id: I5bfed073bd84e4dee4bc7e7b4715e413859beb50 Reviewed-on: https://gerrit.libreoffice.org/1772 Reviewed-by: Olivier Hallot <olivier.hallot@alta.org.br> Tested-by: Olivier Hallot <olivier.hallot@alta.org.br>
Diffstat (limited to 'filter/source/config/cache')
-rw-r--r--filter/source/config/cache/basecontainer.cxx17
-rw-r--r--filter/source/config/cache/contenthandlerfactory.cxx10
-rw-r--r--filter/source/config/cache/filtercache.cxx42
-rw-r--r--filter/source/config/cache/frameloaderfactory.cxx10
-rw-r--r--filter/source/config/cache/typedetection.cxx14
5 files changed, 42 insertions, 51 deletions
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index 431bac69a3c7..8e65caa3a15f 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -133,8 +133,7 @@ void BaseContainer::impl_initFlushMode()
if (!m_pFlushCache)
m_pFlushCache = m_rCache->clone();
if (!m_pFlushCache)
- throw css::uno::RuntimeException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant create write copy of internal used cache on demand." )),
+ throw css::uno::RuntimeException( "Cant create write copy of internal used cache on demand.",
dynamic_cast< css::container::XNameAccess* >(this));
// <- SAFE
}
@@ -203,8 +202,7 @@ void SAL_CALL BaseContainer::insertByName(const ::rtl::OUString& sItem ,
css::uno::RuntimeException )
{
if (sItem.isEmpty())
- throw css::lang::IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "empty value not allowed as item name." )),
+ throw css::lang::IllegalArgumentException("empty value not allowed as item name.",
static_cast< css::container::XNameContainer* >(this),
1);
@@ -267,8 +265,7 @@ void SAL_CALL BaseContainer::replaceByName(const ::rtl::OUString& sItem ,
css::uno::RuntimeException )
{
if (sItem.isEmpty())
- throw css::lang::IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "empty value not allowed as item name." )),
+ throw css::lang::IllegalArgumentException("empty value not allowed as item name.",
static_cast< css::container::XNameContainer* >(this),
1);
@@ -307,8 +304,7 @@ css::uno::Any SAL_CALL BaseContainer::getByName(const ::rtl::OUString& sItem)
css::uno::RuntimeException )
{
if (sItem.isEmpty())
- throw css::container::NoSuchElementException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An empty item cant be part of this cache!" )),
+ throw css::container::NoSuchElementException( "An empty item cant be part of this cache!",
css::uno::Reference< css::uno::XInterface >(static_cast< css::container::XNameAccess* >(this), css::uno::UNO_QUERY));
css::uno::Any aValue;
@@ -506,7 +502,7 @@ void SAL_CALL BaseContainer::flush()
if (!m_pFlushCache)
throw css::lang::WrappedTargetRuntimeException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant guarantee cache consistency. Special flush container does not exists!" )),
+ "Cant guarantee cache consistency. Special flush container does not exists!",
dynamic_cast< css::container::XNameAccess* >(this),
css::uno::Any());
@@ -528,8 +524,7 @@ void SAL_CALL BaseContainer::flush()
// user whish to repair it now and calls flush()
// later again ...
- throw css::lang::WrappedTargetRuntimeException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Flush rejected by internal container." )),
+ throw css::lang::WrappedTargetRuntimeException( "Flush rejected by internal container.",
dynamic_cast< css::container::XNameAccess* >(this),
css::uno::makeAny(ex));
}
diff --git a/filter/source/config/cache/contenthandlerfactory.cxx b/filter/source/config/cache/contenthandlerfactory.cxx
index 2733d22aefd8..6916c9d33be4 100644
--- a/filter/source/config/cache/contenthandlerfactory.cxx
+++ b/filter/source/config/cache/contenthandlerfactory.cxx
@@ -146,17 +146,17 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL ContentHandlerFactory::getAvailab
-::rtl::OUString ContentHandlerFactory::impl_getImplementationName()
+OUString ContentHandlerFactory::impl_getImplementationName()
{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filter.config.ContentHandlerFactory" ));
+ return OUString( "com.sun.star.comp.filter.config.ContentHandlerFactory" );
}
-css::uno::Sequence< ::rtl::OUString > ContentHandlerFactory::impl_getSupportedServiceNames()
+css::uno::Sequence< OUString > ContentHandlerFactory::impl_getSupportedServiceNames()
{
- css::uno::Sequence< ::rtl::OUString > lServiceNames(1);
- lServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ContentHandlerFactory" ));
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames[0] = "com.sun.star.frame.ContentHandlerFactory";
return lServiceNames;
}
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 3e512edc0417..19aba9281b6a 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -671,8 +671,8 @@ void FilterCache::impl_flushByList(const css::uno::Reference< css::container::XN
// special case. no exception - but not a valid item => set must be finalized or mandatory!
// Reject flush operation by throwing an exception. At least one item couldnt be flushed.
if (!xItem.is())
- throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant add item. Set is finalized or mandatory!" )),
- css::uno::Reference< css::uno::XInterface >() );
+ throw css::uno::Exception("Cant add item. Set is finalized or mandatory!",
+ css::uno::Reference< css::uno::XInterface >());
CacheItemList::const_iterator pItem = rCache.find(sItem);
impl_saveItem(xItem, eType, pItem->second);
@@ -688,8 +688,8 @@ void FilterCache::impl_flushByList(const css::uno::Reference< css::container::XN
// special case. no exception - but not a valid item => it must be finalized or mandatory!
// Reject flush operation by throwing an exception. At least one item couldnt be flushed.
if (!xItem.is())
- throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change item. Its finalized or mandatory!" )),
- css::uno::Reference< css::uno::XInterface >() );
+ throw css::uno::Exception("Cant change item. Its finalized or mandatory!",
+ css::uno::Reference< css::uno::XInterface >());
CacheItemList::const_iterator pItem = rCache.find(sItem);
impl_saveItem(xItem, eType, pItem->second);
@@ -782,8 +782,8 @@ const CacheItemList& FilterCache::impl_getItemList(EItemType eType) const
}
- throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown sub container requested." )),
- css::uno::Reference< css::uno::XInterface >() );
+ throw css::uno::Exception("unknown sub container requested.",
+ css::uno::Reference< css::uno::XInterface >());
// <- SAFE ----------------------------------
}
@@ -802,8 +802,8 @@ CacheItemList& FilterCache::impl_getItemList(EItemType eType)
}
- throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown sub container requested." )),
- css::uno::Reference< css::uno::XInterface >() );
+ throw css::uno::Exception("unknown sub container requested.",
+ css::uno::Reference< css::uno::XInterface >());
// <- SAFE ----------------------------------
}
@@ -825,7 +825,7 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_openConfig(EConfig
return m_xConfigTypes;
sPath = CFGPACKAGE_TD_TYPES;
pConfig = &m_xConfigTypes;
- sRtlLog = ::rtl::OString("framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_TYPES)");
+ sRtlLog = "framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_TYPES)";
}
break;
@@ -835,7 +835,7 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_openConfig(EConfig
return m_xConfigFilters;
sPath = CFGPACKAGE_TD_FILTERS;
pConfig = &m_xConfigFilters;
- sRtlLog = ::rtl::OString("framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_FILTERS)");
+ sRtlLog = "framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_FILTERS)";
}
break;
@@ -845,7 +845,7 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_openConfig(EConfig
return m_xConfigOthers;
sPath = CFGPACKAGE_TD_OTHERS;
pConfig = &m_xConfigOthers;
- sRtlLog = ::rtl::OString("framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_OTHERS)");
+ sRtlLog = "framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_OTHERS)";
}
break;
@@ -855,11 +855,11 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_openConfig(EConfig
// the old configuration format only. Its not cached!
sPath = CFGPACKAGE_TD_OLD;
pConfig = &xOld;
- sRtlLog = ::rtl::OString("framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_OLD)");
+ sRtlLog = "framework (as96863) ::FilterCache::impl_openconfig(E_PROVIDER_OLD)";
}
break;
- default : throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "These configuration node isnt supported here for open!" )), 0);
+ default : throw css::uno::Exception("These configuration node isnt supported here for open!", 0);
}
{
@@ -1035,7 +1035,7 @@ void FilterCache::impl_validateAndOptimize()
throw css::document::CorruptedFilterConfigurationException(
"filter configuration: the list of types or filters is empty",
css::uno::Reference< css::uno::XInterface >(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The list of types or filters is empty." )));
+ "The list of types or filters is empty." );
}
// Create a log for all detected problems, which
@@ -1334,7 +1334,7 @@ void FilterCache::impl_addItem2FlushList( EItemType eType,
pList = &m_lChangedDetectServices;
break;
- default : throw css::uno::Exception(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unsupported item type" )), 0);
+ default : throw css::uno::Exception("unsupported item type", 0);
}
OUStringList::const_iterator pItem = ::std::find(pList->begin(), pList->end(), sItem);
@@ -2343,9 +2343,7 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe
css::uno::Reference< css::container::XNameAccess > xItem;
xSet->getByName(sItem) >>= xItem;
if (!xItem.is())
- throw css::uno::Exception(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant read old item." )),
- css::uno::Reference< css::uno::XInterface >());
+ throw css::uno::Exception("Cant read old item.", css::uno::Reference< css::uno::XInterface >());
CacheItem aItem;
aItem[PROPNAME_NAME] <<= sItem;
@@ -2359,16 +2357,14 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe
// Data
::rtl::OUString sData;
OUStringList lData;
- xItem->getByName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Data" ))) >>= sData;
+ xItem->getByName( "Data" ) >>= sData;
lData = impl_tokenizeString(sData, (sal_Unicode)',');
if (
(sData.isEmpty()) ||
(lData.size()<1 )
)
{
- throw css::uno::Exception(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant read old item property DATA." )),
- css::uno::Reference< css::uno::XInterface >());
+ throw css::uno::Exception( "Cant read old item property DATA.", css::uno::Reference< css::uno::XInterface >());
}
sal_Int32 nProp = 0;
@@ -2465,7 +2461,7 @@ sal_Bool FilterCache::impl_isModuleInstalled(const ::rtl::OUString& sModule)
m_xModuleCfg = css::uno::Reference< css::container::XNameAccess >(
::comphelper::ConfigurationHelper::openConfig(
comphelper::getComponentContext(m_xSMGR),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office/Factories" )),
+ "org.openoffice.Setup/Office/Factories",
::comphelper::ConfigurationHelper::E_READONLY),
css::uno::UNO_QUERY_THROW);
}
diff --git a/filter/source/config/cache/frameloaderfactory.cxx b/filter/source/config/cache/frameloaderfactory.cxx
index 2f25149218f7..c3344d9ff499 100644
--- a/filter/source/config/cache/frameloaderfactory.cxx
+++ b/filter/source/config/cache/frameloaderfactory.cxx
@@ -143,17 +143,17 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL FrameLoaderFactory::getAvailableS
-::rtl::OUString FrameLoaderFactory::impl_getImplementationName()
+OUString FrameLoaderFactory::impl_getImplementationName()
{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filter.config.FrameLoaderFactory" ));
+ return OUString( "com.sun.star.comp.filter.config.FrameLoaderFactory" );
}
-css::uno::Sequence< ::rtl::OUString > FrameLoaderFactory::impl_getSupportedServiceNames()
+css::uno::Sequence< OUString > FrameLoaderFactory::impl_getSupportedServiceNames()
{
- css::uno::Sequence< ::rtl::OUString > lServiceNames(1);
- lServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.FrameLoaderFactory" ));
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames[0] = "com.sun.star.frame.FrameLoaderFactory";
return lServiceNames;
}
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index 0732f06b5e5d..ca19fe078c62 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -242,7 +242,7 @@ struct EqualByName : public std::binary_function<FlatDetectionInfo, FlatDetectio
::rtl::OUString sURL = stlDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_URL(), ::rtl::OUString());
#if OSL_DEBUG_LEVEL > 0
- if (stlDescriptor.find(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ))) != stlDescriptor.end())
+ if (stlDescriptor.find( "FileName" ) != stlDescriptor.end())
OSL_FAIL("Detect using of deprecated and already unsupported MediaDescriptor property \"FileName\"!");
#endif
@@ -1136,7 +1136,7 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript
if (
(sURL.isEmpty() ) || // "non existing file" ?
(!xStream.is() ) || // non existing file !
- (sURL.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("private:stream"))) // not a good idea .-)
+ (sURL.equalsIgnoreAsciiCase("private:stream")) // not a good idea .-)
)
return ::rtl::OUString();
@@ -1263,17 +1263,17 @@ sal_Bool TypeDetection::impl_validateAndSetFilterOnDescriptor( ::comphelper
-::rtl::OUString TypeDetection::impl_getImplementationName()
+OUString TypeDetection::impl_getImplementationName()
{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filter.config.TypeDetection" ));
+ return OUString( "com.sun.star.comp.filter.config.TypeDetection" );
}
-css::uno::Sequence< ::rtl::OUString > TypeDetection::impl_getSupportedServiceNames()
+css::uno::Sequence< OUString > TypeDetection::impl_getSupportedServiceNames()
{
- css::uno::Sequence< ::rtl::OUString > lServiceNames(1);
- lServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ));
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames[0] = OUString( "com.sun.star.document.TypeDetection" );
return lServiceNames;
}