officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |    8 +++
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs        |    7 +++
 sc/inc/sc.hrc                                                     |    1 
 sc/sdi/scalc.sdi                                                  |   18 
+++++++
 sc/sdi/tabvwsh.sdi                                                |    1 
 sc/source/ui/view/tabvwsh3.cxx                                    |   13 +++++
 sc/source/ui/view/tabvwsha.cxx                                    |    7 +++
 sc/uiconfig/scalc/menubar/menubar.xml                             |    1 
 sw/source/uibase/inc/navicfg.hxx                                  |   12 +++++
 sw/source/uibase/utlui/content.cxx                                |   23 
++++++++--
 sw/source/uibase/utlui/navicfg.cxx                                |    5 +-
 11 files changed, 92 insertions(+), 4 deletions(-)

New commits:
commit 4dc019cc752013692b74df7d110f415533f4dd12
Author:     Sahil <[email protected]>
AuthorDate: Sat Dec 9 22:03:33 2023 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Dec 15 09:01:18 2023 +0100

    tdf#33201 Add UNO command for Column/Row Highlighting
    
    * Add uno command
    * Add menubar Entry [x] Column/Row Highlighting under View
    
    Change-Id: I86cb0034d5bd7d64bd6bfd64cf6e20507d14e5fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159364
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit d981ee6256a905eb8a45557869288a06eb5ae0fc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160641
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index fe726492ffb4..723ece46d7ce 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1378,6 +1378,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:ViewColumnRowHighlighting" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Column/Row Highlighting</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:ViewHiddenColRow" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Show Hidden Row/Column Indicator</value>
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index f9c04a6e2e53..f6f445fc5a2e 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -277,6 +277,7 @@ class SvxZoomSliderItem;
 #define FID_TOGGLEHEADERS       (VIEW_MENU_START + 2)
 #define FID_SCALE               TypedWhichId<SvxZoomItem>(VIEW_MENU_START + 4)
 #define FID_TOGGLESYNTAX        (VIEW_MENU_START + 5)
+#define FID_TOGGLECOLROWHIGHLIGHTING (VIEW_MENU_START + 6)
 #define FID_PAGEBREAKMODE       (VIEW_MENU_START + 7)
 #define FID_FUNCTION_BOX        (VIEW_MENU_START + 8)
 #define FID_NORMALVIEWMODE      (VIEW_MENU_START + 9)
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 614293cc90bb..d26e99ce2f5d 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -6054,6 +6054,24 @@ SfxBoolItem ViewValueHighlighting FID_TOGGLESYNTAX
     GroupId = SfxGroupId::View;
 ]
 
+SfxBoolItem ViewColumnRowHighlighting FID_TOGGLECOLROWHIGHLIGHTING
+
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = FALSE,
+    GroupId = SfxGroupId::View;
+]
+
 SfxBoolItem ViewHiddenColRow FID_TOGGLEHIDDENCOLROW
 
 [
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index e1da8b2f5d14..7130ff4cabd8 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -174,6 +174,7 @@ interface TableEditView
 
     FID_SCALESTATUS     [ ExecMethod = Execute; StateMethod = GetState; ]
     FID_TOGGLESYNTAX    [ ExecMethod = Execute; StateMethod = GetState; ]
+    FID_TOGGLECOLROWHIGHLIGHTING [ ExecMethod = Execute; StateMethod = 
GetState; ]
     FID_TOGGLEHEADERS   [ ExecMethod = Execute; StateMethod = GetState; ]
     FID_TOGGLEFORMULA   [ ExecMethod = Execute; StateMethod = GetState; ]
     FID_NORMALVIEWMODE  [ ExecMethod = Execute; StateMethod = GetState; ]
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 60754c58baff..208748b7110f 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -56,6 +56,7 @@
 #include <comphelper/string.hxx>
 #include <sfx2/lokhelper.hxx>
 #include <scabstdlg.hxx>
+#include <officecfg/Office/Calc.hxx>
 
 #include <basegfx/utils/zoomtools.hxx>
 
@@ -696,6 +697,18 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                 rReq.Done();
             }
             break;
+        case FID_TOGGLECOLROWHIGHLIGHTING:
+            {
+                bool bNewVal = 
!officecfg::Office::Calc::Content::Display::ColumnRowHighlighting::get();
+
+                auto pChange(comphelper::ConfigurationChanges::create());
+                
officecfg::Office::Calc::Content::Display::ColumnRowHighlighting::set(bNewVal, 
pChange);
+                pChange->commit();
+
+                rReq.AppendItem(SfxBoolItem(nSlot, bNewVal));
+                rReq.Done();
+            }
+            break;
         case FID_TOGGLEHEADERS:
             {
                 bool bSet = !GetViewData().IsHeaderMode();
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 84a3acbcdf44..c332c9542a66 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <com/sun/star/table/BorderLineStyle.hpp>
+#include <officecfg/Office/Calc.hxx>
 
 #include <comphelper/lok.hxx>
 #include <editeng/boxitem.hxx>
@@ -378,6 +379,12 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
                 rSet.Put(SfxBoolItem(nWhich, GetViewData().IsSyntaxMode()));
                 break;
 
+            case FID_TOGGLECOLROWHIGHLIGHTING:
+                rSet.Put(SfxBoolItem(
+                    nWhich,
+                    
officecfg::Office::Calc::Content::Display::ColumnRowHighlighting::get()));
+                break;
+
             case FID_TOGGLEHEADERS:
                 rSet.Put(SfxBoolItem(nWhich, GetViewData().IsHeaderMode()));
                 break;
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml 
b/sc/uiconfig/scalc/menubar/menubar.xml
index ab2c7f81f672..dad1d6844f4e 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -165,6 +165,7 @@
       </menu:menu>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:ViewValueHighlighting"/>
+      <menu:menuitem menu:id=".uno:ViewColumnRowHighlighting"/>
       <menu:menuitem menu:id=".uno:ViewHiddenColRow"/>
       <menu:menuitem menu:id=".uno:ToggleFormula"/>
       <menu:menuitem menu:id=".uno:ShowAnnotations"/>
commit ae8d83c0cca3f721292bceaf358cd03217d5ee39
Author:     Jim Raykowski <[email protected]>
AuthorDate: Fri Nov 24 00:40:30 2023 -0900
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Dec 15 09:01:04 2023 +0100

    tdf#158276 tdf#86395 Make alphabetical sort setting persist
    
    by using a bitwise storage approach inspired by the ActiveBlock
    setting where each content type corresponds to one bit position of
    the stored integer, e.g., bookmarks content type corresponds to bit
    5.
    
    Change-Id: I50de26e44a8d2afb917f3a651eef9a8f704b751f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159916
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <[email protected]>
    (cherry picked from commit bb0a2be91930fbae07657f214b53117b9e8cc204)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160643
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 61054ae8eca9..2bd5995a1e5d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5197,6 +5197,13 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="SortAlphabeticallyBlock" oor:type="xs:int" 
oor:nillable="false">
+        <!-- UIHints: Navigator -->
+        <info>
+          <desc>Specifies whether the contents of a content type are 
alphabetically sorted in the Navigator list box. Each content type corresponds 
to one bit position of the stored int. A bit with value 1 indicates 
alphabetical sorting for the corresponding content type.</desc>
+        </info>
+        <value>0</value>
+      </prop>
     </group>
     <group oor:name="Envelope">
       <info>
diff --git a/sw/source/uibase/inc/navicfg.hxx b/sw/source/uibase/inc/navicfg.hxx
index ad4bb10afb70..b39614f9f63f 100644
--- a/sw/source/uibase/inc/navicfg.hxx
+++ b/sw/source/uibase/inc/navicfg.hxx
@@ -37,6 +37,8 @@ class SwNavigationConfig final : public utl::ConfigItem
 
     o3tl::enumarray<ContentTypeId, bool> mContentTypeTrack;
 
+    sal_Int32 m_nSortAlphabeticallyBlock = 0; // persists content type 
alphabetical sort setting
+
     static css::uno::Sequence<OUString> GetPropertyNames();
 
     virtual void ImplCommit() override;
@@ -125,6 +127,16 @@ public:
     }
 
     bool    IsNavigateOnSelect() const {return m_bIsNavigateOnSelect;}
+
+    sal_Int32 GetSortAlphabeticallyBlock() const {return 
m_nSortAlphabeticallyBlock;}
+    void SetSortAlphabeticallyBlock(sal_Int32 nSet)
+    {
+        if(m_nSortAlphabeticallyBlock != nSet)
+        {
+            SetModified();
+            m_nSortAlphabeticallyBlock = nSet;
+        }
+    }
 };
 
 #endif
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 8d46ef52303a..72fd76cbe1ce 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -431,6 +431,13 @@ SwContentType::SwContentType(SwWrtShell* pShell, 
ContentTypeId nType, sal_uInt8
         break;
         default: break;
     }
+
+    const int nShift = static_cast<int>(m_nContentType);
+    assert(nShift > -1);
+    const sal_Int32 nMask = 1 << nShift;
+    const sal_Int32 nBlock = 
SW_MOD()->GetNavigationConfig()->GetSortAlphabeticallyBlock();
+    m_bAlphabeticSort = nBlock & nMask;
+
     FillMemberList();
 }
 
@@ -1739,10 +1746,12 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
         const ContentTypeId nContentType = pType->GetType();
 
         if (nContentType != ContentTypeId::FOOTNOTE && nContentType != 
ContentTypeId::ENDNOTE
-            && nContentType != ContentTypeId::POSTIT)
+            && nContentType != ContentTypeId::POSTIT && nContentType != 
ContentTypeId::UNKNOWN)
         {
             bRemoveSortEntry = false;
-            xPop->set_active("sort", pType->IsAlphabeticSort());
+            const sal_Int32 nMask = 1 << static_cast<int>(nContentType);
+            sal_uInt64 nSortAlphabeticallyBlock = 
m_pConfig->GetSortAlphabeticallyBlock();
+            xPop->set_active("sort", nSortAlphabeticallyBlock & nMask);
         }
 
         OUString aIdent;
@@ -4960,7 +4969,15 @@ void SwContentTree::ExecuteContextMenuAction(const 
OUString& rSelectedPopupEntry
             pCntType = weld::fromId<SwContentType*>(rId);
         else
             pCntType = 
const_cast<SwContentType*>(weld::fromId<SwContent*>(rId)->GetParent());
-        pCntType->SetAlphabeticSort(!pCntType->IsAlphabeticSort());
+
+        // toggle and persist alphabetical sort setting
+        const int nShift = static_cast<int>(pCntType->GetType());
+        assert(nShift > -1);
+        const sal_Int32 nMask = 1 << nShift;
+        const sal_Int32 nBlock = m_pConfig->GetSortAlphabeticallyBlock();
+        pCntType->SetAlphabeticSort(~nBlock & nMask);
+        m_pConfig->SetSortAlphabeticallyBlock(nBlock ^ nMask);
+
         pCntType->FillMemberList();
         Display(true);
         return;
diff --git a/sw/source/uibase/utlui/navicfg.cxx 
b/sw/source/uibase/utlui/navicfg.cxx
index 0170a8f68a97..dfda8827292f 100644
--- a/sw/source/uibase/utlui/navicfg.cxx
+++ b/sw/source/uibase/utlui/navicfg.cxx
@@ -74,7 +74,8 @@ Sequence<OUString> SwNavigationConfig::GetPropertyNames()
         OUString("FieldTracking"),
         OUString("FootnoteTracking"),
         OUString("EndnoteTracking"),
-        OUString("NavigateOnSelect")};
+        OUString("NavigateOnSelect"),
+        OUString("SortAlphabeticallyBlock")};
 }
 
 SwNavigationConfig::SwNavigationConfig() :
@@ -146,6 +147,7 @@ void SwNavigationConfig::Load()
                     break;
                 }
                 case 22: m_bIsNavigateOnSelect = 
*o3tl::doAccess<bool>(pValues[nProp]); break;
+                case 23: pValues[nProp] >>= m_nSortAlphabeticallyBlock; break;
             }
         }
     }
@@ -180,6 +182,7 @@ void SwNavigationConfig::ImplCommit()
                 break;
             }
             case 22: pValues[nProp] <<= m_bIsNavigateOnSelect; break;
+            case 23: pValues[nProp] <<= m_nSortAlphabeticallyBlock; break;
         }
     }
     PutProperties(aNames, aValues);

Reply via email to