diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-02-06 12:23:21 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2020-02-10 11:49:54 +0100 |
commit | 00e1597c9a8a3451ae4d67ac0d1257c5ccac6a16 (patch) | |
tree | 977f39dd5b4d23679161a2fe1129c2b9555a6234 /sw | |
parent | dddb3877b2ce8fcc40bb1b255f47a0012e6e66de (diff) |
Allow boolean valued statechange messages for...
object align commands :
ObjectAlignLeft [SID_OBJECT_ALIGN_LEFT]
ObjectAlignRight [SID_OBJECT_ALIGN_RIGHT]
AlignCenter [SID_OBJECT_ALIGN_CENTER]
What is pending is to set correct align state items for Impress in
DrawViewShell::GetMenuStateSel(). For doing that we need to store
the object align state somewhere when we execute SID_OBJECT_ALIGN_*
in DrawViewShell::FuTemporary().
For Writer the align state information was already available in
frame-format-manager object.
Change-Id: I86fcf59cfc66af98097611277201ecaa3b8c22cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88077
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/frmsh.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 12f0f8216ede..a34ca5783b87 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -808,7 +808,30 @@ void SwFrameShell::GetState(SfxItemSet& rSet) bProtect || ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER) && bHtmlMode )) + { rSet.DisableItem( nWhich ); + } + else + { + sal_Int16 nHoriOrient = -1; + switch(nWhich) + { + case SID_OBJECT_ALIGN_LEFT: + nHoriOrient = text::HoriOrientation::LEFT; + break; + case SID_OBJECT_ALIGN_CENTER: + nHoriOrient = text::HoriOrientation::CENTER; + break; + case SID_OBJECT_ALIGN_RIGHT: + nHoriOrient = text::HoriOrientation::RIGHT; + break; + default: + break; + } + SwFormatHoriOrient aHOrient(aMgr.GetHoriOrient()); + if (nHoriOrient != -1) + rSet.Put(SfxBoolItem(nWhich, nHoriOrient == aHOrient.GetHoriOrient())); + } break; case FN_FRAME_ALIGN_VERT_ROW_TOP: case FN_FRAME_ALIGN_VERT_ROW_CENTER: |