desktop/source/lib/init.cxx | 3 +++ sfx2/source/control/unoctitm.cxx | 3 +++ svx/sdi/svx.sdi | 6 +++--- sw/source/uibase/shells/drwbassh.cxx | 26 ++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-)
New commits: commit ae323ad6c3df8c8185041fbfa89e6c315f6e0eab Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Aug 3 12:37:06 2020 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Aug 3 12:55:23 2020 +0200 lok: state updates for vertical alignment Change-Id: I6767904e3d3366e1316c932555b979a26e77b8c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99998 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a930e2e2cd92..97ef1635c719 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2789,6 +2789,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 a7a14b40d81c..1cf61d9bab91 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 5231ebe66fb6..e3cbeaa3adfc 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 277b5e092e04..b08e0fbc1f23 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -705,6 +705,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 ) { @@ -748,6 +750,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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits