summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-10-23 18:19:23 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-11-04 17:51:58 +0100
commita981e7e30bfc26275954c1ddb1bae2397200c9f3 (patch)
tree42a643060d91c12fe9ed8d1647cc5a16b74d2114 /sw/source
parente6ae619a59e9447da84f7f5fed77cbaa9f86edae (diff)
Add new 'Table' sidebar panel to Writer
This is the initial layout of the panel. It does not functional yet. Reviewed-on: https://gerrit.libreoffice.org/81893 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 83658678e69ba83979c659e37fd3c950942139f9) Change-Id: Idd67ed921b71559bb704ef50cbfa97013fb80d6b Reviewed-on: https://gerrit.libreoffice.org/82024 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx7
-rw-r--r--sw/source/uibase/sidebar/TableEditPanel.cxx48
-rw-r--r--sw/source/uibase/sidebar/TableEditPanel.hxx43
3 files changed, 98 insertions, 0 deletions
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 9fe8ccc143c9..f188be4da86a 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -26,6 +26,7 @@
#include "PageHeaderPanel.hxx"
#include "PageFooterPanel.hxx"
#include "WrapPropertyPanel.hxx"
+#include "TableEditPanel.hxx"
#include <navipi.hxx>
#include <redlndlg.hxx>
@@ -182,6 +183,12 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
}
+ else if (rsResourceURL.endsWith("/TableEditPanel"))
+ {
+ VclPtr<vcl::Window> pPanel = sw::sidebar::TableEditPanel::Create(pParentWindow, xFrame);
+ xElement = sfx2::sidebar::SidebarPanelBase::Create(
+ rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
+ }
return xElement;
}
diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx
new file mode 100644
index 000000000000..811ffdfdfb0e
--- /dev/null
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -0,0 +1,48 @@
+/* -*- 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/.
+ *
+ */
+
+#include <sal/config.h>
+#include "TableEditPanel.hxx"
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+
+namespace sw
+{
+namespace sidebar
+{
+VclPtr<vcl::Window> TableEditPanel::Create(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+{
+ if (pParent == nullptr)
+ throw css::lang::IllegalArgumentException(
+ "no parent Window given to TableEditPanel::Create", nullptr, 0);
+ if (!rxFrame.is())
+ throw css::lang::IllegalArgumentException("no XFrame given to TableEditPanel::Create",
+ nullptr, 1);
+
+ return VclPtr<TableEditPanel>::Create(pParent, rxFrame);
+}
+
+void TableEditPanel::NotifyItemUpdate(const sal_uInt16 /*nSId*/, const SfxItemState /*eState*/,
+ const SfxPoolItem* /*pState*/, const bool /*bIsEnabled*/)
+{
+}
+
+TableEditPanel::TableEditPanel(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+ : PanelLayout(pParent, "TableEditPanel", "modules/swriter/ui/sidebartableedit.ui", rxFrame)
+{
+}
+
+TableEditPanel::~TableEditPanel() { disposeOnce(); }
+}
+} // end of namespace ::sw::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/uibase/sidebar/TableEditPanel.hxx b/sw/source/uibase/sidebar/TableEditPanel.hxx
new file mode 100644
index 000000000000..25194e2620ac
--- /dev/null
+++ b/sw/source/uibase/sidebar/TableEditPanel.hxx
@@ -0,0 +1,43 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_TABLEEDITPANEL_HXX
+#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_TABLEEDITPANEL_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+
+namespace sw
+{
+namespace sidebar
+{
+class TableEditPanel : public PanelLayout,
+ public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+ friend class VclPtr<TableEditPanel>;
+
+public:
+ static VclPtr<vcl::Window> Create(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState,
+ const SfxPoolItem* pState, const bool bIsEnabled) override;
+
+private:
+ TableEditPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ virtual ~TableEditPanel() override;
+};
+}
+} // end of namespace sw::sidebar
+
+#endif // INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_TABLEEDITPANEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file