diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-07-12 16:16:17 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-07-13 13:20:48 +0200 |
commit | 2da75024f88f7c3242fedd9b5bf4832a596402c0 (patch) | |
tree | 65c0da3b4c47d62e5d6adc57a5138daeaad15f09 | |
parent | a0d0b0248567f6c0e3b57c5875a6551262b32368 (diff) |
Refresh linked OLE representation when OLE updated
Change-Id: If949778779f1a91901412938d0b0298e1d7cfc3e
Reviewed-on: https://gerrit.libreoffice.org/57357
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r-- | sw/inc/ndole.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/ole/ndole.cxx | 35 |
2 files changed, 38 insertions, 1 deletions
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index f77f70905a32..4f6f4596736d 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -149,6 +149,10 @@ public: const OUString& GetChartTableName() const { return msChartTableName; } void SetChartTableName( const OUString& rNm ) { msChartTableName = rNm; } + + + // react on visual change (invalidate) + void SetChanged(); }; /// Inline methods from Node.hxx diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 584dcc8e89f0..e4b6115fd0ec 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -42,9 +42,10 @@ #include <cntfrm.hxx> #include <frmatr.hxx> #include <ndole.hxx> +#include <viewsh.hxx> #include <DocumentSettingManager.hxx> #include <IDocumentLinksAdministration.hxx> - +#include <IDocumentLayoutAccess.hxx> #include <comphelper/classids.hxx> #include <vcl/graph.hxx> #include <sot/formats.hxx> @@ -193,6 +194,8 @@ SwEmbedObjectLink::SwEmbedObjectLink(SwOLENode* pNode): } pOleNode->GetNewReplacement(); + pOleNode->SetChanged(); + return SUCCESS; } @@ -630,6 +633,36 @@ bool SwOLENode::IsChart() const return bIsChart; } +// react on visual change (invalidate) +void SwOLENode::SetChanged() +{ + SwFrame* pFrame(getLayoutFrame(nullptr)); + + if(nullptr == pFrame) + { + return; + } + + const SwRect aFrameArea(pFrame->getFrameArea()); + SwViewShell* pVSh(GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()); + + if(nullptr == pVSh) + { + return; + } + + for(SwViewShell& rShell : pVSh->GetRingContainer()) + { + SET_CURR_SHELL(&rShell); + + if(rShell.VisArea().IsOver(aFrameArea) && OUTDEV_WINDOW == rShell.GetOut()->GetOutDevType()) + { + // invalidate instead of painting + rShell.GetWin()->Invalidate(aFrameArea.SVRect()); + } + } +} + namespace { class DeflateThread; } /// Holder for local data for a parallel-executed task to load a chart model |