diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2018-04-16 12:31:21 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-07-09 17:43:11 +0200 |
commit | 08db80ebb4e831d6501ea30de561b175819cc68c (patch) | |
tree | c3039c793d0342f69f1d34255a1e04643663ab06 /sfx2 | |
parent | 1407aeea58046e0ab5e2483dbc5984ee1c0f4187 (diff) |
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/52960
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokcharthelper.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx index 820788a64195..04fade568a21 100644 --- a/sfx2/source/view/lokcharthelper.cxx +++ b/sfx2/source/view/lokcharthelper.cxx @@ -178,12 +178,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; @@ -254,12 +259,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(); |