summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-04-02 13:13:33 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-07 09:18:12 +0200
commita1605d6860e3c4510177c42ab6d2fda569506f57 (patch)
treee45334352be7189c49b1533266e6aa66de533a5b /sc/source/ui
parent03ee2793543d7db25847c5263d88b0eb0d7e8f28 (diff)
sc tiled editing: Use the LogicMapMode even for mouse positions.
Instead of using whatever MapMode value that was used the last time for rendering the tile, set it to something predictable when counting the mouse clicks (100% zoom), and use the value consistently in Calc via GetDrawMapMode(). This fixes clicking the shapes in various zoom levels. Change-Id: Idf83b560f57baab4dc79c45b2ff7c3d75653e102
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx3
-rw-r--r--sc/source/ui/view/gridwin3.cxx10
-rw-r--r--sc/source/ui/view/gridwin4.cxx9
3 files changed, 18 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index bb319bc58b84..9849b6e08b4e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -540,6 +540,9 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount)
if (!pGridWindow)
return;
+ // update the aLogicMode in ScViewData to something predictable
+ pViewData->SetZoom(Fraction(1, 1), Fraction(1, 1), true);
+
// Calc operates in pixels...
MouseEvent aEvent(Point(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY()), nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index 9b87a7b2ea09..be017e378e92 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -238,6 +238,16 @@ void ScGridWindow::DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pCo
MapMode ScGridWindow::GetDrawMapMode( bool bForce )
{
ScDocument* pDoc = pViewData->GetDocument();
+
+ // FIXME this shouldn't be necessary once we change the entire Calc to
+ // work in the logic coordinates (ideally 100ths of mm - so that it is
+ // the same as editeng and drawinglayer), and get rid of all the
+ // SetMapMode's and other unneccessary fun we have with pixels
+ if (pDoc->GetDrawLayer()->isTiledRendering())
+ {
+ return pViewData->GetLogicMode();
+ }
+
SCTAB nTab = pViewData->GetTabNo();
bool bNegativePage = pDoc->IsNegativePage( nTab );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index c5fe4ea85ae0..97a3336e74f7 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -595,10 +595,11 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
MapMode aDrawMode = GetDrawMapMode();
if (bIsTiledRendering)
{
- // FIXME this shouldn't be necessary once we change this to work in the
- // logic coordinates instead of in pixels (and get rid of all the
- // SetMapMode()'s)
- aDrawMode = pViewData->GetLogicMode(eWhich);
+ // FIXME this shouldn't be necessary once we change the entire Calc to
+ // work in the logic coordinates (ideally 100ths of mm - so that it is
+ // the same as editeng and drawinglayer), and get rid of all the
+ // SetMapMode's and other unneccessary fun we have with pixels
+ // See also ScGridWindow::GetDrawMapMode() for the rest of this hack
aDrawMode.SetOrigin(PixelToLogic(Point(nScrX, nScrY), aDrawMode));
}
Rectangle aDrawingRectLogic;