coverity#735840 Unchecked dynamic_cast
Change-Id: I3c772ec30360103f569b34e7c83f65b469eb5be8
This commit is contained in:
@@ -212,9 +212,12 @@ public:
|
||||
SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
|
||||
virtual ~SdDrawDocument();
|
||||
|
||||
virtual SdrModel* AllocModel() const SAL_OVERRIDE;
|
||||
virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE;
|
||||
SdDrawDocument* AllocSdDrawDocument() const;
|
||||
virtual SdrModel* AllocModel() const SAL_OVERRIDE; //forwards to AllocSdDrawDocument
|
||||
|
||||
SdPage* AllocSdPage(bool bMasterPage);
|
||||
virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE; //forwards to AllocSdPage
|
||||
|
||||
virtual bool IsReadOnly() const SAL_OVERRIDE;
|
||||
virtual void SetChanged(bool bFlag = true) SAL_OVERRIDE;
|
||||
|
||||
|
@@ -434,10 +434,15 @@ SdDrawDocument::~SdDrawDocument()
|
||||
mpCharClass = NULL;
|
||||
}
|
||||
|
||||
SdrModel* SdDrawDocument::AllocModel() const
|
||||
{
|
||||
return AllocSdDrawDocument();
|
||||
}
|
||||
|
||||
// This method creates a new document (SdDrawDocument) and returns a pointer to
|
||||
// said document. The drawing engine uses this method to put the document (or
|
||||
// parts of it) into the clipboard/DragServer.
|
||||
SdrModel* SdDrawDocument::AllocModel() const
|
||||
SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const
|
||||
{
|
||||
SdDrawDocument* pNewModel = NULL;
|
||||
|
||||
|
@@ -467,7 +467,7 @@ void Clipboard::CreateSlideTransferable (
|
||||
SD_MOD()->pTransferClip = pTransferable;
|
||||
|
||||
pDocument->CreatingDataObj (pTransferable);
|
||||
pTransferable->SetWorkDocument( dynamic_cast<SdDrawDocument*>(pDocument->AllocModel()) );
|
||||
pTransferable->SetWorkDocument(pDocument->AllocSdDrawDocument());
|
||||
pDocument->CreatingDataObj (NULL);
|
||||
TransferableObjectDescriptor aObjDesc;
|
||||
pTransferable->GetWorkDocument()->GetDocSh()
|
||||
@@ -573,8 +573,7 @@ void Clipboard::CreateSlideTransferable (
|
||||
new TransferableData(
|
||||
pSlideSorterViewShell,
|
||||
aRepresentatives));
|
||||
pTransferable->SetWorkDocument( dynamic_cast<SdDrawDocument*>(
|
||||
pTreeListBoxTransferable->GetSourceDoc()->AllocModel()));
|
||||
pTransferable->SetWorkDocument(pTreeListBoxTransferable->GetSourceDoc()->AllocSdDrawDocument());
|
||||
// pTransferable->SetView(&mrSlideSorter.GetView());
|
||||
|
||||
// Set page bookmark list.
|
||||
|
Reference in New Issue
Block a user