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