summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-07-16 16:59:45 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-07-16 16:59:45 +0000
commit0849d5a299449da96afa9edae8fdf77f4ee1edb1 (patch)
treeefe9c1d7aae0eb072248019c4660b54ae5da9d69 /sfx2
parent16fd4d874e4a5c9e94a6ebe0f14132f19e8a3ede (diff)
CWS-TOOLING: integrate CWS mav53_DEV300
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.hxx3
-rw-r--r--sfx2/source/doc/docfile.cxx25
-rw-r--r--sfx2/source/doc/objstor.cxx9
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx19
4 files changed, 44 insertions, 12 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 9e82e6f011e5..bebcdc684d89 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 c81595cfc6e6..21a629eec09e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -568,7 +568,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
@@ -607,9 +607,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
{
@@ -866,11 +872,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);
@@ -1400,6 +1403,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;
}
@@ -2662,8 +2669,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 01f46fb71b68..7cd33667c2ac 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1233,7 +1233,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
bStoreToSameLocation = sal_True;
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
- rMedium.CheckFileDate( pMedium->GetInitFileDate() );
+ if ( pMedium->DocNeedsFileDateCheck() )
+ rMedium.CheckFileDate( pMedium->GetInitFileDate( sal_False ) );
if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
@@ -2089,6 +2090,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 c72989339a34..6a776f6a211e 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 );
}