summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-04 12:48:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-04 20:55:22 +0100
commit92fd92f9ad13f6c8f491cf94ee45de2996d1ff82 (patch)
tree13cc44b5328374a9b0d25c7ba2aee9d0e394e536
parente1f1def652ae9697038e4489435353d5f4e3b652 (diff)
remove intermediate SlideTransitionPanel
Change-Id: Ifdecbd56b3da30081ed40e9940c7c2a6c7e1e48a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111962 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/IwyuFilter_sd.yaml3
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx25
-rw-r--r--sd/source/ui/inc/SlideTransitionPane.hxx6
-rw-r--r--sd/source/ui/inc/createslidetransitionpanel.hxx38
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx4
-rw-r--r--sd/source/ui/sidebar/SlideTransitionPanel.cxx61
-rw-r--r--sd/source/ui/sidebar/SlideTransitionPanel.hxx54
8 files changed, 15 insertions, 177 deletions
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 <com/sun/star/drawing/XDrawView.hpp>
#include <SlideTransitionPane.hxx>
-#include <createslidetransitionpanel.hxx>
#include <TransitionPreset.hxx>
#include <sdresid.hxx>
@@ -393,18 +392,23 @@ public:
SlideTransitionPane::SlideTransitionPane(
Window * pParent,
ViewShellBase & rBase,
- SdDrawDocument* pDoc,
const css::uno::Reference<css::frame::XFrame>& 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<css::frame::XFrame>& rxFrame )
-{
- vcl::Window* pWindow = nullptr;
-
- DrawDocShell* pDocSh = rBase.GetDocShell();
- if( pDocSh )
- {
- pWindow = VclPtr<SlideTransitionPane>::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 <svtools/valueset.hxx>
+#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
#include <vcl/weld.hxx>
@@ -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<css::frame::XFrame>& 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 <sal/config.h>
-#include <vcl/window.hxx>
-
-#include <com/sun/star/frame/XFrame.hpp>
-
-#include "ViewShell.hxx"
-
-namespace sd {
-
-vcl::Window* createSlideTransitionPanel (vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference<css::frame::XFrame>& 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 <SlideTransitionPane.hxx>
#include "TableDesignPanel.hxx"
#include "SlideBackground.hxx"
@@ -111,7 +111,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (rsUIElementResourceURL.endsWith("/UsedMasterPages"))
pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (rsUIElementResourceURL.endsWith("/SlideTransitions"))
- pControl = VclPtr<SlideTransitionPanel>::Create(pParentWindow, *pBase, xFrame);
+ pControl = VclPtr<SlideTransitionPane>::Create(pParentWindow, *pBase, xFrame);
else if (rsUIElementResourceURL.endsWith("/TableDesign"))
pControl = VclPtr<TableDesignPanel>::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 <createslidetransitionpanel.hxx>
-
-#include <ViewShellBase.hxx>
-
-namespace sd::sidebar {
-
-SlideTransitionPanel::SlideTransitionPanel (
- vcl::Window* pParentWindow,
- ViewShellBase& rViewShellBase,
- const css::uno::Reference<css::frame::XFrame>& 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<css::frame::XFrame>& 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<css::frame::XFrame> mxFrame;
-};
-
-} // end of namespace sd::sidebar
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */