Kaydet (Commit) 08db80eb authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Jan Holesovsky

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: 's avatarJan Holesovsky <kendy@collabora.com>
üst 1407aeea
...@@ -178,12 +178,17 @@ bool LokChartHelper::Hit(const Point& aPos) ...@@ -178,12 +178,17 @@ bool LokChartHelper::Hit(const Point& aPos)
bool LokChartHelper::HitAny(const Point& aPos) bool LokChartHelper::HitAny(const Point& aPos)
{ {
SfxViewShell* pCurView = SfxViewShell::Current();
int nPartForCurView = pCurView ? pCurView->getPart() : -1;
SfxViewShell* pViewShell = SfxViewShell::GetFirst(); SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell) while (pViewShell)
{ {
LokChartHelper aChartHelper(pViewShell); if (pViewShell->getPart() == nPartForCurView)
if (aChartHelper.Hit(aPos)) {
return true; LokChartHelper aChartHelper(pViewShell);
if (aChartHelper.Hit(aPos))
return true;
}
pViewShell = SfxViewShell::GetNext(*pViewShell); pViewShell = SfxViewShell::GetNext(*pViewShell);
} }
return false; return false;
...@@ -254,12 +259,17 @@ void LokChartHelper::PaintAllChartsOnTile(VirtualDevice& rDevice, ...@@ -254,12 +259,17 @@ void LokChartHelper::PaintAllChartsOnTile(VirtualDevice& rDevice,
aMapMode.SetScaleY(scaleY); aMapMode.SetScaleY(scaleY);
rDevice.SetMapMode(aMapMode); rDevice.SetMapMode(aMapMode);
SfxViewShell* pCurView = SfxViewShell::Current();
int nPartForCurView = pCurView ? pCurView->getPart() : -1;
tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)); tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight));
SfxViewShell* pViewShell = SfxViewShell::GetFirst(); SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell) while (pViewShell)
{ {
LokChartHelper aChartHelper(pViewShell); if (pViewShell->getPart() == nPartForCurView)
aChartHelper.PaintTile(rDevice, aTileRect); {
LokChartHelper aChartHelper(pViewShell);
aChartHelper.PaintTile(rDevice, aTileRect);
}
pViewShell = SfxViewShell::GetNext(*pViewShell); pViewShell = SfxViewShell::GetNext(*pViewShell);
} }
rDevice.Pop(); rDevice.Pop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment