diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-24 17:47:23 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-24 17:47:23 +0000 |
commit | 191a03067dfdae24ac93e32e4b2f4b88b6d0814d (patch) | |
tree | 7376e2ff34511500e9018b38af9683b1be554b5a /svtools | |
parent | ab9aa0da0752cdcf98bf4312b6c36dd48ed9a336 (diff) |
CWS-TOOLING: integrate CWS fwk110_DEV300
2009-04-03 11:16:33 +0200 pl r270467 : fix the vanishing form contro problem
2009-04-03 09:26:00 +0200 cd r270455 : #159523# Use build id to check for showing the registration dialog again
2009-04-03 09:22:55 +0200 od r270454 : #i100732# method <SwTxtFormatter::NewTabPortion(..)>
- correction of condition for applying automatic tab stop at left margin
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/regoptions.cxx | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/svtools/source/config/regoptions.cxx b/svtools/source/config/regoptions.cxx index 98c4bb7ae2d5..7c94807f2c25 100644 --- a/svtools/source/config/regoptions.cxx +++ b/svtools/source/config/regoptions.cxx @@ -35,6 +35,8 @@ #include <tools/date.hxx> #include <comphelper/processfactory.hxx> #include <osl/mutex.hxx> +#include <unotools/bootstrap.hxx> +#include <rtl/ustring.hxx> //........................................................................ namespace svt @@ -172,6 +174,7 @@ namespace svt static ::osl::Mutex& getStaticMutex(); // get the mutex used to protect the static members of this class void commit( ); + sal_Int32 getBuildId() const; private: RegOptions::DialogPermission implGetDialogPermission( ) const; @@ -282,13 +285,8 @@ namespace svt m_aRegistrationNode.getNodeValue( lcl_getReminderDateName() ) >>= sStringValue; bool bIsPatchDate = ( sStringValue.equals( lcl_getPatchName() ) != sal_False ); if ( !bIsPatchDate && sStringValue.getLength() ) - { nIntDate = lcl_convertString2Date( sStringValue ); - OSL_ENSURE( nIntDate, "RegOptionsImpl::RegOptionsImpl: incorrect value found for the reminder date!" ); - } m_aReminderDate.SetDate( nIntDate ); - OSL_ENSURE( bIsPatchDate || !sStringValue.getLength() || m_aReminderDate.IsValid(), - "RegOptionsImpl::RegOptionsImpl: inavlid reminder date value!" ); } //-------------------------------------------------------------------- @@ -364,13 +362,34 @@ namespace svt //-------------------------------------------------------------------- void RegOptionsImpl::removeReminder() { + ::rtl::OUString aDefault; + ::rtl::OUString aReminderValue( lcl_getPatchName() ); + aReminderValue += ::rtl::OUString::valueOf(getBuildId()); + m_aRegistrationNode.setNodeValue( lcl_getReminderDateName(), - makeAny( ::rtl::OUString() ) + Any( aReminderValue ) ); } //-------------------------------------------------------------------- + sal_Int32 RegOptionsImpl::getBuildId() const + { + sal_Int32 nBuildId( 0 ); + ::rtl::OUString aDefault; + ::rtl::OUString aBuildIdData = utl::Bootstrap::getBuildIdData( aDefault ); + sal_Int32 nIndex1 = aBuildIdData.indexOf(':'); + sal_Int32 nIndex2 = aBuildIdData.indexOf(')'); + if (( nIndex1 > 0 ) && ( nIndex2 > 0 ) && ( nIndex2-1 > nIndex1+1 )) + { + ::rtl::OUString aBuildId = aBuildIdData.copy( nIndex1+1, nIndex2-nIndex1-1 ); + nBuildId = aBuildId.toInt32(); + } + + return nBuildId; + } + + //-------------------------------------------------------------------- bool RegOptionsImpl::hasReminderDateCome() const { bool bRet = false; @@ -379,8 +398,22 @@ namespace svt m_aRegistrationNode.getNodeValue( lcl_getReminderDateName() ) >>= sDate; if ( sDate.getLength() ) { - if ( sDate.equals( lcl_getPatchName() ) ) - bRet = true; + if ( sDate.indexOf( lcl_getPatchName() ) == 0) + { + if (sDate.equals( lcl_getPatchName() )) + bRet = true; + else if (sDate.getLength() > lcl_getPatchName().getLength() ) + { + // Check the build ID to determine if the registration + // dialog needs to be shown. + sal_Int32 nBuildId = getBuildId(); + ::rtl::OUString aStoredBuildId( sDate.copy(lcl_getPatchName().getLength())); + + // remind if the current build ID is not the same as the stored one + if ( nBuildId != aStoredBuildId.toInt32() ) + bRet = true; + } + } else { nDate = lcl_convertString2Date( sDate ); @@ -392,6 +425,9 @@ namespace svt } } } + else + bRet = true; + return bRet; } @@ -423,10 +459,7 @@ namespace svt ); // and clear the reminder date - m_aRegistrationNode.setNodeValue( - lcl_getReminderDateName(), - Any() - ); + removeReminder(); } } } |