[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sfx2/source svx/sdi sw/source

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 10 10:50:25 UTC 2020


 desktop/source/lib/init.cxx       |    5 ++++-
 sfx2/source/control/unoctitm.cxx  |    5 ++++-
 svx/sdi/svx.sdi                   |   12 ++++++------
 sw/source/uibase/shells/frmsh.cxx |   23 +++++++++++++++++++++++
 4 files changed, 37 insertions(+), 8 deletions(-)

New commits:
commit 00e1597c9a8a3451ae4d67ac0d1257c5ccac6a16
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Thu Feb 6 12:23:21 2020 +0530
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon Feb 10 11:49:54 2020 +0100

    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 at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8916065bc273..aa6452e3d2cd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2656,7 +2656,10 @@ static void doc_iniUnoCommands ()
         OUString(".uno:InsertSymbol"),
         OUString(".uno:EditRegion"),
         OUString(".uno:ThesaurusDialog"),
-        OUString(".uno:Orientation")
+        OUString(".uno:Orientation"),
+        OUString(".uno:ObjectAlignLeft"),
+        OUString(".uno:ObjectAlignRight"),
+        OUString(".uno:AlignCenter")
     };
 
     util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b95ed01dc784..7bc2cad90b63 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1006,7 +1006,10 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
         aEvent.FeatureURL.Path == "AlignLeft" ||
         aEvent.FeatureURL.Path == "AlignHorizontalCenter" ||
         aEvent.FeatureURL.Path == "AlignRight" ||
-        aEvent.FeatureURL.Path == "DocumentRepair")
+        aEvent.FeatureURL.Path == "DocumentRepair" ||
+        aEvent.FeatureURL.Path == "ObjectAlignLeft" ||
+        aEvent.FeatureURL.Path == "ObjectAlignRight" ||
+        aEvent.FeatureURL.Path == "AlignCenter")
     {
         bool bTemp = false;
         aEvent.State >>= bTemp;
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 9429689d8e81..4774f61fa44e 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -106,10 +106,10 @@ SfxBoolItem Polygon SID_DRAW_POLYGON
     GroupId = SfxGroupId::Drawing;
 ]
 
-SfxVoidItem AlignCenter SID_OBJECT_ALIGN_CENTER
+SfxBoolItem AlignCenter SID_OBJECT_ALIGN_CENTER
 ()
 [
-    AutoUpdate = FALSE,
+    AutoUpdate = TRUE,
     FastCall = FALSE,
     ReadOnlyDoc = FALSE,
     Toggle = FALSE,
@@ -142,10 +142,10 @@ SfxVoidItem AlignDown SID_OBJECT_ALIGN_DOWN
 ]
 
 
-SfxVoidItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT
+SfxBoolItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT
 ()
 [
-    AutoUpdate = FALSE,
+    AutoUpdate = TRUE,
     FastCall = FALSE,
     ReadOnlyDoc = FALSE,
     Toggle = FALSE,
@@ -197,10 +197,10 @@ SfxVoidItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE
 ]
 
 
-SfxVoidItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT
+SfxBoolItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT
 ()
 [
-    AutoUpdate = FALSE,
+    AutoUpdate = TRUE,
     FastCall = FALSE,
     ReadOnlyDoc = FALSE,
     Toggle = FALSE,
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:


More information about the Libreoffice-commits mailing list