summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2002-12-10 16:27:20 +0000
committerPhilipp Lohmann <pl@openoffice.org>2002-12-10 16:27:20 +0000
commit033066a8578ddc7c6779e12d824bdcf2147b6185 (patch)
tree46888bc855bf11e88e341f4c3621293d9f756892 /psprint
parente2f578a8223ddc33946156acd11c1c30598d1ab4 (diff)
#106058# use good old Config since Profile is deprecated
Diffstat (limited to 'psprint')
-rw-r--r--psprint/source/helper/helper.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/psprint/source/helper/helper.cxx b/psprint/source/helper/helper.cxx
index fd597dbafde1..0efebd72d661 100644
--- a/psprint/source/helper/helper.cxx
+++ b/psprint/source/helper/helper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: helper.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: pl $ $Date: 2002-09-23 13:28:52 $
+ * last change: $Author: pl $ $Date: 2002-12-10 17:27:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,7 +67,7 @@
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/thread.h>
-#include <osl/profile.hxx>
+#include <tools/config.hxx>
#include <rtl/bootstrap.hxx>
#include <sal/config.h>
#include <cpputools/jenv.hxx>
@@ -165,15 +165,18 @@ const ::rtl::OUString& psp::getFontPath()
aPath += ::psp::getEnvironmentPath( "SAL_FONTPATH_PRIVATE", (sal_Unicode)';' );
// append jre/jdk fonts if possible
- ::rtl::OUString aJavaRc( RTL_CONSTASCII_USTRINGPARAM( "file://" ) );
- aJavaRc += getOfficePath( psp::UserPath );
+ rtl::OUString aJavaRc( getOfficePath( psp::UserPath ) );
aJavaRc += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/config/" SAL_CONFIGFILE( "java" ) ) );
- ::osl::Profile aProfile( aJavaRc );
- ::rtl::OString aJREpath =
- aProfile.readString(
- ::rtl::OString( "Java" ),
- ::rtl::OString( "Home" ),
- ::rtl::OString() );
+ Config aConfig( aJavaRc );
+ aConfig.SetGroup( "Java" );
+ rtl::OString aJREpath = aConfig.ReadKey( "Home" );
+ if( aJREpath.compareTo( "file:", 5 ) == 0 )
+ {
+ rtl::OUString aURL( rtl::OStringToOUString( aJREpath, osl_getThreadTextEncoding() ) );
+ rtl::OUString aSys;
+ if( osl_getSystemPathFromFileURL( aURL.pData, &aSys.pData ) == osl_File_E_None )
+ aJREpath = rtl::OUStringToOString( aSys, osl_getThreadTextEncoding() );
+ }
if( aJREpath.getLength() > 0 )
{
::rtl::OString aTestPath( aJREpath );