summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-11-02 09:37:07 +0900
committerTomaž Vajngerl <quikee@gmail.com>2017-11-02 07:34:45 +0100
commitdc57c8ce3070b2a99ca312fbc349e6331b703ef7 (patch)
tree2fcc6176e24c3e3db4e333f72b645d6901f7fbf8 /svx
parentaa73ca2e5420dfceeccf19d7e2d5d4f367dd01da (diff)
TSCP: hide markings widgets if the list of markings is empty
Change-Id: I0d4a821935ef29b020409a34259a0c1fc487388f Reviewed-on: https://gerrit.libreoffice.org/44183 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx18
-rw-r--r--svx/uiconfig/ui/classificationdialog.ui2
2 files changed, 15 insertions, 5 deletions
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index 20dc952a47d1..df271dd1c5f2 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -131,6 +131,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
get(m_pRecentlyUsedListBox, "recentlyUsedCB");
get(m_pClassificationListBox, "classificationCB");
get(m_pInternationalClassificationListBox, "internationalClassificationCB");
+ get(m_pMarkingLabel, "markingLabel");
get(m_pMarkingListBox, "markingCB");
get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberCB");
get(m_pIntellectualPropertyPartListBox, "intellectualPropertyPartLB");
@@ -153,10 +154,18 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
m_pInternationalClassificationListBox->InsertEntry(rName);
m_pInternationalClassificationListBox->EnableAutoSize(true);
- m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl));
- for (const OUString& rName : maHelper.GetMarkings())
- m_pMarkingListBox->InsertEntry(rName);
- m_pMarkingListBox->EnableAutoSize(true);
+ if (!maHelper.GetMarkings().empty())
+ {
+ m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl));
+ for (const OUString& rName : maHelper.GetMarkings())
+ m_pMarkingListBox->InsertEntry(rName);
+ m_pMarkingListBox->EnableAutoSize(true);
+ }
+ else
+ {
+ m_pMarkingListBox->Show(false);
+ m_pMarkingLabel->Show(false);
+ }
m_pIntellectualPropertyPartNumberListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl));
for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers())
@@ -184,6 +193,7 @@ void ClassificationDialog::dispose()
m_pRecentlyUsedListBox.clear();
m_pClassificationListBox.clear();
m_pInternationalClassificationListBox.clear();
+ m_pMarkingLabel.clear();
m_pMarkingListBox.clear();
m_pIntellectualPropertyPartListBox.clear();
m_pIntellectualPropertyPartNumberListBox.clear();
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index e5a4788c3618..99d8bf88ad5a 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -163,7 +163,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="markingLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="classificationdialog|label-Marking">Marking:</property>