summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-07-11 09:19:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-07-11 11:40:49 +0100
commit8d92c5d1fa4216749c48e34e471f5362a0906a32 (patch)
treecb0252a492ac85f4f51d0e51cf83abb53b54f366 /cui
parent21e45efa42932ec5fbf8d9fea4cb7e71edf08b9d (diff)
Resolves: #i121917# secure SdrTextObj casts in cui
(cherry picked from commit 005cd2d436221519f74e54fb2373c7cbece6aed0) Change-Id: If38213ec9bce63aab97ad9d32273c05860e583ee
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx4
-rw-r--r--cui/source/tabpages/textattr.cxx4
-rw-r--r--cui/source/tabpages/transfrm.cxx6
3 files changed, 11 insertions, 3 deletions
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 24ce240f3850..1da5012bcce3 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1832,7 +1832,9 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
if( ( pObj->GetObjInventor() == SdrInventor ) &&
( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) &&
- ( (SdrTextObj*) pObj )->HasText() )
+ // #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer
+ 0 != dynamic_cast< const SdrTextObj* >(pObj) &&
+ static_cast< const SdrTextObj* >(pObj)->HasText() )
{
OSL_FAIL("AutoWidth/AutoHeight should be enabled");
}
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 37a7212412e3..aaf5e0a5412a 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -494,7 +494,9 @@ void SvxTextAttrPage::Construct()
case OBJ_OUTLINETEXT :
case OBJ_CAPTION :
{
- if ( ((SdrTextObj*)pObj)->HasText() )
+ if( // #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer
+ 0 != dynamic_cast< const SdrTextObj* >(pObj) &&
+ static_cast< const SdrTextObj* >(pObj)->HasText() )
{
// contour NOT possible for pure text objects
bContourEnabled = sal_False;
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 9cd709f47224..b79795dffe70 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -786,7 +786,11 @@ void SvxPositionSizeTabPage::Construct()
const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
- if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText())
+ if((pObj->GetObjInventor() == SdrInventor) &&
+ (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) &&
+ // #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer
+ 0 != dynamic_cast< const SdrTextObj* >(pObj) &&
+ static_cast< const SdrTextObj* >(pObj)->HasText())
{
mbAdjustDisabled = false;
maFlAdjust.Enable();