diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-07-17 04:31:21 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-07-17 04:31:21 +0000 |
commit | d346cdf3fdffb422571dcf11248c10b788adacfe (patch) | |
tree | 9b9d3fd005a2deb2be7c20188839415d8cf88b9a /sfx2 | |
parent | 48c373cbc74460b51336e6da53e3c47f4fa69cf7 (diff) |
CWS-TOOLING: integrate CWS mav53
2009-06-29 13:42:56 +0200 hbrinkm r273471 : #i101593# switched off optimization in table layout, that caused frames to be layouted incorrectly
2009-06-25 12:29:11 +0200 cd r273376 : #i101774# Don't rely on initialize call for VistaFilePicker
2009-06-25 11:48:33 +0200 tl r273373 : #i101420# Gnome accessibility fix
2009-06-24 18:16:49 +0200 od r273361 : #i97309 method <XMLTextParagraphExport::exportListChange(..)>
- export text:start-value at correct list item.
2009-06-23 14:11:44 +0200 b_michaelsen r273281 : #i103032#: cutting of URL-parameters for usage tracking
2009-06-22 11:49:12 +0200 b_michaelsen r273207 : #i102805#: Added usage tracking to SfxToolboxControl
2009-06-22 11:46:00 +0200 b_michaelsen r273205 : whitespace fixes
2009-06-05 14:21:12 +0200 mav r272683 : #i101741# check the file date only in document file locking context
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/docfile.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 19 |
4 files changed, 44 insertions, 12 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index ab6cc60468..71a188f6a8 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -183,7 +183,8 @@ public: #endif void CheckFileDate( const ::com::sun::star::util::DateTime& aInitDate ); - ::com::sun::star::util::DateTime GetInitFileDate(); + sal_Bool DocNeedsFileDateCheck(); + ::com::sun::star::util::DateTime GetInitFileDate( sal_Bool bIgnoreOldValue ); ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > GetContent() const; const String& GetPhysicalName() const; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 2ca8a68257..e41cb91c59 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -471,7 +471,7 @@ long SfxMedium::GetFileVersion() const //------------------------------------------------------------------ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate ) { - GetInitFileDate(); + GetInitFileDate( sal_True ); if ( pImp->m_aDateTime.Seconds != aInitDate.Seconds || pImp->m_aDateTime.Minutes != aInitDate.Minutes || pImp->m_aDateTime.Hours != aInitDate.Hours @@ -531,9 +531,15 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate ) } //------------------------------------------------------------------ -util::DateTime SfxMedium::GetInitFileDate() +sal_Bool SfxMedium::DocNeedsFileDateCheck() { - if ( !pImp->m_bGotDateTime && GetContent().is() ) + return ( !IsReadOnly() && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ); +} + +//------------------------------------------------------------------ +util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue ) +{ + if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && GetContent().is() ) { try { @@ -790,11 +796,8 @@ sal_Bool SfxMedium::Commit() sal_Bool bResult = ( GetError() == SVSTREAM_OK ); - if ( bResult ) - { - pImp->m_bGotDateTime = sal_False; - GetInitFileDate(); - } + if ( bResult && DocNeedsFileDateCheck() ) + GetInitFileDate( sal_True ); // remove truncation mode from the flags nStorOpenMode &= (~STREAM_TRUNC); @@ -1321,6 +1324,10 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } + // when the file is locked, get the current file date + if ( bResult && DocNeedsFileDateCheck() ) + GetInitFileDate( sal_True ); + return bResult; } @@ -2583,8 +2590,6 @@ void SfxMedium::GetMedium_Impl() pInStream = utl::UcbStreamHelper::CreateStream( pImp->xInputStream ); } - GetInitFileDate(); - pImp->bDownloadDone = sal_True; pImp->aDoneLink.ClearPendingCall(); pImp->aDoneLink.Call( (void*) GetError() ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 37259eb6d8..45fbd18213 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1222,7 +1222,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl { bStoreToSameLocation = sal_True; - rMedium.CheckFileDate( pMedium->GetInitFileDate() ); + if ( pMedium->DocNeedsFileDateCheck() ) + rMedium.CheckFileDate( pMedium->GetInitFileDate( sal_False ) ); if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { @@ -2041,6 +2042,12 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) InvalidateName(); SetModified(sal_False); // nur bei gesetztem Medium zur"ucksetzen Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); + + // this is the end of the saving process, it is possible that the file was changed + // between medium commit and this step ( attributes change and so on ) + // so get the file date again + if ( pNewMed->DocNeedsFileDateCheck() ) + pNewMed->GetInitFileDate( sal_True ); } } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 7058e86e27..7d3e79c610 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1029,6 +1029,25 @@ void SfxToolBoxControl::Select( USHORT nModifier ) void SfxToolBoxControl::Select( BOOL /*bMod1*/ ) { + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# #i102805# + { + ::rtl::OUString sAppName; + try + { + static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = + ::comphelper::getProcessServiceFactory(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( + xServiceManager->createInstance(our_aModuleManagerName) + , ::com::sun::star::uno::UNO_QUERY_THROW); + sAppName = xModuleManager->identify(m_xFrame); + } catch(::com::sun::star::uno::Exception&) {} + Sequence<PropertyValue> vSource; + ::comphelper::UiEventsLogger::appendDispatchOrigin(vSource, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl")); + URL aURL; + aURL.Complete = m_aCommandURL; + ::comphelper::UiEventsLogger::logDispatch(aURL, vSource); + } svt::ToolboxController::execute( pImpl->nSelectModifier ); } |