[Libreoffice-commits] core.git: sw/inc sw/source

Armin Le Grand Armin.Le.Grand at cib.de
Fri Jul 13 11:21:14 UTC 2018


 sw/inc/ndole.hxx             |    4 ++++
 sw/source/core/ole/ndole.cxx |   35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 2da75024f88f7c3242fedd9b5bf4832a596402c0
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Thu Jul 12 16:16:17 2018 +0200

    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 at cib.de>

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


More information about the Libreoffice-commits mailing list