[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - svx/source sw/source
Armin Le Grand
alg at apache.org
Wed Jun 19 04:20:45 PDT 2013
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 57 ++++++++++----------
sw/source/core/draw/dcontact.cxx | 20 +++++--
2 files changed, 48 insertions(+), 29 deletions(-)
New commits:
commit bc69be88fa43901504126740bc8810f4e31e17a5
Author: Armin Le Grand <alg at apache.org>
Date: Tue Jun 18 13:10:42 2013 +0000
Resolves: #i121917# Corrected access to text object
(cherry picked from commit 2c9c9923fdf042c41cebaf9a15def7caac86032d)
Conflicts:
sw/source/core/draw/dcontact.cxx
Change-Id: Ia214127ca540c4f4036a0006e7c227649fb39134
(cherry picked from commit 6c5c5584eb1adb64fee3aaf76196115ba3812e2c)
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 5854e36..20879f1 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -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()
{
mpFtPosX->SetBackground(Wallpaper());
@@ -222,18 +250,7 @@ void PosSizePropertyPanel::Initialize()
if ( mpView != NULL )
{
maUIScale = mpView->GetModel()->GetUIScale();
-
- 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;
- }
- }
+ mbAdjustEnabled = hasText(*mpView);
}
mePoolUnit = maTransfWidthControl.GetCoreMetric();
@@ -701,20 +718,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
if ( mpView == NULL )
return;
- 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;
- else
- mbAdjustEnabled = false;
- }
- else
- mbAdjustEnabled = false;
+ mbAdjustEnabled = hasText(*mpView);
// Pool unit and dialog unit may have changed, make sure that we
// have the current values.
@@ -938,6 +942,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
}
const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
+ const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
switch (rMarkList.GetMarkCount())
{
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index cc6f1a5..6026513 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2332,8 +2332,16 @@ basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const
SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
{
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;
}
@@ -2342,8 +2350,14 @@ SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const
{
SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
- if (pHdl)
+ if(pHdl)
+ {
pHdl->SetPos(pHdl->GetPos() + GetOffset());
+ }
+ else
+ {
+ OSL_ENSURE(false, "Got no SdrHdl(!)");
+ }
return pHdl;
}
More information about the Libreoffice-commits
mailing list