summaryrefslogtreecommitdiff
path: root/svtools/source/misc
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/misc')
-rw-r--r--svtools/source/misc/embedhlp.cxx13
-rw-r--r--svtools/source/misc/filechangedchecker.cxx22
2 files changed, 30 insertions, 5 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 29e427799c82..809a2b155790 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/embed/XStateChangeListener.hpp>
#include <com/sun/star/embed/XLinkageSupport.hpp>
#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
+#include <embeddedobj/embeddedupdate.hxx>
#include <cppuhelper/implbase.hxx>
#include <vcl/svapp.hxx>
#include <tools/diagnose_ex.h>
@@ -878,7 +879,7 @@ bool EmbeddedObjectRef::IsChart(const css::uno::Reference < css::embed::XEmbedde
|| SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId;
}
-void EmbeddedObjectRef::UpdateReplacement()
+void EmbeddedObjectRef::UpdateReplacement( bool bUpdateOle )
{
if (mpImpl->bUpdating)
{
@@ -886,10 +887,20 @@ void EmbeddedObjectRef::UpdateReplacement()
return;
}
mpImpl->bUpdating = true;
+ UpdateOleObject( bUpdateOle );
GetReplacement(true);
+ UpdateOleObject( false );
mpImpl->bUpdating = false;
}
+void EmbeddedObjectRef::UpdateOleObject( bool bUpdateOle )
+{
+ embed::EmbeddedUpdate* pObj = dynamic_cast<embed::EmbeddedUpdate*> (GetObject().get());
+ if( pObj )
+ pObj->SetOleState( bUpdateOle );
+}
+
+
void EmbeddedObjectRef::UpdateReplacementOnDemand()
{
mpImpl->pGraphic.reset();
diff --git a/svtools/source/misc/filechangedchecker.cxx b/svtools/source/misc/filechangedchecker.cxx
index 8536eb0bda57..dd7cf22b924c 100644
--- a/svtools/source/misc/filechangedchecker.cxx
+++ b/svtools/source/misc/filechangedchecker.cxx
@@ -21,7 +21,7 @@ FileChangedChecker::FileChangedChecker(const OUString& rFilename,
, mLastModTime()
, mpCallback(rCallback)
{
- // Get the curren last file modified Status
+ // Get the current last file modified Status
getCurrentModTime(mLastModTime);
// associate the callback function for the Timer
@@ -34,10 +34,23 @@ FileChangedChecker::FileChangedChecker(const OUString& rFilename,
resetTimer();
}
+FileChangedChecker::FileChangedChecker(const OUString& rFilename)
+ : mTimer("")
+ , mFileName(rFilename)
+ , mLastModTime()
+ , mpCallback(nullptr)
+{
+ // Get the current last file modified Status
+ getCurrentModTime(mLastModTime);
+}
+
void FileChangedChecker::resetTimer()
{
+ if (mpCallback == nullptr)
+ return;
+
// Start the Idle if it's not active
- if(!mTimer.IsActive())
+ if (!mTimer.IsActive())
mTimer.Start();
// Set lowest Priority
@@ -61,7 +74,7 @@ bool FileChangedChecker::getCurrentModTime(TimeValue& o_rValue) const
return true;
}
-bool FileChangedChecker::hasFileChanged()
+bool FileChangedChecker::hasFileChanged(bool bUpdate)
{
// Get the current file Status
TimeValue newTime={0,0};
@@ -75,7 +88,8 @@ bool FileChangedChecker::hasFileChanged()
{
// Since the file has changed, set the new status as the file status and
// return True
- mLastModTime = newTime ;
+ if(bUpdate)
+ mLastModTime = newTime ;
return true;
}