summaryrefslogtreecommitdiff
path: root/framework/source/services
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-09-08 04:57:32 +0000
committerOliver Bolte <obo@openoffice.org>2009-09-08 04:57:32 +0000
commitca00697e3dae9a03573d11281fc8d9a4ee391d3d (patch)
treec390c65f02f6f32b6d6d9faa600f4688a8c81857 /framework/source/services
parent047473d4f1a12e867ab7154113f7f1c5422d5368 (diff)
CWS-TOOLING: integrate CWS oj18
2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
Diffstat (limited to 'framework/source/services')
-rw-r--r--framework/source/services/autorecovery.cxx8
-rw-r--r--framework/source/services/backingwindow.cxx13
-rw-r--r--framework/source/services/desktop.cxx1
-rw-r--r--framework/source/services/dispatchhelper.cxx14
-rw-r--r--framework/source/services/frame.cxx10
-rw-r--r--framework/source/services/license.cxx7
-rw-r--r--framework/source/services/mediatypedetectionhelper.cxx18
-rw-r--r--framework/source/services/modulemanager.cxx7
-rw-r--r--framework/source/services/pathsettings.cxx10
-rw-r--r--framework/source/services/substitutepathvars.cxx51
-rw-r--r--framework/source/services/uriabbreviation.cxx13
-rw-r--r--framework/source/services/urltransformer.cxx178
12 files changed, 107 insertions, 223 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 93a9f215c079..9328ed9d9a5c 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3180,15 +3180,13 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
{
case AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA :
{
- css::uno::Any aSessionVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ sal_Bool bSessionData = sal_False;
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xSMGR,
CFG_PACKAGE_RECOVERY,
CFG_PATH_RECOVERYINFO,
CFG_ENTRY_SESSIONDATA,
- ::comphelper::ConfigurationHelper::E_READONLY);
-
- sal_Bool bSessionData = sal_False;
- aSessionVal >>= bSessionData;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= bSessionData;
sal_Bool bRecoveryData = ((sal_Bool)(m_lDocCache.size()>0));
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 660685b8bdcd..c58334ab085b 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -34,6 +34,7 @@
#include "backingwindow.hxx"
#include "framework.hrc"
#include "classes/fwkresid.hxx"
+#include <services.h>
#include "vcl/metric.hxx"
#include "vcl/mnemonic.hxx"
@@ -206,9 +207,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
maToolbox.ShowItem( nItemId_Info );
// get dispatch provider
- mxDesktop = Reference<XDesktop>( comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ),
- UNO_QUERY );
+ mxDesktop = Reference<XDesktop>( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_DESKTOP ),UNO_QUERY );
if( mxDesktop.is() )
mxDesktopDispatchProvider = Reference< XDispatchProvider >( mxDesktop, UNO_QUERY );
@@ -720,9 +719,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
{
try
{
- Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
- UNO_QUERY);
+ Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY);
if( xConfig.is() )
{
Sequence<Any> args(1);
@@ -732,9 +729,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
Any(rtl::OUString::createFromAscii(pNodePath)),
PropertyState_DIRECT_VALUE);
args.getArray()[0] <<= val;
- Reference<container::XNameAccess> xNameAccess(
- xConfig->createInstanceWithArguments(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
- args), UNO_QUERY);
+ Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY);
if( xNameAccess.is() )
{
rtl::OUString sURL;
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index b1ede5fce89e..a734d0bd1931 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -82,6 +82,7 @@
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx
index ffdd88d65818..c47406f424e3 100644
--- a/framework/source/services/dispatchhelper.cxx
+++ b/framework/source/services/dispatchhelper.cxx
@@ -63,19 +63,6 @@ namespace framework{
//_______________________________________________
// XInterface, XTypeProvider, XServiceInfo
-DEFINE_XINTERFACE_4(DispatchHelper ,
- OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::frame::XDispatchHelper ),
- DIRECT_INTERFACE(css::frame::XDispatchResultListener))
-
-DEFINE_XTYPEPROVIDER_4(DispatchHelper ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::frame::XDispatchHelper ,
- css::frame::XDispatchResultListener)
-
DEFINE_XSERVICEINFO_MULTISERVICE(DispatchHelper ,
::cppu::OWeakObject ,
SERVICENAME_DISPATCHHELPER ,
@@ -91,7 +78,6 @@ DEFINE_INIT_SERVICE( DispatchHelper, {} )
*/
DispatchHelper::DispatchHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
: ThreadHelpBase( )
- , OWeakObject ( )
// Init member
, m_xSMGR (xSMGR)
{
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 3d7b28697dd9..a83a7120c40e 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -62,6 +62,7 @@
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -991,10 +992,9 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
sal_Int32 nCount = xContainer->getCount();
for( sal_Int32 i=0; i<nCount; ++i )
{
- css::uno::Any aItem = xContainer->getByIndex(i);
css::uno::Reference< css::frame::XFrame > xSibling;
if (
- ( !(aItem>>=xSibling) ) || // control unpacking
+ ( !(xContainer->getByIndex(i)>>=xSibling) ) || // control unpacking
( ! xSibling.is() ) || // check for valid items
( xSibling==static_cast< ::cppu::OWeakObject* >(this) ) // ignore ourself! (We are a part of this container too - but search on our children was already done.)
)
@@ -2899,11 +2899,7 @@ void Frame::implts_setIconOnWindow()
{
try
{
- css::uno::Any aID = xSet->getPropertyValue( DECLARE_ASCII("IconId") );
- if( aID.hasValue() == sal_True )
- {
- aID >>= nIcon;
- }
+ xSet->getPropertyValue( DECLARE_ASCII("IconId") )>>= nIcon;
}
catch( css::beans::UnknownPropertyException& )
{
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index 768f7aef289c..25d117ca50e2 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -318,9 +318,9 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
#endif
// check if we need to show the license at all
// open org.openoffice.Setup/Office/ooLicenseAcceptDate
- ::rtl::OUString sConfigSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
+ ::rtl::OUString sConfigSrvc = SERVICENAME_CFGPROVIDER;
::rtl::OUString sAccessSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess");
- ::rtl::OUString sReadSrvc = ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess");
+ ::rtl::OUString sReadSrvc = SERVICENAME_CFGREADACCESS;
// get configuration provider
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
@@ -332,11 +332,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
theArgs[0] <<= v;
Reference< XPropertySet > pset = Reference< XPropertySet >(
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
- Any result = pset->getPropertyValue(::rtl::OUString::createFromAscii("ooLicenseAcceptDate"));
// if we find a date there, compare it to baseinstall license date
::rtl::OUString aAcceptDate;
- if (result >>= aAcceptDate)
+ if (pset->getPropertyValue(::rtl::OUString::createFromAscii("ooLicenseAcceptDate")) >>= aAcceptDate)
{
// get LicenseFileDate from base install
::rtl::OUString aLicenseURL = aLicensePath;
diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx
index f2139280f80a..41d57b47899e 100644
--- a/framework/source/services/mediatypedetectionhelper.cxx
+++ b/framework/source/services/mediatypedetectionhelper.cxx
@@ -38,6 +38,7 @@
#include <services.h>
#include <svtools/inettype.hxx>
#include <tools/string.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// interface includes
@@ -72,23 +73,6 @@ MediaTypeDetectionHelper::~MediaTypeDetectionHelper()
{
}
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
-
-DEFINE_XINTERFACE_3 ( MediaTypeDetectionHelper
- , OWeakObject
- , DIRECT_INTERFACE( lang::XTypeProvider )
- , DIRECT_INTERFACE( lang::XServiceInfo )
- , DIRECT_INTERFACE( util::XStringMapping )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( MediaTypeDetectionHelper
- , lang::XTypeProvider
- , lang::XServiceInfo
- , util::XStringMapping
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( MediaTypeDetectionHelper
, ::cppu::OWeakObject
, SERVICENAME_MEDIATYPEDETECTIONHELPER
diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx
index 9fa3f3af2898..9c8ce95a3ffa 100644
--- a/framework/source/services/modulemanager.cxx
+++ b/framework/source/services/modulemanager.cxx
@@ -53,6 +53,7 @@
//_______________________________________________
// other includes
+#include <rtl/logfile.hxx>
namespace framework
{
@@ -194,7 +195,7 @@ void SAL_CALL ModuleManager::replaceByName(const ::rtl::OUString& sName ,
css::uno::RuntimeException )
{
::comphelper::SequenceAsHashMap lProps(aValue);
- if (lProps.size() < 1)
+ if (lProps.empty() )
{
throw css::lang::IllegalArgumentException(
::rtl::OUString::createFromAscii("No properties given to replace part of module."),
@@ -254,10 +255,8 @@ css::uno::Any SAL_CALL ModuleManager::getByName(const ::rtl::OUString& sName)
{
// get access to the element
css::uno::Reference< css::container::XNameAccess > xCFG = implts_getConfig();
- css::uno::Any aElement = xCFG->getByName(sName);
-
css::uno::Reference< css::container::XNameAccess > xModule;
- aElement >>= xModule;
+ xCFG->getByName(sName) >>= xModule;
if (!xModule.is())
{
throw css::uno::RuntimeException(
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index a14324f9c3ed..bb3a18548b42 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -157,6 +157,7 @@ PathSettings::PathSettings( const css::uno::Reference< css::lang::XMultiServiceF
, m_pPropHelp(0 )
, m_bIgnoreEvents(sal_False)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::PathSettings" );
}
//-----------------------------------------------------------------------------
@@ -170,6 +171,7 @@ PathSettings::~PathSettings()
void SAL_CALL PathSettings::changesOccurred(const css::util::ChangesEvent& aEvent)
throw (css::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::changesOccurred" );
/*
if (m_bIgnoreEvents)
return;
@@ -206,6 +208,7 @@ void SAL_CALL PathSettings::changesOccurred(const css::util::ChangesEvent& aEven
void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource)
throw(css::uno::RuntimeException)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::disposing" );
// SAFE ->
WriteGuard aWriteLock(m_aLock);
@@ -219,6 +222,7 @@ void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource)
//-----------------------------------------------------------------------------
void PathSettings::impl_readAll()
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readAll" );
RTL_LOGFILE_CONTEXT(aLog, "framework (as96863) ::PathSettings::load config (all)");
// TODO think about me
@@ -241,6 +245,7 @@ void PathSettings::impl_readAll()
// NO substitution here ! It's done outside ...
OUStringList PathSettings::impl_readOldFormat(const ::rtl::OUString& sPath)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readOldFormat" );
css::uno::Reference< css::container::XNameAccess > xCfg = fa_getCfgOld();
css::uno::Any aVal = xCfg->getByName(sPath);
@@ -308,6 +313,7 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const ::rtl::OUString& s
//-----------------------------------------------------------------------------
void PathSettings::impl_storePath(const PathSettings::PathInfo& aPath)
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_storePath" );
m_bIgnoreEvents = sal_True;
css::uno::Reference< css::container::XNameAccess > xCfgNew = fa_getCfgNew();
@@ -356,6 +362,7 @@ void PathSettings::impl_storePath(const PathSettings::PathInfo& aPath)
void PathSettings::impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
const OUStringList& lOld )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_mergeOldUserPaths" );
OUStringList::const_iterator pIt;
for ( pIt = lOld.begin();
pIt != lOld.end() ;
@@ -654,6 +661,7 @@ void PathSettings::impl_subst(PathSettings::PathInfo& aPath ,
{
OUStringList::const_iterator pIt;
OUStringList lTemp;
+ lTemp.reserve(rPath.lInternalPaths.size() + rPath.lUserPaths.size() + 1);
for ( pIt = rPath.lInternalPaths.begin();
pIt != rPath.lInternalPaths.end() ;
@@ -857,7 +865,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
if (aChangePath.bIsSinglePath)
{
LOG_ASSERT2(lList.size()>1, "PathSettings::impl_setPathValue()", "You try to set more then path value for a defined SINGLE_PATH!")
- if (lList.size()>0)
+ if ( !lList.empty() )
aChangePath.sWritePath = *(lList.begin());
else
aChangePath.sWritePath = ::rtl::OUString();
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index 55849ab8124a..966ce1756c64 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -295,7 +295,7 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu
SubstituteRuleVector aRuleSet;
ReadSharePointRuleSetFromConfiguration( aSharePointNames[ nSharePoints ], aSharePointNodeName, aRuleSet );
- if ( aRuleSet.size() > 0 )
+ if ( !aRuleSet.empty() )
{
// We have at minimum one rule. Filter the correct rule out of the rule set
// and put into our SubstituteVariable map
@@ -409,10 +409,11 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector
{
sal_Bool bResult = sal_False;
- if ( aRuleSet.size() >= 1 )
+ if ( !aRuleSet.empty() )
{
sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ];
- for ( sal_Int32 nIndex = 0; nIndex < (sal_Int32)aRuleSet.size(); nIndex++ )
+ const sal_uInt32 nCount = aRuleSet.size();
+ for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ )
{
const SubstituteRule& aRule = aRuleSet[nIndex];
EnvironmentType eEnvType = aRule.aEnvType;
@@ -587,19 +588,6 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( SubstitutePathVariables ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( css::util::XStringSubstitution )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( SubstitutePathVariables ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::util::XStringSubstitution
- )
-
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
::cppu::OWeakObject ,
SERVICENAME_SUBSTITUTEPATHVARIABLES ,
@@ -616,6 +604,7 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService
m_aImpl( LINK( this, SubstitutePathVariables, implts_ConfigurationNotify )),
m_xServiceManager( xServiceManager )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SubstitutePathVariables" );
int i;
SetPredefinedPathVariables( m_aPreDefVars );
@@ -674,6 +663,7 @@ SubstitutePathVariables::~SubstitutePathVariables()
rtl::OUString SAL_CALL SubstitutePathVariables::substituteVariables( const ::rtl::OUString& aText, sal_Bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::substituteVariables" );
ResetableGuard aLock( m_aLock );
return impl_substituteVariable( aText, bSubstRequired );
}
@@ -681,6 +671,7 @@ throw ( NoSuchElementException, RuntimeException )
rtl::OUString SAL_CALL SubstitutePathVariables::reSubstituteVariables( const ::rtl::OUString& aText )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::reSubstituteVariables" );
ResetableGuard aLock( m_aLock );
return impl_reSubstituteVariables( aText );
}
@@ -688,6 +679,7 @@ throw ( RuntimeException )
rtl::OUString SAL_CALL SubstitutePathVariables::getSubstituteVariableValue( const ::rtl::OUString& aVariable )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::getSubstituteVariableValue" );
ResetableGuard aLock( m_aLock );
return impl_getSubstituteVariableValue( aVariable );
}
@@ -707,6 +699,7 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo
rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" );
String aResult;
rtl::OUString aTemp;
@@ -722,27 +715,27 @@ rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString&
rtl::OUString SubstitutePathVariables::GetWorkPath() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkPath" );
rtl::OUString aWorkPath;
- css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
::rtl::OUString::createFromAscii("Paths/Work"),
::rtl::OUString::createFromAscii("WritePath"),
- ::comphelper::ConfigurationHelper::E_READONLY);
- aVal >>= aWorkPath;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
return aWorkPath;
}
rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
{
- css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkVariableValue" );
+ ::rtl::OUString aWorkPath;
+ ::comphelper::ConfigurationHelper::readDirectKey(
m_xServiceManager,
::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"),
::rtl::OUString::createFromAscii("Variables"),
::rtl::OUString::createFromAscii("Work"),
- ::comphelper::ConfigurationHelper::E_READONLY);
- ::rtl::OUString aWorkPath;
- aVal >>= aWorkPath;
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath;
// fallback to $HOME in case platform dependend config layer does not return
// an usuable work dir value.
@@ -756,6 +749,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const
rtl::OUString SubstitutePathVariables::GetHomeVariableValue() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetHomeVariableValue" );
osl::Security aSecurity;
rtl::OUString aHomePath;
@@ -765,6 +759,7 @@ rtl::OUString SubstitutePathVariables::GetHomeVariableValue() const
rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetPathVariableValue" );
const int PATH_EXTEND_FACTOR = 120;
rtl::OUString aRetStr;
@@ -801,6 +796,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const
rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" );
// This is maximal recursive depth supported!
const sal_Int32 nMaxRecursiveDepth = 8;
@@ -928,7 +924,8 @@ throw ( NoSuchElementException, RuntimeException )
else
{
// Check for recursion
- for ( sal_Int32 i=0; i < (sal_Int32)aEndlessRecursiveDetector.size(); i++ )
+ const sal_uInt32 nCount = aEndlessRecursiveDetector.size();
+ for ( sal_uInt32 i=0; i < nCount; i++ )
{
if ( aEndlessRecursiveDetector[i] == aWorkText )
{
@@ -992,6 +989,7 @@ throw ( NoSuchElementException, RuntimeException )
rtl::OUString SubstitutePathVariables::impl_reSubstituteVariables( const ::rtl::OUString& rURL )
throw ( RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_reSubstituteVariables" );
rtl::OUString aURL;
INetURLObject aUrl( rURL );
@@ -1096,6 +1094,7 @@ throw ( RuntimeException )
::rtl::OUString SubstitutePathVariables::impl_getSubstituteVariableValue( const ::rtl::OUString& rVariable )
throw ( NoSuchElementException, RuntimeException )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_getSubstituteVariableValue" );
rtl::OUString aVariable;
sal_Int32 nPos = rVariable.indexOf( m_aVarStart );
@@ -1148,6 +1147,7 @@ throw ( NoSuchElementException, RuntimeException )
void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables )
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" );
Any aAny;
::rtl::OUString aOfficePath;
::rtl::OUString aUserPath;
@@ -1204,9 +1204,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Detect the language type of the current office
aPreDefPathVariables.m_eLanguageType = LANGUAGE_ENGLISH_US;
- Any aLocale = utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( utl::ConfigManager::LOCALE );
rtl::OUString aLocaleStr;
- if ( aLocale >>= aLocaleStr )
+ if ( utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( utl::ConfigManager::LOCALE ) >>= aLocaleStr )
aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
else
{
diff --git a/framework/source/services/uriabbreviation.cxx b/framework/source/services/uriabbreviation.cxx
index 71c9b430c0b9..45dc02068c91 100644
--- a/framework/source/services/uriabbreviation.cxx
+++ b/framework/source/services/uriabbreviation.cxx
@@ -55,19 +55,6 @@ namespace css = ::com::sun::star;
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( UriAbbreviation ,
- cppu::OWeakObject ,
- DIRECT_INTERFACE(css::lang::XTypeProvider ),
- DIRECT_INTERFACE(css::lang::XServiceInfo ),
- DIRECT_INTERFACE(css::util::XStringAbbreviation )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( UriAbbreviation ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- css::util::XStringAbbreviation
- )
-
DEFINE_XSERVICEINFO_MULTISERVICE_2 ( UriAbbreviation ,
::cppu::OWeakObject ,
SERVICENAME_STRINGABBREVIATION ,
diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx
index 90e63a2ce122..e248c8308b52 100644
--- a/framework/source/services/urltransformer.cxx
+++ b/framework/source/services/urltransformer.cxx
@@ -77,21 +77,11 @@ using namespace ::com::sun::star::util ;
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
-URLTransformer::URLTransformer( const Reference< XMultiServiceFactory >& xFactory )
- // Init baseclasses first
- // Attention:
- // Don't change order of initialization!
- // ThreadHelpBase is a struct with a mutex as member. We can't use a mutex as member, while
- // we must garant right initialization and a valid value of this! First initialize
- // baseclasses and then members. And we need the mutex for other baseclasses !!!
- : ThreadHelpBase ( &Application::GetSolarMutex() )
- , OWeakObject ( )
- // Init member
- , m_xFactory ( xFactory )
+URLTransformer::URLTransformer( const Reference< XMultiServiceFactory >& /*xFactory*/ )
{
// Safe impossible cases.
// Method not defined for all incoming parameter.
- LOG_ASSERT( xFactory.is(), "URLTransformer::URLTransformer()\nInvalid parameter detected!\n" )
+ //LOG_ASSERT( xFactory.is(), "URLTransformer::URLTransformer()\nInvalid parameter detected!\n" )
}
//*****************************************************************************************************************
@@ -105,19 +95,6 @@ URLTransformer::~URLTransformer()
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_3 ( URLTransformer ,
- OWeakObject ,
- DIRECT_INTERFACE(XTypeProvider ),
- DIRECT_INTERFACE(XServiceInfo ),
- DIRECT_INTERFACE(XURLTransformer )
- )
-
-DEFINE_XTYPEPROVIDER_3 ( URLTransformer ,
- XTypeProvider ,
- XServiceInfo ,
- XURLTransformer
- )
-
DEFINE_XSERVICEINFO_MULTISERVICE ( URLTransformer ,
OWeakObject ,
SERVICENAME_URLTRANSFORMER ,
@@ -129,21 +106,68 @@ DEFINE_INIT_SERVICE ( URLTransformer,
}
)
+namespace
+{
+ void lcl_ParserHelper(INetURLObject& _rParser,URL& _rURL,bool _bUseIntern)
+ {
+ // Get all information about this URL.
+ _rURL.Protocol = INetURLObject::GetScheme( _rParser.GetProtocol() );
+ _rURL.User = _rParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Password = _rParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Server = _rParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
+ _rURL.Port = (sal_Int16)_rParser.GetPort();
+
+ sal_Int32 nCount = _rParser.getSegmentCount( false );
+ if ( nCount > 0 )
+ {
+ // Don't add last segment as it is the name!
+ --nCount;
+
+ rtl::OUStringBuffer aPath;
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ aPath.append( sal_Unicode( '/' ));
+ aPath.append( _rParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
+ }
+
+ if ( nCount > 0 )
+ aPath.append( sal_Unicode( '/' )); // final slash!
+
+ _rURL.Path = aPath.makeStringAndClear();
+ _rURL.Name = _rParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
+ }
+ else
+ {
+ _rURL.Path = _rParser.GetURLPath( INetURLObject::NO_DECODE );
+ _rURL.Name = _rParser.GetName ( );
+ }
+
+ _rURL.Arguments = _rParser.GetParam ( INetURLObject::NO_DECODE );
+ _rURL.Mark = _rParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
+
+ // INetURLObject supports only an intelligent method of parsing URL's. So write
+ // back Complete to have a valid encoded URL in all cases!
+ _rURL.Complete = _rParser.GetMainURL( INetURLObject::NO_DECODE );
+ if ( _bUseIntern )
+ _rURL.Complete = _rURL.Complete.intern();
+
+ _rParser.SetMark ( ::rtl::OUString() );
+ _rParser.SetParam( ::rtl::OUString() );
+
+ _rURL.Main = _rParser.GetMainURL( INetURLObject::NO_DECODE );
+ }
+}
//*****************************************************************************************************************
// XURLTransformer
//*****************************************************************************************************************
sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) )
{
return sal_False;
}
-
// Try to extract the protocol
sal_Int32 nURLIndex = aURL.Complete.indexOf( sal_Unicode( ':' ));
::rtl::OUString aProtocol;
@@ -165,50 +189,7 @@ sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeExcepti
}
else if ( !aParser.HasError() )
{
- aURL.Protocol = INetURLObject::GetScheme( aParser.GetProtocol() );
- aURL.User = aParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Password = aParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Server = aParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Port = (sal_Int16)aParser.GetPort();
-
- sal_Int32 nCount = aParser.getSegmentCount( false );
- if ( nCount > 0 )
- {
- // Don't add last segment as it is the name!
- --nCount;
-
- rtl::OUStringBuffer aPath;
- for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aPath.append( sal_Unicode( '/' ));
- aPath.append( aParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
- }
-
- if ( nCount > 0 )
- aPath.append( sal_Unicode( '/' )); // final slash!
-
- aURL.Path = aPath.makeStringAndClear();
- aURL.Name = aParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
- }
- else
- {
- aURL.Path = aParser.GetURLPath( INetURLObject::NO_DECODE );
- aURL.Name = aParser.GetName ( );
- }
-
- aURL.Arguments = aParser.GetParam ( INetURLObject::NO_DECODE );
- aURL.Mark = aParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
-
- // INetURLObject supports only an intelligent method of parsing URL's. So write
- // back Complete to have a valid encoded URL in all cases!
- aURL.Complete = aParser.GetMainURL( INetURLObject::NO_DECODE );
- aURL.Complete = aURL.Complete.intern();
-
- aParser.SetMark ( ::rtl::OUString() );
- aParser.SetParam( ::rtl::OUString() );
-
- aURL.Main = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
+ lcl_ParserHelper(aParser,aURL,false);
// Return "URL is parsed".
return sal_True;
}
@@ -235,8 +216,6 @@ sal_Bool SAL_CALL URLTransformer::parseStrict( URL& aURL ) throw( RuntimeExcepti
sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL ,
const ::rtl::OUString& sSmartProtocol ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) )
@@ -251,48 +230,7 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL
bool bOk = aParser.SetSmartURL( aURL.Complete );
if ( bOk )
{
- // Get all information about this URL.
- aURL.Protocol = INetURLObject::GetScheme( aParser.GetProtocol() );
- aURL.User = aParser.GetUser ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Password = aParser.GetPass ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Server = aParser.GetHost ( INetURLObject::DECODE_WITH_CHARSET );
- aURL.Port = (sal_Int16)aParser.GetPort();
-
- sal_Int32 nCount = aParser.getSegmentCount( false );
- if ( nCount > 0 )
- {
- // Don't add last segment as it is the name!
- --nCount;
-
- rtl::OUStringBuffer aPath;
- for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aPath.append( sal_Unicode( '/' ));
- aPath.append( aParser.getName( nIndex, false, INetURLObject::NO_DECODE ));
- }
-
- if ( nCount > 0 )
- aPath.append( sal_Unicode( '/' )); // final slash!
-
- aURL.Path = aPath.makeStringAndClear();
- aURL.Name = aParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::NO_DECODE );
- }
- else
- {
- aURL.Path = aParser.GetURLPath( INetURLObject::NO_DECODE );
- aURL.Name = aParser.GetName ( );
- }
-
- aURL.Arguments = aParser.GetParam ( INetURLObject::NO_DECODE );
- aURL.Mark = aParser.GetMark ( INetURLObject::DECODE_WITH_CHARSET );
-
- aURL.Complete = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
- aParser.SetMark ( ::rtl::OUString() );
- aParser.SetParam( ::rtl::OUString() );
-
- aURL.Main = aParser.GetMainURL( INetURLObject::NO_DECODE );
-
+ lcl_ParserHelper(aParser,aURL,true);
// Return "URL is parsed".
return sal_True;
}
@@ -333,9 +271,6 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( URL& aURL
//*****************************************************************************************************************
sal_Bool SAL_CALL URLTransformer::assemble( URL& aURL ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if ( &aURL == NULL )
return sal_False ;
@@ -400,9 +335,6 @@ sal_Bool SAL_CALL URLTransformer::assemble( URL& aURL ) throw( RuntimeException
::rtl::OUString SAL_CALL URLTransformer::getPresentation( const URL& aURL ,
sal_Bool bWithPassword ) throw( RuntimeException )
{
- // Ready for multithreading
- ResetableGuard aGuard( m_aLock );
-
// Safe impossible cases.
if (( &aURL == NULL ) ||
( aURL.Complete.getLength() < 1 ) ||