diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-04 16:01:36 +0000 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-05-25 12:12:32 +0200 |
commit | 377e946029f2286899d5736ec9fe54f300169aa2 (patch) | |
tree | ee05987afb6b2b29da8938a867299f0904abe81c /sd | |
parent | a27922ba260f00287e0ae261ca14b2b596ff6186 (diff) |
remove intermediate TableDesignPanel
Change-Id: Icdc1aef7a0d53239ee41e818a56d137aa959249c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111973
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/Library_sd.mk | 1 | ||||
-rw-r--r-- | sd/source/ui/inc/TableDesignPane.hxx (renamed from sd/source/ui/table/TableDesignPane.hxx) | 7 | ||||
-rw-r--r-- | sd/source/ui/inc/createtabledesignpanel.hxx | 40 | ||||
-rw-r--r-- | sd/source/ui/sidebar/PanelFactory.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/TableDesignPanel.cxx | 57 | ||||
-rw-r--r-- | sd/source/ui/sidebar/TableDesignPanel.hxx | 48 | ||||
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 16 |
7 files changed, 10 insertions, 163 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index b4a029c81920..be4d3e77ffac 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -341,7 +341,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/sidebar/RecentlyUsedMasterPages \ sd/source/ui/sidebar/RecentMasterPagesSelector \ sd/source/ui/sidebar/SlideBackground \ - sd/source/ui/sidebar/TableDesignPanel \ sd/source/ui/slideshow/PaneHider \ sd/source/ui/slideshow/SlideShowRestarter \ sd/source/ui/slideshow/showwin \ diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/inc/TableDesignPane.hxx index d03a3260303a..69a8c6142907 100644 --- a/sd/source/ui/table/TableDesignPane.hxx +++ b/sd/source/ui/inc/TableDesignPane.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX #include <svtools/valueset.hxx> +#include <sfx2/sidebar/ILayoutableWindow.hxx> #include <sfx2/sidebar/PanelLayout.hxx> #include <vcl/weld.hxx> @@ -102,6 +103,7 @@ private: }; class TableDesignPane : public PanelLayout + , public sfx2::sidebar::ILayoutableWindow { private: std::unique_ptr<TableDesignWidget> m_xImpl; @@ -113,6 +115,11 @@ public: { m_pInitialFocusWidget = m_xImpl->GetInitialFocusWidget(); } + virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 /*nWidth*/) override + { + sal_Int32 nMinimumHeight = get_preferred_size().Height(); + return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight); + } virtual void dispose() override { m_xImpl.reset(); diff --git a/sd/source/ui/inc/createtabledesignpanel.hxx b/sd/source/ui/inc/createtabledesignpanel.hxx deleted file mode 100644 index 2ed8ec9672e1..000000000000 --- a/sd/source/ui/inc/createtabledesignpanel.hxx +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- 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_UI_INC_CREATETABLEDESIGNPANEL_HXX -#define INCLUDED_SD_SOURCE_UI_INC_CREATETABLEDESIGNPANEL_HXX - -#include <sal/config.h> -#include <vcl/vclptr.hxx> - -namespace vcl -{ -class Window; -} - -class ViewShellBase; - -namespace sd -{ -VclPtr<vcl::Window> createTableDesignPanel(vcl::Window* pParent, ViewShellBase& rBase); -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx index baa2938320ad..4fd154ef974f 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -28,7 +28,7 @@ #include <CustomAnimationPane.hxx> #include "NavigatorWrapper.hxx" #include <SlideTransitionPane.hxx> -#include "TableDesignPanel.hxx" +#include <TableDesignPane.hxx> #include "SlideBackground.hxx" #include <sfx2/sidebar/SidebarPanelBase.hxx> @@ -113,7 +113,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( else if (rsUIElementResourceURL.endsWith("/SlideTransitions")) pControl = VclPtr<SlideTransitionPane>::Create(pParentWindow, *pBase, xFrame); else if (rsUIElementResourceURL.endsWith("/TableDesign")) - pControl = VclPtr<TableDesignPanel>::Create(pParentWindow, *pBase); + pControl = VclPtr<TableDesignPane>::Create(pParentWindow, *pBase); else if (rsUIElementResourceURL.endsWith("/NavigatorPanel")) pControl = VclPtr<NavigatorWrapper>::Create(pParentWindow, *pBase, pBindings); else if (rsUIElementResourceURL.endsWith("/SlideBackgroundPanel")) diff --git a/sd/source/ui/sidebar/TableDesignPanel.cxx b/sd/source/ui/sidebar/TableDesignPanel.cxx deleted file mode 100644 index f756c46e0107..000000000000 --- a/sd/source/ui/sidebar/TableDesignPanel.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- 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 "TableDesignPanel.hxx" -#include <createtabledesignpanel.hxx> - -#include <ViewShellBase.hxx> - -namespace sd::sidebar { - -TableDesignPanel::TableDesignPanel ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase) - : PanelBase(pParentWindow, rViewShellBase) -{ -#ifdef DEBUG - SetText(OUString("sd:TableDesignPanel")); -#endif -} - -TableDesignPanel::~TableDesignPanel() -{ -} - -vcl::Window* TableDesignPanel::CreateWrappedControl ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase) -{ - return createTableDesignPanel(pParentWindow, rViewShellBase); -} - -css::ui::LayoutSize TableDesignPanel::GetHeightForWidth (const sal_Int32 /*nWidth*/) -{ - Window *pControl = mpWrappedControl.get(); - sal_Int32 nMinimumHeight = pControl ? pControl->get_preferred_size().Height() : 0; - return css::ui::LayoutSize(nMinimumHeight,-1, nMinimumHeight); -} - -} // end of namespace sd::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/sidebar/TableDesignPanel.hxx b/sd/source/ui/sidebar/TableDesignPanel.hxx deleted file mode 100644 index 7a2f15832fc9..000000000000 --- a/sd/source/ui/sidebar/TableDesignPanel.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- 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_UI_SIDEBAR_TABLEDESIGNPANEL_HXX -#define INCLUDED_SD_SOURCE_UI_SIDEBAR_TABLEDESIGNPANEL_HXX - -#include "PanelBase.hxx" - -namespace sd::sidebar { - -class TableDesignPanel - : public PanelBase -{ -public: - TableDesignPanel ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase); - virtual ~TableDesignPanel() override; - - // ILayoutableWindow - virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override; - -protected: - virtual vcl::Window* CreateWrappedControl ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase) override; -}; - -} // end of namespace sd::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 4fce1f9bf324..d244147ae700 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -52,8 +52,7 @@ #include <o3tl/enumrange.hxx> #include <o3tl/string_view.hxx> -#include "TableDesignPane.hxx" -#include <createtabledesignpanel.hxx> +#include <TableDesignPane.hxx> #include <ViewShell.hxx> #include <ViewShellBase.hxx> @@ -760,19 +759,6 @@ void TableDesignWidget::FillDesignPreviewControl() m_xValueSet->SelectItem(nSelectedItem); } -VclPtr<vcl::Window> createTableDesignPanel( vcl::Window* pParent, ViewShellBase& rBase ) -{ - VclPtr<TableDesignPane> pRet = nullptr; - try - { - pRet = VclPtr<TableDesignPane>::Create( pParent, rBase ); - } - catch (const uno::Exception&) - { - } - return pRet; -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |