Kaydet (Commit) ba757840 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

LOKit: ensure DrawViewShell is available (prevent crash)

Change-Id: Id143f5fabdcb8b7451d750563c76b77f9c3787a3
üst b69f5a18
...@@ -2303,12 +2303,18 @@ void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode ) ...@@ -2303,12 +2303,18 @@ void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode )
Size SdXImpressDocument::getDocumentSize() 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(); Size aSize = pCurPageView->GetPageRect().GetSize();
// Convert the size in 100th mm to TWIP // Convert the size in 100th mm to TWIP
// See paintTile above for further info. // See paintTile above for further info.
return Size( convertMm100ToTwip( aSize.getWidth() ), return Size(convertMm100ToTwip(aSize.getWidth()), convertMm100ToTwip(aSize.getHeight()));
convertMm100ToTwip( aSize.getHeight() ) );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment