Avoid invalid downcasts
Change-Id: Iea1688213cc0ebb8fcb3d3e3c862fd31275b9b38
This commit is contained in:
parent
2a7119021e
commit
3584d4b47c
1 changed files with 7 additions and 6 deletions
|
@ -248,16 +248,17 @@ bool SdrTextObj::LoadText(const OUString& rFileName, const OUString& /*rFilterNa
|
|||
|
||||
ImpSdrObjTextLinkUserData* SdrTextObj::GetLinkUserData() const
|
||||
{
|
||||
ImpSdrObjTextLinkUserData* pData=NULL;
|
||||
sal_uInt16 nAnz=GetUserDataCount();
|
||||
for (sal_uInt16 nNum=nAnz; nNum>0 && pData==NULL;) {
|
||||
for (sal_uInt16 nNum=nAnz; nNum>0;) {
|
||||
nNum--;
|
||||
pData=(ImpSdrObjTextLinkUserData*)GetUserData(nNum);
|
||||
if (pData->GetInventor()!=SdrInventor || pData->GetId()!=SDRUSERDATA_OBJTEXTLINK) {
|
||||
pData=NULL;
|
||||
SdrObjUserData * pData=GetUserData(nNum);
|
||||
if (pData->GetInventor() == SdrInventor
|
||||
&& pData->GetId() == SDRUSERDATA_OBJTEXTLINK)
|
||||
{
|
||||
return static_cast<ImpSdrObjTextLinkUserData *>(pData);
|
||||
}
|
||||
}
|
||||
return pData;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SdrTextObj::ImpLinkAnmeldung()
|
||||
|
|
Loading…
Reference in a new issue