summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2022-01-06 10:54:49 +0530
committerAndras Timar <andras.timar@collabora.com>2022-01-11 11:18:09 +0100
commit284068c7eb473bafd5cafeb30a78daab4538cff6 (patch)
tree170a2b16f0a2dee74cb991e98c494ac2cecaa834 /sc
parent0f2208a43861ebe94c4a2482a0cf7e5c63bb186e (diff)
lokCalcRTL: fix rendering of charts in edit mode
Inform Sfx2InPlaceClient and LokChartHelper when negated X coordinates are used. Ensure that invalidation rectangles have positive coordinates in all cases. Change-Id: I8f5440718e288d8f0d379c8da5f49a29e51f6940
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx3
-rw-r--r--sc/source/ui/view/gridwin4.cxx7
-rw-r--r--sc/source/ui/view/tabvwshb.cxx14
3 files changed, 21 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3af00c03a404..f18793734baf 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -568,9 +568,6 @@ void ScModelObj::paintTile( VirtualDevice& rDevice,
pGridWindow->PaintTile( rDevice, nOutputWidth, nOutputHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight );
- LokChartHelper::PaintAllChartsOnTile(rDevice, nOutputWidth, nOutputHeight,
- nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-
// Draw Form controls
ScDrawLayer* pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
SdrPage* pPage = pDrawLayer->GetPage(sal_uInt16(pViewData->GetTabNo()));
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 9de8604f2bfd..cb085fcc6e64 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -33,6 +33,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <sfx2/lokhelper.hxx>
+#include <sfx2/lokcharthelper.hxx>
#include <svx/svdview.hxx>
#include <svx/svdpagv.hxx>
@@ -1581,6 +1582,12 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
DrawContent(rDevice, aTabInfo, aOutputData, true);
rDevice.SetMapMode(aOriginalMode);
+ // Paint the chart(s) in edit mode.
+ LokChartHelper::PaintAllChartsOnTile(rDevice, nOutputWidth, nOutputHeight,
+ nTilePosX, nTilePosY, nTileWidth, nTileHeight, bLayoutRTL);
+
+ rDevice.SetMapMode(aOriginalMode);
+
// Flag drawn formula cells "unchanged".
rDoc.ResetChanged(ScRange(nTopLeftTileCol, nTopLeftTileRow, nTab, nBottomRightTileCol, nBottomRightTileRow, nTab));
rDoc.PrepareFormulaCalc();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index d0006564d53e..a62770067796 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -80,6 +80,13 @@ void ScTabViewShell::ConnectObject( const SdrOle2Obj* pObj )
return;
pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), pObj );
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bNegativeX = comphelper::LibreOfficeKit::isActive() && rDoc.IsNegativePage(rViewData.GetTabNo());
+ if (bNegativeX)
+ pClient->SetNegativeX(true);
+
tools::Rectangle aRect = pObj->GetLogicRect();
Size aDrawSize = aRect.GetSize();
@@ -153,10 +160,17 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, tools::Long nVerb )
bool bErrorShown = false;
{
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bNegativeX = comphelper::LibreOfficeKit::isActive() && rDoc.IsNegativePage(rViewData.GetTabNo());
SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
if ( !pClient )
pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), pObj );
+ if (bNegativeX)
+ pClient->SetNegativeX(true);
+
if ( (sal_uInt32(nErr) & ERRCODE_ERROR_MASK) == 0 && xObj.is() )
{
tools::Rectangle aRect = pObj->GetLogicRect();