Avoid invalid downcasts

Change-Id: Iea1688213cc0ebb8fcb3d3e3c862fd31275b9b38
This commit is contained in:
Stephan Bergmann 2014-08-22 11:55:42 +02:00
parent 2a7119021e
commit 3584d4b47c

View file

@ -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()