Resolves: #i122720# Adapted HasText() to SdrObject

(cherry picked from commit 880138a7794e7e641cdcf49277ed01b54ca93c59)

Conflicts:
	cui/source/tabpages/swpossizetabpage.cxx
	cui/source/tabpages/textattr.cxx
	cui/source/tabpages/transfrm.cxx
	svx/inc/svx/svdobj.hxx
	svx/inc/svx/svdotable.hxx
	svx/inc/svx/svdotext.hxx
	svx/source/svdraw/svdobj.cxx

Change-Id: Ic2564b845425ba63e6ae2ad6a80f3bfdb8a2f287
This commit is contained in:
Armin Le Grand
2013-07-17 12:07:18 +00:00
committed by Caolán McNamara
parent 3e312f729b
commit add80418d0
7 changed files with 15 additions and 9 deletions

View File

@@ -1832,9 +1832,7 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
if( ( pObj->GetObjInventor() == SdrInventor ) && if( ( pObj->GetObjInventor() == SdrInventor ) &&
( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) && ( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) &&
// #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer pObj->HasText() )
0 != dynamic_cast< const SdrTextObj* >(pObj) &&
static_cast< const SdrTextObj* >(pObj)->HasText() )
{ {
OSL_FAIL("AutoWidth/AutoHeight should be enabled"); OSL_FAIL("AutoWidth/AutoHeight should be enabled");
} }

View File

@@ -494,9 +494,7 @@ void SvxTextAttrPage::Construct()
case OBJ_OUTLINETEXT : case OBJ_OUTLINETEXT :
case OBJ_CAPTION : case OBJ_CAPTION :
{ {
if( // #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer if(pObj->HasText())
0 != dynamic_cast< const SdrTextObj* >(pObj) &&
static_cast< const SdrTextObj* >(pObj)->HasText() )
{ {
// contour NOT possible for pure text objects // contour NOT possible for pure text objects
bContourEnabled = sal_False; bContourEnabled = sal_False;

View File

@@ -788,9 +788,7 @@ void SvxPositionSizeTabPage::Construct()
if((pObj->GetObjInventor() == SdrInventor) && if((pObj->GetObjInventor() == SdrInventor) &&
(OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) &&
// #i121917# The original ((SdrTextObj*)pObj)->HasText() will fail badly with SdrVirtObjs from Writer pObj->HasText())
0 != dynamic_cast< const SdrTextObj* >(pObj) &&
static_cast< const SdrTextObj* >(pObj)->HasText())
{ {
mbAdjustDisabled = false; mbAdjustDisabled = false;
maFlAdjust.Enable(); maFlAdjust.Enable();

View File

@@ -1050,6 +1050,9 @@ public:
/// @see mbDoNotInsertIntoPageAutomatically /// @see mbDoNotInsertIntoPageAutomatically
bool IsDoNotInsertIntoPageAutomatically() const; bool IsDoNotInsertIntoPageAutomatically() const;
// #i121917#
virtual bool HasText() const;
protected: protected:
/** Sets a new UNO shape /** Sets a new UNO shape
* *

View File

@@ -172,7 +172,9 @@ public:
/** returns the index of the text that contains the given point or -1 */ /** returns the index of the text that contains the given point or -1 */
virtual sal_Int32 CheckTextHit(const Point& rPnt) const; virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
// #i121917#
virtual bool HasText() const; virtual bool HasText() const;
sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); } sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }
bool IsTextEditActive( const sdr::table::CellPos& rPos ); bool IsTextEditActive( const sdr::table::CellPos& rPos );

View File

@@ -336,7 +336,9 @@ public:
bool IsFitToSize() const; bool IsFitToSize() const;
SdrObjKind GetTextKind() const { return eTextKind; } SdrObjKind GetTextKind() const { return eTextKind; }
// #i121917#
virtual bool HasText() const; virtual bool HasText() const;
bool HasEditText() const; bool HasEditText() const;
sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); } sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }

View File

@@ -3270,6 +3270,11 @@ bool SdrObject::IsDoNotInsertIntoPageAutomatically() const
return mbDoNotInsertIntoPageAutomatically; return mbDoNotInsertIntoPageAutomatically;
} }
// #i121917#
bool SdrObject::HasText() const
{
return false;
}
SdrObjFactory::SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel) SdrObjFactory::SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel)
{ {