From 92fd92f9ad13f6c8f491cf94ee45de2996d1ff82 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 4 Mar 2021 12:48:52 +0000 Subject: remove intermediate SlideTransitionPanel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifdecbd56b3da30081ed40e9940c7c2a6c7e1e48a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111962 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sd/IwyuFilter_sd.yaml | 3 -- sd/Library_sd.mk | 1 - sd/source/ui/animations/SlideTransitionPane.cxx | 25 ++++------ sd/source/ui/inc/SlideTransitionPane.hxx | 6 ++- sd/source/ui/inc/createslidetransitionpanel.hxx | 38 --------------- sd/source/ui/sidebar/PanelFactory.cxx | 4 +- sd/source/ui/sidebar/SlideTransitionPanel.cxx | 61 ------------------------- sd/source/ui/sidebar/SlideTransitionPanel.hxx | 54 ---------------------- 8 files changed, 15 insertions(+), 177 deletions(-) delete mode 100644 sd/source/ui/inc/createslidetransitionpanel.hxx delete mode 100644 sd/source/ui/sidebar/SlideTransitionPanel.cxx delete mode 100644 sd/source/ui/sidebar/SlideTransitionPanel.hxx diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml index 19e1a3694b31..b4632fdb7c91 100644 --- a/sd/IwyuFilter_sd.yaml +++ b/sd/IwyuFilter_sd.yaml @@ -90,9 +90,6 @@ excludelist: sd/source/ui/animations/CustomAnimationPane.hxx: # Needed for typedef - motionpathtag.hxx - sd/source/ui/animations/SlideTransitionPane.cxx: - # Avoid loplugin:unreffun error - - /createslidetransitionpanel.hxx sd/source/ui/animations/CustomAnimationPane.cxx: # Avoid loplugin:unreffun error - createcustomanimationpanel.hxx diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index d70b5216fe05..9ba5375ad7fa 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/PreviewValueSet \ sd/source/ui/sidebar/RecentlyUsedMasterPages \ sd/source/ui/sidebar/RecentMasterPagesSelector \ - sd/source/ui/sidebar/SlideTransitionPanel \ sd/source/ui/sidebar/SlideBackground \ sd/source/ui/sidebar/TableDesignPanel \ sd/source/ui/slideshow/PaneHider \ diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index f3b1f2a1f5ec..908f78df3f70 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -393,18 +392,23 @@ public: SlideTransitionPane::SlideTransitionPane( Window * pParent, ViewShellBase & rBase, - SdDrawDocument* pDoc, const css::uno::Reference& rxFrame ) : PanelLayout( pParent, "SlideTransitionsPanel", "modules/simpress/ui/slidetransitionspanel.ui", rxFrame ), mrBase( rBase ), - mpDrawDoc( pDoc ), + mpDrawDoc( rBase.GetDocShell() ? rBase.GetDocShell()->GetDoc() : nullptr ), mbHasSelection( false ), mbUpdatingControls( false ), mbIsMainViewChangePending( false ), maLateInitTimer() { - Initialize(pDoc); + Initialize(mpDrawDoc); +} + +css::ui::LayoutSize SlideTransitionPane::GetHeightForWidth(const sal_Int32 /*nWidth*/) +{ + sal_Int32 nMinimumHeight = get_preferred_size().Height(); + return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight); } void SlideTransitionPane::Initialize(SdDrawDocument* pDoc) @@ -1164,19 +1168,6 @@ IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback, Timer *, void) updateControls(); } -vcl::Window * createSlideTransitionPanel( vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference& rxFrame ) -{ - vcl::Window* pWindow = nullptr; - - DrawDocShell* pDocSh = rBase.GetDocShell(); - if( pDocSh ) - { - pWindow = VclPtr::Create( pParent, rBase, pDocSh->GetDoc(), rxFrame ); - } - - return pWindow; -} - } // namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/SlideTransitionPane.hxx b/sd/source/ui/inc/SlideTransitionPane.hxx index 4665206d7bf6..b68fc63a4662 100644 --- a/sd/source/ui/inc/SlideTransitionPane.hxx +++ b/sd/source/ui/inc/SlideTransitionPane.hxx @@ -22,6 +22,7 @@ #include "SlideSorterViewShell.hxx" #include +#include #include #include @@ -46,16 +47,19 @@ namespace impl } class SlideTransitionPane : public PanelLayout + , public sfx2::sidebar::ILayoutableWindow { public: explicit SlideTransitionPane( Window * pParent, ViewShellBase & rBase, - SdDrawDocument* pDoc, const css::uno::Reference& rxFrame ); virtual ~SlideTransitionPane() override; virtual void dispose() override; + // ILayoutableWindow + virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override; + // Window virtual void DataChanged (const DataChangedEvent& rEvent) override; diff --git a/sd/source/ui/inc/createslidetransitionpanel.hxx b/sd/source/ui/inc/createslidetransitionpanel.hxx deleted file mode 100644 index 564e9a689190..000000000000 --- a/sd/source/ui/inc/createslidetransitionpanel.hxx +++ /dev/null @@ -1,38 +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_CREATESLIDETRANSITIONPANEL_HXX -#define INCLUDED_SD_SOURCE_UI_INC_CREATESLIDETRANSITIONPANEL_HXX - -#include -#include - -#include - -#include "ViewShell.hxx" - -namespace sd { - -vcl::Window* createSlideTransitionPanel (vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference& rxFrame); - -} - -#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 554d4f1c2b73..d24eca6ff0a9 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -27,7 +27,7 @@ #include "AllMasterPagesSelector.hxx" #include "CustomAnimationPanel.hxx" #include "NavigatorWrapper.hxx" -#include "SlideTransitionPanel.hxx" +#include #include "TableDesignPanel.hxx" #include "SlideBackground.hxx" @@ -111,7 +111,7 @@ Reference SAL_CALL PanelFactory::createUIElement ( else if (rsUIElementResourceURL.endsWith("/UsedMasterPages")) pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); else if (rsUIElementResourceURL.endsWith("/SlideTransitions")) - pControl = VclPtr::Create(pParentWindow, *pBase, xFrame); + pControl = VclPtr::Create(pParentWindow, *pBase, xFrame); else if (rsUIElementResourceURL.endsWith("/TableDesign")) pControl = VclPtr::Create(pParentWindow, *pBase); else if (rsUIElementResourceURL.endsWith("/NavigatorPanel")) diff --git a/sd/source/ui/sidebar/SlideTransitionPanel.cxx b/sd/source/ui/sidebar/SlideTransitionPanel.cxx deleted file mode 100644 index 8727db823449..000000000000 --- a/sd/source/ui/sidebar/SlideTransitionPanel.cxx +++ /dev/null @@ -1,61 +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 "SlideTransitionPanel.hxx" -#include - -#include - -namespace sd::sidebar { - -SlideTransitionPanel::SlideTransitionPanel ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase, - const css::uno::Reference& rxFrame - ) - : PanelBase(pParentWindow, rViewShellBase), - mxFrame( rxFrame ) -{ - SetStyle( GetStyle() | WB_DIALOGCONTROL ); -#ifdef DEBUG - SetText(OUString("sd:SlideTransitionPanel")); -#endif -} - -SlideTransitionPanel::~SlideTransitionPanel() -{ -} - -vcl::Window* SlideTransitionPanel::CreateWrappedControl ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase) -{ - return createSlideTransitionPanel(pParentWindow, rViewShellBase, mxFrame); -} - -css::ui::LayoutSize SlideTransitionPanel::GetHeightForWidth (const sal_Int32 /*nWidth*/) -{ - vcl::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/SlideTransitionPanel.hxx b/sd/source/ui/sidebar/SlideTransitionPanel.hxx deleted file mode 100644 index fd04a0d60df3..000000000000 --- a/sd/source/ui/sidebar/SlideTransitionPanel.hxx +++ /dev/null @@ -1,54 +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_SLIDETRANSITIONPANEL_HXX -#define INCLUDED_SD_SOURCE_UI_SIDEBAR_SLIDETRANSITIONPANEL_HXX - -#include "PanelBase.hxx" - -namespace com::sun::star::frame { class XFrame; } - -namespace sd::sidebar { - -class SlideTransitionPanel - : public PanelBase -{ -public: - SlideTransitionPanel ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase, - const css::uno::Reference& rxFrame ); - virtual ~SlideTransitionPanel() override; - - // ILayoutableWindow - virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override; - -protected: - virtual vcl::Window* CreateWrappedControl ( - vcl::Window* pParentWindow, - ViewShellBase& rViewShellBase) override; - -private: - css::uno::Reference mxFrame; -}; - -} // end of namespace sd::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit