desktop/source/lib/init.cxx                                  |   11 --
 include/sfx2/sidebar/SidebarController.hxx                   |    1 
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |   46 +++--------
 sfx2/source/sidebar/Context.cxx                              |    9 --
 sfx2/source/sidebar/SidebarController.cxx                    |    4 
 5 files changed, 19 insertions(+), 52 deletions(-)

New commits:
commit 2493e90ef3b955a06c80ecb5e5f6b4173b5b71ef
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Apr 21 15:14:49 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jun 5 07:33:48 2022 +0200

    Drop special-casing for Chart's sidebar property deck
    
    Introduced in commit b33b2afe6a8b4224450da7c686beb81dbf5cd24a
      Author Markus Mohrhard <markus.mohrh...@googlemail.com>
      Date   Thu Jul 09 20:39:06 2015 +0200
        big step towards real chart sidebar
    
    later in commit da57c32c5cb27eee38e32d10232b31d459c399df
      Author Tor Lillqvist <t...@collabora.com>
      Date   Fri Feb 28 17:02:30 2020 +0200
        tdf#130348: Add special case for ChartDeck, too
    
    and then in commit ff23d87cb00388095a94b90e061564fc179e1823
      Author Mert Tumer <mert.tu...@collabora.com>
      Date   Fri May 08 17:23:12 2020 +0300
        mobile: fix calc chart wizard properties is not shown
    
    The normal PropertyDeck can host all the chart-specific panels,
    and the other decks that had "all" application context, but are
    not needed for charts, have their context fixed.
    
    This cleanup is needed for a following introduction of sidebar
    in Math.
    
    Change-Id: I5bb24d52b8dec2133213d7dddfeb91359ed4cb4b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133262
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135395
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index db0fc5145fe9..3a72be64a139 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -877,22 +877,13 @@ void setupSidebar(std::u16string_view sidebarDeckId = u"")
         if (!pDockingWin)
             return;
 
-        OUString currentDeckId = 
pDockingWin->GetSidebarController()->GetCurrentDeckId();
-
-        // check if it is the chart deck id, if it is, don't switch to default 
deck
-        bool switchToDefault = true;
-
-        if (currentDeckId == "ChartDeck")
-            switchToDefault = false;
-
         if (!sidebarDeckId.empty())
         {
             pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId);
         }
         else
         {
-            if (switchToDefault)
-                pDockingWin->GetSidebarController()->SwitchToDefaultDeck();
+            pDockingWin->GetSidebarController()->SwitchToDefaultDeck();
         }
 
         pDockingWin->SyncUpdate();
diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index 0a09f993dbad..9aea16754399 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -135,7 +135,6 @@ public:
     FocusManager& GetFocusManager() { return maFocusManager;}
 
     ResourceManager* GetResourceManager() { return mpResourceManager.get();}
-    auto& GetCurrentDeckId() const { return msCurrentDeckId; }
 
    // std::unique_ptr<ResourceManager> GetResourceManager() { return 
mpResourceManager;}
 
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 69ade7054af8..086c745c9d82 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -114,7 +114,9 @@
         </prop>
         <prop oor:name="ContextList">
           <value oor:separator=";">
-            any, any, visible ;
+            Calc,           any, visible;
+            DrawImpress,    any, visible;
+            WriterVariants, any, visible;
           </value>
         </prop>
         <prop oor:name="OrderIndex" oor:type="xs:int">
@@ -194,7 +196,9 @@
         </prop>
         <prop oor:name="ContextList">
           <value oor:separator=";">
-            any, any, visible ;
+            Calc,           any, visible;
+            DrawImpress,    any, visible;
+            WriterVariants, any, visible;
           </value>
         </prop>
         <prop oor:name="OrderIndex" oor:type="xs:int">
@@ -214,7 +218,9 @@
         </prop>
         <prop oor:name="ContextList">
           <value oor:separator=";">
-            any, any, visible ;
+            Calc,           any, visible;
+            DrawImpress,    any, visible;
+            WriterVariants, any, visible;
           </value>
         </prop>
         <prop oor:name="OrderIndex" oor:type="xs:int">
@@ -292,26 +298,6 @@
         </prop>
       </node>
 
-      <node oor:name="ChartDeck" oor:op="replace">
-        <prop oor:name="Title" oor:type="xs:string">
-          <value xml:lang="en-US">Properties</value>
-        </prop>
-        <prop oor:name="Id" oor:type="xs:string">
-          <value>ChartDeck</value>
-        </prop>
-        <prop oor:name="IconURL" oor:type="xs:string">
-          
<value>private:graphicrepository/sfx2/res/symphony/sidebar-property-large.png</value>
-        </prop>
-        <prop oor:name="ContextList">
-          <value oor:separator=";">
-            Chart, any, visible ;
-          </value>
-        </prop>
-        <prop oor:name="OrderIndex" oor:type="xs:int">
-          <value>10</value>
-        </prop>
-      </node>
-
     </node>
     <node oor:name="PanelList">
 
@@ -1649,7 +1635,7 @@
           <value>ChartElementsPanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="ContextList">
           <value oor:separator=";">
@@ -1675,7 +1661,7 @@
           <value>ChartSeriesPanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="DefaultMenuCommand">
           <value>.uno:ChartProperties</value>
@@ -1704,7 +1690,7 @@
           <value>ChartErrorBarPanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="DefaultMenuCommand">
           <value>.uno:ChartProperties</value>
@@ -1733,7 +1719,7 @@
           <value>ChartAxisPanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="DefaultMenuCommand">
           <value>.uno:ChartProperties</value>
@@ -1762,7 +1748,7 @@
           <value>ChartAreaPanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="DefaultMenuCommand">
           <value>.uno:ChartProperties</value>
@@ -1792,7 +1778,7 @@
           <value>ChartLinePanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="DefaultMenuCommand">
           <value>.uno:ChartProperties</value>
@@ -1858,7 +1844,7 @@
           <value>ChartTypePanel</value>
         </prop>
         <prop oor:name="DeckId" oor:type="xs:string">
-          <value>ChartDeck</value>
+          <value>PropertyDeck</value>
         </prop>
         <prop oor:name="ContextList">
           <value oor:separator=";">
diff --git a/sfx2/source/sidebar/Context.cxx b/sfx2/source/sidebar/Context.cxx
index 8a254ebbe2f7..2065fbd0473b 100644
--- a/sfx2/source/sidebar/Context.cxx
+++ b/sfx2/source/sidebar/Context.cxx
@@ -46,14 +46,7 @@ Context::Context (
 sal_Int32 Context::EvaluateMatch (
     const Context& rOther) const
 {
-    bool bApplicationNameIsAny (rOther.msApplication == AnyApplicationName);
-
-    // special case for charts which use a whole own set of decks
-    if (msApplication == "com.sun.star.chart2.ChartDocument")
-    {
-        bApplicationNameIsAny = false;
-    }
-
+    const bool bApplicationNameIsAny (rOther.msApplication == 
AnyApplicationName);
     if (rOther.msApplication == msApplication || bApplicationNameIsAny)
     {
         // Application name matches.
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 279b602cb2a6..1973650a20a1 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -470,9 +470,7 @@ void SidebarController::NotifyResize()
                 // it's the PropertyDeck that really has many panes
                 // that can collapse or expand. For others, limit
                 // the height to something sensible.
-                // tdf#130348: Add special case for ChartDeck, too.
-                const sal_Int32 nExtHeight = (msCurrentDeckId == 
"PropertyDeck" ? 2000 :
-                                              (msCurrentDeckId == "ChartDeck" 
? 1200 : 600));
+                const sal_Int32 nExtHeight = (msCurrentDeckId == 
"PropertyDeck" ? 2000 : 600);
                 // No TabBar in LOK (use nWidth in full).
                 mpCurrentDeck->setPosSizePixel(nDeckX, 0, nWidth, nExtHeight);
             }

Reply via email to