diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 3 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 26 |
4 files changed, 35 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index db2a16179bfe..d28bb2bc64d0 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2819,6 +2819,9 @@ static void doc_iniUnoCommands () OUString(".uno:CharmapControl"), OUString(".uno:EnterGroup"), OUString(".uno:LeaveGroup"), + OUString(".uno:AlignUp"), + OUString(".uno:AlignMiddle"), + OUString(".uno:AlignDown"), OUString(".uno:FreezePanesRow") }; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index e66edd9313ea..3fe778493188 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1012,6 +1012,9 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra aEvent.FeatureURL.Path == "ObjectAlignLeft" || aEvent.FeatureURL.Path == "ObjectAlignRight" || aEvent.FeatureURL.Path == "AlignCenter" || + aEvent.FeatureURL.Path == "AlignUp" || + aEvent.FeatureURL.Path == "AlignMiddle" || + aEvent.FeatureURL.Path == "AlignDown" || aEvent.FeatureURL.Path == "FormatPaintbrush") { bool bTemp = false; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index b647dbeb3676..d2ba31f57608 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -124,7 +124,7 @@ SfxBoolItem AlignCenter SID_OBJECT_ALIGN_CENTER ] -SfxVoidItem AlignDown SID_OBJECT_ALIGN_DOWN +SfxBoolItem AlignDown SID_OBJECT_ALIGN_DOWN () [ AutoUpdate = FALSE, @@ -179,7 +179,7 @@ SvxAdjustItem Alignment SID_ATTR_PARA_ADJUST ] -SfxVoidItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE +SfxBoolItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE () [ AutoUpdate = FALSE, @@ -215,7 +215,7 @@ SfxBoolItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT ] -SfxVoidItem AlignUp SID_OBJECT_ALIGN_UP +SfxBoolItem AlignUp SID_OBJECT_ALIGN_UP () [ AutoUpdate = FALSE, diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index c707b803736b..fea15d78428a 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -701,6 +701,8 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) bool bDisableHoriz = false; bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER || nWhich == SID_OBJECT_ALIGN_RIGHT); + bool bVert = (nWhich == SID_OBJECT_ALIGN_UP || nWhich == SID_OBJECT_ALIGN_MIDDLE || + nWhich == SID_OBJECT_ALIGN_DOWN); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); if ( !rSh.IsAlignPossible() || bProtected ) { @@ -744,6 +746,30 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT)); rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient)); } + + if (bVert && !bDisableThis && rMarkList.GetMarkCount() == 1) + { + sal_Int16 nVertOrient = -1; + switch(nWhich) + { + case SID_OBJECT_ALIGN_UP: + nVertOrient = text::VertOrientation::TOP; + break; + case SID_OBJECT_ALIGN_MIDDLE: + nVertOrient = text::VertOrientation::CENTER; + break; + case SID_OBJECT_ALIGN_DOWN: + nVertOrient = text::VertOrientation::BOTTOM; + break; + default: + break; + } + + SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); + SwFrameFormat* pFrameFormat = FindFrameFormat(pObj); + SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT)); + rSet.Put(SfxBoolItem(nWhich, aVOrient.GetVertOrient() == nVertOrient)); + } } break; |