diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 2f2a032fda3a..50eb1053a44a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -60,6 +60,28 @@
100
+
+
+
+ Shapes
+
+
+ ShapesDeck
+
+
+ private:graphicrepository/cmd/lc_basicshapes.png
+
+
+
+ DrawImpress, any, visible ;
+
+
+
+ 200
+
+
+
+
Gallery
@@ -690,6 +712,33 @@
+
+
+ Default
+
+
+ DefaultShapesPanel
+
+
+ ShapesDeck
+
+
+
+ DrawImpress, DrawPage, visible ;
+ DrawImpress, default, visible ;
+ DrawImpress, HandoutPage, visible ;
+ DrawImpress, NotesPage, visible ;
+ DrawImpress, SlidesorterPage, visible ;
+
+
+
+ private:resource/toolpanel/SvxPanelFactory/DefaultShapesPanel
+
+
+ 100
+
+
+
Slide
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 12b629b27fd3..af4695dba76f 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -30,7 +30,7 @@
#include "NavigatorWrapper.hxx"
#include "SlideTransitionPanel.hxx"
#include "TableDesignPanel.hxx"
-#include
+#include "SlideBackground.hxx"
#include
#include
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 359e231fd6f7..919f721c480e 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -202,6 +202,8 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/line/LineWidthPopup \
svx/source/sidebar/possize/PosSizePropertyPanel \
svx/source/sidebar/possize/SidebarDialControl \
+ svx/source/sidebar/shapes/DefaultShapesPanel \
+ svx/source/sidebar/shapes/ShapesUtil \
svx/source/sidebar/tools/PopupControl \
svx/source/sidebar/tools/PopupContainer \
svx/source/sidebar/tools/Popup \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 9202248d2e18..bb1bda38d500 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/compressgraphicdialog \
svx/uiconfig/ui/crashreportdlg \
svx/uiconfig/ui/datanavigator \
+ svx/uiconfig/ui/defaultshapespanel \
svx/uiconfig/ui/deleteheaderdialog \
svx/uiconfig/ui/deletefooterdialog \
svx/uiconfig/ui/docking3deffects \
@@ -63,7 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/redlineviewpage \
svx/uiconfig/ui/savemodifieddialog \
svx/uiconfig/ui/sidebararea \
- svx/uiconfig/ui/sidebarshadow \
+ svx/uiconfig/ui/sidebarshadow \
svx/uiconfig/ui/sidebargraphic \
svx/uiconfig/ui/sidebarline \
svx/uiconfig/ui/sidebarparagraph \
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index ceb4f68f0ec3..d64ee5c4c9f0 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -25,6 +25,7 @@
#include "graphic/GraphicPropertyPanel.hxx"
#include "line/LinePropertyPanel.hxx"
#include "possize/PosSizePropertyPanel.hxx"
+#include "shapes/DefaultShapesPanel.hxx"
#include "GalleryControl.hxx"
#include "EmptyPanel.hxx"
#include
@@ -167,6 +168,10 @@ Reference SAL_CALL PanelFactory::createUIElement (
{
pControl = PosSizePropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar);
}
+ else if (rsResourceURL.endsWith("/DefaultShapesPanel"))
+ {
+ pControl = DefaultShapesPanel::Create(pParentWindow, xFrame);
+ }
else if (rsResourceURL.endsWith("/GalleryPanel"))
{
pControl.reset(VclPtr::Create(pBindings, pParentWindow));
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
new file mode 100644
index 000000000000..66f1189ab48b
--- /dev/null
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -0,0 +1,141 @@
+/* -*- 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 "DefaultShapesPanel.hxx"
+
+#include
+#include
+#include
+#include
+
+using ::rtl::OUString;
+
+namespace svx { namespace sidebar {
+
+DefaultShapesPanel::DefaultShapesPanel (
+ vcl::Window* pParent,
+ const css::uno::Reference& rxFrame)
+ : PanelLayout(pParent, "DefaultShapesPanel", "svx/ui/defaultshapespanel.ui", rxFrame),
+ SvxShapeCommandsMap(),
+ mxFrame(rxFrame)
+{
+ get(mpScrollWindow, "scrolledwindow1");
+ get(mpLineArrowSet, "LinesArrows");
+ get(mpCurveSet, "Curves");
+ get(mpConnectorSet, "Connectors");
+ get(mpBasicShapeSet, "BasicShapes");
+ get(mpSymbolShapeSet, "SymbolShapes");
+ get(mpBlockArrowSet, "BlockArrows");
+ get(mpFlowchartSet, "Flowcharts");
+ get(mpCalloutSet, "Callouts");
+ get(mpStarSet, "Stars");
+ get(mp3DObjectSet, "3DObjects");
+ Initialize();
+}
+
+VclPtr< vcl::Window > DefaultShapesPanel::Create(
+ vcl::Window* pParent,
+ const Reference< XFrame >& rxFrame)
+{
+ if (pParent == nullptr)
+ throw lang::IllegalArgumentException("no parent Window given to DefaultShapesPanel::Create", nullptr, 0);
+ if ( ! rxFrame.is())
+ throw lang::IllegalArgumentException("no XFrame given to DefaultShapesPanel::Create", nullptr, 1);
+
+ return VclPtr::Create(
+ pParent,
+ rxFrame);
+}
+
+DefaultShapesPanel::~DefaultShapesPanel()
+{
+ disposeOnce();
+}
+
+void DefaultShapesPanel::Initialize()
+{
+ mpShapesSetMap = decltype(mpShapesSetMap){
+ { mpLineArrowSet, mpLineShapes },
+ { mpCurveSet, mpCurveShapes },
+ { mpConnectorSet, mpConnectorShapes },
+ { mpBasicShapeSet, mpBasicShapes },
+ { mpSymbolShapeSet, mpSymbolShapes },
+ { mpBlockArrowSet, mpBlockArrowShapes },
+ { mpFlowchartSet, mpFlowchartShapes },
+ { mpCalloutSet, mpCalloutShapes },
+ { mpStarSet, mpStarShapes },
+ { mp3DObjectSet, mp3DShapes }
+ };
+ populateShapes();
+ for(auto& aSetMap: mpShapesSetMap)
+ {
+ aSetMap.first->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ aSetMap.first->SetSelectHdl(LINK(this, DefaultShapesPanel, ShapeSelectHdl));
+ }
+}
+
+void DefaultShapesPanel::dispose()
+{
+ mpScrollWindow.clear();
+ mpLineArrowSet.clear();
+ mpCurveSet.clear();
+ mpConnectorSet.clear();
+ mpBasicShapeSet.clear();
+ mpSymbolShapeSet.clear();
+ mpBlockArrowSet.clear();
+ mpFlowchartSet.clear();
+ mpCalloutSet.clear();
+ mpStarSet.clear();
+ mp3DObjectSet.clear();
+ PanelLayout::dispose();
+}
+
+IMPL_LINK_TYPED(DefaultShapesPanel, ShapeSelectHdl, ValueSet*, rValueSet, void)
+{
+ for(auto& aSetMap : mpShapesSetMap)
+ {
+ if(rValueSet == aSetMap.first)
+ {
+ int aSelection = aSetMap.first->GetSelectItemId();
+ comphelper::dispatchCommand(aSetMap.second[aSelection], {});
+ }
+ else
+ aSetMap.first->SetNoSelection();
+ }
+}
+
+void DefaultShapesPanel::populateShapes()
+{
+ OUString sSlotStr, sLabel;
+ Image aSlotImage;
+ for(auto& aSet : mpShapesSetMap)
+ {
+ aSet.first->SetColCount(6);
+ for(sal_uInt16 i = 0; i < aSet.second.size(); i++)
+ {
+ sSlotStr = aSet.second[i];
+ aSlotImage = ::GetImage(mxFrame, sSlotStr, false);
+ sLabel = vcl::CommandInfoProvider::Instance().GetTooltipForCommand(sSlotStr, mxFrame);
+ aSet.first->InsertItem(i, aSlotImage, sLabel);
+ }
+ }
+}
+
+} } // end of namespace sd::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.hxx b/svx/source/sidebar/shapes/DefaultShapesPanel.hxx
new file mode 100644
index 000000000000..5da2f184a845
--- /dev/null
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.hxx
@@ -0,0 +1,77 @@
+/* -*- 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_SD_SOURCE_SIDEBAR_INSERT_DEFAULTSHAPESPANEL_HXX
+#define INCLUDED_SD_SOURCE_SIDEBAR_INSERT_DEFAULTSHAPESPANEL_HXX
+
+#include
+#include
+
+#include