diff options
authorDennis Francis <>2020-05-22 09:38:29 +0530
committerDennis Francis <>2020-05-25 00:39:50 +0530
commit552db9165faaa8425f2b8cbf71bbef1438bb243a (patch)
parentfd60c5a4879cb881b6c5abfe53ba80126ebb7303 (diff)
Fix sc tiledrendering unit test document-setup
The calc tiledrendering unit tests that use view-data's nPPTX directy or indirectly are failing in pristine master build (at least in my setup). When creating a document for each test via createDoc(), the docshell has an output-factor != 1.0 by default (at least for these unit-tests). We do call ScModelObj::initializeForTiledRendering() soon afterwards which does the right thing by setting it back to 1.0 (indirectly), but nPPTX value in view-data is not updated and stays wrong. I haven't had a chance to investigate more why this happens only in my setup, but as an interim fix, an explicit call to RefreshZoom() is added to createDoc(). Change-Id: Ia7044381fa203e03c56f8a2589140c634347fe66
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 315910de60ac..7bdf8f189239 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -203,6 +203,11 @@ ScModelObj* ScTiledRenderingTest::createDoc(const char* pName)
ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ // Without a zoom reset the docshell "output-factor" computed in ScModelObj::initializeForTiledRendering is not
+ // reflected in view-data nPPTX without an explicit CalcPPT() call.
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ if (pViewData)
+ pViewData->RefreshZoom();
return pModelObj;