sc/inc/viewopti.hxx                |    4 -
 sc/source/core/tool/viewopti.cxx   |    4 +
 sc/source/ui/inc/tpview.hxx        |    2 
 sc/source/ui/optdlg/tpview.cxx     |   34 ----------------
 sc/source/ui/view/viewdata.cxx     |   17 --------
 sc/uiconfig/scalc/ui/tpviewpage.ui |   75 +++++--------------------------------
 6 files changed, 15 insertions(+), 121 deletions(-)

New commits:
commit 2039fd382af9d110bd68be8629ab757b3617926a
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Wed Mar 29 15:12:58 2023 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Tue Apr 4 10:53:56 2023 +0200

    Resolves tdf#154446 - Remove redundant option for grid line color
    
    Change-Id: I41d39b763e651f90660f2a451ed0a9b473ead206
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149715
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index cd641198753b..b90e1b65f076 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -59,10 +59,6 @@ enum ScVObjType
 #define MAX_OPT             sal_uInt16(VOPT_CLIPMARKS)+1
 #define MAX_TYPE            sal_uInt16(VOBJ_TYPE_DRAW)+1
 
-// SC_STD_GRIDCOLOR is obsolete since tdf#152184 since GridColor == COL_AUTO
-// converts now to either light or dark but still used on options > view > 
visual aids
-#define SC_STD_GRIDCOLOR    COL_LIGHTGRAY
-
 // SvxGrid options with standard operators
 
 class ScGridOptions : public SvxOptionsGrid
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 6079323f13e7..f243289653cd 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -22,6 +22,8 @@
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 
+#include <svtools/colorcfg.hxx>
+
 #include <global.hxx>
 #include <viewopti.hxx>
 #include <sc.hrc>
@@ -111,7 +113,7 @@ void ScViewOptions::SetDefaults()
     aModeArr[VOBJ_TYPE_CHART] = VOBJ_MODE_SHOW;
     aModeArr[VOBJ_TYPE_DRAW ] = VOBJ_MODE_SHOW;
 
-    aGridCol     = SC_STD_GRIDCOLOR;
+    aGridCol = svtools::ColorConfig().GetColorValue( svtools::CALCGRID 
).nColor;
 
     aGridOpt.SetDefaults();
 }
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index 7be90de5aceb..ad485b361580 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -29,8 +29,6 @@ class ScTpContentOptions : public SfxTabPage
     std::unique_ptr<ScViewOptions> m_xLocalOptions;
 
     std::unique_ptr<weld::ComboBox> m_xGridLB;
-    std::unique_ptr<weld::Label> m_xColorFT;
-    std::unique_ptr<ColorListBox> m_xColorLB;
     std::unique_ptr<weld::CheckButton> m_xBreakCB;
     std::unique_ptr<weld::CheckButton> m_xGuideLineCB;
 
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 926436864e79..f83ce9f033a5 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -30,15 +30,11 @@
 #include <appoptio.hxx>
 #include <scmod.hxx>
 #include <svl/eitem.hxx>
-#include <svx/colorbox.hxx>
 #include <svtools/unitconv.hxx>
 
 ScTpContentOptions::ScTpContentOptions(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet&  rArgSet)
     : SfxTabPage(pPage, pController, "modules/scalc/ui/tpviewpage.ui", 
"TpViewPage", &rArgSet)
     , m_xGridLB(m_xBuilder->weld_combo_box("grid"))
-    , m_xColorFT(m_xBuilder->weld_label("color_label"))
-    , m_xColorLB(new ColorListBox(m_xBuilder->weld_menu_button("color"),
-                [this]{ return GetDialogController()->getDialog(); }))
     , m_xBreakCB(m_xBuilder->weld_check_button("break"))
     , m_xGuideLineCB(m_xBuilder->weld_check_button("guideline"))
     , m_xFormulaCB(m_xBuilder->weld_check_button("formula"))
@@ -88,14 +84,10 @@ ScTpContentOptions::ScTpContentOptions(weld::Container* 
pPage, weld::DialogContr
     m_xRowColHeaderCB->connect_toggled(aCBHdl);
     m_xSummaryCB->connect_toggled(aCBHdl);
     m_xThemedCursorRB->connect_toggled(aCBHdl);
-
-    m_xColorLB->SetSlotId(SID_ATTR_CHAR_COLOR);
-    m_xColorLB->SetAutoDisplayColor(SC_STD_GRIDCOLOR);
 }
 
 ScTpContentOptions::~ScTpContentOptions()
 {
-    m_xColorLB.reset();
 }
 
 std::unique_ptr<SfxTabPage> ScTpContentOptions::Create( weld::Container* 
pPage, weld::DialogController* pController,
@@ -123,19 +115,11 @@ bool    ScTpContentOptions::FillItemSet( SfxItemSet* 
rCoreSet )
         m_xVScrollCB->get_state_changed_from_saved() ||
         m_xTblRegCB->get_state_changed_from_saved() ||
         m_xOutlineCB->get_state_changed_from_saved() ||
-        m_xColorLB->IsValueChangedFromSaved() ||
         m_xBreakCB->get_state_changed_from_saved() ||
         m_xSummaryCB->get_state_changed_from_saved() ||
         m_xThemedCursorRB->get_state_changed_from_saved() ||
         m_xGuideLineCB->get_state_changed_from_saved())
     {
-        NamedColor aNamedColor = m_xColorLB->GetSelectedEntry();
-        if (aNamedColor.first == COL_AUTO)
-        {
-            aNamedColor.first = SC_STD_GRIDCOLOR;
-            aNamedColor.second.clear();
-        }
-        m_xLocalOptions->SetGridColor(aNamedColor.first, aNamedColor.second);
         rCoreSet->Put(ScTpViewItem(*m_xLocalOptions));
         bRet = true;
     }
@@ -211,7 +195,6 @@ void    ScTpContentOptions::Reset( const SfxItemSet* 
rCoreSet )
     m_xTblRegCB->save_state();
     m_xOutlineCB->save_state();
     m_xGridLB->save_value();
-    m_xColorLB->SaveValue();
     m_xBreakCB->save_state();
     m_xGuideLineCB->save_state();
     m_xSummaryCB->save_state();
@@ -278,30 +261,15 @@ void ScTpContentOptions::InitGridOpt()
 
     if ( bGrid || bGridOnTop )
     {
-        m_xColorFT->set_sensitive(true);
-        m_xColorLB->set_sensitive(true);
         if ( !bGridOnTop )
             nSelPos = 0;
         else
             nSelPos = 1;
     }
     else
-    {
-        m_xColorFT->set_sensitive(false);
-        m_xColorLB->set_sensitive(false);
         nSelPos = 2;
-    }
 
     m_xGridLB->set_active (nSelPos);
-
-    //  select grid color entry
-    OUString  aName;
-    Color     aCol    = m_xLocalOptions->GetGridColor( &aName );
-
-    if (aName.trim().isEmpty() && aCol == SC_STD_GRIDCOLOR)
-        aCol = COL_AUTO;
-
-    m_xColorLB->SelectEntry(std::make_pair(aCol, aName));
 }
 
 IMPL_LINK( ScTpContentOptions, GridHdl, weld::ComboBox&, rLb, void )
@@ -310,8 +278,6 @@ IMPL_LINK( ScTpContentOptions, GridHdl, weld::ComboBox&, 
rLb, void )
     bool    bGrid = ( nSelPos <= 1 );
     bool    bGridOnTop = ( nSelPos == 1 );
 
-    m_xColorFT->set_sensitive(bGrid);
-    m_xColorLB->set_sensitive(bGrid);
     m_xLocalOptions->SetOption( VOPT_GRID, bGrid );
     m_xLocalOptions->SetOption( VOPT_GRID_ONTOP, bGridOnTop );
 }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e236256ce35d..936eb34d4805 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -3514,12 +3514,6 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& 
rDocOpt ) const
             const ScMarkData& rMarkData = GetMarkData();
             rTabSett.mbSelected = rMarkData.GetTableSelect( nTab );
             rMarkData.FillRangeListWithMarks( &rTabSett.maSelection, true );
-
-            // grid color
-            rTabSett.maGridColor = COL_AUTO;
-            const Color& rGridColor = maOptions.GetGridColor();
-            if (rGridColor != SC_STD_GRIDCOLOR)
-                rTabSett.maGridColor = rGridColor;
             rTabSett.mbShowGrid = pViewTab->bShowGrid;
 
             // view mode and zoom
@@ -3674,12 +3668,6 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& 
rDocOpt )
             // get some settings from displayed Excel sheet, set at Calc 
document
             if( nTab == GetTabNo() )
             {
-                // grid color -- #i47435# set automatic grid color explicitly
-                Color aGridColor(rTabSett.maGridColor);
-                if (aGridColor == COL_AUTO)
-                    aGridColor = SC_STD_GRIDCOLOR;
-                maOptions.SetGridColor(aGridColor, OUString());
-
                 // view mode and default zoom (for new sheets) from current 
sheet
                 if( rTabSett.mnNormalZoom )
                     aDefZoomX = aDefZoomY = Fraction( rTabSett.mnNormalZoom, 
100L );
@@ -3911,12 +3899,7 @@ void ScViewData::ReadUserDataSequence(const 
uno::Sequence <beans::PropertyValue>
         {
             Color aColor;
             if (rSetting.Value >>= aColor)
-            {
-                // #i47435# set automatic grid color explicitly
-                if( aColor == COL_AUTO )
-                    aColor = SC_STD_GRIDCOLOR;
                 maOptions.SetGridColor(aColor, OUString());
-            }
         }
         else if ( sName == SC_UNO_SHOWPAGEBR )
             maOptions.SetOption(VOPT_PAGEBREAKS, 
ScUnoHelpFunctions::GetBoolFromAny(rSetting.Value));
diff --git a/sc/uiconfig/scalc/ui/tpviewpage.ui 
b/sc/uiconfig/scalc/ui/tpviewpage.ui
index 8198a7ed5ec4..4e3f9806956c 100644
--- a/sc/uiconfig/scalc/ui/tpviewpage.ui
+++ b/sc/uiconfig/scalc/ui/tpviewpage.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkBox" id="TpViewPage">
@@ -20,7 +20,7 @@
             <property name="label-xalign">0</property>
             <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=1 n-rows=7 -->
+              <!-- n-columns=1 n-rows=8 -->
               <object class="GtkGrid" id="grid6">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
@@ -373,13 +373,14 @@
             <property name="label-xalign">0</property>
             <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=3 n-rows=5 -->
+              <!-- n-columns=3 n-rows=4 -->
               <object class="GtkGrid" id="grid5">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="margin-start">12</property>
                 <property name="margin-top">6</property>
                 <property name="row-spacing">3</property>
+                <property name="column-spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="break">
                     <property name="label" translatable="yes" 
context="tpviewpage|break">_Page breaks</property>
@@ -396,7 +397,7 @@
                   </object>
                   <packing>
                     <property name="left-attach">0</property>
-                    <property name="top-attach">3</property>
+                    <property name="top-attach">2</property>
                     <property name="width">3</property>
                   </packing>
                 </child>
@@ -416,7 +417,7 @@
                   </object>
                   <packing>
                     <property name="left-attach">0</property>
-                    <property name="top-attach">4</property>
+                    <property name="top-attach">3</property>
                     <property name="width">3</property>
                   </packing>
                 </child>
@@ -426,6 +427,7 @@
                     <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="tpviewpage|grid_label">_Grid lines:</property>
                     <property name="use-underline">True</property>
+                    <property name="mnemonic-widget">grid</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -433,19 +435,6 @@
                     <property name="top-attach">0</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkLabel" id="color_label">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="label" translatable="yes" 
context="tpviewpage|color_label">_Color:</property>
-                    <property name="use-underline">True</property>
-                    <property name="xalign">0</property>
-                  </object>
-                  <packing>
-                    <property name="left-attach">0</property>
-                    <property name="top-attach">1</property>
-                  </packing>
-                </child>
                 <child>
                   <object class="GtkComboBoxText" id="grid">
                     <property name="visible">True</property>
@@ -467,29 +456,6 @@
                     <property name="width">2</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkMenuButton" id="color">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="receives-default">False</property>
-                    <property name="xalign">0</property>
-                    <property name="draw-indicator">True</property>
-                    <property name="label" translatable="no"></property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child internal-child="accessible">
-                      <object class="AtkObject" id="color-atkobject">
-                        <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|color">Specifies a color for the grid 
lines in the current document.</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left-attach">1</property>
-                    <property name="top-attach">1</property>
-                    <property name="width">2</property>
-                  </packing>
-                </child>
                 <child>
                   <object class="GtkLabel" id="lbCursor">
                     <property name="visible">True</property>
@@ -501,7 +467,7 @@
                   </object>
                   <packing>
                     <property name="left-attach">0</property>
-                    <property name="top-attach">2</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
@@ -517,7 +483,7 @@
                   </object>
                   <packing>
                     <property name="left-attach">1</property>
-                    <property name="top-attach">2</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
                 <child>
@@ -533,7 +499,7 @@
                   </object>
                   <packing>
                     <property name="left-attach">2</property>
-                    <property name="top-attach">2</property>
+                    <property name="top-attach">1</property>
                   </packing>
                 </child>
               </object>
@@ -702,23 +668,6 @@
       </object>
     </child>
   </object>
-  <object class="GtkSizeGroup" id="sizegroupLabel">
-    <widgets>
-      <widget name="grid_label"/>
-      <widget name="color_label"/>
-      <widget name="objgrf_label"/>
-      <widget name="diagram_label"/>
-      <widget name="draw_label"/>
-      <widget name="lbCursor"/>
-    </widgets>
-  </object>
-  <object class="GtkSizeGroup" id="sizegroupWidget">
-    <widgets>
-      <widget name="grid"/>
-      <widget name="color"/>
-      <widget name="objgrf"/>
-      <widget name="diagram"/>
-      <widget name="draw"/>
-    </widgets>
-  </object>
+  <object class="GtkSizeGroup" id="sizegroupLabel"/>
+  <object class="GtkSizeGroup" id="sizegroupWidget"/>
 </interface>

Reply via email to