[Libreoffice-commits] core.git: svx/source
Stephan Bergmann
sbergman at redhat.com
Fri Aug 22 02:56:20 PDT 2014
svx/source/svdraw/svdotxln.cxx | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
New commits:
commit 3584d4b47c4e6db479eee6735df8d56831d09638
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 22 11:55:42 2014 +0200
Avoid invalid downcasts
Change-Id: Iea1688213cc0ebb8fcb3d3e3c862fd31275b9b38
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx
index 1cc6bc4..8fad6e3 100644
--- a/svx/source/svdraw/svdotxln.cxx
+++ b/svx/source/svdraw/svdotxln.cxx
@@ -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()
More information about the Libreoffice-commits
mailing list