diff options
author | Carsten Driesner <cd@openoffice.org> | 2011-02-09 16:04:16 +0100 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2011-02-09 16:04:16 +0100 |
commit | c0cbcdd2c93eb5ceca7c24f1475757da0a920360 (patch) | |
tree | 81122313a641bd1d5bb2532bf67e42029075f863 /framework | |
parent | fb9f0268794bc2f0966c595c5003b19697af5aae (diff) |
fwk165: #164407# Prevent substitution of abs. path variable in the middle of a path string.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/services/substitutepathvars.hxx | 205 | ||||
-rwxr-xr-x | framework/qa/complex/path_substitution/PathSubstitutionTest.java | 22 | ||||
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 329 |
3 files changed, 283 insertions, 273 deletions
diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx index 9bf4b1ead43d..8825386d1b57 100644 --- a/framework/inc/services/substitutepathvars.hxx +++ b/framework/inc/services/substitutepathvars.hxx @@ -36,7 +36,7 @@ #include <hash_map> //_________________________________________________________________________________________________________________ -// my own includes +// my own includes //_________________________________________________________________________________________________________________ #include <threadhelp/threadhelpbase.hxx> #include <macros/generic.hxx> @@ -46,7 +46,7 @@ #include <stdtypes.h> //_________________________________________________________________________________________________________________ -// interface includes +// interface includes //_________________________________________________________________________________________________________________ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> @@ -54,7 +54,7 @@ #include <com/sun/star/util/XStringSubstitution.hpp> //_________________________________________________________________________________________________________________ -// other includes +// other includes //_________________________________________________________________________________________________________________ #include <cppuhelper/implbase2.hxx> #include <rtl/ustring.hxx> @@ -68,24 +68,24 @@ namespace framework // Must be zero value based enum EnvironmentType { - ET_HOST = 0 , - ET_YPDOMAIN , - ET_DNSDOMAIN , - ET_NTDOMAIN , - ET_OS , - ET_UNKNOWN , - ET_COUNT + ET_HOST = 0 , + ET_YPDOMAIN , + ET_DNSDOMAIN , + ET_NTDOMAIN , + ET_OS , + ET_UNKNOWN , + ET_COUNT }; // Must be zero value based enum OperatingSystem { - OS_WINDOWS = 0, - OS_UNIX , - OS_SOLARIS , - OS_LINUX , - OS_UNKNOWN , - OS_COUNT + OS_WINDOWS = 0, + OS_UNIX , + OS_SOLARIS , + OS_LINUX , + OS_UNKNOWN , + OS_COUNT }; struct SubstituteRule @@ -97,15 +97,16 @@ struct SubstituteRule EnvironmentType aType ) : aSubstVariable( aVarName ), aSubstValue( aValue ), aEnvValue( aVal ), aEnvType( aType ) {} - rtl::OUString aSubstVariable; - rtl::OUString aSubstValue; - com::sun::star::uno::Any aEnvValue; - EnvironmentType aEnvType; + rtl::OUString aSubstVariable; + rtl::OUString aSubstValue; + com::sun::star::uno::Any aEnvValue; + EnvironmentType aEnvType; }; struct SubstitutePathNotify { SubstitutePathNotify() {}; + const com::sun::star::uno::Sequence<rtl::OUString> aPropertyNames; }; @@ -131,45 +132,45 @@ class SubstitutePathVariables_Impl : public utl::ConfigItem static OperatingSystem GetOperatingSystemFromString( const rtl::OUString& ); static EnvironmentType GetEnvTypeFromString( const rtl::OUString& ); - void GetSharePointsRules( SubstituteVariables& aSubstVarMap ); + void GetSharePointsRules( SubstituteVariables& aSubstVarMap ); /** is called from the ConfigManager before application ends or from the PropertyChangeListener if the sub tree broadcasts changes. */ - virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); - virtual void Commit(); - - private: - // Wrapper methods for low-level functions - OperatingSystem GetOperatingSystem(); - const rtl::OUString& GetYPDomainName(); - const rtl::OUString& GetDNSDomainName(); - const rtl::OUString& GetNTDomainName(); - const rtl::OUString& GetHostName(); - - sal_Bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ); - - void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq ); - void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName, - const rtl::OUString& aSharePointNodeName, - SubstituteRuleVector& aRuleSet ); - - // Stored values for domains and host - sal_Bool m_bYPDomainRetrieved; - rtl::OUString m_aYPDomain; - sal_Bool m_bDNSDomainRetrieved; - rtl::OUString m_aDNSDomain; - sal_Bool m_bNTDomainRetrieved; - rtl::OUString m_aNTDomain; - sal_Bool m_bHostRetrieved; - rtl::OUString m_aHost; - sal_Bool m_bOSRetrieved; - OperatingSystem m_eOSType; - - Link m_aListenerNotify; - const rtl::OUString m_aSharePointsNodeName; - const rtl::OUString m_aDirPropertyName; - const rtl::OUString m_aEnvPropertyName; - const rtl::OUString m_aLevelSep; + virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); + virtual void Commit(); + + private: + // Wrapper methods for low-level functions + OperatingSystem GetOperatingSystem(); + const rtl::OUString& GetYPDomainName(); + const rtl::OUString& GetDNSDomainName(); + const rtl::OUString& GetNTDomainName(); + const rtl::OUString& GetHostName(); + + bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ); + + void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq ); + void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName, + const rtl::OUString& aSharePointNodeName, + SubstituteRuleVector& aRuleSet ); + + // Stored values for domains and host + bool m_bYPDomainRetrieved; + rtl::OUString m_aYPDomain; + bool m_bDNSDomainRetrieved; + rtl::OUString m_aDNSDomain; + bool m_bNTDomainRetrieved; + rtl::OUString m_aNTDomain; + bool m_bHostRetrieved; + rtl::OUString m_aHost; + bool m_bOSRetrieved; + OperatingSystem m_eOSType; + + Link m_aListenerNotify; + const rtl::OUString m_aSharePointsNodeName; + const rtl::OUString m_aDirPropertyName; + const rtl::OUString m_aEnvPropertyName; + const rtl::OUString m_aLevelSep; }; enum PreDefVariable @@ -234,8 +235,8 @@ struct ReSubstUserVarOrder typedef std::list< ReSubstFixedVarOrder > ReSubstFixedVarOrderVector; typedef std::list< ReSubstUserVarOrder > ReSubstUserVarOrderVector; -class SubstitutePathVariables : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses. - public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo> +class SubstitutePathVariables : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses. + public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo > { friend class SubstitutePathVariables_Impl; @@ -254,51 +255,51 @@ class SubstitutePathVariables : private ThreadHelpBase virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - protected: - DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* ); - - void SetPredefinedPathVariables( PredefinedPathVariables& ); - rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const; - - // Special case (transient) values can change during runtime! - // Don't store them in the pre defined struct - rtl::OUString GetWorkPath() const; - rtl::OUString GetWorkVariableValue() const; - rtl::OUString GetPathVariableValue() const; - - rtl::OUString GetHomeVariableValue() const; - - // XStringSubstitution implementation methods - rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, sal_Bool bSustRequired ) - throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText ) - throw (::com::sun::star::uno::RuntimeException); - ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable ) - throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - - private: - class VarNameToIndexMap : public std::hash_map< ::rtl::OUString, - PreDefVariable, - OUStringHashCode, - ::std::equal_to< ::rtl::OUString > > - { - inline void free() + protected: + DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* ); + + void SetPredefinedPathVariables( PredefinedPathVariables& ); + rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const; + + // Special case (transient) values can change during runtime! + // Don't store them in the pre defined struct + rtl::OUString GetWorkPath() const; + rtl::OUString GetWorkVariableValue() const; + rtl::OUString GetPathVariableValue() const; + + rtl::OUString GetHomeVariableValue() const; + + // XStringSubstitution implementation methods + rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, bool bSustRequired ) + throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText ) + throw (::com::sun::star::uno::RuntimeException); + ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable ) + throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + private: + class VarNameToIndexMap : public std::hash_map< ::rtl::OUString, + PreDefVariable, + OUStringHashCode, + ::std::equal_to< ::rtl::OUString > > { - VarNameToIndexMap().swap( *this ); - } - }; - - // heavy used string - const rtl::OUString m_aVarStart; - const rtl::OUString m_aVarEnd; - - VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access - SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name! - PredefinedPathVariables m_aPreDefVars; // All predefined variables - SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration - ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) - ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + inline void free() + { + VarNameToIndexMap().swap( *this ); + } + }; + + // heavy used string + const rtl::OUString m_aVarStart; + const rtl::OUString m_aVarEnd; + + VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access + SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name! + PredefinedPathVariables m_aPreDefVars; // All predefined variables + SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration + ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) + ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; }; } diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java index aeea9907e6bc..451b2d3db8ec 100755 --- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java +++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java @@ -66,17 +66,17 @@ public class PathSubstitutionTest @Before private void initialize() { substVars = new VariableContainer(); - substVars.add("$(prog)", false, true); - substVars.add("$(inst)", false, true); - substVars.add("$(user)", false, true); - substVars.add("$(work)", false, true); - substVars.add("$(home)", false, true); - substVars.add("$(temp)", false, true); + substVars.add("$(prog)", true, true); + substVars.add("$(inst)", true, true); + substVars.add("$(user)", true, true); + substVars.add("$(work)", true, true); + substVars.add("$(home)", true, true); + substVars.add("$(temp)", true, true); substVars.add("$(lang)", false, false); substVars.add("$(langid)", false, false); substVars.add("$(vlang)", false, false); // path won't resubstitute - substVars.add("$(path)", false, false); + substVars.add("$(path)", true, false); } /** @@ -106,8 +106,6 @@ public class PathSubstitutionTest return; } -// initialize(); - for (int i = 0; i < substVars.size(); i++) { String var = substVars.getVariable(i); @@ -148,6 +146,12 @@ public class PathSubstitutionTest //in middle of text works substString = "file:///starting/" + var + "/path"; + String sCanSubstAllPos; + if (substVars.onlySubstituteAtBegin(i)) + sCanSubstAllPos = "NO"; + else + sCanSubstAllPos = "YES"; + System.out.println("Variable can substitute within string: "+sCanSubstAllPos); System.out.println("Substitute '" + substString + "'"); newValue = oObj.substituteVariables(substString, false); System.out.println("Return value '" + newValue + "'"); diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 90c460b74298..5fde74764eda 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -29,7 +29,7 @@ #include "precompiled_framework.hxx" //_________________________________________________________________________________________________________________ -// my own includes +// my own includes //_________________________________________________________________________________________________________________ #include "services/substitutepathvars.hxx" #include <threadhelp/resetableguard.hxx> @@ -37,12 +37,12 @@ #include "services.h" //_________________________________________________________________________________________________________________ -// interface includes +// interface includes //_________________________________________________________________________________________________________________ #include <com/sun/star/beans/XPropertySet.hpp> //_________________________________________________________________________________________________________________ -// includes of other projects +// includes of other projects //_________________________________________________________________________________________________________________ #include <unotools/configitem.hxx> #include <unotools/localfilehelper.hxx> @@ -69,38 +69,38 @@ #include <string.h> //_________________________________________________________________________________________________________________ -// Defines +// Defines //_________________________________________________________________________________________________________________ // -#define STRPOS_NOTFOUND (sal_Int32)-1 +#define STRPOS_NOTFOUND (sal_Int32)-1 -#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val )) +#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val )) -#define SEARCHPATH_DELIMITER ';' +#define SEARCHPATH_DELIMITER ';' // Variable start/end characters -#define SIGN_STARTVARIABLE ASCII_STR("$(") -#define SIGN_ENDVARIABLE ASCII_STR(")") +#define SIGN_STARTVARIABLE ASCII_STR("$(") +#define SIGN_ENDVARIABLE ASCII_STR(")") // Length of SUBSTITUTE_... to replace it with real values. -#define REPLACELENGTH_INST 7 -#define REPLACELENGTH_PROG 7 -#define REPLACELENGTH_USER 7 -#define REPLACELENGTH_WORK 7 -#define REPLACELENGTH_HOME 7 -#define REPLACELENGTH_TEMP 7 -#define REPLACELENGTH_PATH 7 +#define REPLACELENGTH_INST 7 +#define REPLACELENGTH_PROG 7 +#define REPLACELENGTH_USER 7 +#define REPLACELENGTH_WORK 7 +#define REPLACELENGTH_HOME 7 +#define REPLACELENGTH_TEMP 7 +#define REPLACELENGTH_PATH 7 #define REPLACELENGTH_INSTPATH 11 #define REPLACELENGTH_PROGPATH 11 #define REPLACELENGTH_USERPATH 11 #define REPLACELENGTH_INSTURL 10 #define REPLACELENGTH_PROGURL 10 #define REPLACELENGTH_USERURL 10 -#define REPLACELENGTH_PATH 7 -#define REPLACELENGTH_LANG 7 -#define REPLACELENGTH_LANGID 9 -#define REPLACELENGTH_VLANG 8 +#define REPLACELENGTH_PATH 7 +#define REPLACELENGTH_LANG 7 +#define REPLACELENGTH_LANGID 9 +#define REPLACELENGTH_VLANG 8 #define REPLACELENGTH_WORKDIRURL 13 // --> PB 2004-10-27 #i32656# - new variable of hierachy service #define REPLACELENGTH_BASEINSTURL 14 @@ -108,27 +108,28 @@ // <-- // Name of the pre defined path variables -#define VARIABLE_INST "$(inst)" -#define VARIABLE_PROG "$(prog)" -#define VARIABLE_USER "$(user)" -#define VARIABLE_WORK "$(work)" -#define VARIABLE_HOME "$(home)" -#define VARIABLE_TEMP "$(temp)" -#define VARIABLE_PATH "$(path)" -#define VARIABLE_LANG "$(lang)" -#define VARIABLE_LANGID "$(langid)" -#define VARIABLE_VLANG "$(vlang)" -#define VARIABLE_INSTPATH "$(instpath)" -#define VARIABLE_PROGPATH "$(progpath)" -#define VARIABLE_USERPATH "$(userpath)" -#define VARIABLE_INSTURL "$(insturl)" -#define VARIABLE_PROGURL "$(progurl)" -#define VARIABLE_USERURL "$(userurl)" -#define VARIABLE_WORKDIRURL "$(workdirurl)" +#define VARIABLE_INST "$(inst)" +#define VARIABLE_PROG "$(prog)" +#define VARIABLE_USER "$(user)" +#define VARIABLE_WORK "$(work)" +#define VARIABLE_HOME "$(home)" +#define VARIABLE_TEMP "$(temp)" +#define VARIABLE_PATH "$(path)" +#define VARIABLE_LANG "$(lang)" +#define VARIABLE_LANGID "$(langid)" +#define VARIABLE_VLANG "$(vlang)" +#define VARIABLE_INSTPATH "$(instpath)" +#define VARIABLE_PROGPATH "$(progpath)" +#define VARIABLE_USERPATH "$(userpath)" +#define VARIABLE_INSTURL "$(insturl)" +#define VARIABLE_PROGURL "$(progurl)" +#define VARIABLE_USERURL "$(userurl)" +#define VARIABLE_WORKDIRURL "$(workdirurl)" // --> PB 2004-10-27 #i32656# - new variable of hierachy service -#define VARIABLE_BASEINSTURL "$(baseinsturl)" -#define VARIABLE_USERDATAURL "$(userdataurl)" +#define VARIABLE_BASEINSTURL "$(baseinsturl)" +#define VARIABLE_USERDATAURL "$(userdataurl)" // <-- +#define VARIABLE_BRANDBASEURL "$(brandbaseurl)" using namespace com::sun::star::uno; using namespace com::sun::star::beans; @@ -137,7 +138,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; //_________________________________________________________________________________________________________________ -// Namespace +// Namespace //_________________________________________________________________________________________________________________ // @@ -149,6 +150,7 @@ struct FixedVariable const char* pVarName; PreDefVariable nEnumValue; int nStrLen; + bool bAbsPath; }; struct TableEntry @@ -162,11 +164,11 @@ struct TableEntry // of the string static TableEntry aOSTable[OS_COUNT] = { - { "WINDOWS" , 7 }, - { "UNIX" , 4 }, - { "SOLARIS" , 7 }, - { "LINUX" , 5 }, - { "" , 0 } // unknown + { "WINDOWS" , 7 }, + { "UNIX" , 4 }, + { "SOLARIS" , 7 }, + { "LINUX" , 5 }, + { "" , 0 } // unknown }; // Table with valid environment variables @@ -174,12 +176,12 @@ static TableEntry aOSTable[OS_COUNT] = // the length of the string. static TableEntry aEnvTable[ET_COUNT] = { - { "HOST" , 4 }, - { "YPDOMAIN" , 8 }, - { "DNSDOMAIN" , 9 }, - { "NTDOMAIN" , 8 }, - { "OS" , 2 }, - { "" , 0 } // unknown + { "HOST" , 4 }, + { "YPDOMAIN" , 8 }, + { "DNSDOMAIN" , 9 }, + { "NTDOMAIN" , 8 }, + { "OS" , 2 }, + { "" , 0 } // unknown }; // Priority table for the environment types. Lower numbers define @@ -187,44 +189,43 @@ static TableEntry aEnvTable[ET_COUNT] = // that the first match wins!! static sal_Int16 aEnvPrioTable[ET_COUNT] = { - 1, // ET_HOST - 2, // ET_IPDOMAIN - 2, // ET_DNSDOMAIN - 2, // ET_NTDOMAIN - 3, // ET_OS - 99, // ET_UNKNOWN + 1, // ET_HOST + 2, // ET_IPDOMAIN + 2, // ET_DNSDOMAIN + 2, // ET_NTDOMAIN + 3, // ET_OS + 99, // ET_UNKNOWN }; // Table with all fixed/predefined variables supported. static FixedVariable aFixedVarTable[] = { - { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST }, - { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG }, - { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER }, - { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK }, // Special variable (transient)! - { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME }, - { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP }, - { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH }, - { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG }, - { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID }, - { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG }, - { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH }, - { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH }, - { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH }, - { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL }, - { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL }, - { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL }, - { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL }, // Special variable (transient) and don't use for resubstitution! + { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST, true }, + { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG, true }, + { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER, true }, + { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK, true }, // Special variable (transient)! + { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME, true }, + { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP, true }, + { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH, true }, + { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG, false }, + { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID, false }, + { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG, false }, + { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH, true }, + { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH, true }, + { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH, true }, + { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL, true }, + { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL, true }, + { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL, true }, + { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL,true }, // Special variable (transient) and don't use for resubstitution! // --> PB 2004-10-27 #i32656# - new variable of hierachy service - { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL }, - { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL }, + { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL,true }, + { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL,true }, // <-- - { "$(brandbaseurl)", PREDEFVAR_BRANDBASEURL, - RTL_CONSTASCII_LENGTH("$(brandbaseurl)") } + { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true } }; //_________________________________________________________________________________________________________________ -// Implementation helper classes +// Implementation helper classes //_________________________________________________________________________________________________________________ // @@ -252,11 +253,11 @@ EnvironmentType SubstitutePathVariables_Impl::GetEnvTypeFromString( const rtl::O SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link& aNotifyLink ) : utl::ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Substitution" ))), - m_bYPDomainRetrieved( sal_False ), - m_bDNSDomainRetrieved( sal_False ), - m_bNTDomainRetrieved( sal_False ), - m_bHostRetrieved( sal_False ), - m_bOSRetrieved( sal_False ), + m_bYPDomainRetrieved( false ), + m_bDNSDomainRetrieved( false ), + m_bNTDomainRetrieved( false ), + m_bHostRetrieved( false ), + m_bOSRetrieved( false ), m_aListenerNotify( aNotifyLink ), m_aSharePointsNodeName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SharePoints" ))), m_aDirPropertyName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/Directory" ))), @@ -302,10 +303,9 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu // We have found an active rule aActiveRule.aSubstVariable = aSharePointNames[ nSharePoints ]; aSubstVarMap.insert( SubstituteVariables::value_type( - aActiveRule.aSubstVariable, aActiveRule )); + aActiveRule.aSubstVariable, aActiveRule )); } } - ++nSharePoints; } } @@ -322,7 +322,7 @@ void SubstitutePathVariables_Impl::Commit() //_________________________________________________________________________________________________________________ -// private methods +// private methods //_________________________________________________________________________________________________________________ // @@ -407,18 +407,19 @@ const rtl::OUString& SubstitutePathVariables_Impl::GetHostName() return m_aHost; } -sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ) +bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ) { - sal_Bool bResult = sal_False; + bool bResult = sal_False; if ( !aRuleSet.empty() ) { - sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ]; const sal_uInt32 nCount = aRuleSet.size(); + + sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ]; for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ ) { const SubstituteRule& aRule = aRuleSet[nIndex]; - EnvironmentType eEnvType = aRule.aEnvType; + EnvironmentType eEnvType = aRule.aEnvType; // Check if environment type has a higher priority than current one! if ( nPrioCurrentRule > aEnvPrioTable[eEnvType] ) @@ -433,13 +434,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector aHostStr = aHostStr.toAsciiLowerCase(); // Pattern match if domain environment match - WildCard aPattern(aHostStr); - sal_Bool bMatch = aPattern.Matches(aHost); + WildCard aPattern(aHostStr); + bool bMatch = aPattern.Matches(aHost); if ( bMatch ) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; @@ -462,13 +463,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector aDomain = GetNTDomainName(); // Pattern match if domain environment match - WildCard aPattern(aDomainStr); - sal_Bool bMatch = aPattern.Matches(aDomain); + WildCard aPattern(aDomainStr); + bool bMatch = aPattern.Matches(aDomain); if ( bMatch ) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; @@ -481,24 +482,24 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector sal_Int16 nValue = 0; aRule.aEnvValue >>= nValue; - sal_Bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS ); + bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS ); OperatingSystem eRuleOSType = (OperatingSystem)nValue; // Match if OS identical or rule is set to UNIX and OS is LINUX/SOLARIS! if (( eRuleOSType == eOSType ) || ( eRuleOSType == OS_UNIX && bUnix )) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; - case ET_UNKNOWN: // nothing to do - break; + case ET_UNKNOWN: // nothing to do + break; - default: - break; + default: + break; } } } @@ -514,9 +515,9 @@ void SubstitutePathVariables_Impl::ReadSharePointsFromConfiguration( Sequence< r } void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( - const rtl::OUString& aSharePointName, - const rtl::OUString& aSharePointNodeName, - SubstituteRuleVector& rRuleSet ) + const rtl::OUString& aSharePointName, + const rtl::OUString& aSharePointNodeName, + SubstituteRuleVector& rRuleSet ) { Sequence< rtl::OUString > aSharePointMappingsNodeNames = GetNodeNames( aSharePointNodeName, utl::CONFIG_NAME_LOCAL_PATH ); @@ -569,7 +570,7 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( } // Decode the environment and optional the operatng system settings - Any aEnvValue; + Any aEnvValue; EnvironmentType eEnvType = GetEnvTypeFromString( aEnvUsed ); if ( eEnvType == ET_OS ) { @@ -588,13 +589,12 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( } //***************************************************************************************************************** -// XInterface, XTypeProvider, XServiceInfo +// XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables , - ::cppu::OWeakObject , - SERVICENAME_SUBSTITUTEPATHVARIABLES , - IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES - ) +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables , + ::cppu::OWeakObject , + SERVICENAME_SUBSTITUTEPATHVARIABLES , + IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES ) DEFINE_INIT_SERVICE ( SubstitutePathVariables, {} ) @@ -626,16 +626,15 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService // Sort predefined/fixed variable to path length for ( i = 0; i < PREDEFVAR_COUNT; i++ ) { - if (( i != PREDEFVAR_WORKDIRURL ) && - ( i != PREDEFVAR_PATH )) + if (( i != PREDEFVAR_WORKDIRURL ) && ( i != PREDEFVAR_PATH )) { // Special path variables, don't include into automatic resubstituion search! // $(workdirurl) is not allowed to resubstitute! This variable is the value of path settings entry // and it could be possible that it will be resubstituted by itself!! // Example: WORK_PATH=c:\test, $(workdirurl)=WORK_PATH => WORK_PATH=$(workdirurl) and this cannot be substituted! ReSubstFixedVarOrder aFixedVar; - aFixedVar.eVariable = aFixedVarTable[i].nEnumValue; - aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength(); + aFixedVar.eVariable = aFixedVarTable[i].nEnumValue; + aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength(); m_aReSubstFixedVarOrder.push_back( aFixedVar ); } } @@ -650,8 +649,8 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService aStrBuffer.append( m_aVarStart ); aStrBuffer.append( pIter->second.aSubstVariable ); aStrBuffer.append( m_aVarEnd ); - aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear(); - aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength(); + aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear(); + aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength(); m_aReSubstUserVarOrder.push_back( aUserOrderVar ); } m_aReSubstUserVarOrder.sort(); @@ -687,7 +686,7 @@ throw ( NoSuchElementException, RuntimeException ) } //_________________________________________________________________________________________________________________ -// protected methods +// protected methods //_________________________________________________________________________________________________________________ // @@ -702,7 +701,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; + String aResult; rtl::OUString aTemp; osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp ); @@ -718,7 +717,7 @@ 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; + rtl::OUString aWorkPath; ::comphelper::ConfigurationHelper::readDirectKey( m_xServiceManager, ::rtl::OUString::createFromAscii("org.openoffice.Office.Paths"), @@ -739,7 +738,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const ::rtl::OUString::createFromAscii("Work"), ::comphelper::ConfigurationHelper::E_READONLY) >>= aWorkPath; - // fallback to $HOME in case platform dependend config layer does not return + // fallback to $HOME in case platform dependend config layer does not return // an usuable work dir value. if (aWorkPath.getLength() < 1) { @@ -773,7 +772,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const rtl::OUString aPathList( pEnv, strlen( pEnv ), gsl_getSystemTextEncoding() ); rtl::OUStringBuffer aPathStrBuffer( aPathList.getLength() * PATH_EXTEND_FACTOR / 100 ); - sal_Bool bAppendSep = sal_False; + bool bAppendSep = false; sal_Int32 nToken = 0; do { @@ -784,7 +783,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const if ( bAppendSep ) aPathStrBuffer.appendAscii( ";" ); // Office uses ';' as path separator aPathStrBuffer.append( aTmp ); - bAppendSep = sal_True; + bAppendSep = true; } } while(nToken>=0); @@ -795,7 +794,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const return aRetStr; } -rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired ) +rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, bool bSubstRequired ) throw ( NoSuchElementException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" ); @@ -811,9 +810,9 @@ throw ( NoSuchElementException, RuntimeException ) // Search for first occure of "$(...". sal_Int32 nDepth = 0; sal_Int32 bSubstitutionCompleted = sal_False; - sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string + sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string sal_Int32 nLength = 0; // = count of letters from "$(" to ")" in string - sal_Bool bVarNotSubstituted = sal_False; + bool bVarNotSubstituted = false; // Have we found any variable like "$(...)"? if ( nPosition != STRPOS_NOTFOUND ) @@ -826,17 +825,17 @@ throw ( NoSuchElementException, RuntimeException ) } // Is there something to replace ? - sal_Bool bWorkRetrieved = sal_False; - sal_Bool bWorkDirURLRetrieved = sal_False; + bool bWorkRetrieved = false; + bool bWorkDirURLRetrieved = false; while ( !bSubstitutionCompleted && nDepth < nMaxRecursiveDepth ) { while ( ( nPosition != STRPOS_NOTFOUND ) && ( nLength > 3 ) ) // "$(" ")" { // YES; Get the next variable for replace. - sal_Int32 nReplaceLength = 0; - rtl::OUString aReplacement; - rtl::OUString aSubString = aWorkText.copy( nPosition, nLength ); - rtl::OUString aSubVarString; + sal_Int32 nReplaceLength = 0; + rtl::OUString aReplacement; + rtl::OUString aSubString = aWorkText.copy( nPosition, nLength ); + rtl::OUString aSubVarString; // Path variables are not case sensitive! aSubVarString = aSubString.toAsciiLowerCase(); @@ -851,17 +850,24 @@ throw ( NoSuchElementException, RuntimeException ) { // Transient value, retrieve it again m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkVariableValue(); - bWorkRetrieved = sal_True; + bWorkRetrieved = true; } else if ( nIndex == PREDEFVAR_WORKDIRURL && !bWorkDirURLRetrieved ) { // Transient value, retrieve it again m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkPath(); - bWorkDirURLRetrieved = sal_True; + bWorkDirURLRetrieved = true; } - aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ]; - nReplaceLength = nLength; + // Check preconditions to substitue path variables. + // 1. A path variable can only be substituted if it follows a SEARCHPATH_DELIMITER ';'! + // 2. It's located exactly at the start of the string being substituted! + if (( aFixedVarTable[ int( nIndex ) ].bAbsPath && (( nPosition == 0 ) || (( nPosition > 0 ) && ( aWorkText[nPosition-1] == ';')))) || + ( !aFixedVarTable[ int( nIndex ) ].bAbsPath )) + { + aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ]; + nReplaceLength = nLength; + } } else { @@ -870,7 +876,7 @@ throw ( NoSuchElementException, RuntimeException ) SubstituteVariables::const_iterator pIter = m_aSubstVarMap.find( aVarName ); if ( pIter != m_aSubstVarMap.end() ) { - // found! + // Found. aReplacement = pIter->second.aSubstValue; nReplaceLength = nLength; } @@ -885,7 +891,7 @@ throw ( NoSuchElementException, RuntimeException ) else { // Variable not known - bVarNotSubstituted = sal_False; + bVarNotSubstituted = false; nPosition += nLength; } @@ -1017,8 +1023,8 @@ throw ( RuntimeException ) } // Due to a recursive definition this code must exchange variables with variables! - sal_Bool bResubstitutionCompleted = sal_False; - sal_Bool bVariableFound = sal_False; + bool bResubstitutionCompleted = false; + bool bVariableFound = false; // Get transient predefined path variable $(work) value before starting resubstitution m_aPreDefVars.m_FixedVar[ PREDEFVAR_WORK ] = GetWorkVariableValue(); @@ -1032,7 +1038,7 @@ throw ( RuntimeException ) sal_Int32 nPos = aURL.indexOf( aValue ); if ( nPos >= 0 ) { - sal_Bool bMatch = sal_True; + bool bMatch = true; if ( pIterFixed->eVariable == PREDEFVAR_LANG || pIterFixed->eVariable == PREDEFVAR_LANGID || pIterFixed->eVariable == PREDEFVAR_VLANG ) @@ -1058,7 +1064,7 @@ throw ( RuntimeException ) aStrBuffer.append( m_aPreDefVars.m_FixedVarNames[ (sal_Int32)pIterFixed->eVariable ] ); // Get the variable name for struct var name array! aStrBuffer.append( aURL.copy( nPos + aValue.getLength(), ( aURL.getLength() - ( nPos + aValue.getLength() )) )); aURL = aStrBuffer.makeStringAndClear(); - bVariableFound = sal_True; // Resubstitution not finished yet! + bVariableFound = true; // Resubstitution not finished yet! break; } } @@ -1079,12 +1085,12 @@ throw ( RuntimeException ) aStrBuffer.append( m_aVarEnd ); aStrBuffer.append( aURL.copy( nPos + aVarValue.getLength(), ( aURL.getLength() - ( nPos + aVarValue.getLength() )) )); aURL = aStrBuffer.makeStringAndClear(); - bVariableFound = sal_True; // Resubstitution not finished yet! + bVariableFound = true; // Resubstitution not finished yet! } } if ( !bVariableFound ) - bResubstitutionCompleted = sal_True; + bResubstitutionCompleted = true; else bVariableFound = sal_False; // Next resubstitution } @@ -1150,7 +1156,7 @@ throw ( NoSuchElementException, RuntimeException ) void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" ); - Any aAny; + Any aAny; ::rtl::OUString aOfficePath; ::rtl::OUString aUserPath; ::rtl::OUString aTmp; @@ -1194,14 +1200,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable // Detect the program directory // Set $(prog), $(progpath), $(progurl) INetURLObject aProgObj( - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] ); - if ( !aProgObj.HasError() && - aProgObj.insertName( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) ) + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] ); + if ( !aProgObj.HasError() && aProgObj.insertName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) ) { - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE); - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE); + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; } // Detect the language type of the current office @@ -1216,7 +1220,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable // Set $(lang) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_LANG ] = ConvertOSLtoUCBURL( - rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) )); + rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) )); + // Set $(vlang) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_VLANG ] = aLocaleStr; @@ -1241,7 +1246,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable aPreDefPathVariables.m_FixedVar[ PREDEFVAR_TEMP ] = ConvertOSLtoUCBURL( aTmp ); aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR")); + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR")); rtl::Bootstrap::expandMacros( aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL]); } |