Resolves: #i121917# Corrected access to text object
(cherry picked from commit 2c9c9923fdf042c41cebaf9a15def7caac86032d) Conflicts: sw/source/core/draw/dcontact.cxx Change-Id: Ia214127ca540c4f4036a0006e7c227649fb39134
This commit is contained in:
committed by
Caolán McNamara
parent
297b41ebbe
commit
6c5c5584eb
@@ -150,6 +150,34 @@ void PosSizePropertyPanel::ShowMenu (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
bool hasText(const SdrView& rSdrView)
|
||||||
|
{
|
||||||
|
const SdrMarkList& rMarkList = rSdrView.GetMarkedObjectList();
|
||||||
|
|
||||||
|
if(1 == rMarkList.GetMarkCount())
|
||||||
|
{
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(pObj);
|
||||||
|
|
||||||
|
if(pSdrTextObj && pSdrTextObj->HasText())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} // end of anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PosSizePropertyPanel::Initialize()
|
void PosSizePropertyPanel::Initialize()
|
||||||
{
|
{
|
||||||
mpFtPosX->SetBackground(Wallpaper());
|
mpFtPosX->SetBackground(Wallpaper());
|
||||||
@@ -222,18 +250,7 @@ void PosSizePropertyPanel::Initialize()
|
|||||||
if ( mpView != NULL )
|
if ( mpView != NULL )
|
||||||
{
|
{
|
||||||
maUIScale = mpView->GetModel()->GetUIScale();
|
maUIScale = mpView->GetModel()->GetUIScale();
|
||||||
|
mbAdjustEnabled = hasText(*mpView);
|
||||||
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
|
||||||
if(1 == rMarkList.GetMarkCount())
|
|
||||||
{
|
|
||||||
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())
|
|
||||||
{
|
|
||||||
mbAdjustEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mePoolUnit = maTransfWidthControl.GetCoreMetric();
|
mePoolUnit = maTransfWidthControl.GetCoreMetric();
|
||||||
@@ -701,20 +718,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
|
|||||||
if ( mpView == NULL )
|
if ( mpView == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
mbAdjustEnabled = hasText(*mpView);
|
||||||
|
|
||||||
if(1 == rMarkList.GetMarkCount())
|
|
||||||
{
|
|
||||||
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())
|
|
||||||
mbAdjustEnabled = true;
|
|
||||||
else
|
|
||||||
mbAdjustEnabled = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mbAdjustEnabled = false;
|
|
||||||
|
|
||||||
// Pool unit and dialog unit may have changed, make sure that we
|
// Pool unit and dialog unit may have changed, make sure that we
|
||||||
// have the current values.
|
// have the current values.
|
||||||
@@ -938,6 +942,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
|
const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
|
||||||
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
||||||
|
|
||||||
switch (rMarkList.GetMarkCount())
|
switch (rMarkList.GetMarkCount())
|
||||||
{
|
{
|
||||||
|
@@ -2332,8 +2332,16 @@ basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const
|
|||||||
SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
|
SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
|
||||||
{
|
{
|
||||||
SdrHdl* pHdl = rRefObj.GetHdl(nHdlNum);
|
SdrHdl* pHdl = rRefObj.GetHdl(nHdlNum);
|
||||||
Point aP(pHdl->GetPos() + GetOffset());
|
|
||||||
pHdl->SetPos(aP);
|
if(pHdl)
|
||||||
|
{
|
||||||
|
Point aP(pHdl->GetPos() + GetOffset());
|
||||||
|
pHdl->SetPos(aP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OSL_ENSURE(false, "Got no SdrHdl(!)");
|
||||||
|
}
|
||||||
|
|
||||||
return pHdl;
|
return pHdl;
|
||||||
}
|
}
|
||||||
@@ -2342,8 +2350,14 @@ SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const
|
|||||||
{
|
{
|
||||||
SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
|
SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
|
||||||
|
|
||||||
if (pHdl)
|
if(pHdl)
|
||||||
|
{
|
||||||
pHdl->SetPos(pHdl->GetPos() + GetOffset());
|
pHdl->SetPos(pHdl->GetPos() + GetOffset());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OSL_ENSURE(false, "Got no SdrHdl(!)");
|
||||||
|
}
|
||||||
|
|
||||||
return pHdl;
|
return pHdl;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user