diff options
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 ) |