diff options
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 12 |
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())); } |