summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2020-06-25 16:20:45 +0300
committerTor Lillqvist <tml@collabora.com>2020-06-30 08:18:52 +0200
commitca1df564c3199a569c681d5814e1fddc66c48522 (patch)
tree4215c7ee011b0b617d747a7ffedd66fc31f995b5 /sc
parenta3020001d1156c914e401ccc4c672ad0ebe4c8f8 (diff)
Let's not run on hope
Change-Id: If2fb2c55d53321ec2e5beff0ade9974c02811f7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97120 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97408 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index fc9903bb2e3c..d0ec84d8cea5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -500,15 +500,14 @@ void ScModelObj::paintTile( VirtualDevice& rDevice,
int nTilePosX, int nTilePosY,
long nTileWidth, long nTileHeight )
{
- // There seems to be no clear way of getting the grid window for this
- // particular document, hence we need to hope we get the right window.
- // FIXME: "hope"? Are you kidding me?
- ScViewData* pViewData = ScDocShell::GetViewData();
+ ScTabViewShell* pViewShell = pDocShell->GetBestViewShell(false);
- // FIXME
- if (!pViewData)
+ // FIXME: Can this happen? What should we do?
+ if (!pViewShell)
return;
+ ScViewData* pViewData = &pViewShell->GetViewData();
+
ScGridWindow* pGridWindow = pViewData->GetActiveWin();
// update the size of the area we are painting