summaryrefslogtreecommitdiff
path: root/xmlhelp/source/treeview/tvread.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-06-05 10:35:22 +0200
committerNoel Grandin <noel@peralex.com>2013-06-05 14:48:19 +0200
commit27c6434fccfec5fb4184c1efa2057595c8716fad (patch)
treec0c65b6653853b345d066324a5e847daa1347fa8 /xmlhelp/source/treeview/tvread.cxx
parentb83edcf00d4ccd0c734731ed66d167286bf89d6b (diff)
fdo#46808, Replace usage of SpecialConfigManager
with usage of the underlying SvtPathOptions. The service is just a thing wrapper that serves no real purpose. Change-Id: Id762edf71ba0f699ef091261905c88c2d93e1c12
Diffstat (limited to 'xmlhelp/source/treeview/tvread.cxx')
-rw-r--r--xmlhelp/source/treeview/tvread.cxx38
1 files changed, 10 insertions, 28 deletions
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 83ebfd7ca012..8a2d494d4cbe 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <comphelper/string.hxx>
+#include <unotools/pathoptions.hxx>
namespace treeview {
@@ -492,9 +493,9 @@ TVChildTarget::TVChildTarget( const ConfigData& configData,TVDom* tvDom )
Elements[i] = new TVRead( configData,tvDom->children[i] );
}
-TVChildTarget::TVChildTarget( const Reference< XMultiServiceFactory >& xMSF )
+TVChildTarget::TVChildTarget( const Reference< XComponentContext >& xContext )
{
- ConfigData configData = init( xMSF );
+ ConfigData configData = init( xContext );
if( configData.locale.isEmpty() || configData.system.isEmpty() )
return;
@@ -710,10 +711,10 @@ TVChildTarget::hasByHierarchicalName( const OUString& aName )
-ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
+ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
{
ConfigData configData;
- Reference< XMultiServiceFactory > sProvider( getConfiguration(comphelper::getComponentContext(xSMgr)) );
+ Reference< XMultiServiceFactory > sProvider( getConfiguration(xContext) );
/**********************************************************************/
/* reading Office.Common */
@@ -729,7 +730,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
instPath = OUString( "$(instpath)/help" );
// replace anything like $(instpath);
- subst( xSMgr,instPath );
+ subst( instPath );
/**********************************************************************/
/* reading setup */
@@ -743,7 +744,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
try
{
- Reference< lang::XMultiServiceFactory > xConfigProvider = theDefaultProvider::get( comphelper::getComponentContext(xSMgr) );
+ Reference< lang::XMultiServiceFactory > xConfigProvider = theDefaultProvider::get( xContext );
uno::Sequence < uno::Any > lParams(1);
beans::PropertyValue aParam ;
@@ -978,29 +979,10 @@ TVChildTarget::getBooleanKey(const Reference<
}
-void TVChildTarget::subst( const Reference< XMultiServiceFactory >& m_xSMgr,
- OUString& instpath ) const
+void TVChildTarget::subst( OUString& instpath ) const
{
- Reference< XConfigManager > xCfgMgr;
- if( m_xSMgr.is() )
- {
- try
- {
- xCfgMgr =
- Reference< XConfigManager >(
- m_xSMgr->createInstance( OUString( "com.sun.star.config.SpecialConfigManager" ) ),
- UNO_QUERY );
- }
- catch( const com::sun::star::uno::Exception& )
- {
- OSL_ENSURE( xCfgMgr.is()," cant instantiate the special config manager " );
- }
- }
-
- OSL_ENSURE( xCfgMgr.is(), "specialconfigmanager not found\n" );
-
- if( xCfgMgr.is() )
- instpath = xCfgMgr->substituteVariables( instpath );
+ SvtPathOptions aOptions;
+ instpath = aOptions.SubstituteVariable( instpath );
}