This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 6ed1dc3 Fixed typos, removed whitespace 6ed1dc3 is described below commit 6ed1dc3eff63dd2c77295d034fd10207505ba1ea Author: mseidel <msei...@apache.org> AuthorDate: Thu Nov 5 22:09:26 2020 +0100 Fixed typos, removed whitespace --- main/extensions/source/update/check/download.cxx | 167 +++++----- .../source/update/check/updatecheckconfig.cxx | 343 ++++++++++----------- main/extensions/source/update/check/updatehdl.cxx | 105 +++---- main/sw/source/core/doc/extinput.cxx | 47 ++- 4 files changed, 331 insertions(+), 331 deletions(-) diff --git a/main/extensions/source/update/check/download.cxx b/main/extensions/source/update/check/download.cxx index a6b2bef..4942cac 100644 --- a/main/extensions/source/update/check/download.cxx +++ b/main/extensions/source/update/check/download.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -68,17 +68,17 @@ static void openFile( OutData& out ) { char * effective_url; curl_easy_getinfo(out.curl, CURLINFO_EFFECTIVE_URL, &effective_url); - + double fDownloadSize; curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fDownloadSize); - + rtl::OString aURL(effective_url); - + // ensure no trailing '/' sal_Int32 nLen = aURL.getLength(); while( (nLen > 0) && ('/' == aURL[nLen-1]) ) aURL = aURL.copy(0, --nLen); - + // extract file name last '/' sal_Int32 nIndex = aURL.lastIndexOf('/'); if( nIndex > 0 ) @@ -86,48 +86,48 @@ static void openFile( OutData& out ) out.File = out.DestinationDir + rtl::OStringToOUString(aURL.copy(nIndex), RTL_TEXTENCODING_UTF8); oslFileError rc; - + // Give the user an overwrite warning if the target file exists const sal_Int32 openFlags = osl_File_OpenFlag_Write | osl_File_OpenFlag_Create; do { rc = osl_openFile(out.File.pData, &out.FileHandle, openFlags); - + if( osl_File_E_EXIST == rc && ! out.Handler->downloadTargetExists(out.File) ) { out.StopCondition.set(); break; } - + } while( osl_File_E_EXIST == rc ); - + if( osl_File_E_None == rc ) out.Handler->downloadStarted(out.File, (sal_Int64) fDownloadSize); - } + } } //------------------------------------------------------------------------------ -static inline rtl::OString +static inline rtl::OString getStringValue(const uno::Reference< container::XNameAccess >& xNameAccess, const rtl::OUString& aName) { rtl::OString aRet; - + OSL_ASSERT(xNameAccess->hasByName(aName)); uno::Any aValue = xNameAccess->getByName(aName); - + return rtl::OUStringToOString(aValue.get<rtl::OUString>(), RTL_TEXTENCODING_UTF8); } //------------------------------------------------------------------------------ -static inline sal_Int32 -getInt32Value(const uno::Reference< container::XNameAccess >& xNameAccess, +static inline sal_Int32 +getInt32Value(const uno::Reference< container::XNameAccess >& xNameAccess, const rtl::OUString& aName, sal_Int32 nDefault=-1) { OSL_ASSERT(xNameAccess->hasByName(aName)); uno::Any aValue = xNameAccess->getByName(aName); - + sal_Int32 n=nDefault; aValue >>= n; return n; @@ -135,19 +135,19 @@ getInt32Value(const uno::Reference< container::XNameAccess >& xNameAccess, //------------------------------------------------------------------------------ -static size_t +static size_t write_function( void *ptr, size_t size, size_t nmemb, void *stream ) { OutData *out = reinterpret_cast < OutData * > (stream); - + if( NULL == out->FileHandle ) openFile(*out); - + sal_uInt64 nBytesWritten = 0; - + if( NULL != out->FileHandle ) osl_writeFile(out->FileHandle, ptr, size * nmemb, &nBytesWritten); - + return (size_t) nBytesWritten; } @@ -160,9 +160,9 @@ progress_callback( void *clientp, double dltotal, double dlnow, double ultotal, (void) ulnow; OutData *out = reinterpret_cast < OutData * > (clientp); - + OSL_ASSERT( out ); - + if( ! out->StopCondition.check() ) { double fPercent = 0; @@ -170,58 +170,58 @@ progress_callback( void *clientp, double dltotal, double dlnow, double ultotal, fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset); if( fPercent < 0 ) fPercent = 0; - + // Do not report progress for redirection replies long nCode; curl_easy_getinfo(out->curl, CURLINFO_RESPONSE_CODE, &nCode); if( (nCode != 302) && (nCode != 303) && (dltotal > 0) ) out->Handler->downloadProgressAt((sal_Int8)fPercent); - + return 0; } - + // If stop condition is set, return non 0 value to abort return -1; } //------------------------------------------------------------------------------ -void +void Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int32& rPort) const { if( !m_xContext.is() ) - throw uno::RuntimeException( - UNISTRING( "Download: empty component context" ), + throw uno::RuntimeException( + UNISTRING( "Download: empty component context" ), uno::Reference< uno::XInterface >() ); - + uno::Reference< lang::XMultiComponentFactory > xServiceManager(m_xContext->getServiceManager()); - + if( !xServiceManager.is() ) - throw uno::RuntimeException( - UNISTRING( "Download: unable to obtain service manager from component context" ), + throw uno::RuntimeException( + UNISTRING( "Download: unable to obtain service manager from component context" ), uno::Reference< uno::XInterface >() ); - - uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), m_xContext ), - uno::UNO_QUERY_THROW); - + + uno::Reference< lang::XMultiServiceFactory > xConfigProvider( + xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), m_xContext ), + uno::UNO_QUERY_THROW); + beans::PropertyValue aProperty; aProperty.Name = UNISTRING( "nodepath" ); aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Inet/Settings") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); - - uno::Reference< container::XNameAccess > xNameAccess( - xConfigProvider->createInstanceWithArguments( + + uno::Reference< container::XNameAccess > xNameAccess( + xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); - + OSL_ASSERT(xNameAccess->hasByName(UNISTRING("ooInetProxyType"))); uno::Any aValue = xNameAccess->getByName(UNISTRING("ooInetProxyType")); - + sal_Int32 nProxyType = aValue.get< sal_Int32 >(); - if( 0 != nProxyType ) // type 0 means "direct connection to the internet + if( 0 != nProxyType ) // type 0 means "direct connection to the Internet" { if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("http:")) ) { @@ -245,63 +245,63 @@ Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProxyHost, sal_Int32 nProxyPort) { - /* Need to investigate further whether it is necessary to call + /* Need to investigate further whether it is necessary to call * curl_global_init or not - leave it for now (as the ftp UCB content * provider does as well). */ - + CURL * pCURL = curl_easy_init(); bool ret = false; - + if( NULL != pCURL ) { out.curl = pCURL; - + rtl::OString aURL(rtl::OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); curl_easy_setopt(pCURL, CURLOPT_URL, aURL.getStr()); - + // abort on http errors curl_easy_setopt(pCURL, CURLOPT_FAILONERROR, 1); // enable redirection curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1); - + // write function curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out); curl_easy_setopt(pCURL, CURLOPT_WRITEFUNCTION, &write_function); - + // progress handler - Condition::check unfortunately is not defined const curl_easy_setopt(pCURL, CURLOPT_NOPROGRESS, 0); curl_easy_setopt(pCURL, CURLOPT_PROGRESSFUNCTION, &progress_callback); curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, &out); - + // proxy curl_easy_setopt(pCURL, CURLOPT_PROXY, aProxyHost.getStr()); curl_easy_setopt(pCURL, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); if( -1 != nProxyPort ) curl_easy_setopt(pCURL, CURLOPT_PROXYPORT, nProxyPort); - + if( out.Offset > 0 ) { - // curl_off_t offset = nOffset; libcurl seems to be compiled with large + // curl_off_t offset = nOffset; libcurl seems to be compiled with large // file support (and we not) .. sal_Int64 offset = (sal_Int64) out.Offset; curl_easy_setopt(pCURL, CURLOPT_RESUME_FROM_LARGE, offset); } - + CURLcode cc = curl_easy_perform(pCURL); // treat zero byte downloads as errors if( NULL == out.FileHandle ) openFile(out); - + if( CURLE_OK == cc ) { out.Handler->downloadFinished(out.File); ret = true; } - - if ( CURLE_PARTIAL_FILE == cc ) + + if ( CURLE_PARTIAL_FILE == cc ) { // this sometimes happens, when a user throws away his user data, but has already // completed the download of an update. @@ -313,7 +313,7 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx ret = true; } } - + // Avoid target file being removed else if( (CURLE_ABORTED_BY_CALLBACK == cc) || out.StopCondition.check() ) ret = true; @@ -322,7 +322,7 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx else { rtl::OString aMessage(RTL_CONSTASCII_STRINGPARAM("Unknown error")); - + const char * error_message = curl_easy_strerror(cc); if( NULL != error_message ) aMessage = error_message; @@ -352,20 +352,20 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx if ( !ret ) out.Handler->downloadStalled( rtl::OStringToOUString(aMessage, RTL_TEXTENCODING_UTF8) ); } - + curl_easy_cleanup(pCURL); } - + return ret; } //------------------------------------------------------------------------------ -bool +bool Download::start(const rtl::OUString& rURL, const rtl::OUString& rFile, const rtl::OUString& rDestinationDir) { OSL_ASSERT( m_aHandler.is() ); - + OutData out(m_aCondition); rtl::OUString aFile( rFile ); @@ -422,35 +422,36 @@ Download::start(const rtl::OUString& rURL, const rtl::OUString& rFile, const rtl osl_getFilePos(out.FileHandle, &out.Offset); } } - else if( osl_File_E_NOENT == rc ) // file has been deleted meanwhile .. + else if( osl_File_E_NOENT == rc ) // file has been deleted meanwhile... out.File = rtl::OUString(); } - + rtl::OString aProxyHost; sal_Int32 nProxyPort = -1; getProxyForURL(rURL, aProxyHost, nProxyPort); - bool ret = curl_run(rURL, out, aProxyHost, nProxyPort); - - if( NULL != out.FileHandle ) - { - osl_syncFile(out.FileHandle); - osl_closeFile(out.FileHandle); + bool ret = curl_run(rURL, out, aProxyHost, nProxyPort); + + if( NULL != out.FileHandle ) + { + osl_syncFile(out.FileHandle); + osl_closeFile(out.FileHandle); // #i90930# Don't remove already downloaded bits, when curl_run reports an error // because later calls might be successful -// if( ! ret ) -// osl_removeFile(out.File.pData); - } - - m_aCondition.reset(); - return ret; +// if( ! ret ) +// osl_removeFile(out.File.pData); + } + + m_aCondition.reset(); + return ret; } //------------------------------------------------------------------------------ -void +void Download::stop() { - m_aCondition.set(); + m_aCondition.set(); } + diff --git a/main/extensions/source/update/check/updatecheckconfig.cxx b/main/extensions/source/update/check/updatecheckconfig.cxx index fe35489..08eb5b2 100644 --- a/main/extensions/source/update/check/updatecheckconfig.cxx +++ b/main/extensions/source/update/check/updatecheckconfig.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -74,20 +74,20 @@ namespace uno = com::sun::star::uno ; #define PROPERTY_VERSION UNISTRING("Version") -static const sal_Char * const aUpdateEntryProperties[] = { - UPDATE_VERSION, - UPDATE_BUILDID, - UPDATE_DESCRIPTION, - DOWNLOAD_URL, - IS_DIRECT_DOWNLOAD, - RELEASE_NOTE"1", - RELEASE_NOTE"2", - RELEASE_NOTE"3", - RELEASE_NOTE"4", - RELEASE_NOTE"5", - OLD_VERSION +static const sal_Char * const aUpdateEntryProperties[] = { + UPDATE_VERSION, + UPDATE_BUILDID, + UPDATE_DESCRIPTION, + DOWNLOAD_URL, + IS_DIRECT_DOWNLOAD, + RELEASE_NOTE"1", + RELEASE_NOTE"2", + RELEASE_NOTE"3", + RELEASE_NOTE"4", + RELEASE_NOTE"5", + OLD_VERSION }; - + static const sal_uInt32 nUpdateEntryProperties = sizeof(aUpdateEntryProperties) / sizeof(sal_Char *); //------------------------------------------------------------------------------ @@ -98,16 +98,16 @@ NamedValueByNameAccess::~NamedValueByNameAccess() //------------------------------------------------------------------------------ -::com::sun::star::uno::Any +::com::sun::star::uno::Any NamedValueByNameAccess::getValue(const sal_Char * pName) { - const sal_Int32 nLen = m_rValues.getLength(); - for( sal_Int32 n=0; n < nLen; ++n ) - { - if( m_rValues[n].Name.equalsAscii( pName ) ) - return m_rValues[n].Value; - } - return ::com::sun::star::uno::Any(); + const sal_Int32 nLen = m_rValues.getLength(); + for( sal_Int32 n=0; n < nLen; ++n ) + { + if( m_rValues[n].Name.equalsAscii( pName ) ) + return m_rValues[n].Value; + } + return ::com::sun::star::uno::Any(); } @@ -116,46 +116,46 @@ NamedValueByNameAccess::getValue(const sal_Char * pName) bool UpdateCheckROModel::isAutoCheckEnabled() const { - return sal_True == m_aNameAccess.getValue(AUTOCHECK_ENABLED).get< sal_Bool >(); + return sal_True == m_aNameAccess.getValue(AUTOCHECK_ENABLED).get< sal_Bool >(); } //------------------------------------------------------------------------------ -bool +bool UpdateCheckROModel::isDownloadPaused() const { - return sal_True == m_aNameAccess.getValue(DOWNLOAD_PAUSED).get< sal_Bool >(); + return sal_True == m_aNameAccess.getValue(DOWNLOAD_PAUSED).get< sal_Bool >(); } //------------------------------------------------------------------------------ -rtl::OUString +rtl::OUString UpdateCheckROModel::getStringValue(const sal_Char * pStr) const { - uno::Any aAny( m_aNameAccess.getValue(pStr) ); - rtl::OUString aRet; - - aAny >>= aRet; - - return aRet; + uno::Any aAny( m_aNameAccess.getValue(pStr) ); + rtl::OUString aRet; + + aAny >>= aRet; + + return aRet; } //------------------------------------------------------------------------------ -rtl::OUString UpdateCheckROModel::getLocalFileName() const -{ - return getStringValue(LOCAL_FILE); +rtl::OUString UpdateCheckROModel::getLocalFileName() const +{ + return getStringValue(LOCAL_FILE); }; //------------------------------------------------------------------------------ -sal_Int64 UpdateCheckROModel::getDownloadSize() const -{ - uno::Any aAny( m_aNameAccess.getValue(DOWNLOAD_SIZE) ); - sal_Int64 nRet = -1; - - aAny >>= nRet; - return nRet; +sal_Int64 UpdateCheckROModel::getDownloadSize() const +{ + uno::Any aAny( m_aNameAccess.getValue(DOWNLOAD_SIZE) ); + sal_Int64 nRet = -1; + + aAny >>= nRet; + return nRet; }; //------------------------------------------------------------------------------ @@ -163,23 +163,23 @@ sal_Int64 UpdateCheckROModel::getDownloadSize() const rtl::OUString UpdateCheckROModel::getUpdateEntryVersion() const { - return getStringValue(OLD_VERSION); + return getStringValue(OLD_VERSION); } //------------------------------------------------------------------------------ -void +void UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const { rInfo.BuildId = getStringValue(UPDATE_BUILDID); rInfo.Version = getStringValue(UPDATE_VERSION); rInfo.Description = getStringValue(UPDATE_DESCRIPTION); - + sal_Bool isDirectDownload = sal_False; m_aNameAccess.getValue(IS_DIRECT_DOWNLOAD) >>= isDirectDownload; - + rInfo.Sources.push_back( DownloadSource( isDirectDownload, getStringValue(DOWNLOAD_URL) ) ); - + rtl::OString aStr(RELEASE_NOTE); for(sal_Int32 n=1; n < 6; ++n ) { @@ -195,7 +195,7 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const rtl::OUString UpdateCheckConfig::getDesktopDirectory() { rtl::OUString aRet; - + #ifdef WNT WCHAR szPath[MAX_PATH]; @@ -205,7 +205,7 @@ rtl::OUString UpdateCheckConfig::getDesktopDirectory() osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); } #else - // This should become a desktop specific setting in some system backend .. + // This should become a desktop specific setting in some system backend... rtl::OUString aHomeDir; osl::Security().getHomeDir( aHomeDir ); aRet = aHomeDir + rtl::OUString::createFromAscii("/Desktop"); @@ -215,7 +215,7 @@ rtl::OUString UpdateCheckConfig::getDesktopDirectory() if( osl::FileBase::E_None != aDocumentsDir.open() ) aRet = aHomeDir; #endif - + return aRet; } @@ -224,7 +224,7 @@ rtl::OUString UpdateCheckConfig::getDesktopDirectory() rtl::OUString UpdateCheckConfig::getAllUsersDirectory() { rtl::OUString aRet; - + #ifdef WNT WCHAR szPath[MAX_PATH]; @@ -232,12 +232,12 @@ rtl::OUString UpdateCheckConfig::getAllUsersDirectory() { aRet = rtl::OUString( reinterpret_cast< sal_Unicode * >(szPath) ); osl::FileBase::RC rc; - rc = osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); + rc = osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); } #else osl::FileBase::getTempDirURL(aRet); #endif - + return aRet; } @@ -259,38 +259,38 @@ UpdateCheckConfig::~UpdateCheckConfig() //------------------------------------------------------------------------------ ::rtl::Reference< UpdateCheckConfig > -UpdateCheckConfig::get( +UpdateCheckConfig::get( const uno::Reference<uno::XComponentContext>& xContext, const ::rtl::Reference< UpdateCheckConfigListener >& rListener) { if( !xContext.is() ) - throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: empty component context" ), + throw uno::RuntimeException( + UNISTRING( "UpdateCheckConfig: empty component context" ), uno::Reference< uno::XInterface >() ); - + uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); - + if( !xServiceManager.is() ) - throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: unable to obtain service manager from component context" ), + throw uno::RuntimeException( + UNISTRING( "UpdateCheckConfig: unable to obtain service manager from component context" ), uno::Reference< uno::XInterface >() ); - - uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), xContext ), - uno::UNO_QUERY_THROW); - + + uno::Reference< lang::XMultiServiceFactory > xConfigProvider( + xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), xContext ), + uno::UNO_QUERY_THROW); + beans::PropertyValue aProperty; aProperty.Name = UNISTRING( "nodepath" ); aProperty.Value = uno::makeAny( UNISTRING("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( + + uno::Reference< container::XNameContainer > xContainer( + xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); - + aProperty.Value = uno::makeAny( UNISTRING("/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 ); @@ -304,7 +304,7 @@ UpdateCheckConfig::get( //------------------------------------------------------------------------------ -bool +bool UpdateCheckConfig::isAutoCheckEnabled() const { sal_Bool nValue = sal_False; @@ -314,7 +314,7 @@ UpdateCheckConfig::isAutoCheckEnabled() const //------------------------------------------------------------------------------ -bool +bool UpdateCheckConfig::isAutoDownloadEnabled() const { sal_Bool nValue = sal_False; @@ -324,15 +324,15 @@ UpdateCheckConfig::isAutoDownloadEnabled() const //------------------------------------------------------------------------------ -rtl::OUString +rtl::OUString UpdateCheckConfig::getUpdateEntryVersion() const { rtl::OUString aValue; - + // getByName is defined as non const in XNameAccess const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( OLD_VERSION ) ) >>= aValue; - - return aValue; + + return aValue; } //------------------------------------------------------------------------------ @@ -341,10 +341,10 @@ sal_Int64 UpdateCheckConfig::getLastChecked() const { sal_Int64 nValue = 0; - + // getByName is defined as non const in XNameAccess const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( LAST_CHECK ) ) >>= nValue; - + return nValue; } @@ -354,49 +354,49 @@ sal_Int64 UpdateCheckConfig::getCheckInterval() const { sal_Int64 nValue = 0; - + // getByName is defined as non const in XNameAccess const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( CHECK_INTERVAL ) ) >>= nValue; - + return nValue; } //------------------------------------------------------------------------------ -rtl::OUString +rtl::OUString UpdateCheckConfig::getLocalFileName() const { rtl::OUString aName = UNISTRING(LOCAL_FILE); rtl::OUString aRet; - + if( m_xContainer->hasByName(aName) ) m_xContainer->getByName(aName) >>= aRet; - - return aRet; + + return aRet; } //------------------------------------------------------------------------------ -rtl::OUString +rtl::OUString UpdateCheckConfig::getDownloadDestination() const { rtl::OUString aName = UNISTRING(DOWNLOAD_DESTINATION); rtl::OUString aRet; - + const_cast <UpdateCheckConfig *> (this)->getByName(aName) >>= aRet; - - return aRet; + + return aRet; } //------------------------------------------------------------------------------ -void +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 uno::Any aValueList[nItems] = { uno::makeAny(rLocalFileName), uno::makeAny(nFileSize) }; - + for( sal_uInt8 i=0; i < nItems; ++i ) { if( m_xContainer->hasByName(aNameList[i]) ) @@ -404,30 +404,30 @@ UpdateCheckConfig::storeLocalFileName(const rtl::OUString& rLocalFileName, sal_I else m_xContainer->insertByName(aNameList[i], aValueList[i]); } - + commitChanges(); } //------------------------------------------------------------------------------ -void +void UpdateCheckConfig::clearLocalFileName() { const sal_uInt8 nItems = 2; const rtl::OUString aNameList[nItems] = { UNISTRING(LOCAL_FILE), UNISTRING(DOWNLOAD_SIZE) }; - + for( sal_uInt8 i=0; i < nItems; ++i ) { if( m_xContainer->hasByName(aNameList[i]) ) m_xContainer->removeByName(aNameList[i]); } - + commitChanges(); } //------------------------------------------------------------------------------ -void +void UpdateCheckConfig::storeDownloadPaused(bool paused) { replaceByName(UNISTRING(DOWNLOAD_PAUSED) , uno::makeAny(paused)); @@ -441,10 +441,10 @@ UpdateCheckConfig::updateLastChecked() { TimeValue systime; osl_getSystemTime(&systime); - + sal_Int64 lastCheck = systime.Seconds; - replaceByName(UNISTRING(LAST_CHECK), uno::makeAny(lastCheck)); + replaceByName(UNISTRING(LAST_CHECK), uno::makeAny(lastCheck)); } //------------------------------------------------------------------------------ @@ -454,47 +454,47 @@ UpdateCheckConfig::storeUpdateFound( const UpdateInfo& rInfo, const rtl::OUStrin { bool autoDownloadEnabled = isAutoDownloadEnabled(); - - uno::Any aValues[nUpdateEntryProperties] = - { - uno::makeAny(rInfo.Version), - uno::makeAny(rInfo.BuildId), + + uno::Any aValues[nUpdateEntryProperties] = + { + uno::makeAny(rInfo.Version), + uno::makeAny(rInfo.BuildId), uno::makeAny(rInfo.Description), - uno::makeAny(rInfo.Sources[0].URL), + uno::makeAny(rInfo.Sources[0].URL), uno::makeAny(rInfo.Sources[0].IsDirect ? sal_True : sal_False), uno::makeAny(getReleaseNote(rInfo, 1, autoDownloadEnabled) ), uno::makeAny(getReleaseNote(rInfo, 2, autoDownloadEnabled) ), uno::makeAny(getReleaseNote(rInfo, 3, autoDownloadEnabled) ), uno::makeAny(getReleaseNote(rInfo, 4, autoDownloadEnabled) ), uno::makeAny(getReleaseNote(rInfo, 5, autoDownloadEnabled) ), - uno::makeAny(aCurrentBuild) + uno::makeAny(aCurrentBuild) }; - + rtl::OUString aName; for( sal_uInt32 n=0; n < nUpdateEntryProperties; ++n ) { aName = rtl::OUString::createFromAscii(aUpdateEntryProperties[n]); - + if( m_xContainer->hasByName(aName) ) m_xContainer->replaceByName(aName, aValues[n]); else m_xContainer->insertByName(aName,aValues[n]); } - + commitChanges(); } //------------------------------------------------------------------------------ -void +void UpdateCheckConfig::clearUpdateFound() { rtl::OUString aName; - + for( sal_uInt32 n=0; n < nUpdateEntryProperties; ++n ) { aName = rtl::OUString::createFromAscii(aUpdateEntryProperties[n]); - + try { if( m_xContainer->hasByName(aName) ) m_xContainer->removeByName(aName); @@ -507,7 +507,7 @@ UpdateCheckConfig::clearUpdateFound() /* As we have removed UpdateVersionFound from the shared configuration * existing entries in the user layer do not have a oor operation and - * thus are completly ignored (which also means they can not be removed). + * thus are completely ignored (which also means they can not be removed). */ commitChanges(); @@ -515,7 +515,7 @@ UpdateCheckConfig::clearUpdateFound() //------------------------------------------------------------------------------ -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > UpdateCheckConfig::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); @@ -525,80 +525,80 @@ UpdateCheckConfig::getServiceNames() //------------------------------------------------------------------------------ -rtl::OUString +rtl::OUString UpdateCheckConfig::getImplName() -{ +{ return UNISTRING( "vnd.sun.UpdateCheckConfig"); } //------------------------------------------------------------------------------ -uno::Type SAL_CALL -UpdateCheckConfig::getElementType() throw (uno::RuntimeException) -{ - return m_xContainer->getElementType(); +uno::Type SAL_CALL +UpdateCheckConfig::getElementType() throw (uno::RuntimeException) +{ + return m_xContainer->getElementType(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL -UpdateCheckConfig::hasElements() throw (uno::RuntimeException) -{ - return m_xContainer->hasElements(); +sal_Bool SAL_CALL +UpdateCheckConfig::hasElements() throw (uno::RuntimeException) +{ + return m_xContainer->hasElements(); } //------------------------------------------------------------------------------ -uno::Any SAL_CALL -UpdateCheckConfig::getByName( const ::rtl::OUString& aName ) - throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) +uno::Any SAL_CALL +UpdateCheckConfig::getByName( const ::rtl::OUString& aName ) + throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { uno::Any aValue = m_xContainer->getByName( aName ); - + // Provide dynamic default value if( aName.equalsAscii(DOWNLOAD_DESTINATION) ) { rtl::OUString aStr; aValue >>= aStr; - + if( aStr.getLength() == 0 ) aValue = uno::makeAny(getDesktopDirectory()); } - + return aValue; } - + //------------------------------------------------------------------------------ -uno::Sequence< ::rtl::OUString > SAL_CALL +uno::Sequence< ::rtl::OUString > SAL_CALL UpdateCheckConfig::getElementNames( ) throw (uno::RuntimeException) { return m_xContainer->getElementNames(); } - + //------------------------------------------------------------------------------ - -sal_Bool SAL_CALL + +sal_Bool SAL_CALL UpdateCheckConfig::hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) { return m_xContainer->hasByName( aName ); } - + //------------------------------------------------------------------------------ - -void SAL_CALL + +void SAL_CALL UpdateCheckConfig::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) - throw (lang::IllegalArgumentException, container::NoSuchElementException, + throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - return m_xContainer->replaceByName( aName, aElement ); + return m_xContainer->replaceByName( aName, aElement ); } //------------------------------------------------------------------------------ // XChangesBatch -void SAL_CALL -UpdateCheckConfig::commitChanges() +void SAL_CALL +UpdateCheckConfig::commitChanges() throw (lang::WrappedTargetException, uno::RuntimeException) { uno::Reference< util::XChangesBatch > xChangesBatch(m_xContainer, uno::UNO_QUERY); @@ -615,7 +615,7 @@ UpdateCheckConfig::commitChanges() for( sal_Int32 i=0; i<nChanges; ++i ) { aChangesSet[i].Accessor >>= aString; - + // FIXME: use non IgnoreAsciiCase version as soon as it becomes available if( aString.endsWithIgnoreAsciiCaseAsciiL(AUTOCHECK_ENABLED "']", sizeof(AUTOCHECK_ENABLED)+1) ) { @@ -648,25 +648,25 @@ UpdateCheckConfig::commitChanges() //------------------------------------------------------------------------------ -sal_Bool SAL_CALL +sal_Bool SAL_CALL UpdateCheckConfig::hasPendingChanges( ) throw (uno::RuntimeException) { uno::Reference< util::XChangesBatch > xChangesBatch(m_xContainer, uno::UNO_QUERY); if( xChangesBatch.is() ) return xChangesBatch->hasPendingChanges(); - + return sal_False; } - + //------------------------------------------------------------------------------ - -uno::Sequence< util::ElementChange > SAL_CALL + +uno::Sequence< util::ElementChange > SAL_CALL UpdateCheckConfig::getPendingChanges( ) throw (uno::RuntimeException) { uno::Reference< util::XChangesBatch > xChangesBatch(m_xContainer, uno::UNO_QUERY); if( xChangesBatch.is() ) return xChangesBatch->getPendingChanges(); - + return uno::Sequence< util::ElementChange >(); } @@ -759,7 +759,7 @@ bool UpdateCheckConfig::isVersionGreater( const rtl::OUString& rVersion1, if ( sSub1.getLength() < sSub2.getLength() ) { return true; - } else if ( sSub1.getLength() > sSub2.getLength() ) { + } else if ( sSub1.getLength() > sSub2.getLength() ) { return false; } else if ( sSub1 < sSub2 ) { return true; @@ -773,34 +773,33 @@ bool UpdateCheckConfig::isVersionGreater( const rtl::OUString& rVersion1, //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL -UpdateCheckConfig::getImplementationName() throw (uno::RuntimeException) + +rtl::OUString SAL_CALL +UpdateCheckConfig::getImplementationName() throw (uno::RuntimeException) { - return getImplName(); + return getImplName(); } - + //------------------------------------------------------------------------------ - -sal_Bool SAL_CALL -UpdateCheckConfig::supportsService(rtl::OUString const & serviceName) - throw (uno::RuntimeException) + +sal_Bool SAL_CALL +UpdateCheckConfig::supportsService(rtl::OUString const & serviceName) + throw (uno::RuntimeException) { - uno::Sequence< rtl::OUString > aServiceNameList = getServiceNames(); - - for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ ) - if( aServiceNameList[n].equals(serviceName) ) - return sal_True; - - return sal_False; + uno::Sequence< rtl::OUString > aServiceNameList = getServiceNames(); + + for( sal_Int32 n=0; n < aServiceNameList.getLength(); n++ ) + if( aServiceNameList[n].equals(serviceName) ) + return sal_True; + + return sal_False; } - + //------------------------------------------------------------------------------ - -uno::Sequence< rtl::OUString > SAL_CALL -UpdateCheckConfig::getSupportedServiceNames() throw (uno::RuntimeException) + +uno::Sequence< rtl::OUString > SAL_CALL +UpdateCheckConfig::getSupportedServiceNames() throw (uno::RuntimeException) { - return getServiceNames(); + return getServiceNames(); } - diff --git a/main/extensions/source/update/check/updatehdl.cxx b/main/extensions/source/update/check/updatehdl.cxx index bb2f2b5..b0c017b 100644 --- a/main/extensions/source/update/check/updatehdl.cxx +++ b/main/extensions/source/update/check/updatehdl.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -107,39 +107,39 @@ UpdateHandler::UpdateHandler( const uno::Reference< uno::XComponentContext > & r //-------------------------------------------------------------------- UpdateHandler::~UpdateHandler() { - mxContext = NULL; - mxUpdDlg = NULL; - mxInteractionHdl = NULL; - mxActionListener = NULL; + mxContext = NULL; + mxUpdDlg = NULL; + mxInteractionHdl = NULL; + mxActionListener = NULL; } //-------------------------------------------------------------------- void UpdateHandler::enableControls( short nCtrlState ) { - osl::MutexGuard aGuard( maMutex ); + osl::MutexGuard aGuard( maMutex ); - if ( nCtrlState == mnLastCtrlState ) - return; + if ( nCtrlState == mnLastCtrlState ) + return; - bool bEnableControl; + bool bEnableControl; - short nCurStateVal = nCtrlState; - short nOldStateVal = mnLastCtrlState; + short nCurStateVal = nCtrlState; + short nOldStateVal = mnLastCtrlState; - // the help button should always be the last button in the - // enum list und must never be disabled - for ( int i=0; i<HELP_BUTTON; i++ ) - { - nCurStateVal = (short)(nCtrlState >> i); - nOldStateVal = (short)(mnLastCtrlState >> i); - if ( ( nCurStateVal & 0x01 ) != ( nOldStateVal & 0x01 ) ) - { - bEnableControl = ( ( nCurStateVal & 0x01 ) == 0x01 ); - setControlProperty( msButtonIDs[i], UNISTRING("Enabled"), uno::Any( bEnableControl ) ); - } - } + // the help button should always be the last button in the + // enum list and must never be disabled + for ( int i=0; i<HELP_BUTTON; i++ ) + { + nCurStateVal = (short)(nCtrlState >> i); + nOldStateVal = (short)(mnLastCtrlState >> i); + if ( ( nCurStateVal & 0x01 ) != ( nOldStateVal & 0x01 ) ) + { + bEnableControl = ( ( nCurStateVal & 0x01 ) == 0x01 ); + setControlProperty( msButtonIDs[i], UNISTRING("Enabled"), uno::Any( bEnableControl ) ); + } + } - mnLastCtrlState = nCtrlState; + mnLastCtrlState = nCtrlState; } //-------------------------------------------------------------------- @@ -258,7 +258,7 @@ void UpdateHandler::setDownloadFile( const rtl::OUString& rFilePath ) sal_Int32 nLast = rFilePath.lastIndexOf( '/' ); if ( nLast != -1 ) { - msDownloadFile = rFilePath.copy( nLast+1 ); + msDownloadFile = rFilePath.copy( nLast+1 ); const rtl::OUString aDownloadURL = rFilePath.copy( 0, nLast ); osl::FileBase::getSystemPathFromFileURL( aDownloadURL, msDownloadPath ); } @@ -393,7 +393,7 @@ void SAL_CALL UpdateHandler::windowClosing( const lang::EventObject& e ) awt::ActionEvent aActionEvt; aActionEvt.ActionCommand = COMMAND_CLOSE; aActionEvt.Source = e.Source; - + actionPerformed( aActionEvt ); } @@ -445,8 +445,8 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > throw uno::RuntimeException( UNISTRING( "UpdateHandler: unable to obtain service manager from component context" ), *this ); mxInteractionHdl = uno::Reference<task::XInteractionHandler> ( - xServiceManager->createInstanceWithContext( - UNISTRING( "com.sun.star.task.InteractionHandler" ), + xServiceManager->createInstanceWithContext( + UNISTRING( "com.sun.star.task.InteractionHandler" ), mxContext), uno::UNO_QUERY_THROW); if( !mxInteractionHdl.is() ) @@ -510,7 +510,7 @@ void SAL_CALL UpdateHandler::notifyTermination( const lang::EventObject& ) uno::Reference< lang::XComponent > xComponent( mxUpdDlg, uno::UNO_QUERY ); if ( xComponent.is() ) - xComponent->dispose(); + xComponent->dispose(); mxUpdDlg.clear(); } @@ -546,7 +546,7 @@ void UpdateHandler::updateState( UpdateState eState ) break; case UPDATESTATE_UPDATE_AVAIL: showControls( 0 ); - enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); + enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadWarning); @@ -559,7 +559,7 @@ void UpdateHandler::updateState( UpdateState eState ) break; case UPDATESTATE_UPDATE_NO_DOWNLOAD: showControls( 0 ); - enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); + enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadNotAvail); @@ -571,7 +571,7 @@ void UpdateHandler::updateState( UpdateState eState ) focusControl( DOWNLOAD_BUTTON ); break; case UPDATESTATE_NO_UPDATE_AVAIL: - case UPDATESTATE_EXT_UPD_AVAIL: // will only be set, when there are no office updates avail + 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) ) ); @@ -735,7 +735,7 @@ void UpdateHandler::loadStrings() msPauseBtn = loadString( xBundle, RID_UPDATE_BTN_PAUSE ); msResumeBtn = loadString( xBundle, RID_UPDATE_BTN_RESUME ); msCancelBtn = loadString( xBundle, RID_UPDATE_BTN_CANCEL ); - + // all update states before UPDATESTATE_UPDATE_AVAIL don't have a bubble // so we can ignore them for ( int i=0; i < (int)(UPDATESTATES_COUNT - UPDATESTATE_UPDATE_AVAIL); i++ ) @@ -860,13 +860,13 @@ void UpdateHandler::setFullVersion( rtl::OUString& rString ) throw uno::RuntimeException( UNISTRING( "getProductName: empty component context" ), *this ); uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() ); - + if( !xServiceManager.is() ) throw uno::RuntimeException( UNISTRING( "getProductName: unable to obtain service manager from component context" ), *this ); - - uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), mxContext ), - uno::UNO_QUERY_THROW); + + uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider( + xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), mxContext ), + uno::UNO_QUERY_THROW); beans::PropertyValue aProperty; aProperty.Name = UNISTRING( "nodepath" ); @@ -877,7 +877,7 @@ void UpdateHandler::setFullVersion( rtl::OUString& rString ) uno::Reference< uno::XInterface > xConfigAccess; xConfigAccess = xConfigurationProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationAccess"), - aArgumentList ); + aArgumentList ); uno::Reference< container::XNameAccess > xNameAccess( xConfigAccess, uno::UNO_QUERY_THROW ); @@ -938,7 +938,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const uno::Reference< awt::XControl > xControl( mxUpdDlg, uno::UNO_QUERY ); if ( !xControl.is() ) return bRet; - + uno::Reference< awt::XWindowPeer > xPeer = xControl->getPeer(); if ( !xPeer.is() ) return bRet; @@ -973,7 +973,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const uno::Reference< lang::XComponent > xComponent( xMsgBox, uno::UNO_QUERY ); if ( xComponent.is() ) - xComponent->dispose(); + xComponent->dispose(); return bRet; } @@ -987,7 +987,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, uno::Reference< awt::XControl > xControl( mxUpdDlg, uno::UNO_QUERY ); if ( !xControl.is() ) return bRet; - + uno::Reference< awt::XWindowPeer > xPeer = xControl->getPeer(); if ( !xPeer.is() ) return bRet; @@ -1044,7 +1044,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, uno::Reference< lang::XComponent > xComponent( xMsgBox, uno::UNO_QUERY ); if ( xComponent.is() ) - xComponent->dispose(); + xComponent->dispose(); return bRet; } @@ -1110,7 +1110,7 @@ void UpdateHandler::showControls( short nControls ) nShiftMe = (short)(nControls >> i); showControl( msButtonIDs[i], (bool)(nShiftMe & 0x01) ); } - + nShiftMe = (short)(nControls >> THROBBER_CTRL); startThrobber( (bool)(nShiftMe & 0x01) ); @@ -1119,7 +1119,7 @@ void UpdateHandler::showControls( short nControls ) showControl( TEXT_PERCENT, (bool)(nShiftMe & 0x01) ); // 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 ) + 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 ) ) ); else setControlProperty( TEXT_STATUS, UNISTRING("Width"), uno::Any( sal_Int32(EDIT_WIDTH - 2*TEXT_OFFSET ) ) ); @@ -1141,10 +1141,10 @@ void UpdateHandler::createDialog() } uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() ); - + if( xServiceManager.is() ) { - uno::Reference< frame::XDesktop > xDesktop( + uno::Reference< frame::XDesktop > xDesktop( xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.frame.Desktop"), mxContext ), uno::UNO_QUERY ); if ( xDesktop.is() ) @@ -1411,6 +1411,7 @@ void UpdateHandler::createDialog() } } - mxUpdDlg.set( xControl, uno::UNO_QUERY_THROW ); - mnLastCtrlState = -1; + mxUpdDlg.set( xControl, uno::UNO_QUERY_THROW ); + mnLastCtrlState = -1; } + diff --git a/main/sw/source/core/doc/extinput.cxx b/main/sw/source/core/doc/extinput.cxx index 95054e1..76c0f63 100644 --- a/main/sw/source/core/doc/extinput.cxx +++ b/main/sw/source/core/doc/extinput.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -45,8 +45,8 @@ using namespace ::com::sun::star; SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing ) - : SwPaM( *rPam.GetPoint(), (SwPaM*)pRing ), - eInputLanguage(LANGUAGE_DONTKNOW) + : SwPaM( *rPam.GetPoint(), (SwPaM*)pRing ), + eInputLanguage(LANGUAGE_DONTKNOW) { bIsOverwriteCursor = sal_False; bInsText = sal_True; @@ -54,8 +54,8 @@ SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing ) SwExtTextInput::~SwExtTextInput() { - SwDoc *const pDoc = GetDoc(); - if (pDoc->IsInDtor()) { return; /* #i58606# */ } + SwDoc *const pDoc = GetDoc(); + if (pDoc->IsInDtor()) { return; /* #i58606# */ } SwTxtNode* pTNd = GetPoint()->nNode.GetNode().GetTxtNode(); if( pTNd ) @@ -72,8 +72,8 @@ SwExtTextInput::~SwExtTextInput() // damit Undo / Redlining usw. richtig funktioniert, // muss ueber die Doc-Schnittstellen gegangen werden !!! - if(eInputLanguage != LANGUAGE_DONTKNOW) - { + if(eInputLanguage != LANGUAGE_DONTKNOW) + { // --> FME 2005-02-11 #i41974# Only set language attribute // for CJK/CTL scripts. bool bLang = true; @@ -95,13 +95,13 @@ SwExtTextInput::~SwExtTextInput() String sTxt( pTNd->GetTxt().Copy( nSttCnt, nEndCnt - nSttCnt )); if( bIsOverwriteCursor && sOverwriteText.Len() ) { - xub_StrLen nLen = sTxt.Len(); + xub_StrLen nLen = sTxt.Len(); if( nLen > sOverwriteText.Len() ) { rIdx += sOverwriteText.Len(); - pTNd->EraseText( rIdx, nLen - sOverwriteText.Len() ); + pTNd->EraseText( rIdx, nLen - sOverwriteText.Len() ); rIdx = nSttCnt; - pTNd->ReplaceText( rIdx, sOverwriteText.Len(), + pTNd->ReplaceText( rIdx, sOverwriteText.Len(), sOverwriteText ); if( bInsText ) { @@ -128,7 +128,7 @@ SwExtTextInput::~SwExtTextInput() } } else - { + { pTNd->EraseText( rIdx, nEndCnt - nSttCnt ); if( bInsText ) @@ -164,7 +164,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData ) // some characters nReplace = nReplace - rNewStr.Len(); aIdx += rNewStr.Len(); - pTNd->ReplaceText( aIdx, nReplace, + pTNd->ReplaceText( aIdx, nReplace, sOverwriteText.Copy( rNewStr.Len(), nReplace )); aIdx = nSttCnt; nReplace = rNewStr.Len(); @@ -173,14 +173,14 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData ) { nReplace = nReplace - sOverwriteText.Len(); aIdx += sOverwriteText.Len(); - pTNd->EraseText( aIdx, nReplace ); + pTNd->EraseText( aIdx, nReplace ); aIdx = nSttCnt; nReplace = sOverwriteText.Len(); } else if( (nReplace = sOverwriteText.Len()) > rNewStr.Len() ) nReplace = rNewStr.Len(); - pTNd->ReplaceText( aIdx, nReplace, rNewStr ); + pTNd->ReplaceText( aIdx, nReplace, rNewStr ); if( !HasMark() ) SetMark(); GetMark()->nContent = aIdx; @@ -188,12 +188,12 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData ) else { if( nSttCnt < nEndCnt ) - { - pTNd->EraseText( aIdx, nEndCnt - nSttCnt ); - } + { + pTNd->EraseText( aIdx, nEndCnt - nSttCnt ); + } - pTNd->InsertText( rNewStr, aIdx, - IDocumentContentOperations::INS_EMPTYEXPAND ); + pTNd->InsertText( rNewStr, aIdx, + IDocumentContentOperations::INS_EMPTYEXPAND ); if( !HasMark() ) SetMark(); } @@ -289,8 +289,7 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd, SwExtTextInput* SwDoc::GetExtTextInput() const { ASSERT( !pExtInputRing || pExtInputRing == pExtInputRing->GetNext(), - "more then one InputEngine available" ); + "more than one InputEngine available" ); return (SwExtTextInput*)pExtInputRing; } -