[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

Marco Cecchetti marco.cecchetti at collabora.com
Mon Jul 9 15:44:02 UTC 2018


 sfx2/source/view/lokcharthelper.cxx |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 7af24c0c0f8e5d42d595da256edd71f080c06022
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Mon Apr 16 12:31:21 2018 +0200

    lok: chart when edited is visible on other user's document parts
    
    - Open a spreadsheet with chart in multiple views.
    - With one view double-click in the chart.
    - With the other switch to a different sheet.
    
    => The chart is visible for the second view on the other sheet.
    
    The same is true in impress for slides.
    
    Change-Id: Ia3fe98b0a9fc94c7f3a8f59f28e3a8937eb51a2a
    Reviewed-on: https://gerrit.libreoffice.org/52959
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index cd7e6feeffc0..05e9b206ef11 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -177,12 +177,17 @@ bool LokChartHelper::Hit(const Point& aPos)
 
 bool LokChartHelper::HitAny(const Point& aPos)
 {
+    SfxViewShell* pCurView = SfxViewShell::Current();
+    int nPartForCurView = pCurView ? pCurView->getPart() : -1;
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
     while (pViewShell)
     {
-        LokChartHelper aChartHelper(pViewShell);
-        if (aChartHelper.Hit(aPos))
-            return true;
+        if (pViewShell->getPart() == nPartForCurView)
+        {
+            LokChartHelper aChartHelper(pViewShell);
+            if (aChartHelper.Hit(aPos))
+                return true;
+        }
         pViewShell = SfxViewShell::GetNext(*pViewShell);
     }
     return false;
@@ -253,12 +258,17 @@ void LokChartHelper::PaintAllChartsOnTile(VirtualDevice& rDevice,
         aMapMode.SetScaleY(scaleY);
         rDevice.SetMapMode(aMapMode);
 
+        SfxViewShell* pCurView = SfxViewShell::Current();
+        int nPartForCurView = pCurView ? pCurView->getPart() : -1;
         tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight));
         SfxViewShell* pViewShell = SfxViewShell::GetFirst();
         while (pViewShell)
         {
-            LokChartHelper aChartHelper(pViewShell);
-            aChartHelper.PaintTile(rDevice, aTileRect);
+            if (pViewShell->getPart() == nPartForCurView)
+            {
+                LokChartHelper aChartHelper(pViewShell);
+                aChartHelper.PaintTile(rDevice, aTileRect);
+            }
             pViewShell = SfxViewShell::GetNext(*pViewShell);
         }
         rDevice.Pop();


More information about the Libreoffice-commits mailing list