summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-08-10 22:56:44 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-08-10 23:00:46 +0200
commitba7578401b4fed4df7b255cf23bd674f86953436 (patch)
tree09fde1b87a915e351045849ee937b83ebfb1dfe0 /sd
parentb69f5a1857d2dcad4b234ad84cde98b9fd436f90 (diff)
LOKit: ensure DrawViewShell is available (prevent crash)
Change-Id: Id143f5fabdcb8b7451d750563c76b77f9c3787a3
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 97de832cd63f..79146e9c2ccc 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2303,12 +2303,18 @@ void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode )
Size SdXImpressDocument::getDocumentSize()
{
- SdrPageView* pCurPageView = mpDoc->GetDocSh()->GetViewShell()->GetView()->GetSdrPageView();
+ DrawViewShell* pViewSh = dynamic_cast<DrawViewShell*>(mpDoc->GetDocSh()->GetViewShell());
+ if (!pViewSh)
+ {
+ SAL_WARN("sd", "DrawViewShell not available!");
+ return Size();
+ }
+
+ SdrPageView* pCurPageView = pViewSh->GetView()->GetSdrPageView();
Size aSize = pCurPageView->GetPageRect().GetSize();
// Convert the size in 100th mm to TWIP
// See paintTile above for further info.
- return Size( convertMm100ToTwip( aSize.getWidth() ),
- convertMm100ToTwip( aSize.getHeight() ) );
+ return Size(convertMm100ToTwip(aSize.getWidth()), convertMm100ToTwip(aSize.getHeight()));
}