summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-01-06 14:14:21 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-01-06 14:14:21 +0100
commit3b2321d5120d8c9d654120312819bf1459941a20 (patch)
tree88a3ca5045e8d57b21bb5d26c6b1cb860431fe37 /framework/source
parent74ffe76476d5b8941454a2acce569737237fc1d7 (diff)
autorecovery: only include documents in the autorecovery which support the XDocumentRecovery interface
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/inc/loadenv/loadenv.hxx2
-rw-r--r--framework/source/jobs/jobdata.cxx8
-rw-r--r--framework/source/jobs/jobresult.cxx4
-rw-r--r--framework/source/loadenv/loadenv.cxx2
-rw-r--r--framework/source/services/autorecovery.cxx41
5 files changed, 31 insertions, 26 deletions
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index 40ded72db9f6..c1b23f0394eb 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -487,7 +487,7 @@ class LoadEnv : private ThreadHelpBase
/** @short tries to detect the type and the filter of the specified content.
- @descr This method actualize the available media descriptor of this instance,
+ @descr This method update the available media descriptor of this instance,
so it contains the right type, a corresponding filter, may a
valid frame loader etc. In case detection failed, this descriptor
is corrected first, before a suitable exception will be thrown.
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index ce615370cd82..d93d4eb74abf 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -305,10 +305,10 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >&
/* SAFE { */
WriteGuard aWriteLock(m_aLock);
- // actualize member
+ // update member
m_lArguments = lArguments;
- // actualize the configuration ... if possible!
+ // update the configuration ... if possible!
if (m_eMode==E_ALIAS)
{
// It doesn't matter if this config object was already opened before.
@@ -366,7 +366,7 @@ void JobData::setResult( const JobResult& aResult )
// overwrite the last saved result
m_aLastExecutionResult = aResult;
- // Don't use his informations to actualize
+ // Don't use his informations to update
// e.g. the arguments of this job. It must be done
// from outside! Here we save this information only.
@@ -536,7 +536,7 @@ void JobData::disableJob()
if (m_eMode!=E_EVENT)
return;
- // actualize the configuration
+ // update the configuration
// It doesn't matter if this config object was already opened before.
// It doesn nothing here then ... or it change the mode automaticly, if
// it was opened using another one before.
diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx
index c30e2c411539..c02f46912bd8 100644
--- a/framework/source/jobs/jobresult.cxx
+++ b/framework/source/jobs/jobresult.cxx
@@ -84,7 +84,7 @@ JobResult::JobResult()
/**
@short special ctor
@descr It initialize this new instance with a pure job execution result
- and analyze it. Doing so, we actualize our other members.
+ and analyze it. Doing so, we update our other members.
<p>
It's a list of named values, packed inside this any.
@@ -136,7 +136,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult )
// That can be usefull if something will fail here ...
m_eParts = E_NOPART;
- // analyze the result and actualize our other members
+ // analyze the result and update our other members
::comphelper::SequenceAsHashMap aProtocol(aResult);
if ( aProtocol.empty() )
return;
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 911a0430763f..8fbe1dc6cb7b 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -821,7 +821,7 @@ void LoadEnv::impl_detectTypeAndFilter()
// Attention: Because our stl media descriptor is a copy of an uno sequence
// we cant use as an in/out parameter here. Copy it before and dont forget to
- // actualize structure afterwards again!
+ // update structure afterwards again!
css::uno::Sequence< css::beans::PropertyValue > lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList();
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index a8fcb9046bf2..7c45d96bd019 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -645,7 +645,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
// dont enable AutoSave hardly !
// reload configuration to know the current state.
implts_readAutoSaveConfig();
- implts_actualizeTimer();
+ implts_updateTimer();
// can it happen that might be the listener was stopped ? .-)
// make sure it runs always ... even if AutoSave itself was disabled temporarly.
implts_startListening();
@@ -791,7 +791,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
// <- SAFE ----------------------------------
// depends on bAllowAutoSaveReactivation implicitly by looking on m_eJob=E_AUTO_SAVE! see before ...
- implts_actualizeTimer();
+ implts_updateTimer();
if (bAllowAutoSaveReactivation)
implts_startListening();
@@ -861,7 +861,7 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
else
if (aEvent.EventName.equals(EVENT_ON_MODIFYCHANGED))
{
- implts_actualizeModifiedState(xDocument);
+ implts_updateModifiedState(xDocument);
}
/* at least one document starts saving process =>
Our application code isnt ready for multiple save requests
@@ -970,7 +970,7 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven
// Note: This call stops the timer and starts it again.
// But it checks the different timer states internaly and
// may be supress the restart!
- implts_actualizeTimer();
+ implts_updateTimer();
}
//-----------------------------------------------
@@ -1193,7 +1193,7 @@ void AutoRecovery::implts_readConfig()
// <- REENTRANT --------------------------
}
- implts_actualizeTimer();
+ implts_updateTimer();
}
//-----------------------------------------------
@@ -1330,11 +1330,6 @@ void AutoRecovery::implts_persistAllActiveViewNames()
WriteGuard aWriteLock(m_aLock);
// This list will be filled with every document
- // which should be saved as last one. E.g. if it was used
- // already for an UI save operation => crashed ... and
- // now we try to save it again ... which can fail again ( of course .-) ).
- ::std::vector< AutoRecovery::TDocumentList::iterator > lDangerousDocs;
-
AutoRecovery::TDocumentList::iterator pIt;
for ( pIt = m_lDocCache.begin();
pIt != m_lDocCache.end() ;
@@ -1555,7 +1550,7 @@ void AutoRecovery::implts_stopModifyListeningOnDoc(AutoRecovery::TDocumentInfo&
}
//-----------------------------------------------
-void AutoRecovery::implts_actualizeTimer()
+void AutoRecovery::implts_updateTimer()
{
implts_stopTimer();
@@ -1646,7 +1641,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
m_eTimerType = AutoRecovery::E_POLL_TILL_AUTOSAVE_IS_ALLOWED;
aWriteLock.unlock();
// <- SAFE ------------------------------
- implts_actualizeTimer();
+ implts_updateTimer();
return 0;
}
@@ -1661,7 +1656,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
sal_Bool bUserIdle = (Application::GetLastInputInterval()>MIN_TIME_FOR_USER_IDLE);
if (!bUserIdle)
{
- implts_actualizeTimer();
+ implts_updateTimer();
return 0;
}
}
@@ -1702,7 +1697,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
aWriteLock.unlock();
// <- SAFE ----------------------------------
- implts_actualizeTimer();
+ implts_updateTimer();
}
catch(const css::uno::Exception&)
{
@@ -1739,7 +1734,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// notification for already existing document !
// Can happen if events came in asynchronous on recovery time.
// Then our cache was filled from the configuration ... but now we get some
- // asynchronous events from the global event broadcaster. We must be shure that
+ // asynchronous events from the global event broadcaster. We must be sure that
// we dont add the same document more then once.
AutoRecovery::TDocumentList::iterator pIt = AutoRecovery::impl_searchDocument(m_lDocCache, xDocument);
if (pIt != m_lDocCache.end())
@@ -1747,7 +1742,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// Normaly nothing must be done for this "late" notification.
// But may be the modified state was changed inbetween.
// Check it ...
- implts_actualizeModifiedState(xDocument);
+ implts_updateModifiedState(xDocument);
return;
}
@@ -1772,6 +1767,11 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
if (!xDesktop.is())
return;
+ // if the document doesn't support the XDocumentRecovery interface, we're not interested in it.
+ Reference< XDocumentRecovery > xDocRecovery( xDocument, UNO_QUERY );
+ if ( !xDocRecovery.is() )
+ return;
+
// get all needed informations of this document
// We need it to update our cache or to locate already existing elements there!
AutoRecovery::TDocumentInfo aNew;
@@ -1800,7 +1800,12 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
(!aNew.OrgURL.getLength() ) &&
(!aNew.FactoryURL.getLength())
)
- return;
+ {
+ OSL_ENSURE( false, "AutoRecovery::implts_registerDocument: this should not happen anymore!" );
+ // nowadays, the Basic IDE should already die on the "supports XDocumentRecovery" check. And no other known
+ // document type fits in here ...
+ return;
+ }
// By the way - get some information about the default format for saving!
// and save an information about the real used filter by this document.
@@ -1923,7 +1928,7 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno::
}
//-----------------------------------------------
-void AutoRecovery::implts_actualizeModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument)
+void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument)
{
CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_USE);