diff options
author | Juergen Funk <juergen.funk_ml@cib.de> | 2022-02-22 09:19:29 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-05-10 09:02:01 +0200 |
commit | cf650ceaafb4d3a3f46991dc1b12efa0e37a71f9 (patch) | |
tree | 0bcbc4178c8f940c747507f4d24bef2685dfa399 /svtools | |
parent | 63a2f314250b05d484747fafc4a814a4553f461e (diff) |
tdf#147590 update OLE object after document refresh
Regression from b099da78a6f0b3e120f706714003b05d84d11e70
we didn't update linked OLE document after document reload
Change-Id: I8e52f6430f454b276cb43449c6f7a3b0e07e909f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130692
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 13 | ||||
-rw-r--r-- | svtools/source/misc/filechangedchecker.cxx | 22 |
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; } |