summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-05-16 08:19:55 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-05-16 15:26:22 +0200
commit92254b0a2feeb6326796e3f93c289db829eed896 (patch)
tree76bac36ca9c45e5f258f7d39d918a64432d49c5a
parente6cca743556c2135d5e381cdbd883e937221eef9 (diff)
sw content controls, dropdown: edit list items in the properties dialog
- add a weld::TreeView to show existing display name - value pairs - add a button to add a new list item, together with a new SwContentControlListItemDlg to specify the list item properties + write the changed list back to the doc model Change-Id: I9243be84eb0af65437eccfb48c6780787609bc68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134379 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--sw/Library_swui.mk1
-rw-r--r--sw/UIConfig_swriter.mk3
-rw-r--r--sw/inc/formatcontentcontrol.hxx11
-rw-r--r--sw/inc/swabstdlg.hxx16
-rw-r--r--sw/source/core/txtnode/attrcontentcontrol.cxx5
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx14
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx24
-rw-r--r--sw/source/ui/misc/contentcontroldlg.cxx72
-rw-r--r--sw/source/ui/misc/contentcontrollistitemdlg.cxx46
-rw-r--r--sw/source/uibase/inc/contentcontroldlg.hxx7
-rw-r--r--sw/source/uibase/inc/contentcontrollistitemdlg.hxx40
-rw-r--r--sw/uiconfig/swriter/ui/contentcontroldlg.ui145
-rw-r--r--sw/uiconfig/swriter/ui/contentcontrollistitemdlg.ui168
13 files changed, 547 insertions, 5 deletions
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index dda2d5b54682..ba69e5eadaea 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -140,6 +140,7 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
sw/source/ui/index/swuiidxmrk \
sw/source/ui/misc/bookmark \
sw/source/ui/misc/contentcontroldlg \
+ sw/source/ui/misc/contentcontrollistitemdlg \
sw/source/ui/misc/docfnote \
sw/source/ui/misc/glosbib \
sw/source/ui/misc/glossary \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 4278b5f30437..012d86008b39 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -118,11 +118,12 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/columndialog \
sw/uiconfig/swriter/ui/columnpage \
sw/uiconfig/swriter/ui/columnwidth \
- sw/uiconfig/swriter/ui/contentcontroldlg \
sw/uiconfig/swriter/ui/combobox \
sw/uiconfig/swriter/ui/comboboxfragment \
sw/uiconfig/swriter/ui/conditionpage \
+ sw/uiconfig/swriter/ui/contentcontroldlg \
sw/uiconfig/swriter/ui/contentcontroldropdown \
+ sw/uiconfig/swriter/ui/contentcontrollistitemdlg \
sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/createaddresslist \
sw/uiconfig/swriter/ui/createauthorentry \
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index adf20db09162..da7cc89d591e 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -27,6 +27,7 @@
#include <svl/poolitem.hxx>
#include "calbck.hxx"
+#include "swdllapi.h"
class SwContentControl;
class SwTextContentControl;
@@ -41,7 +42,7 @@ enum class SwContentControlType
};
/// SfxPoolItem subclass that wraps an SwContentControl.
-class SAL_DLLPUBLIC_RTTI SwFormatContentControl final : public SfxPoolItem
+class SW_DLLPUBLIC SwFormatContentControl final : public SfxPoolItem
{
std::shared_ptr<SwContentControl> m_pContentControl;
SwTextContentControl* m_pTextAttr;
@@ -76,16 +77,20 @@ public:
};
/// Represents one list item in a content control dropdown list.
-class SwContentControlListItem
+class SW_DLLPUBLIC SwContentControlListItem
{
public:
+ /// This may be empty, ToString() falls back to m_aValue.
OUString m_aDisplayText;
+ /// This must not be empty.
OUString m_aValue;
void dumpAsXml(xmlTextWriterPtr pWriter) const;
OUString ToString() const;
+ bool operator==(const SwContentControlListItem& rOther) const;
+
static void ItemsToAny(const std::vector<SwContentControlListItem>& rItems,
css::uno::Any& rVal);
@@ -93,7 +98,7 @@ public:
};
/// Stores the properties of a content control.
-class SAL_DLLPUBLIC_RTTI SwContentControl : public sw::BroadcastingModify
+class SW_DLLPUBLIC SwContentControl : public sw::BroadcastingModify
{
css::uno::WeakReference<css::text::XTextContent> m_wXContentControl;
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 52964ba91177..f3ab3c820d37 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -61,6 +61,7 @@ enum class SwBorderModes;
enum class SwCharDlgMode;
enum class SfxStyleFamily;
enum class SwLineBreakClear;
+class SwContentControlListItem;
namespace com::sun::star{
namespace frame{
@@ -339,6 +340,18 @@ public:
css::uno::Reference< css::container::XNameAccess > & xThird ) = 0;
};
+/**
+ * Interface for e.g. the form -> content control -> properties -> add dialog. It's implemented by
+ * AbstractSwContentControlListItemDlg_Impl, but SwContentControlDlg only knows about this interface
+ * and the SwAbstractDialogFactory::CreateSwContentControlListItemDlg() factory.
+ */
+class AbstractSwContentControlListItemDlg : public VclAbstractDialog
+{
+protected:
+ virtual ~AbstractSwContentControlListItemDlg() override = default;
+public:
+};
+
class AbstractSwModalRedlineAcceptDlg : public VclAbstractDialog
{
protected:
@@ -391,6 +404,9 @@ public:
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwContentControlDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
+ virtual VclPtr<AbstractSwContentControlListItemDlg>
+ CreateSwContentControlListItemDlg(weld::Window* pParent, SwContentControlListItem& rItem) = 0;
+
virtual std::shared_ptr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwChangeDBDlg(SwView& rVw) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx b/sw/source/core/txtnode/attrcontentcontrol.cxx
index fd98947e3458..c249adffd819 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -256,6 +256,11 @@ OUString SwContentControlListItem::ToString() const
return m_aValue;
}
+bool SwContentControlListItem::operator==(const SwContentControlListItem& rOther) const
+{
+ return m_aDisplayText == rOther.m_aDisplayText && m_aValue == rOther.m_aValue;
+}
+
void SwContentControlListItem::ItemsToAny(const std::vector<SwContentControlListItem>& rItems,
uno::Any& rVal)
{
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 01795a8ff001..cac21458ef9f 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -34,6 +34,7 @@
#include <chrdlg.hxx>
#include <colwd.hxx>
#include <contentcontroldlg.hxx>
+#include <contentcontrollistitemdlg.hxx>
#include <convert.hxx>
#include <cption.hxx>
#include <dbinsdlg.hxx>
@@ -208,6 +209,11 @@ short AbstractSwRenameXNamedDlg_Impl::Execute()
return m_xDlg->run();
}
+short AbstractSwContentControlListItemDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
short AbstractSwModalRedlineAcceptDlg_Impl::Execute()
{
return m_xDlg->run();
@@ -841,6 +847,14 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwContentControlDl
return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwContentControlDlg>(pParent, rSh));
}
+VclPtr<AbstractSwContentControlListItemDlg>
+SwAbstractDialogFactory_Impl::CreateSwContentControlListItemDlg(weld::Window* pParent,
+ SwContentControlListItem& rItem)
+{
+ return VclPtr<AbstractSwContentControlListItemDlg_Impl>::Create(
+ std::make_unique<SwContentControlListItemDlg>(pParent, rItem));
+}
+
std::shared_ptr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld::Window* pParent, SwWrtShell &rSh)
{
return std::make_shared<AbstractSwBreakDlg_Impl>(std::make_unique<SwBreakDlg>(pParent, rSh));
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 6eb68355762c..8690d9db8129 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -25,6 +25,7 @@
#include <ascfldlg.hxx>
#include <cnttab.hxx>
#include <colwd.hxx>
+#include <contentcontrollistitemdlg.hxx>
#include <convert.hxx>
#include <DateFormFieldDialog.hxx>
#include <dbinsdlg.hxx>
@@ -409,6 +410,24 @@ public:
css::uno::Reference< css::container::XNameAccess > & xThird ) override;
};
+/**
+ * Implementation of AbstractSwContentControlListItemDlg, that is only visible to
+ * SwAbstractDialogFactory_Impl::CreateSwContentControlListItemDlg().
+ */
+class AbstractSwContentControlListItemDlg_Impl : public AbstractSwContentControlListItemDlg
+{
+ std::unique_ptr<SwContentControlListItemDlg> m_xDlg;
+
+public:
+ explicit AbstractSwContentControlListItemDlg_Impl(
+ std::unique_ptr<SwContentControlListItemDlg> xDlg)
+ : m_xDlg(std::move(xDlg))
+ {
+ }
+
+ short Execute() override;
+};
+
class AbstractSwModalRedlineAcceptDlg_Impl : public AbstractSwModalRedlineAcceptDlg
{
std::unique_ptr<SwModalRedlineAcceptDlg> m_xDlg;
@@ -659,6 +678,11 @@ public:
SvStream* pStream) override;
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh) override;
virtual VclPtr<VclAbstractDialog> CreateSwContentControlDlg(weld::Window *pParent, SwWrtShell &rSh) override;
+
+ VclPtr<AbstractSwContentControlListItemDlg>
+ CreateSwContentControlListItemDlg(weld::Window* pParent,
+ SwContentControlListItem& rItem) override;
+
virtual std::shared_ptr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) override;
virtual VclPtr<VclAbstractDialog> CreateSwChangeDBDlg(SwView& rVw) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
diff --git a/sw/source/ui/misc/contentcontroldlg.cxx b/sw/source/ui/misc/contentcontroldlg.cxx
index d18c3077f24d..7a066fb80d22 100644
--- a/sw/source/ui/misc/contentcontroldlg.cxx
+++ b/sw/source/ui/misc/contentcontroldlg.cxx
@@ -25,6 +25,7 @@
#include <ndtxt.hxx>
#include <textcontentcontrol.hxx>
#include <IDocumentState.hxx>
+#include <swuiexp.hxx>
using namespace com::sun::star;
@@ -33,10 +34,19 @@ SwContentControlDlg::SwContentControlDlg(weld::Window* pParent, SwWrtShell& rWrt
"ContentControlDialog")
, m_rWrtShell(rWrtShell)
, m_xShowingPlaceHolderCB(m_xBuilder->weld_check_button("showing_place_holder"))
+ , m_xListItemsFrame(m_xBuilder->weld_frame("listitemsframe"))
+ , m_xListItems(m_xBuilder->weld_tree_view("listitems"))
+ , m_xListItemButtons(m_xBuilder->weld_box("listitembuttons"))
+ , m_xInsertBtn(m_xBuilder->weld_button("add"))
, m_xOk(m_xBuilder->weld_button("ok"))
{
m_xOk->connect_clicked(LINK(this, SwContentControlDlg, OkHdl));
+ // Only 2 items would be visible by default.
+ m_xListItems->set_size_request(-1, m_xListItems->get_height_rows(8));
+
+ m_xInsertBtn->connect_clicked(LINK(this, SwContentControlDlg, InsertHdl));
+
const SwPosition* pStart = rWrtShell.GetCursor()->Start();
SwTextNode* pTextNode = pStart->nNode.GetNode().GetTextNode();
if (!pTextNode)
@@ -59,12 +69,33 @@ SwContentControlDlg::SwContentControlDlg(weld::Window* pParent, SwWrtShell& rWrt
TriState eShowingPlaceHolder = bShowingPlaceHolder ? TRISTATE_TRUE : TRISTATE_FALSE;
m_xShowingPlaceHolderCB->set_state(eShowingPlaceHolder);
m_xShowingPlaceHolderCB->save_state();
+
+ if (m_pContentControl->HasListItems())
+ {
+ for (const auto& rListItem : m_pContentControl->GetListItems())
+ {
+ int nRow = m_xListItems->n_children();
+ m_xListItems->append_text(rListItem.m_aDisplayText);
+ m_xListItems->set_text(nRow, rListItem.m_aValue, 1);
+ }
+ m_aSavedListItems = m_pContentControl->GetListItems();
+ }
+ else
+ {
+ m_xListItemsFrame->set_visible(false);
+ m_xListItemButtons->set_visible(false);
+ }
}
SwContentControlDlg::~SwContentControlDlg() {}
IMPL_LINK_NOARG(SwContentControlDlg, OkHdl, weld::Button&, void)
{
+ if (!m_pContentControl)
+ {
+ return;
+ }
+
bool bChanged = false;
if (m_xShowingPlaceHolderCB->get_state_changed_from_saved())
{
@@ -73,6 +104,20 @@ IMPL_LINK_NOARG(SwContentControlDlg, OkHdl, weld::Button&, void)
bChanged = true;
}
+ std::vector<SwContentControlListItem> aItems;
+ for (int i = 0; i < m_xListItems->n_children(); ++i)
+ {
+ SwContentControlListItem aItem;
+ aItem.m_aDisplayText = m_xListItems->get_text(i, 0);
+ aItem.m_aValue = m_xListItems->get_text(i, 1);
+ aItems.push_back(aItem);
+ }
+ if (aItems != m_aSavedListItems)
+ {
+ m_pContentControl->SetListItems(aItems);
+ bChanged = true;
+ }
+
if (bChanged)
{
m_rWrtShell.GetDoc()->getIDocumentState().SetModified();
@@ -81,4 +126,31 @@ IMPL_LINK_NOARG(SwContentControlDlg, OkHdl, weld::Button&, void)
m_xDialog->response(RET_OK);
}
+IMPL_LINK_NOARG(SwContentControlDlg, InsertHdl, weld::Button&, void)
+{
+ SwContentControlListItem aItem;
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
+ ScopedVclPtr<VclAbstractDialog> pDlg(
+ rFact.CreateSwContentControlListItemDlg(m_xDialog.get(), aItem));
+ if (!pDlg->Execute())
+ {
+ return;
+ }
+
+ if (aItem.m_aDisplayText.isEmpty() && aItem.m_aValue.isEmpty())
+ {
+ // Maintain the invariant that value can't be empty.
+ return;
+ }
+
+ if (aItem.m_aValue.isEmpty())
+ {
+ aItem.m_aValue = aItem.m_aDisplayText;
+ }
+
+ int nRow = m_xListItems->n_children();
+ m_xListItems->append_text(aItem.m_aDisplayText);
+ m_xListItems->set_text(nRow, aItem.m_aValue, 1);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/contentcontrollistitemdlg.cxx b/sw/source/ui/misc/contentcontrollistitemdlg.cxx
new file mode 100644
index 000000000000..ca6716b7b770
--- /dev/null
+++ b/sw/source/ui/misc/contentcontrollistitemdlg.cxx
@@ -0,0 +1,46 @@
+/* -*- 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 .
+ */
+
+#include <contentcontrollistitemdlg.hxx>
+
+#include <formatcontentcontrol.hxx>
+
+using namespace com::sun::star;
+
+SwContentControlListItemDlg::SwContentControlListItemDlg(weld::Widget* pParent,
+ SwContentControlListItem& rItem)
+ : GenericDialogController(pParent, "modules/swriter/ui/contentcontrollistitemdlg.ui",
+ "ContentControlListItemDialog")
+ , m_rItem(rItem)
+ , m_xDisplayNameED(m_xBuilder->weld_entry("displayname"))
+ , m_xValueED(m_xBuilder->weld_entry("value"))
+ , m_xOk(m_xBuilder->weld_button("ok"))
+{
+ m_xOk->connect_clicked(LINK(this, SwContentControlListItemDlg, OkHdl));
+}
+
+IMPL_LINK_NOARG(SwContentControlListItemDlg, OkHdl, weld::Button&, void)
+{
+ m_rItem.m_aDisplayText = m_xDisplayNameED->get_text();
+ m_rItem.m_aValue = m_xValueED->get_text();
+
+ m_xDialog->response(RET_OK);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/contentcontroldlg.hxx b/sw/source/uibase/inc/contentcontroldlg.hxx
index 6b354a39e7c4..45a6659b4fbf 100644
--- a/sw/source/uibase/inc/contentcontroldlg.hxx
+++ b/sw/source/uibase/inc/contentcontroldlg.hxx
@@ -23,6 +23,7 @@
class SwWrtShell;
class SwContentControl;
+class SwContentControlListItem;
/**
* The content control dialog allows editing the properties of the content control under the
@@ -32,10 +33,16 @@ class SwContentControlDlg final : public SfxDialogController
{
SwWrtShell& m_rWrtShell;
std::shared_ptr<SwContentControl> m_pContentControl;
+ std::vector<SwContentControlListItem> m_aSavedListItems;
std::unique_ptr<weld::CheckButton> m_xShowingPlaceHolderCB;
+ std::unique_ptr<weld::Frame> m_xListItemsFrame;
+ std::unique_ptr<weld::TreeView> m_xListItems;
+ std::unique_ptr<weld::Box> m_xListItemButtons;
+ std::unique_ptr<weld::Button> m_xInsertBtn;
std::unique_ptr<weld::Button> m_xOk;
+ DECL_LINK(InsertHdl, weld::Button&, void);
DECL_LINK(OkHdl, weld::Button&, void);
public:
diff --git a/sw/source/uibase/inc/contentcontrollistitemdlg.hxx b/sw/source/uibase/inc/contentcontrollistitemdlg.hxx
new file mode 100644
index 000000000000..2367de4847b4
--- /dev/null
+++ b/sw/source/uibase/inc/contentcontrollistitemdlg.hxx
@@ -0,0 +1,40 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <vcl/weld.hxx>
+
+class SwContentControlListItem;
+
+/// Edits the properties of a sing list item in a (drop-down) content control.
+class SwContentControlListItemDlg final : public weld::GenericDialogController
+{
+ SwContentControlListItem& m_rItem;
+
+ std::unique_ptr<weld::Entry> m_xDisplayNameED;
+ std::unique_ptr<weld::Entry> m_xValueED;
+ std::unique_ptr<weld::Button> m_xOk;
+
+ DECL_LINK(OkHdl, weld::Button&, void);
+
+public:
+ SwContentControlListItemDlg(weld::Widget* pParent, SwContentControlListItem& rItem);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/swriter/ui/contentcontroldlg.ui b/sw/uiconfig/swriter/ui/contentcontroldlg.ui
index 5ac95091d71c..4a1eb810a75c 100644
--- a/sw/uiconfig/swriter/ui/contentcontroldlg.ui
+++ b/sw/uiconfig/swriter/ui/contentcontroldlg.ui
@@ -2,6 +2,16 @@
<!-- Generated with glade 3.38.2 -->
<interface domain="sw">
<requires lib="gtk+" version="3.20"/>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkDialog" id="ContentControlDialog">
<property name="can-focus">False</property>
<property name="border-width">6</property>
@@ -69,7 +79,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -102,6 +112,139 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="listitemsframe">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkTreeView" id="listitems">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="hexpand">True</property>
+ <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"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn0">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="contentcontroldlg|displayname">Display Name</property>
+ <property name="clickable">False</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer0"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="contentcontroldlg|value">Value</property>
+ <property name="clickable">False</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="lblistitems">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="contentcontordlg|listitems">List Items:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">listitems</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="listitembuttons">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="add">
+ <property name="label" translatable="yes" context="contentcontordlg|add">Add</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack-type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="remove">
+ <property name="label" translatable="yes" context="contentcontordlg|remove">Remove</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack-type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="modify">
+ <property name="label" translatable="yes" context="contentcontordlg|modify">Modify</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack-type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
<action-widgets>
diff --git a/sw/uiconfig/swriter/ui/contentcontrollistitemdlg.ui b/sw/uiconfig/swriter/ui/contentcontrollistitemdlg.ui
new file mode 100644
index 000000000000..8d580179be50
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/contentcontrollistitemdlg.ui
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.36.0 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="ContentControlListItemDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" context="contentcontrollistitemdlg|ContentControlListItemDialog">Content Control List Item Properties</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <!-- n-columns=2 n-rows=2 -->
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
+ <child>
+ <object class="GtkLabel" id="lbdisplayname">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="contentcontrollistitemdlg|lbdisplayname">Display name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">displayname</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="displayname">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lbvalue">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="contentcontrollistitemdlg|lbvalue">Value:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">value</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="GtkEntry" id="value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
+ </object>
+</interface>