diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-11-06 14:34:28 +0200 |
---|---|---|
committer | Mihai Varga <mihai.mv13@gmail.com> | 2015-11-13 09:55:19 +0200 |
commit | 96cd2abd748ed24e5aba50cc4c300cf06e512db3 (patch) | |
tree | a1e6636aef83f49a1d9ee81c87d0a9f71c88b5d2 /sc | |
parent | 249f8b1cc9897ac9666dd5c69dc22fae7586c207 (diff) |
LOK: setClientZoom() - sets the client zoom level
We need to know the client's view level to correctly handle the mouse
events in calc. PaintTile() set a zoom level that corresponds to the
requested tiles and previously postMouseEvent would call SetZoom(1,1).
Now we can make use of knowing the client's view level and call
SetZoom() with the correct parameters
Change-Id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd
Conflicts:
sc/source/ui/unoobj/docuno.cxx
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/docuno.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index c208db36ec34..4c79af8343b5 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -405,6 +405,9 @@ public: /// @see vcl::ITiledRenderable::isMimeTypeSupported(). virtual bool isMimeTypeSupported() override; + /// @see vcl::ITiledRenderable::setClientZoom(). + virtual void setClientZoom(int nTilePixelWidth, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight) override; + /// @see vcl::ITiledRenderable::getRowColumnHeaders(). virtual OUString getRowColumnHeaders(const Rectangle& rRectangle) override; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index b3f80b28f2d2..01ca52d393cb 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -604,7 +604,8 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt return; // update the aLogicMode in ScViewData to something predictable - pViewData->SetZoom(Fraction(1, 1), Fraction(1, 1), true); + pViewData->SetZoom(Fraction(nTilePixelWidth * TWIPS_PER_PIXEL, nTileTwipWidth), + Fraction(nTilePixelHeight * TWIPS_PER_PIXEL, nTileTwipHeight), true); // Calc operates in pixels... MouseEvent aEvent(Point(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY()), nCount, @@ -872,6 +873,14 @@ bool ScModelObj::isMimeTypeSupported() return EditEngine::HasValidData(aDataHelper.GetTransferable()); } +void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int nTileTwipWidth_, int nTileTwipHeight_) +{ + nTilePixelWidth = nTilePixelWidth_; + nTilePixelHeight = nTilePixelHeight_; + nTileTwipWidth = nTileTwipWidth_; + nTileTwipHeight = nTileTwipHeight_; +} + OUString ScModelObj::getRowColumnHeaders(const Rectangle& rRectangle) { ScViewData* pViewData = ScDocShell::GetViewData(); @@ -930,6 +939,13 @@ void ScModelObj::initializeForTiledRendering() // tdf#93154: in tiled rendering LO doesn't always detect changes SvtMiscOptions aMiscOpt; aMiscOpt.SetSaveAlwaysAllowed(true); + + // default tile size in pixels + nTilePixelWidth = 256; + nTilePixelHeight = 256; + // the default zoom level will be 1 + nTileTwipWidth = nTilePixelWidth * TWIPS_PER_PIXEL; + nTileTwipHeight = nTilePixelHeight * TWIPS_PER_PIXEL; } uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) |