diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-02-01 09:33:19 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-14 13:20:14 +0000 |
commit | 77fd448d0990adc79406e13a127b2b1834984b71 (patch) | |
tree | 3b8d1b23e7029dedcb97eb1d38ba83c91dfdac51 /extensions | |
parent | 5502501a8848c771aff5a77448a02451e22398a4 (diff) |
Removed several useless macros: UNISTRING, USTR, USTR_ASCII, ASCII_STR, ASCII_STRING, CONST_ASCII, ASCSTR, ASCII, DEFINE_CONST_UNICODE, DEFINE_CONST_OUSTRING
Change-Id: I96d690bf9f9b319e9eeafcf218ec5ce87f21215f
Reviewed-on: https://gerrit.libreoffice.org/1954
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/update/check/download.cxx | 24 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheck.cxx | 54 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheckconfig.cxx | 46 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheckjob.cxx | 6 | ||||
-rw-r--r-- | extensions/source/update/check/updatehdl.cxx | 308 | ||||
-rw-r--r-- | extensions/source/update/check/updateprotocol.cxx | 40 | ||||
-rw-r--r-- | extensions/source/update/check/updateprotocoltest.cxx | 2 | ||||
-rw-r--r-- | extensions/source/update/feed/test/updatefeedtest.cxx | 6 | ||||
-rw-r--r-- | extensions/source/update/feed/updatefeed.cxx | 58 | ||||
-rw-r--r-- | extensions/source/update/ui/updatecheckui.cxx | 10 |
10 files changed, 267 insertions, 287 deletions
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index ad2b3acb3e75..ad57db85fa1b 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -41,8 +41,6 @@ namespace container = com::sun::star::container ; namespace lang = com::sun::star::lang ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - struct OutData { @@ -188,37 +186,37 @@ Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int com::sun::star::configuration::theDefaultProvider::get( m_xContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Inet/Settings") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Inet/Settings") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< container::XNameAccess > xNameAccess( xConfigProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ), + "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - OSL_ASSERT(xNameAccess->hasByName(UNISTRING("ooInetProxyType"))); - uno::Any aValue = xNameAccess->getByName(UNISTRING("ooInetProxyType")); + OSL_ASSERT(xNameAccess->hasByName("ooInetProxyType")); + uno::Any aValue = xNameAccess->getByName("ooInetProxyType"); sal_Int32 nProxyType = aValue.get< sal_Int32 >(); if( 0 != nProxyType ) // type 0 means "direct connection to the internet { if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("http:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetHTTPProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetHTTPProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetHTTPProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetHTTPProxyPort"); } else if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("https:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetHTTPSProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetHTTPSProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetHTTPSProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetHTTPSProxyPort"); } else if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("ftp:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetFTPProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetFTPProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetFTPProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetFTPProxyPort"); } } } diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 540b98ee8045..cea6ec74fa7a 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -62,16 +62,14 @@ namespace c3s = com::sun::star::system ; namespace task = com::sun::star::task ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -#define PROPERTY_TITLE UNISTRING("BubbleHeading") -#define PROPERTY_TEXT UNISTRING("BubbleText") -#define PROPERTY_IMAGE UNISTRING("BubbleImageURL") -#define PROPERTY_SHOW_BUBBLE UNISTRING("BubbleVisible") -#define PROPERTY_CLICK_HDL UNISTRING("MenuClickHDL") -#define PROPERTY_DEFAULT_TITLE UNISTRING("DefaultHeading") -#define PROPERTY_DEFAULT_TEXT UNISTRING("DefaultText") -#define PROPERTY_SHOW_MENUICON UNISTRING("MenuIconVisible") +#define PROPERTY_TITLE "BubbleHeading" +#define PROPERTY_TEXT "BubbleText" +#define PROPERTY_IMAGE "BubbleImageURL" +#define PROPERTY_SHOW_BUBBLE "BubbleVisible" +#define PROPERTY_CLICK_HDL "MenuClickHDL" +#define PROPERTY_DEFAULT_TITLE "DefaultHeading" +#define PROPERTY_DEFAULT_TEXT "DefaultText" +#define PROPERTY_SHOW_MENUICON "MenuIconVisible" extern "C" bool SAL_CALL WNT_hasInternetConnection(); //------------------------------------------------------------------------------ @@ -103,7 +101,7 @@ namespace static inline rtl::OUString getBuildId() { - rtl::OUString aPathVal(UNISTRING("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}")); + OUString aPathVal("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}"); rtl::Bootstrap::expandMacros(aPathVal); return aPathVal; } @@ -111,7 +109,7 @@ static inline rtl::OUString getBuildId() //------------------------------------------------------------------------------ static inline rtl::OUString getBaseInstallation() { - rtl::OUString aPathVal(UNISTRING("$BRAND_BASE_DIR")); + rtl::OUString aPathVal("$BRAND_BASE_DIR"); rtl::Bootstrap::expandMacros(aPathVal); return aPathVal; } @@ -136,7 +134,7 @@ rtl::OUString getImageFromFileName(const rtl::OUString& aFile) if ( lastIndex > 0 ) { aUnpackPath = aUnpackPath.copy( 0, lastIndex+1 ); - aUnpackPath += UNISTRING( "unpack_update" ); + aUnpackPath += "unpack_update"; } oslFileHandle hOut = NULL; @@ -208,16 +206,16 @@ static uno::Reference< beans::XPropertySet > createMenuBarUI( { if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckJob: empty component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheckJob: empty component context", uno::Reference< uno::XInterface > () ); uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckJob: unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheckJob: unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); uno::Reference< beans::XPropertySet > xMenuBarUI = uno::Reference< beans::XPropertySet > ( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.setup.UpdateCheckUI" ), xContext ), + xServiceManager->createInstanceWithContext( "com.sun.star.setup.UpdateCheckUI", xContext ), uno::UNO_QUERY_THROW); xMenuBarUI->setPropertyValue( PROPERTY_CLICK_HDL, uno::makeAny( xJob ) ); @@ -716,7 +714,7 @@ ShutdownThread::run() // Tell QuickStarter not to veto .. uno::Reference< beans::XFastPropertySet > xQuickStarter( - UpdateCheck::createService(UNISTRING("com.sun.star.office.Quickstart"), m_xContext), + UpdateCheck::createService("com.sun.star.office.Quickstart", m_xContext), uno::UNO_QUERY ); @@ -924,7 +922,7 @@ UpdateCheck::install() if( !aParameter.isEmpty() ) osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); - aParameter += UNISTRING(" &"); + aParameter += " &"; #endif rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); @@ -1483,13 +1481,13 @@ bool UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) { osl::FileBase::RC rc; - rtl::OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + UNISTRING( "/sun" ) ); + rtl::OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + "/sun" ); rc = osl::Directory::createPath( aTargetDir ); - rtl::OUString aFileName = UNISTRING("releasenote") + + rtl::OUString aFileName = "releasenote" + rtl::OUString::valueOf( (sal_Int32) nNum ) + - UNISTRING(".url"); + ".url"; rtl::OUString aFilePath; rc = osl::FileBase::getAbsoluteFileURL( aTargetDir, aFileName, aFilePath ); @@ -1513,7 +1511,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) #ifdef WNT rc = aFile.write( aLineBuf.getStr(), aLineBuf.getLength(), nWritten ); if ( rc != osl::FileBase::E_None ) return false; - aURL = UNISTRING("URL=") + rURL; + aURL = "URL=" + rURL; #endif aLineBuf = rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ); rc = aFile.write( aLineBuf.getStr(), aLineBuf.getLength(), nWritten ); @@ -1526,18 +1524,18 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) //------------------------------------------------------------------------------ void UpdateCheck::showExtensionDialog() { - rtl::OUString sServiceName = UNISTRING("com.sun.star.deployment.ui.PackageManagerDialog"); - rtl::OUString sArguments = UNISTRING("SHOW_UPDATE_DIALOG"); + rtl::OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog"; + rtl::OUString sArguments = "SHOW_UPDATE_DIALOG"; uno::Reference< uno::XInterface > xService; if( ! m_xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheck::showExtensionDialog(): empty component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheck::showExtensionDialog(): empty component context", uno::Reference< uno::XInterface > () ); uno::Reference< lang::XMultiComponentFactory > xServiceManager( m_xContext->getServiceManager() ); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheck::showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheck::showExtensionDialog(): unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); xService = xServiceManager->createInstanceWithContext( sServiceName, m_xContext ); uno::Reference< task::XJobExecutor > xExecuteable( xService, uno::UNO_QUERY ); @@ -1581,14 +1579,14 @@ UpdateCheck::createService(const rtl::OUString& rServiceName, { if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: empty component context" ), + "UpdateCheckConfig: empty component context", uno::Reference< uno::XInterface >() ); const uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: unable to obtain service manager from component context" ), + "UpdateCheckConfig: unable to obtain service manager from component context", uno::Reference< uno::XInterface >() ); return xServiceManager->createInstanceWithContext(rServiceName, xContext); diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 9ad538be2a7f..554cf0d0e6db 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -45,8 +45,6 @@ namespace lang = com::sun::star::lang ; namespace util = com::sun::star::util ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(s) - #define LAST_CHECK "LastCheck" #define VERSION_FOUND "UpdateVersionFound" #define UPDATE_VERSION "UpdateVersion" @@ -64,7 +62,7 @@ namespace uno = com::sun::star::uno ; #define DOWNLOAD_DESTINATION "DownloadDestination" #define RELEASE_NOTE "ReleaseNote" -#define PROPERTY_VERSION UNISTRING("Version") +#define PROPERTY_VERSION "Version" static const sal_Char * const aUpdateEntryProperties[] = { UPDATE_VERSION, @@ -259,24 +257,24 @@ UpdateCheckConfig::get( com::sun::star::configuration::theDefaultProvider::get( xContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Jobs/Jobs/UpdateCheck/Arguments") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Office.Jobs/Jobs/UpdateCheck/Arguments") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< container::XNameContainer > xContainer( xConfigProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), + "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - aProperty.Value = uno::makeAny( UNISTRING("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates") ); + aProperty.Value = uno::makeAny( OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates") ); aArgumentList[0] = uno::makeAny( aProperty ); - uno::Reference< container::XNameContainer > xIgnoredExt( xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xIgnoredExt( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - aProperty.Value = uno::makeAny( UNISTRING("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates") ); + aProperty.Value = uno::makeAny( OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates") ); aArgumentList[0] = uno::makeAny( aProperty ); - uno::Reference< container::XNameContainer > xUpdateAvail( xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xUpdateAvail( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); return new UpdateCheckConfig( xContainer, xUpdateAvail, xIgnoredExt, rListener ); } @@ -287,7 +285,7 @@ bool UpdateCheckConfig::isAutoCheckEnabled() const { sal_Bool nValue = sal_False; - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( AUTOCHECK_ENABLED ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( AUTOCHECK_ENABLED ) >>= nValue; return nValue; } @@ -297,7 +295,7 @@ bool UpdateCheckConfig::isAutoDownloadEnabled() const { sal_Bool nValue = sal_False; - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( AUTODOWNLOAD_ENABLED ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( AUTODOWNLOAD_ENABLED ) >>= nValue; return nValue; } @@ -309,7 +307,7 @@ UpdateCheckConfig::getUpdateEntryVersion() const rtl::OUString aValue; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( OLD_VERSION ) ) >>= aValue; + const_cast < UpdateCheckConfig *> (this)->getByName( OLD_VERSION ) >>= aValue; return aValue; } @@ -322,7 +320,7 @@ UpdateCheckConfig::getLastChecked() const sal_Int64 nValue = 0; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( LAST_CHECK ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( LAST_CHECK ) >>= nValue; return nValue; } @@ -335,7 +333,7 @@ UpdateCheckConfig::getCheckInterval() const sal_Int64 nValue = 0; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( CHECK_INTERVAL ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( CHECK_INTERVAL ) >>= nValue; return nValue; } @@ -345,7 +343,7 @@ UpdateCheckConfig::getCheckInterval() const rtl::OUString UpdateCheckConfig::getLocalFileName() const { - rtl::OUString aName = UNISTRING(LOCAL_FILE); + rtl::OUString aName = LOCAL_FILE; rtl::OUString aRet; if( m_xContainer->hasByName(aName) ) @@ -359,8 +357,8 @@ UpdateCheckConfig::getLocalFileName() const rtl::OUString UpdateCheckConfig::getDownloadDestination() const { - rtl::OUString aName = UNISTRING(DOWNLOAD_DESTINATION); - rtl::OUString aRet; + OUString aName = DOWNLOAD_DESTINATION; + OUString aRet; const_cast <UpdateCheckConfig *> (this)->getByName(aName) >>= aRet; @@ -373,7 +371,7 @@ void UpdateCheckConfig::storeLocalFileName(const rtl::OUString& rLocalFileName, sal_Int64 nFileSize) { const sal_uInt8 nItems = 2; - const rtl::OUString aNameList[nItems] = { UNISTRING(LOCAL_FILE), UNISTRING(DOWNLOAD_SIZE) }; + const OUString aNameList[nItems] = { LOCAL_FILE, DOWNLOAD_SIZE }; const uno::Any aValueList[nItems] = { uno::makeAny(rLocalFileName), uno::makeAny(nFileSize) }; for( sal_uInt8 i=0; i < nItems; ++i ) @@ -393,7 +391,7 @@ void UpdateCheckConfig::clearLocalFileName() { const sal_uInt8 nItems = 2; - const rtl::OUString aNameList[nItems] = { UNISTRING(LOCAL_FILE), UNISTRING(DOWNLOAD_SIZE) }; + const OUString aNameList[nItems] = { LOCAL_FILE, DOWNLOAD_SIZE }; for( sal_uInt8 i=0; i < nItems; ++i ) { @@ -409,7 +407,7 @@ UpdateCheckConfig::clearLocalFileName() void UpdateCheckConfig::storeDownloadPaused(bool paused) { - replaceByName(UNISTRING(DOWNLOAD_PAUSED) , uno::makeAny(paused)); + replaceByName(DOWNLOAD_PAUSED , uno::makeAny(paused)); commitChanges(); } @@ -423,7 +421,7 @@ UpdateCheckConfig::updateLastChecked() sal_Int64 lastCheck = systime.Seconds; - replaceByName(UNISTRING(LAST_CHECK), uno::makeAny(lastCheck)); + replaceByName(LAST_CHECK, uno::makeAny(lastCheck)); } //------------------------------------------------------------------------------ @@ -498,7 +496,7 @@ uno::Sequence< rtl::OUString > UpdateCheckConfig::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheckConfig"); + aServiceList[0] = "com.sun.star.setup.UpdateCheckConfig"; return aServiceList; } @@ -507,7 +505,7 @@ UpdateCheckConfig::getServiceNames() rtl::OUString UpdateCheckConfig::getImplName() { - return UNISTRING( "vnd.sun.UpdateCheckConfig"); + return "vnd.sun.UpdateCheckConfig"; } //------------------------------------------------------------------------------ diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 1d33c7be2b6e..8b30e4d5d505 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -38,8 +38,6 @@ namespace lang = com::sun::star::lang ; namespace task = com::sun::star::task ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - namespace { @@ -168,7 +166,7 @@ uno::Sequence< rtl::OUString > UpdateCheckJob::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheck"); + aServiceList[0] = "com.sun.star.setup.UpdateCheck"; return aServiceList; }; @@ -177,7 +175,7 @@ UpdateCheckJob::getServiceNames() rtl::OUString UpdateCheckJob::getImplName() { - return UNISTRING( "vnd.sun.UpdateCheck"); + return "vnd.sun.UpdateCheck"; } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 98657d0c1216..4ed0a20f1b35 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -64,22 +64,20 @@ #include "updatehdl.hrc" #include <tools/urlobj.hxx> -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) +#define COMMAND_CLOSE "close" -#define COMMAND_CLOSE UNISTRING("close") +#define CTRL_THROBBER "throbber" +#define CTRL_PROGRESS "progress" -#define CTRL_THROBBER UNISTRING("throbber") -#define CTRL_PROGRESS UNISTRING("progress") +#define TEXT_STATUS "text_status" +#define TEXT_PERCENT "text_percent" +#define TEXT_DESCRIPTION "text_description" -#define TEXT_STATUS UNISTRING("text_status") -#define TEXT_PERCENT UNISTRING("text_percent") -#define TEXT_DESCRIPTION UNISTRING("text_description") - -#define FIXED_LINE_MODEL UNISTRING("com.sun.star.awt.UnoControlFixedLineModel") -#define FIXED_TEXT_MODEL UNISTRING("com.sun.star.awt.UnoControlFixedTextModel") -#define EDIT_FIELD_MODEL UNISTRING("com.sun.star.awt.UnoControlEditModel") -#define BUTTON_MODEL UNISTRING("com.sun.star.awt.UnoControlButtonModel") -#define GROUP_BOX_MODEL UNISTRING("com.sun.star.awt.UnoControlGroupBoxModel") +#define FIXED_LINE_MODEL "com.sun.star.awt.UnoControlFixedLineModel" +#define FIXED_TEXT_MODEL "com.sun.star.awt.UnoControlFixedTextModel" +#define EDIT_FIELD_MODEL "com.sun.star.awt.UnoControlEditModel" +#define BUTTON_MODEL "com.sun.star.awt.UnoControlButtonModel" +#define GROUP_BOX_MODEL "com.sun.star.awt.UnoControlGroupBoxModel" using namespace com::sun::star; @@ -132,7 +130,7 @@ void UpdateHandler::enableControls( short nCtrlState ) if ( ( nCurStateVal & 0x01 ) != ( nOldStateVal & 0x01 ) ) { bEnableControl = ( ( nCurStateVal & 0x01 ) == 0x01 ); - setControlProperty( msButtonIDs[i], UNISTRING("Enabled"), uno::Any( bEnableControl ) ); + setControlProperty( msButtonIDs[i], "Enabled", uno::Any( bEnableControl ) ); } } @@ -149,10 +147,10 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots ) rtl::OUString aLabel( msDownload ); if ( bAppendDots ) - aLabel += UNISTRING( "..." ); + aLabel += "..."; - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], UNISTRING("Label"), uno::Any( aLabel ) ); - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( aLabel ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) ); mbDownloadBtnHasDots = bAppendDots; } @@ -238,15 +236,15 @@ void UpdateHandler::setProgress( sal_Int32 nPercent ) osl::MutexGuard aGuard( maMutex ); mnPercent = nPercent; - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( nPercent ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( nPercent ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); } } //-------------------------------------------------------------------- void UpdateHandler::setErrorMessage( const rtl::OUString& rErrorMsg ) { - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rErrorMsg ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rErrorMsg ) ); } //-------------------------------------------------------------------- @@ -434,12 +432,12 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > if ( !mxInteractionHdl.is() ) { if( !mxContext.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateHandler:: empty component context" ), *this ); + throw uno::RuntimeException( "UpdateHandler:: empty component context", *this ); uno::Reference< lang::XMultiComponentFactory > xServiceManager(mxContext->getServiceManager()); if( !xServiceManager.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateHandler: unable to obtain service manager from component context" ), *this ); + throw uno::RuntimeException( "UpdateHandler: unable to obtain service manager from component context", *this ); mxInteractionHdl.set( task::InteractionHandler::createWithParent(mxContext, 0), @@ -450,7 +448,7 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > beans::Optional< ::rtl::OUString > aErrorText = xStrResolver->getStringFromInformationalRequest( rRequest ); if ( aErrorText.IsPresent ) { - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( aErrorText.Value ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( aErrorText.Value ) ); uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations(); if ( xContinuations.getLength() == 1 ) @@ -482,7 +480,7 @@ void SAL_CALL UpdateHandler::queryTermination( const lang::EventObject& ) xTopWindow->toFront(); throw frame::TerminationVetoException( - UNISTRING("The office cannot be closed while displaying a warning!"), + "The office cannot be closed while displaying a warning!", uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY)); } else @@ -527,25 +525,25 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_CHECKING: showControls( (1<<CANCEL_BUTTON) + (1<<THROBBER_CTRL) ); enableControls( 1<<CANCEL_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msChecking) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msChecking) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rtl::OUString() ) ); focusControl( CANCEL_BUTTON ); break; case UPDATESTATE_ERROR_CHECKING: showControls( 0 ); enableControls( 1 << CLOSE_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msCheckingError) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msCheckingError) ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_UPDATE_AVAIL: showControls( 0 ); enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadWarning); if ( !msDescriptionMsg.isEmpty() ) - sText += UNISTRING("\n\n") + msDescriptionMsg; - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( sText ) ); + sText += "\n\n" + msDescriptionMsg; + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( sText ) ); setDownloadBtnLabel( false ); focusControl( DOWNLOAD_BUTTON ); @@ -553,12 +551,12 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_UPDATE_NO_DOWNLOAD: showControls( 0 ); enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadNotAvail); if ( !msDescriptionMsg.isEmpty() ) - sText += UNISTRING("\n\n") + msDescriptionMsg; - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( sText ) ); + sText += "\n\n" + msDescriptionMsg; + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( sText ) ); setDownloadBtnLabel( true ); focusControl( DOWNLOAD_BUTTON ); @@ -567,39 +565,39 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_EXT_UPD_AVAIL: // will only be set, when there are no office updates avail showControls( 0 ); enableControls( 1 << CLOSE_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msNoUpdFound) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msNoUpdFound) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rtl::OUString() ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOADING: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloading) ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadWarning) ) ); - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( mnPercent ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloading) ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadWarning) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( mnPercent ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOAD_PAUSED: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) + (1<<RESUME_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloadPause) ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadWarning) ) ); - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( mnPercent ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloadPause) ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadWarning) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( mnPercent ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_ERROR_DOWNLOADING: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloadError) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloadError) ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOAD_AVAIL: showControls( 0 ); enableControls( (1<<CLOSE_BUTTON) + (1<<INSTALL_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msReady2Install) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadDescr) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msReady2Install) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadDescr) ) ); focusControl( INSTALL_BUTTON ); break; case UPDATESTATE_AUTO_START: @@ -630,7 +628,7 @@ rtl::OUString UpdateHandler::loadString( const uno::Reference< resource::XResour sal_Int32 nResourceId ) const { rtl::OUString sString; - rtl::OUString sKey = UNISTRING( "string:" ) + rtl::OUString::valueOf( nResourceId ); + rtl::OUString sKey = "string:" + rtl::OUString::valueOf( nResourceId ); try { @@ -639,7 +637,7 @@ rtl::OUString UpdateHandler::loadString( const uno::Reference< resource::XResour catch( const uno::Exception& ) { OSL_FAIL( "UpdateHandler::loadString: caught an exception!" ); - sString = UNISTRING("Missing ") + sKey; + sString = "Missing " + sKey; } return sString; @@ -649,10 +647,10 @@ rtl::OUString UpdateHandler::substVariables( const rtl::OUString &rSource ) cons { rtl::OUString sString( rSource ); - searchAndReplaceAll( sString, UNISTRING( "%NEXTVERSION" ), msNextVersion ); - searchAndReplaceAll( sString, UNISTRING( "%DOWNLOAD_PATH" ), msDownloadPath ); - searchAndReplaceAll( sString, UNISTRING( "%FILE_NAME" ), msDownloadFile ); - searchAndReplaceAll( sString, UNISTRING( "%PERCENT" ), rtl::OUString::valueOf( mnPercent ) ); + searchAndReplaceAll( sString, "%NEXTVERSION", msNextVersion ); + searchAndReplaceAll( sString, "%DOWNLOAD_PATH", msDownloadPath ); + searchAndReplaceAll( sString, "%FILE_NAME", msDownloadFile ); + searchAndReplaceAll( sString, "%PERCENT", rtl::OUString::valueOf( mnPercent ) ); return sString; } @@ -669,7 +667,7 @@ void UpdateHandler::loadStrings() try { uno::Any aValue( mxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ); + "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ); OSL_VERIFY( aValue >>= xLoader ); } catch( const uno::Exception& ) @@ -683,7 +681,7 @@ void UpdateHandler::loadStrings() try { - xBundle = xLoader->loadBundle_Default( UNISTRING( "upd" ) ); + xBundle = xLoader->loadBundle_Default( "upd" ); } catch( const resource::MissingResourceException& ) { @@ -739,7 +737,7 @@ void UpdateHandler::loadStrings() for ( int i=0; i < BUTTON_COUNT; i++ ) { - msButtonIDs[ i ] = UNISTRING("BUTTON_") + rtl::OUString::valueOf( (sal_Int32) i ); + msButtonIDs[ i ] = "BUTTON_" + rtl::OUString::valueOf( (sal_Int32) i ); } } @@ -835,11 +833,11 @@ void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > & r } // @see awt/UnoControlDialogElement.idl - xPropSet->setPropertyValue( UNISTRING("Name"), uno::Any (rControlName) ); - xPropSet->setPropertyValue( UNISTRING("PositionX"), uno::Any (rPosSize.X) ); - xPropSet->setPropertyValue( UNISTRING("PositionY"), uno::Any (rPosSize.Y) ); - xPropSet->setPropertyValue( UNISTRING("Height"), uno::Any (rPosSize.Height) ); - xPropSet->setPropertyValue( UNISTRING("Width"), uno::Any (rPosSize.Width) ); + xPropSet->setPropertyValue( "Name", uno::Any (rControlName) ); + xPropSet->setPropertyValue( "PositionX", uno::Any (rPosSize.X) ); + xPropSet->setPropertyValue( "PositionY", uno::Any (rPosSize.Y) ); + xPropSet->setPropertyValue( "Height", uno::Any (rPosSize.Height) ); + xPropSet->setPropertyValue( "Width", uno::Any (rPosSize.Width) ); // insert by Name into DialogModel container uno::Reference< container::XNameContainer > xContainer (rxDialogModel, uno::UNO_QUERY_THROW); @@ -853,25 +851,25 @@ void UpdateHandler::setFullVersion( rtl::OUString& rString ) com::sun::star::configuration::theDefaultProvider::get( mxContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Setup/Product") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Setup/Product") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< uno::XInterface > xConfigAccess; - xConfigAccess = xConfigurationProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationAccess"), + xConfigAccess = xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgumentList ); uno::Reference< container::XNameAccess > xNameAccess( xConfigAccess, uno::UNO_QUERY_THROW ); rtl::OUString aProductVersion; - xNameAccess->getByName(UNISTRING("ooSetupVersion")) >>= aProductVersion; + xNameAccess->getByName("ooSetupVersion") >>= aProductVersion; sal_Int32 nVerIndex = rString.indexOf( aProductVersion ); if ( nVerIndex != -1 ) { rtl::OUString aProductFullVersion; - xNameAccess->getByName(UNISTRING("ooSetupVersionAboutBox")) >>= aProductFullVersion; + xNameAccess->getByName("ooSetupVersionAboutBox") >>= aProductFullVersion; rString = rString.replaceAt( nVerIndex, aProductVersion.getLength(), aProductFullVersion ); } } @@ -897,7 +895,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const nWindowAttributes |= awt::VclWindowPeerAttribute::DEF_NO; aDescriptor.Type = awt::WindowClass_MODALTOP; - aDescriptor.WindowServiceName = UNISTRING( "warningbox" ); + aDescriptor.WindowServiceName = "warningbox"; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xPeer; aDescriptor.Bounds = awt::Rectangle( 10, 10, 250, 150 ); @@ -946,7 +944,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, nWindowAttributes |= awt::VclWindowPeerAttribute::DEF_NO; aDescriptor.Type = awt::WindowClass_MODALTOP; - aDescriptor.WindowServiceName = UNISTRING( "warningbox" ); + aDescriptor.WindowServiceName = "warningbox"; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xPeer; aDescriptor.Bounds = awt::Rectangle( 10, 10, 250, 150 ); @@ -966,12 +964,12 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, if ( xMsgBoxCtrl.is() ) { bool bIsDefault = true; - uno::Any aValue = xMsgBoxCtrl->getProperty( UNISTRING("DefaultButton") ); + uno::Any aValue = xMsgBoxCtrl->getProperty( "DefaultButton" ); aValue >>= bIsDefault; if ( bIsDefault ) - xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_1 ) ); + xMsgBoxCtrl->setProperty( "Text", uno::Any( rBtnText_1 ) ); else - xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_2 ) ); + xMsgBoxCtrl->setProperty( "Text", uno::Any( rBtnText_2 ) ); } } } @@ -998,8 +996,8 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, bool UpdateHandler::showOverwriteWarning( const rtl::OUString& rFileName ) const { rtl::OUString aMsg( msReloadWarning ); - searchAndReplaceAll( aMsg, UNISTRING( "%FILENAME" ), rFileName ); - searchAndReplaceAll( aMsg, UNISTRING( "%DOWNLOAD_PATH" ), msDownloadPath ); + searchAndReplaceAll( aMsg, "%FILENAME", rFileName ); + searchAndReplaceAll( aMsg, "%DOWNLOAD_PATH", msDownloadPath ); return showWarning( aMsg, msReloadContinue, msReloadReload ); } @@ -1065,15 +1063,15 @@ void UpdateHandler::showControls( short nControls ) // Status text needs to be smaller, when there are buttons at the right side of the dialog if ( ( nControls & ( (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ) ) != 0 ) - setControlProperty( TEXT_STATUS, UNISTRING("Width"), uno::Any( sal_Int32(EDIT_WIDTH - BUTTON_WIDTH - 2*INNER_BORDER - TEXT_OFFSET ) ) ); + setControlProperty( TEXT_STATUS, "Width", uno::Any( sal_Int32(EDIT_WIDTH - BUTTON_WIDTH - 2*INNER_BORDER - TEXT_OFFSET ) ) ); else - setControlProperty( TEXT_STATUS, UNISTRING("Width"), uno::Any( sal_Int32(EDIT_WIDTH - 2*TEXT_OFFSET ) ) ); + setControlProperty( TEXT_STATUS, "Width", uno::Any( sal_Int32(EDIT_WIDTH - 2*TEXT_OFFSET ) ) ); // Status text needs to be taller, when we show the progress bar if ( ( nControls & ( 1<<PROGRESS_CTRL ) ) != 0 ) - setControlProperty( TEXT_STATUS, UNISTRING("Height"), uno::Any( sal_Int32(LABEL_HEIGHT) ) ); + setControlProperty( TEXT_STATUS, "Height", uno::Any( sal_Int32(LABEL_HEIGHT) ) ); else - setControlProperty( TEXT_STATUS, UNISTRING("Height"), uno::Any( sal_Int32(BOX_HEIGHT1 - 4*TEXT_OFFSET - LABEL_HEIGHT ) ) ); + setControlProperty( TEXT_STATUS, "Height", uno::Any( sal_Int32(BOX_HEIGHT1 - 4*TEXT_OFFSET - LABEL_HEIGHT ) ) ); } //-------------------------------------------------------------------- @@ -1095,50 +1093,50 @@ void UpdateHandler::createDialog() uno::Reference< lang::XMultiComponentFactory > xFactory( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< awt::XControlModel > xControlModel( xFactory->createInstanceWithContext( - UNISTRING("com.sun.star.awt.UnoControlDialogModel"), + "com.sun.star.awt.UnoControlDialogModel", mxContext), uno::UNO_QUERY_THROW ); { // @see awt/UnoControlDialogModel.idl uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW ); - xPropSet->setPropertyValue( UNISTRING("Title"), uno::Any( msDlgTitle ) ); - xPropSet->setPropertyValue( UNISTRING("Closeable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Enabled"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Moveable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Sizeable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("DesktopAsParent"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("PositionX"), uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( UNISTRING("PositionY"), uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( UNISTRING("Width"), uno::Any(sal_Int32( DIALOG_WIDTH )) ); - xPropSet->setPropertyValue( UNISTRING("Height"), uno::Any(sal_Int32( DIALOG_HEIGHT )) ); - xPropSet->setPropertyValue( UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); + xPropSet->setPropertyValue( "Title", uno::Any( msDlgTitle ) ); + xPropSet->setPropertyValue( "Closeable", uno::Any( true ) ); + xPropSet->setPropertyValue( "Enabled", uno::Any( true ) ); + xPropSet->setPropertyValue( "Moveable", uno::Any( true ) ); + xPropSet->setPropertyValue( "Sizeable", uno::Any( true ) ); + xPropSet->setPropertyValue( "DesktopAsParent", uno::Any( true ) ); + xPropSet->setPropertyValue( "PositionX", uno::Any(sal_Int32( 100 )) ); + xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) ); + xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) ); + xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) ); + xPropSet->setPropertyValue( "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); } { // Label (fixed text) <status> uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Label"), uno::Any( msStatusFL ) ); + setProperty( aProps, 0, "Label", uno::Any( msStatusFL ) ); - insertControlModel( xControlModel, FIXED_TEXT_MODEL, UNISTRING( "fixedLineStatus" ), + insertControlModel( xControlModel, FIXED_TEXT_MODEL, "fixedLineStatus", awt::Rectangle( DIALOG_BORDER+1, DIALOG_BORDER, EDIT_WIDTH-2, LABEL_HEIGHT ), aProps ); } { // box around <status> text uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, GROUP_BOX_MODEL, UNISTRING( "StatusBox" ), + insertControlModel( xControlModel, GROUP_BOX_MODEL, "StatusBox", awt::Rectangle( DIALOG_BORDER, DIALOG_BORDER + LABEL_HEIGHT, EDIT_WIDTH, BOX_HEIGHT1 - LABEL_HEIGHT ), aProps ); } { // Text (multiline edit) <status> uno::Sequence< beans::NamedValue > aProps(7); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( substVariables(msChecking) ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("MultiLine"), uno::Any( true ) ); - setProperty( aProps, 4, UNISTRING("ReadOnly"), uno::Any( true ) ); - setProperty( aProps, 5, UNISTRING("AutoVScroll"), uno::Any( true ) ); - setProperty( aProps, 6, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) ); + setProperty( aProps, 0, "Text", uno::Any( substVariables(msChecking) ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); + setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); + setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1150,10 +1148,10 @@ void UpdateHandler::createDialog() { // Text (edit) <percent> uno::Sequence< beans::NamedValue > aProps(4); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( msPercent ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("ReadOnly"), uno::Any( true ) ); + setProperty( aProps, 0, "Text", uno::Any( msPercent ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "ReadOnly", uno::Any( true ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_PERCENT, awt::Rectangle( PROGRESS_X_POS + PROGRESS_WIDTH + DIALOG_BORDER, @@ -1165,11 +1163,11 @@ void UpdateHandler::createDialog() { // pause button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msPauseBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msPauseBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[PAUSE_BUTTON], awt::Rectangle( BOX1_BTN_X, BOX1_BTN_Y, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1178,11 +1176,11 @@ void UpdateHandler::createDialog() { // resume button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msResumeBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msResumeBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[RESUME_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1194,11 +1192,11 @@ void UpdateHandler::createDialog() { // abort button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msCancelBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msCancelBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[CANCEL_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1210,29 +1208,29 @@ void UpdateHandler::createDialog() { // Label (FixedText) <description> uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Label"), uno::Any( msDescription ) ); + setProperty( aProps, 0, "Label", uno::Any( msDescription ) ); - insertControlModel( xControlModel, FIXED_TEXT_MODEL, UNISTRING( "fixedTextDescription" ), + insertControlModel( xControlModel, FIXED_TEXT_MODEL, "fixedTextDescription", awt::Rectangle( DIALOG_BORDER+1, LABEL_Y_POS, EDIT_WIDTH-2, LABEL_HEIGHT ), aProps ); } { // box around <description> text uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, GROUP_BOX_MODEL, UNISTRING( "DescriptionBox" ), + insertControlModel( xControlModel, GROUP_BOX_MODEL, "DescriptionBox", awt::Rectangle( DIALOG_BORDER, EDIT2_Y_POS, EDIT_WIDTH, BOX_HEIGHT2 ), aProps ); } { // Text (MultiLineEdit) <description> uno::Sequence< beans::NamedValue > aProps(7); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("MultiLine"), uno::Any( true ) ); - setProperty( aProps, 4, UNISTRING("ReadOnly"), uno::Any( true ) ); - setProperty( aProps, 5, UNISTRING("AutoVScroll"), uno::Any( true ) ); - setProperty( aProps, 6, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) ); + setProperty( aProps, 0, "Text", uno::Any( rtl::OUString() ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); + setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); + setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1244,25 +1242,25 @@ void UpdateHandler::createDialog() { // @see awt/UnoControlFixedLineModel.idl uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Orientation"), uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 0, "Orientation", uno::Any( sal_Int32( 0 ) ) ); - insertControlModel( xControlModel, FIXED_LINE_MODEL, UNISTRING("fixedLine"), + insertControlModel( xControlModel, FIXED_LINE_MODEL, "fixedLine", awt::Rectangle( 0, BUTTON_BAR_Y_POS, DIALOG_WIDTH, 5 ), aProps ); } { // close button // @see awt/UnoControlButtonModel.idl uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); // [property] short PushButtonType // with own "ButtonActionListener" - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); // with default ActionListener => endDialog(). - // setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); + // setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); // [property] string Label // only if PushButtonType_STANDARD - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msClose ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) ); + setProperty( aProps, 3, "Label", uno::Any( msClose ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[ CLOSE_BUTTON ], awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1271,11 +1269,11 @@ void UpdateHandler::createDialog() { // install button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msInstall ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msInstall ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON], awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1284,11 +1282,11 @@ void UpdateHandler::createDialog() { // download button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msDownload ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msDownload ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[DOWNLOAD_BUTTON], awt::Rectangle( DOWNLOAD_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1297,9 +1295,9 @@ void UpdateHandler::createDialog() { // help button uno::Sequence< beans::NamedValue > aProps(3); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_HELP) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_HELP) ) ); insertControlModel( xControlModel, BUTTON_MODEL, msButtonIDs[HELP_BUTTON], awt::Rectangle( DIALOG_BORDER, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1308,24 +1306,24 @@ void UpdateHandler::createDialog() { // @see awt/UnoControlThrobberModel.idl uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.SpinningProgressControlModel"), CTRL_THROBBER, + insertControlModel( xControlModel, "com.sun.star.awt.SpinningProgressControlModel", CTRL_THROBBER, awt::Rectangle( THROBBER_X_POS, THROBBER_Y_POS, THROBBER_WIDTH, THROBBER_HEIGHT), aProps ); } { // @see awt/UnoControlProgressBarModel.idl uno::Sequence< beans::NamedValue > aProps(4); - setProperty( aProps, 0, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 1, UNISTRING("ProgressValue"), uno::Any( sal_Int32( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("ProgressValueMax"), uno::Any( sal_Int32( 100 ) ) ); - setProperty( aProps, 3, UNISTRING("ProgressValueMin"), uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 0, "Enabled", uno::Any( true ) ); + setProperty( aProps, 1, "ProgressValue", uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 2, "ProgressValueMax", uno::Any( sal_Int32( 100 ) ) ); + setProperty( aProps, 3, "ProgressValueMin", uno::Any( sal_Int32( 0 ) ) ); - insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.UnoControlProgressBarModel"), CTRL_PROGRESS, + insertControlModel( xControlModel, "com.sun.star.awt.UnoControlProgressBarModel", CTRL_PROGRESS, awt::Rectangle( PROGRESS_X_POS, PROGRESS_Y_POS, PROGRESS_WIDTH, PROGRESS_HEIGHT ), aProps); } uno::Reference< awt::XControl > xControl( - xFactory->createInstanceWithContext( UNISTRING("com.sun.star.awt.UnoControlDialog"), mxContext), + xFactory->createInstanceWithContext( "com.sun.star.awt.UnoControlDialog", mxContext), uno::UNO_QUERY_THROW ); xControl->setModel( xControlModel ); diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index 906cad094d70..48730b6b76e7 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -42,8 +42,6 @@ namespace uno = css::uno ; namespace task = css::task ; namespace xml = css::xml ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - //------------------------------------------------------------------------------ static bool @@ -52,17 +50,17 @@ getBootstrapData( ::rtl::OUString & rGitID, ::rtl::OUString & rInstallSetID) { - rGitID = UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ); + rGitID = "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}"; rtl::Bootstrap::expandMacros( rGitID ); if ( rGitID.isEmpty() ) return false; - rInstallSetID = UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateID}" ); + rInstallSetID = "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateID}"; rtl::Bootstrap::expandMacros( rInstallSetID ); if ( rInstallSetID.isEmpty() ) return false; - rtl::OUString aValue( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateURL}" ) ); + OUString aValue( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateURL}" ); rtl::Bootstrap::expandMacros( aValue ); if( !aValue.isEmpty() ) @@ -89,8 +87,8 @@ checkForUpdates( ::rtl::OUString myArch; ::rtl::OUString myOS; - rtl::Bootstrap::get(UNISTRING("_OS"), myOS); - rtl::Bootstrap::get(UNISTRING("_ARCH"), myArch); + rtl::Bootstrap::get("_OS", myOS); + rtl::Bootstrap::get("_ARCH", myArch); uno::Sequence< ::rtl::OUString > aRepositoryList; ::rtl::OUString aGitID; @@ -118,14 +116,14 @@ checkForUpdates( { if( !rxContext.is() ) throw uno::RuntimeException( - UNISTRING( "checkForUpdates: empty component context" ), uno::Reference< uno::XInterface >() ); + "checkForUpdates: empty component context", uno::Reference< uno::XInterface >() ); OSL_ASSERT( rxContext->getServiceManager().is() ); // XPath implementation uno::Reference< xml::xpath::XXPathAPI > xXPath = xml::xpath::XPathAPI::create(rxContext); - xXPath->registerNS( UNISTRING("inst"), UNISTRING("http://update.libreoffice.org/description") ); + xXPath->registerNS( "inst", "http://update.libreoffice.org/description" ); if( rxInteractionHandler.is() ) rUpdateInfoProvider->setInteractionHandler(rxInteractionHandler); @@ -159,7 +157,7 @@ checkForUpdates( uno::Reference< xml::dom::XNodeList > xNodeList; try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression - + UNISTRING("/inst:update/attribute::src")); + + "/inst:update/attribute::src"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -172,7 +170,7 @@ checkForUpdates( if( xNode2.is() ) { uno::Reference< xml::dom::XElement > xParent(xNode2->getParentNode(), uno::UNO_QUERY_THROW); - rtl::OUString aType = xParent->getAttribute(UNISTRING("type")); + rtl::OUString aType = xParent->getAttribute("type"); bool bIsDirect = ( sal_False == aType.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("text/html")) ); o_rUpdateInfo.Sources.push_back( DownloadSource(bIsDirect, xNode2->getNodeValue()) ); @@ -182,7 +180,7 @@ checkForUpdates( uno::Reference< xml::dom::XNode > xNode2; try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression - + UNISTRING("/inst:version/text()")); + + "/inst:version/text()"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -192,7 +190,7 @@ checkForUpdates( try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression - + UNISTRING("/inst:buildid/text()")); + + "/inst:buildid/text()"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -205,7 +203,7 @@ checkForUpdates( // Release Notes try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression - + UNISTRING("/inst:relnote")); + + "/inst:relnote"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -215,15 +213,15 @@ checkForUpdates( uno::Reference< xml::dom::XElement > xRelNote(xNodeList->item(i), uno::UNO_QUERY); if( xRelNote.is() ) { - sal_Int32 pos = xRelNote->getAttribute(UNISTRING("pos")).toInt32(); + sal_Int32 pos = xRelNote->getAttribute("pos").toInt32(); - ReleaseNote aRelNote((sal_uInt8) pos, xRelNote->getAttribute(UNISTRING("src"))); + ReleaseNote aRelNote((sal_uInt8) pos, xRelNote->getAttribute("src")); - if( xRelNote->hasAttribute(UNISTRING("src2")) ) + if( xRelNote->hasAttribute("src2") ) { - pos = xRelNote->getAttribute(UNISTRING("pos2")).toInt32(); + pos = xRelNote->getAttribute("pos2").toInt32(); aRelNote.Pos2 = (sal_Int8) pos; - aRelNote.URL2 = xRelNote->getAttribute(UNISTRING("src2")); + aRelNote.URL2 = xRelNote->getAttribute("src2"); } o_rUpdateInfo.ReleaseNotes.push_back(aRelNote); @@ -272,7 +270,7 @@ bool checkForExtensionUpdates( const uno::Reference< uno::XComponentContext > & try { uno::Any aValue( rxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ) ); + "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ); OSL_VERIFY( aValue >>= xInfoProvider ); } catch( const uno::Exception& ) @@ -298,7 +296,7 @@ bool checkForPendingUpdates( const uno::Reference< uno::XComponentContext > & rx try { uno::Any aValue( rxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ) ); + "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ); OSL_VERIFY( aValue >>= xInfoProvider ); } catch( const uno::Exception& ) diff --git a/extensions/source/update/check/updateprotocoltest.cxx b/extensions/source/update/check/updateprotocoltest.cxx index 69113b9a98c3..e88367cc44f8 100644 --- a/extensions/source/update/check/updateprotocoltest.cxx +++ b/extensions/source/update/check/updateprotocoltest.cxx @@ -27,8 +27,6 @@ #include <osl/process.h> #include <stdio.h> -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - namespace task = ::com::sun::star::task; namespace uno = ::com::sun::star::uno; diff --git a/extensions/source/update/feed/test/updatefeedtest.cxx b/extensions/source/update/feed/test/updatefeedtest.cxx index c2bedb087a2b..fdea48d79433 100644 --- a/extensions/source/update/feed/test/updatefeedtest.cxx +++ b/extensions/source/update/feed/test/updatefeedtest.cxx @@ -37,8 +37,6 @@ namespace lang = ::com::sun::star::lang; namespace uno = ::com::sun::star::uno; namespace xml = ::com::sun::star::xml; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - // ----------------------------------------------------------------------- SAL_IMPLEMENT_MAIN() @@ -65,9 +63,9 @@ SAL_IMPLEMENT_MAIN() uno::Sequence< rtl::OUString > theURLs(1); osl_getCommandArg( 0, &theURLs[0].pData ); - // theURLs[0] = UNISTRING( "http://localhost/~olli/atomfeed.xml" ); + // theURLs[0] = "http://localhost/~olli/atomfeed.xml"; - rtl::OUString aExtension = UNISTRING( "MyExtension" ); + rtl::OUString aExtension = "MyExtension"; try { diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 7c514fd8d097..045ac07b2571 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -64,7 +64,6 @@ namespace uno = com::sun::star::uno ; namespace xml = com::sun::star::xml ; namespace sdbc = com::sun::star::sdbc ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) //------------------------------------------------------------------------------ @@ -255,14 +254,14 @@ public: uno::Reference< xml::dom::XNode > xAtomEntryNode( m_xNodeList->item(m_nCount++) ); uno::Reference< xml::dom::XNode > xSummaryNode( - m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, UNISTRING( "summary/text()" ) ) + m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "summary/text()" ) ); if( xSummaryNode.is() ) aEntry.Description = xSummaryNode->getNodeValue(); uno::Reference< xml::dom::XNode > xContentNode( - m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, UNISTRING( "content" ) ) ); + m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "content" ) ); if( xContentNode.is() ) aEntry.UpdateDocument = m_xUpdateInformationProvider->getDocumentRoot(xContentNode); @@ -272,14 +271,14 @@ public: // action has been aborted catch( ucb::CommandAbortedException const & e) - { throw lang::WrappedTargetException( UNISTRING( "Command aborted" ), *this, uno::makeAny(e) ); } + { throw lang::WrappedTargetException( "Command aborted", *this, uno::makeAny(e) ); } // let runtime exception pass catch( uno::RuntimeException const & ) { throw; } // document not accessible catch( uno::Exception const & e) - { throw lang::WrappedTargetException( UNISTRING( "Document not accessible" ), *this, uno::makeAny(e) ); } + { throw lang::WrappedTargetException( "Document not accessible", *this, uno::makeAny(e) ); } } private: @@ -333,20 +332,19 @@ UpdateInformationProvider::UpdateInformationProvider( rtl::OUString name; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooName")) >>= name; + "org.openoffice.Setup/Product", + "ooName") >>= name; buf.append(name); buf.append(sal_Unicode(' ')); rtl::OUString version; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooSetupVersion")) >>= version; + "org.openoffice.Setup/Product", + "ooSetupVersion") >>= version; buf.append(version); rtl::OUString edition( - UNISTRING( "${${BRAND_BASE_DIR}/program/edition/edition.ini:" - "EDITIONNAME}")); + "EDITIONNAME}"); rtl::Bootstrap::expandMacros(edition); if (!edition.isEmpty()) { buf.append(sal_Unicode(' ')); @@ -355,15 +353,15 @@ UpdateInformationProvider::UpdateInformationProvider( rtl::OUString extension; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooSetupExtension")) >>= extension; + "org.openoffice.Setup/Product", + "ooSetupExtension") >>= extension; if (!extension.isEmpty()) { buf.append(sal_Unicode(' ')); buf.append(extension); } rtl::OUString product(buf.makeStringAndClear()); - rtl::OUString aUserAgent( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateUserAgent}" ) ); + rtl::OUString aUserAgent( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateUserAgent}" ); rtl::Bootstrap::expandMacros( aUserAgent ); for (sal_Int32 i = 0;;) { @@ -377,12 +375,12 @@ UpdateInformationProvider::UpdateInformationProvider( i += product.getLength(); } - m_aRequestHeaderList[0].Name = UNISTRING("Accept-Language"); - m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, UNISTRING("org.openoffice.Setup/L10N"), UNISTRING("ooLocale") ); + m_aRequestHeaderList[0].Name = "Accept-Language"; + m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, "org.openoffice.Setup/L10N", "ooLocale" ); if( !aUserAgent.isEmpty() ) { m_aRequestHeaderList.realloc(2); - m_aRequestHeaderList[1].Name = UNISTRING("User-Agent"); + m_aRequestHeaderList[1].Name = "User-Agent"; m_aRequestHeaderList[1].Value = uno::makeAny(aUserAgent); } } @@ -399,7 +397,7 @@ UpdateInformationProvider::createInstance(const uno::Reference<uno::XComponentCo uno::Reference< xml::xpath::XXPathAPI > xXPath = xml::xpath::XPathAPI::create( xContext ); - xXPath->registerNS( UNISTRING("atom"), UNISTRING("http://www.w3.org/2005/Atom") ); + xXPath->registerNS( "atom", "http://www.w3.org/2005/Atom" ); return *new UpdateInformationProvider(xContext, xUniversalContentBroker, xDocumentBuilder, xXPath); } @@ -416,7 +414,7 @@ uno::Any UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServiceFactory> const & configurationProvider, rtl::OUString const & node, rtl::OUString const & item) { beans::NamedValue aProperty; - aProperty.Name = UNISTRING("nodepath"); + aProperty.Name = "nodepath"; aProperty.Value = uno::makeAny(node); uno::Sequence< uno::Any > aArgumentList( 1 ); @@ -424,7 +422,7 @@ UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServi uno::Reference< container::XNameAccess > xNameAccess( configurationProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationAccess"), + "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), uno::UNO_QUERY_THROW); @@ -453,7 +451,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) if( !xId.is() ) throw uno::RuntimeException( - UNISTRING( "unable to obtain universal content id" ), *this); + "unable to obtain universal content id", *this); uno::Reference< ucb::XCommandProcessor > xCommandProcessor(m_xUniversalContentBroker->queryContent(xId), uno::UNO_QUERY_THROW); rtl::Reference< ActiveDataSink > aSink(new ActiveDataSink()); @@ -462,7 +460,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) // instances phone home & clog up servers uno::Sequence< beans::NamedValue > aProps( 1 ); aProps[ 0 ] = beans::NamedValue( - UNISTRING("KeepAlive"), uno::makeAny(sal_False)); + "KeepAlive", uno::makeAny(sal_False)); ucb::OpenCommandArgument3 aOpenArgument; aOpenArgument.Mode = ucb::OpenMode::DOCUMENT; @@ -471,7 +469,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) aOpenArgument.OpeningFlags = aProps; ucb::Command aCommand; - aCommand.Name = UNISTRING("open"); + aCommand.Name = "open"; aCommand.Argument = uno::makeAny(aOpenArgument); sal_Int32 nCommandId = xCommandProcessor->createCommandIdentifier(); @@ -513,10 +511,10 @@ UpdateInformationProvider::getDocumentRoot(const uno::Reference< xml::dom::XNode uno::Reference< xml::dom::XElement > xElement(rxNode, uno::UNO_QUERY_THROW); // load the document referenced in 'src' attribute .. - if( xElement->hasAttribute( UNISTRING("src") ) ) + if( xElement->hasAttribute( "src" ) ) { uno::Reference< xml::dom::XDocument > xUpdateXML = - m_xDocumentBuilder->parse(load(xElement->getAttribute( UNISTRING("src") ))); + m_xDocumentBuilder->parse(load(xElement->getAttribute( "src" ))); OSL_ASSERT( xUpdateXML.is() ); @@ -556,7 +554,7 @@ UpdateInformationProvider::getChildNode(const uno::Reference< xml::dom::XNode >& { OSL_ASSERT(m_xXPathAPI.is()); try { - return m_xXPathAPI->selectSingleNode(rxNode, UNISTRING( "./atom:" ) + rName); + return m_xXPathAPI->selectSingleNode(rxNode, "./atom:" + rName); } catch (const xml::xpath::XPathException &) { // ignore return 0; @@ -593,9 +591,9 @@ UpdateInformationProvider::getUpdateInformationEnumeration( rtl::OUString aXPathExpression; if( !extensionId.isEmpty() ) - aXPathExpression = UNISTRING("//atom:entry/atom:category[@term=\'") + extensionId + UNISTRING("\']/.."); + aXPathExpression = "//atom:entry/atom:category[@term=\'" + extensionId + "\']/.."; else - aXPathExpression = UNISTRING("//atom:entry"); + aXPathExpression = "//atom:entry"; uno::Reference< xml::dom::XNodeList > xNodeList; try { @@ -740,7 +738,7 @@ uno::Sequence< rtl::OUString > UpdateInformationProvider::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.deployment.UpdateInformationProvider"); + aServiceList[0] = "com.sun.star.deployment.UpdateInformationProvider"; return aServiceList; }; @@ -749,7 +747,7 @@ UpdateInformationProvider::getServiceNames() rtl::OUString UpdateInformationProvider::getImplName() { - return UNISTRING( "vnd.sun.UpdateInformationProvider"); + return OUString("vnd.sun.UpdateInformationProvider"); } //------------------------------------------------------------------------------ diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index 441a57eca717..f5565f38742a 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -51,8 +51,6 @@ #include "updatecheckui.hrc" -#define UNISTRING(s) rtl::OUString(s) - #define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START + 7) #define PROPERTY_TITLE RTL_CONSTASCII_STRINGPARAM("BubbleHeading") @@ -69,7 +67,7 @@ using namespace ::com::sun::star; static uno::Sequence< rtl::OUString > getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheckUI"); + aServiceList[0] = "com.sun.star.setup.UpdateCheckUI"; return aServiceList; } @@ -77,7 +75,7 @@ static uno::Sequence< rtl::OUString > getServiceNames() static rtl::OUString getImplementationName() { - return UNISTRING( "vnd.sun.UpdateCheckUI"); + return "vnd.sun.UpdateCheckUI"; } //------------------------------------------------------------------------------ @@ -244,7 +242,7 @@ UpdateCheckUI::getGlobalEventBroadcaster() const throw (uno::RuntimeException) { if( !m_xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckUI: empty component context" ), + "UpdateCheckUI: empty component context", uno::Reference< uno::XInterface >() ); return uno::Reference<document::XEventBroadcaster> ( @@ -308,7 +306,7 @@ Image UpdateCheckUI::GetBubbleImage( ::rtl::OUString &rURL ) if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckUI: unable to obtain service manager from component context" ), + "UpdateCheckUI: unable to obtain service manager from component context", uno::Reference< uno::XInterface >() ); try |