diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 11 |
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 |