[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - sw/inc sw/source

Armin Le Grand Armin.Le.Grand at cib.de
Fri Jul 13 11:44:10 UTC 2018


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

New commits:
commit 5f343974b6b6404599b8c1bce804ec73fd7a600c
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 fe1bab2f599d..a1f25902d0ed 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -135,6 +135,9 @@ public:
 
     const OUString& GetChartTableName() const { return sChartTableName; }
     void SetChartTableName( const OUString& rNm ) { sChartTableName = 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 83ca26989316..c9f26b9b2156 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -47,9 +47,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>
@@ -199,6 +200,8 @@ SwEmbedObjectLink::~SwEmbedObjectLink()
     }
 
     pOleNode->GetNewReplacement();
+    pOleNode->SetChanged();
+
     return SUCCESS;
 }
 
@@ -637,6 +640,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->Frame());
+    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());
+        }
+    }
+}
+
 SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) :
     pOLENd( nullptr ),
     pListener( nullptr ),


More information about the Libreoffice-commits mailing list