summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-05 21:01:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-19 12:09:25 +0100
commit97bbffc917deba872090667e9dc096ecec99d557 (patch)
tree672bff54843461ff30270a11b726c1a48eea50cd /sc
parent5b3592a42cc88a225237efadcc4d110be307303e (diff)
weld TreeView
a) use GtkTreeStores for GtkTreeViews b) ironically can't store GtkTreeStore contents in .ui apparently c) set show_expanders for all non-trees and unconverted cases d) on-demand subtrees Change-Id: I3c1036a222daba2c129b1a22ffeb3fe35005ae31 Reviewed-on: https://gerrit.libreoffice.org/63336 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/subtotals.hrc42
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx4
-rw-r--r--sc/uiconfig/scalc/ui/autoformattable.ui1
-rw-r--r--sc/uiconfig/scalc/ui/consolidatedialog.ui1
-rw-r--r--sc/uiconfig/scalc/ui/externaldata.ui2
-rw-r--r--sc/uiconfig/scalc/ui/functionpanel.ui1
-rw-r--r--sc/uiconfig/scalc/ui/insertsheet.ui2
-rw-r--r--sc/uiconfig/scalc/ui/movecopysheet.ui2
-rw-r--r--sc/uiconfig/scalc/ui/namerangesdialog.ui1
-rw-r--r--sc/uiconfig/scalc/ui/optsortlists.ui1
-rw-r--r--sc/uiconfig/scalc/ui/selectrange.ui2
-rw-r--r--sc/uiconfig/scalc/ui/showdetaildialog.ui2
-rw-r--r--sc/uiconfig/scalc/ui/showsheetdialog.ui2
-rw-r--r--sc/uiconfig/scalc/ui/subtotalgrppage.ui38
14 files changed, 59 insertions, 42 deletions
diff --git a/sc/inc/subtotals.hrc b/sc/inc/subtotals.hrc
new file mode 100644
index 000000000000..233d47fe122b
--- /dev/null
+++ b/sc/inc/subtotals.hrc
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SC_INC_SUBTOTALS_HRC
+#define INCLUDED_SC_INC_SUBTOTALS_HRC
+
+#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+
+const char* SCSTR_SUBTOTALS[] =
+{
+ NC_("subtotalgrppage|liststore1", "Sum"),
+ NC_("subtotalgrppage|liststore1", "Count"),
+ NC_("subtotalgrppage|liststore1", "Average"),
+ NC_("subtotalgrppage|liststore1", "Max"),
+ NC_("subtotalgrppage|liststore1", "Min"),
+ NC_("subtotalgrppage|liststore1", "Product"),
+ NC_("subtotalgrppage|liststore1", "Count (numbers only)"),
+ NC_("subtotalgrppage|liststore1", "StDev (Sample)"),
+ NC_("subtotalgrppage|liststore1", "StDevP (Population)"),
+ NC_("subtotalgrppage|liststore1", "Var (Sample)"),
+ NC_("subtotalgrppage|liststore1", "VarP (Population)")
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 36b1d8a28c15..8d02700b866b 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -28,6 +28,7 @@
#include <scresid.hxx>
#include <sc.hrc>
#include <strings.hrc>
+#include <subtotals.hrc>
#include <subtdlg.hxx>
#include <tpsubt.hxx>
@@ -54,6 +55,9 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent,
get(mpLbColumns, "columns");
get(mpLbFunctions, "functions");
+ for (size_t i = 0; i < SAL_N_ELEMENTS(SCSTR_SUBTOTALS); ++i)
+ mpLbFunctions->InsertEntry(ScResId(SCSTR_SUBTOTALS[i]));
+
long nHeight = mpLbColumns->GetTextHeight() * 14;
mpLbColumns->set_height_request(nHeight);
mpLbFunctions->set_height_request(nHeight);
diff --git a/sc/uiconfig/scalc/ui/autoformattable.ui b/sc/uiconfig/scalc/ui/autoformattable.ui
index cddccf1a4829..eedb29905b06 100644
--- a/sc/uiconfig/scalc/ui/autoformattable.ui
+++ b/sc/uiconfig/scalc/ui/autoformattable.ui
@@ -162,6 +162,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
diff --git a/sc/uiconfig/scalc/ui/consolidatedialog.ui b/sc/uiconfig/scalc/ui/consolidatedialog.ui
index a73e89941d30..384b5d2315b2 100644
--- a/sc/uiconfig/scalc/ui/consolidatedialog.ui
+++ b/sc/uiconfig/scalc/ui/consolidatedialog.ui
@@ -148,6 +148,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1">
<property name="mode">multiple</property>
diff --git a/sc/uiconfig/scalc/ui/externaldata.ui b/sc/uiconfig/scalc/ui/externaldata.ui
index 449cce77cd7e..5f43901249d6 100644
--- a/sc/uiconfig/scalc/ui/externaldata.ui
+++ b/sc/uiconfig/scalc/ui/externaldata.ui
@@ -9,7 +9,7 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/functionpanel.ui b/sc/uiconfig/scalc/ui/functionpanel.ui
index a6a7264210c2..2c8f2f290fd7 100644
--- a/sc/uiconfig/scalc/ui/functionpanel.ui
+++ b/sc/uiconfig/scalc/ui/functionpanel.ui
@@ -89,6 +89,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
diff --git a/sc/uiconfig/scalc/ui/insertsheet.ui b/sc/uiconfig/scalc/ui/insertsheet.ui
index 1df67c647a23..c6a54c82bbc9 100644
--- a/sc/uiconfig/scalc/ui/insertsheet.ui
+++ b/sc/uiconfig/scalc/ui/insertsheet.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/movecopysheet.ui b/sc/uiconfig/scalc/ui/movecopysheet.ui
index f3e21cc5b03e..1da0b27928e0 100644
--- a/sc/uiconfig/scalc/ui/movecopysheet.ui
+++ b/sc/uiconfig/scalc/ui/movecopysheet.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/namerangesdialog.ui b/sc/uiconfig/scalc/ui/namerangesdialog.ui
index 9f5588bb7936..667ed4afd5cb 100644
--- a/sc/uiconfig/scalc/ui/namerangesdialog.ui
+++ b/sc/uiconfig/scalc/ui/namerangesdialog.ui
@@ -281,6 +281,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
diff --git a/sc/uiconfig/scalc/ui/optsortlists.ui b/sc/uiconfig/scalc/ui/optsortlists.ui
index 3703245769ba..a471882ffd48 100644
--- a/sc/uiconfig/scalc/ui/optsortlists.ui
+++ b/sc/uiconfig/scalc/ui/optsortlists.ui
@@ -134,6 +134,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
diff --git a/sc/uiconfig/scalc/ui/selectrange.ui b/sc/uiconfig/scalc/ui/selectrange.ui
index 23944b5a0d44..752824034dfe 100644
--- a/sc/uiconfig/scalc/ui/selectrange.ui
+++ b/sc/uiconfig/scalc/ui/selectrange.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/showdetaildialog.ui b/sc/uiconfig/scalc/ui/showdetaildialog.ui
index 75b7257e1e6d..13fdb58fe1b0 100644
--- a/sc/uiconfig/scalc/ui/showdetaildialog.ui
+++ b/sc/uiconfig/scalc/ui/showdetaildialog.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/showsheetdialog.ui b/sc/uiconfig/scalc/ui/showsheetdialog.ui
index a88105542580..a26d15574fa3 100644
--- a/sc/uiconfig/scalc/ui/showsheetdialog.ui
+++ b/sc/uiconfig/scalc/ui/showsheetdialog.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
diff --git a/sc/uiconfig/scalc/ui/subtotalgrppage.ui b/sc/uiconfig/scalc/ui/subtotalgrppage.ui
index fffa2f758f48..add6750d55d0 100644
--- a/sc/uiconfig/scalc/ui/subtotalgrppage.ui
+++ b/sc/uiconfig/scalc/ui/subtotalgrppage.ui
@@ -2,46 +2,11 @@
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
- <data>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Sum</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Count</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Average</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Max</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Min</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Product</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Count (numbers only)</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">StDev (Sample)</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">StDevP (Population)</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">Var (Sample)</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="subtotalgrppage|liststore1">VarP (Population)</col>
- </row>
- </data>
</object>
<object class="GtkBox" id="SubTotalGrpPage">
<property name="visible">True</property>
@@ -152,6 +117,7 @@
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<property name="search_column">0</property>
+ <property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>