diff options
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.cxx | 92 | ||||
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.hxx | 6 | ||||
-rw-r--r-- | l10ntools/source/help/HelpLinker.cxx | 45 | ||||
-rwxr-xr-x[-rw-r--r--] | svtools/source/control/inettbc.cxx | 19 | ||||
-rw-r--r-- | ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx | 8 | ||||
-rw-r--r-- | ucbhelper/source/client/proxydecider.cxx | 239 |
6 files changed, 216 insertions, 193 deletions
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index 3ce0d4de865a..ebeedc92839d 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -101,10 +101,12 @@ static bool makeCanonicalFileURL( rtl::OUString & rURL ) OfficeInstallationDirectories::OfficeInstallationDirectories( const uno::Reference< uno::XComponentContext > & xCtx ) -: m_aOfficeDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ), +: m_aOfficeBrandDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(brandbaseurl)" ) ), + m_aOfficeBaseDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ), m_aUserDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(userdataurl)" ) ), m_xCtx( xCtx ), - m_pOfficeDir( 0 ), + m_pOfficeBrandDir( 0 ), + m_pOfficeBaseDir( 0 ), m_pUserDir( 0 ) { } @@ -113,6 +115,9 @@ OfficeInstallationDirectories::OfficeInstallationDirectories( // virtual OfficeInstallationDirectories::~OfficeInstallationDirectories() { + delete m_pOfficeBrandDir; + delete m_pOfficeBaseDir; + delete m_pUserDir; } //========================================================================= @@ -124,9 +129,8 @@ rtl::OUString SAL_CALL OfficeInstallationDirectories::getOfficeInstallationDirectoryURL() throw ( uno::RuntimeException ) { - // late init m_pOfficeDir and m_pUserDir initDirs(); - return rtl::OUString( *m_pOfficeDir ); + return rtl::OUString( *m_pOfficeBrandDir ); } //========================================================================= @@ -135,7 +139,6 @@ rtl::OUString SAL_CALL OfficeInstallationDirectories::getOfficeUserDataDirectoryURL() throw ( uno::RuntimeException ) { - // late init m_pOfficeDir and m_pUserDir initDirs(); return rtl::OUString( *m_pUserDir ); } @@ -149,29 +152,39 @@ OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL ) { if ( URL.getLength() > 0 ) { - // late init m_pOfficeDir and m_pUserDir initDirs(); rtl::OUString aCanonicalURL( URL ); makeCanonicalFileURL( aCanonicalURL ); - sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeDir ); + sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeBrandDir ); if ( nIndex != -1 ) { return rtl::OUString( URL.replaceAt( nIndex, - m_pOfficeDir->getLength(), - m_aOfficeDirMacro ) ); + m_pOfficeBrandDir->getLength(), + m_aOfficeBrandDirMacro ) ); } else { - nIndex = aCanonicalURL.indexOf( *m_pUserDir ); + nIndex = aCanonicalURL.indexOf( *m_pOfficeBaseDir ); if ( nIndex != -1 ) { return rtl::OUString( URL.replaceAt( nIndex, - m_pUserDir->getLength(), - m_aUserDirMacro ) ); + m_pOfficeBaseDir->getLength(), + m_aOfficeBaseDirMacro ) ); + } + else + { + nIndex = aCanonicalURL.indexOf( *m_pUserDir ); + if ( nIndex != -1 ) + { + return rtl::OUString( + URL.replaceAt( nIndex, + m_pUserDir->getLength(), + m_aUserDirMacro ) ); + } } } } @@ -186,29 +199,40 @@ OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL ) { if ( URL.getLength() > 0 ) { - sal_Int32 nIndex = URL.indexOf( m_aOfficeDirMacro ); + sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro ); if ( nIndex != -1 ) { - // late init m_pOfficeDir and m_pUserDir initDirs(); return rtl::OUString( URL.replaceAt( nIndex, - m_aOfficeDirMacro.getLength(), - *m_pOfficeDir ) ); + m_aOfficeBrandDirMacro.getLength(), + *m_pOfficeBrandDir ) ); } else { - nIndex = URL.indexOf( m_aUserDirMacro ); + nIndex = URL.indexOf( m_aOfficeBaseDirMacro ); if ( nIndex != -1 ) { - // late init m_pOfficeDir and m_pUserDir initDirs(); return rtl::OUString( URL.replaceAt( nIndex, - m_aUserDirMacro.getLength(), - *m_pUserDir ) ); + m_aOfficeBaseDirMacro.getLength(), + *m_pOfficeBaseDir ) ); + } + else + { + nIndex = URL.indexOf( m_aUserDirMacro ); + if ( nIndex != -1 ) + { + initDirs(); + + return rtl::OUString( + URL.replaceAt( nIndex, + m_aUserDirMacro.getLength(), + *m_pUserDir ) ); + } } } } @@ -300,13 +324,14 @@ OfficeInstallationDirectories::Create( void OfficeInstallationDirectories::initDirs() { - if ( m_pOfficeDir == 0 ) + if ( m_pOfficeBrandDir == 0 ) { osl::MutexGuard aGuard( m_aMutex ); - if ( m_pOfficeDir == 0 ) + if ( m_pOfficeBrandDir == 0 ) { - m_pOfficeDir = new rtl::OUString; - m_pUserDir = new rtl::OUString; + m_pOfficeBrandDir = new rtl::OUString; + m_pOfficeBaseDir = new rtl::OUString; + m_pUserDir = new rtl::OUString; uno::Reference< util::XMacroExpander > xExpander; @@ -320,15 +345,24 @@ void OfficeInstallationDirectories::initDirs() if ( xExpander.is() ) { - *m_pOfficeDir = + *m_pOfficeBrandDir = + xExpander->expandMacros( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR" ) ) ); + + OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0, + "Unable to obtain office brand installation directory!" ); + + makeCanonicalFileURL( *m_pOfficeBrandDir ); + + *m_pOfficeBaseDir = xExpander->expandMacros( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":BaseInstallation}" ) ) ); - OSL_ENSURE( m_pOfficeDir->getLength() > 0, - "Unable to obtain office installation directory!" ); + OSL_ENSURE( m_pOfficeBaseDir->getLength() > 0, + "Unable to obtain office base installation directory!" ); - makeCanonicalFileURL( *m_pOfficeDir ); + makeCanonicalFileURL( *m_pOfficeBaseDir ); *m_pUserDir = xExpander->expandMacros( @@ -336,7 +370,7 @@ void OfficeInstallationDirectories::initDirs() "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) ); OSL_ENSURE( m_pUserDir->getLength() > 0, - "Unable to obtain office user data directory!" ); + "Unable to obtain office user data directory!" ); makeCanonicalFileURL( *m_pUserDir ); } diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx index 2ffb3582718a..9c56f7ce80fd 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx @@ -94,11 +94,13 @@ public: private: void initDirs(); - rtl::OUString m_aOfficeDirMacro; + rtl::OUString m_aOfficeBrandDirMacro; + rtl::OUString m_aOfficeBaseDirMacro; rtl::OUString m_aUserDirMacro; com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xCtx; - rtl::OUString * m_pOfficeDir; + rtl::OUString * m_pOfficeBrandDir; + rtl::OUString * m_pOfficeBaseDir; rtl::OUString * m_pUserDir; }; diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 8e6976c0efd1..4e3a4cedbe6f 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -46,17 +46,16 @@ #define DBHELP_ONLY - class IndexerPreProcessor { private: - std::string m_aModuleName; - fs::path m_fsIndexBaseDir; - fs::path m_fsCaptionFilesDirName; - fs::path m_fsContentFilesDirName; + std::string m_aModuleName; + fs::path m_fsIndexBaseDir; + fs::path m_fsCaptionFilesDirName; + fs::path m_fsContentFilesDirName; - xsltStylesheetPtr m_xsltStylesheetPtrCaption; - xsltStylesheetPtr m_xsltStylesheetPtrContent; + xsltStylesheetPtr m_xsltStylesheetPtrCaption; + xsltStylesheetPtr m_xsltStylesheetPtrContent; public: IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir, @@ -245,7 +244,6 @@ class HelpLinker { public: void main(std::vector<std::string> &args, -// std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) std::string* pExtensionPath = NULL, std::string* pDestination = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) @@ -667,8 +665,8 @@ void HelpLinker::link() throw( HelpProcessingException ) if( !bExtensionMode ) std::cout << std::endl; - } // try - catch( HelpProcessingException& ) + } // try + catch( const HelpProcessingException& ) { // catch HelpProcessingException to avoid locking data bases #ifndef DBHELP_ONLY @@ -1039,7 +1037,6 @@ void HelpLinker::main( std::vector<std::string> &args, aStrStream << "language missing" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - link(); } @@ -1102,7 +1099,7 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr // Returns true in case of success, false in case of error HELPLINKER_DLLPUBLIC bool compileExtensionHelp ( - const rtl::OUString& aOfficeHelpPath, + const rtl::OUString& aOfficeHelpPath, const rtl::OUString& aExtensionName, const rtl::OUString& aExtensionLanguageRoot, sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, @@ -1112,31 +1109,20 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp { bool bSuccess = true; - sal_Int32 argc = nXhpFileCount + 3; - const char** argv = new const char*[argc]; - argv[0] = ""; - argv[1] = "-mod"; + std::vector<std::string> args; + args.reserve(nXhpFileCount + 2); + args.push_back(std::string("-mod")); rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() ); - argv[2] = aOExtensionName.getStr(); + args.push_back(std::string(aOExtensionName.getStr())); for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) { rtl::OUString aXhpFile = pXhpFiles[iXhp]; rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() ); - char* pArgStr = new char[aOXhpFile.getLength() + 1]; - strcpy( pArgStr, aOXhpFile.getStr() ); - argv[iXhp + 3] = pArgStr; + args.push_back(std::string(aOXhpFile.getStr())); } - std::vector<std::string> args; - for( sal_Int32 i = 1; i < argc; ++i ) - args.push_back(std::string( argv[i]) ); - - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - delete[] argv[iXhp + 3]; - delete[] argv; - rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); const char* pExtensionPath = aOExtensionLanguageRoot.getStr(); std::string aStdStrExtensionPath = pExtensionPath; @@ -1206,6 +1192,3 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp return bSuccess; } -// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ - diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 6781efc070fe..4aaa55409266 100644..100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -41,10 +41,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> - -#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HDL_ -#include <com/sun/star/task/XInteractionHandler.hdl> -#endif +#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/NumberedSortingInfo.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> @@ -165,7 +162,7 @@ SvtMatchContext_Impl::SvtMatchContext_Impl( SvtURLBox* pBoxP, const String& rText ) : aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) ) , aBaseURL( pBoxP->aBaseURL ) - , aText( rText ) + , aText( rText ) , pBox( pBoxP ) , bStop( FALSE ) , bOnlyDirectories( pBoxP->bOnlyDirectories ) @@ -426,7 +423,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL, uno::Reference< XDynamicResultSet > xDynResultSet; ResultSetInclude eInclude = INCLUDE_FOLDERS_AND_DOCUMENTS; if ( bOnlyDirectories ) - eInclude = INCLUDE_FOLDERS_ONLY; + eInclude = INCLUDE_FOLDERS_ONLY; xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude ); @@ -654,7 +651,7 @@ void SvtMatchContext_Impl::run() { // if text input is a directory, it must be part of the match list! Until then it is scanned if ( UCBContentHelper::IsFolder( aMainURL ) && aURLObject.hasFinalSlash() ) - Insert( aText, aMatch ); + Insert( aText, aMatch ); else // otherwise the parent folder will be taken aURLObject.removeSegment(); @@ -684,6 +681,7 @@ void SvtMatchContext_Impl::run() aCurObj.SetURL( *aPickList.GetObject( nPos ) ); aCurObj.SetSmartURL( aCurObj.GetURLNoPass()); aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); + if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt ) continue; @@ -708,7 +706,7 @@ void SvtMatchContext_Impl::run() { // try if text matches the scheme String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) ); - if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() ) + if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() ) { if( bFull ) aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -727,7 +725,7 @@ void SvtMatchContext_Impl::run() aCurString.Erase( 0, aScheme.Len() ); } - if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL ) + if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL ) { if( bFull ) aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -858,6 +856,7 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart void SvtURLBox::ImplInit() { pImp = new SvtURLBox_Impl(); + SetHelpId( ".uno:OpenURL" ); EnableAutocomplete( FALSE ); @@ -1314,7 +1313,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing( return sal_False; // no such user #else pPasswd = getpwnam( OUStringToOString( OUString( aUserName ), RTL_TEXTENCODING_ASCII_US ).getStr() ); - if( pPasswd ) + if( pPasswd ) aParseTilde = String::CreateFromAscii( pPasswd->pw_dir ); else return sal_False; // no such user diff --git a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx index 7f3da27ece7c..8ab8ead7cffb 100644 --- a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx +++ b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx @@ -37,7 +37,7 @@ namespace ucbhelper { /** * This class implements a simple name clash resolve interaction request. * Instances can be passed directly to XInteractionHandler::handle(...). Each - * instance contains an NameClashResolveRequest and two interaction + * instance contains a NameClashResolveRequest and two interaction * continuations: "Abort" and "SupplyName". Another continuation * ("ReplaceExistingData") may be supplied optionally. * @@ -56,11 +56,11 @@ public: * * @param rTargetFolderURL contains the URL of the folder that contains * the clashing resource. - * @param rClashingName contains the clashing name, + * @param rClashingName contains the clashing name. * @param rProposedNewName contains a proposal for the new name or is * empty. - * @param bSupportsOverwriteData indictes whether an - * InteractioneplaceExistingData continuation shall be supplied + * @param bSupportsOverwriteData indicates whether an + * InteractionReplaceExistingData continuation shall be supplied * with the interaction request. */ SimpleNameClashResolveRequest( const rtl::OUString & rTargetFolderURL, diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index 8505472e1b1f..d6fc260f558b 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -51,13 +51,15 @@ using namespace com::sun::star; using namespace ucbhelper; -#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings" -#define PROXY_TYPE_KEY "ooInetProxyType" -#define NO_PROXY_LIST_KEY "ooInetNoProxy" -#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName" -#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort" -#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName" -#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort" +#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings" +#define PROXY_TYPE_KEY "ooInetProxyType" +#define NO_PROXY_LIST_KEY "ooInetNoProxy" +#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName" +#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort" +#define HTTPS_PROXY_NAME_KEY "ooInetHTTPSProxyName" +#define HTTPS_PROXY_PORT_KEY "ooInetHTTPSProxyPort" +#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName" +#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort" //========================================================================= namespace ucbhelper @@ -132,6 +134,7 @@ class InternetProxyDecider_Impl : { mutable osl::Mutex m_aMutex; InternetProxyServer m_aHttpProxy; + InternetProxyServer m_aHttpsProxy; InternetProxyServer m_aFtpProxy; const InternetProxyServer m_aEmptyProxy; sal_Int32 m_nProxyType; @@ -246,6 +249,63 @@ bool WildCard::Matches( const rtl::OUString& rString ) const } //========================================================================= +bool getConfigStringValue( + const uno::Reference< container::XNameAccess > & xNameAccess, + const char * key, + rtl::OUString & value ) +{ + try + { + if ( !( xNameAccess->getByName( rtl::OUString::createFromAscii( key ) ) + >>= value ) ) + { + OSL_ENSURE( sal_False, + "InternetProxyDecider - " + "Error getting config item value!" ); + return false; + } + } + catch ( lang::WrappedTargetException const & ) + { + return false; + } + catch ( container::NoSuchElementException const & ) + { + return false; + } + return true; +} + +//========================================================================= +bool getConfigInt32Value( + const uno::Reference< container::XNameAccess > & xNameAccess, + const char * key, + sal_Int32 & value ) +{ + try + { + uno::Any aValue = xNameAccess->getByName( + rtl::OUString::createFromAscii( key ) ); + if ( aValue.hasValue() && !( aValue >>= value ) ) + { + OSL_ENSURE( sal_False, + "InternetProxyDecider - " + "Error getting config item value!" ); + return false; + } + } + catch ( lang::WrappedTargetException const & ) + { + return false; + } + catch ( container::NoSuchElementException const & ) + { + return false; + } + return true; +} + +//========================================================================= //========================================================================= // // InternetProxyDecider_Impl Implementation. @@ -291,127 +351,43 @@ InternetProxyDecider_Impl::InternetProxyDecider_Impl( if ( xNameAccess.is() ) { - try - { - if ( !( xNameAccess->getByName( - rtl::OUString::createFromAscii( - PROXY_TYPE_KEY ) ) >>= m_nProxyType ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } + // *** Proxy type *** + getConfigInt32Value( + xNameAccess, PROXY_TYPE_KEY, m_nProxyType ); + // *** No proxy list *** rtl::OUString aNoProxyList; - try - { - if ( !( xNameAccess->getByName( - rtl::OUString::createFromAscii( - NO_PROXY_LIST_KEY ) ) >>= aNoProxyList ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } - + getConfigStringValue( + xNameAccess, NO_PROXY_LIST_KEY, aNoProxyList ); setNoProxyList( aNoProxyList ); - try - { - if ( !( xNameAccess->getByName( - rtl::OUString::createFromAscii( - HTTP_PROXY_NAME_KEY ) ) - >>= m_aHttpProxy.aName ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } + // *** HTTP *** + getConfigStringValue( + xNameAccess, HTTP_PROXY_NAME_KEY, m_aHttpProxy.aName ); m_aHttpProxy.nPort = -1; - try - { - uno::Any aValue = xNameAccess->getByName( - rtl::OUString::createFromAscii( - HTTP_PROXY_PORT_KEY ) ); - if ( aValue.hasValue() && - !( aValue >>= m_aHttpProxy.nPort ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } - + getConfigInt32Value( + xNameAccess, HTTP_PROXY_PORT_KEY, m_aHttpProxy.nPort ); if ( m_aHttpProxy.nPort == -1 ) m_aHttpProxy.nPort = 80; // standard HTTP port. - try - { - if ( !( xNameAccess->getByName( - rtl::OUString::createFromAscii( - FTP_PROXY_NAME_KEY ) ) - >>= m_aFtpProxy.aName ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } + // *** HTTPS *** + getConfigStringValue( + xNameAccess, HTTPS_PROXY_NAME_KEY, m_aHttpsProxy.aName ); + + m_aHttpsProxy.nPort = -1; + getConfigInt32Value( + xNameAccess, HTTPS_PROXY_PORT_KEY, m_aHttpsProxy.nPort ); + if ( m_aHttpsProxy.nPort == -1 ) + m_aHttpsProxy.nPort = 443; // standard HTTPS port. + + // *** FTP *** + getConfigStringValue( + xNameAccess, FTP_PROXY_NAME_KEY, m_aFtpProxy.aName ); m_aFtpProxy.nPort = -1; - try - { - uno::Any aValue = xNameAccess->getByName( - rtl::OUString::createFromAscii( - FTP_PROXY_PORT_KEY ) ); - if ( aValue.hasValue() && - !( aValue >>= m_aFtpProxy.nPort ) ) - { - OSL_ENSURE( sal_False, - "InternetProxyDecider - " - "Error getting config item value!" ); - } - } - catch ( lang::WrappedTargetException const & ) - { - } - catch ( container::NoSuchElementException const & ) - { - } + getConfigInt32Value( + xNameAccess, FTP_PROXY_PORT_KEY, m_aFtpProxy.nPort ); } // Register as listener for config changes. @@ -588,6 +564,12 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy( if ( m_aFtpProxy.aName.getLength() > 0 && m_aFtpProxy.nPort >= 0 ) return m_aFtpProxy; } + else if ( rProtocol.toAsciiLowerCase() + .equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) ) + { + if ( m_aHttpsProxy.aName.getLength() ) + return m_aHttpsProxy; + } else if ( m_aHttpProxy.aName.getLength() ) { // All other protocols use the HTTP proxy. @@ -662,6 +644,29 @@ void SAL_CALL InternetProxyDecider_Impl::changesOccurred( m_aHttpProxy.nPort = 80; // standard HTTP port. } else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( + HTTPS_PROXY_NAME_KEY ) ) ) + { + if ( !( rElem.Element >>= m_aHttpsProxy.aName ) ) + { + OSL_ENSURE( sal_False, + "InternetProxyDecider - changesOccurred - " + "Error getting config item value!" ); + } + } + else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( + HTTPS_PROXY_PORT_KEY ) ) ) + { + if ( !( rElem.Element >>= m_aHttpsProxy.nPort ) ) + { + OSL_ENSURE( sal_False, + "InternetProxyDecider - changesOccurred - " + "Error getting config item value!" ); + } + + if ( m_aHttpsProxy.nPort == -1 ) + m_aHttpsProxy.nPort = 443; // standard HTTPS port. + } + else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( FTP_PROXY_NAME_KEY ) ) ) { if ( !( rElem.Element >>= m_aFtpProxy.aName ) ) |