sd/Library_sdui.mk | 1 sd/source/console/PresenterHelper.cxx | 56 --------------------------- sd/source/console/PresenterHelper.hxx | 48 ----------------------- sd/source/console/PresenterScreen.cxx | 5 +- sd/source/console/PresenterSlideShowView.cxx | 32 ++++++++++++++- sd/source/ui/presenter/PresenterHelper.cxx | 2 solenv/clang-format/excludelist | 2 7 files changed, 35 insertions(+), 111 deletions(-)
New commits: commit d38795dfc3f749272e8d4b161c5ffbd5e17571ee Author: Michael Weghorn <[email protected]> AuthorDate: Wed Feb 26 15:11:44 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 27 07:58:01 2025 +0100 sd presenter: Move PresenterHelper.hxx to sd/inc This is in preparation of using the PresenterHelper class directly PresenterController instead of the XPresenterHelper UNO interface. Change-Id: If1896a4514b1f5a39091c4a154d8bc53dc752ef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182238 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sd/source/ui/presenter/PresenterHelper.hxx b/sd/inc/PresenterHelper.hxx similarity index 100% rename from sd/source/ui/presenter/PresenterHelper.hxx rename to sd/inc/PresenterHelper.hxx diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 0f40a723add5..b22bbe02e53b 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -21,7 +21,7 @@ #include <cstddef> -#include "PresenterHelper.hxx" +#include <PresenterHelper.hxx> #include "PresenterCanvas.hxx" #include <cppcanvas/vclfactory.hxx> #include <cppuhelper/supportsservice.hxx> diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 638a5b1ecd20..dc69473a12bf 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -9217,6 +9217,7 @@ sd/inc/CustomAnimationPreset.hxx sd/inc/EffectMigration.hxx sd/inc/FactoryIds.hxx sd/inc/OutlinerIterator.hxx +sd/inc/PresenterHelper.hxx sd/inc/TransitionPreset.hxx sd/inc/animations.hxx sd/inc/anminfo.hxx @@ -9707,7 +9708,6 @@ sd/source/ui/presenter/CanvasUpdateRequester.cxx sd/source/ui/presenter/PresenterCanvas.cxx sd/source/ui/presenter/PresenterCanvas.hxx sd/source/ui/presenter/PresenterHelper.cxx -sd/source/ui/presenter/PresenterHelper.hxx sd/source/ui/presenter/PresenterPreviewCache.cxx sd/source/ui/presenter/PresenterPreviewCache.hxx sd/source/ui/presenter/PresenterTextView.cxx commit e34fbd4c70f00409b9566ee28d924123e31311e5 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Feb 26 14:55:09 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 27 07:57:54 2025 +0100 sd presenter: Get rid of sdext::presenter::PresenterHelper Turn sdext::presenter::PresenterHelper::GetSlideShowController into a local helper function in the only source file using it and drop the sdext::presenter::PresenterHelper namespace altogether. This also helps avoid confusion because there's also a sd::presenter::PresenterHelper class that's something completely different (s. sd/source/ui/presenter/PresenterHelper.hxx). Change-Id: I91478fe14190acc9cafe4d91962b5f068f3d0223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182237 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk index 5f0f457a43c5..d4cce6c2b54d 100644 --- a/sd/Library_sdui.mk +++ b/sd/Library_sdui.mk @@ -101,7 +101,6 @@ $(eval $(call gb_Library_add_exception_objects,sdui,\ sd/source/console/PresenterFrameworkObserver \ sd/source/console/PresenterGeometryHelper \ sd/source/console/PresenterHelpView \ - sd/source/console/PresenterHelper \ sd/source/console/PresenterNotesView \ sd/source/console/PresenterPaintManager \ sd/source/console/PresenterPane \ diff --git a/sd/source/console/PresenterHelper.cxx b/sd/source/console/PresenterHelper.cxx deleted file mode 100644 index 73758fdeacfd..000000000000 --- a/sd/source/console/PresenterHelper.cxx +++ /dev/null @@ -1,53 +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 "PresenterHelper.hxx" - -#include <com/sun/star/presentation/XPresentationSupplier.hpp> -#include <com/sun/star/presentation/XPresentation2.hpp> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::presentation; - -namespace sdext::presenter { - -Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowController ( - const Reference<frame::XController>& rxController) -{ - Reference<presentation::XSlideShowController> xSlideShowController; - - if( rxController.is() ) try - { - Reference<XPresentationSupplier> xPS ( rxController->getModel(), UNO_QUERY_THROW); - - Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW); - - xSlideShowController = xPresentation->getController(); - } - catch(RuntimeException&) - { - } - - return xSlideShowController; -} - -} // end of namespace ::sdext::presenter - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/console/PresenterHelper.hxx b/sd/source/console/PresenterHelper.hxx deleted file mode 100644 index 851d799542c1..000000000000 --- a/sd/source/console/PresenterHelper.hxx +++ /dev/null @@ -1,45 +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_SDEXT_SOURCE_PRESENTER_PRESENTERHELPER_HXX -#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERHELPER_HXX - -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/presentation/XSlideShowController.hpp> - -namespace sdext::presenter -{ -/** Collection of helper functions that do not fit in anywhere else. -*/ -namespace PresenterHelper -{ -/** Return the slide show controller of a running presentation that has - the same document as the given framework controller. - @return - When no presentation is running this method returns an empty reference. -*/ -css::uno::Reference<css::presentation::XSlideShowController> -GetSlideShowController(const css::uno::Reference<css::frame::XController>& rxController); -} - -} // end of namespace presenter - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index b7018ffb6b5c..6a479de6b297 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -21,7 +21,6 @@ #include "PresenterConfigurationAccess.hxx" #include "PresenterController.hxx" #include "PresenterFrameworkObserver.hxx" -#include "PresenterHelper.hxx" #include "PresenterPaneContainer.hxx" #include "PresenterPaneFactory.hxx" #include "PresenterViewFactory.hxx" diff --git a/sd/source/console/PresenterSlideShowView.cxx b/sd/source/console/PresenterSlideShowView.cxx index 956aabb3745a..5f461a968679 100644 --- a/sd/source/console/PresenterSlideShowView.cxx +++ b/sd/source/console/PresenterSlideShowView.cxx @@ -21,7 +21,6 @@ #include "PresenterSlideShowView.hxx" #include "PresenterCanvasHelper.hxx" #include "PresenterGeometryHelper.hxx" -#include "PresenterHelper.hxx" #include "PresenterPaneContainer.hxx" #include <DrawController.hxx> #include <com/sun/star/awt/InvalidateStyle.hpp> @@ -33,6 +32,8 @@ #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/drawing/XPresenterHelper.hpp> #include <com/sun/star/drawing/framework/XConfigurationController.hpp> +#include <com/sun/star/presentation/XPresentationSupplier.hpp> +#include <com/sun/star/presentation/XPresentation2.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/rendering/TexturingMode.hpp> @@ -43,6 +44,33 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; +namespace { +/** Return the slide show controller of a running presentation that has + the same document as the given framework controller. + @return + When no presentation is running this method returns an empty reference. +*/ +Reference<presentation::XSlideShowController> lcl_GetSlideShowController ( + const Reference<frame::XController>& rxController) +{ + Reference<presentation::XSlideShowController> xSlideShowController; + + if( rxController.is() ) try + { + Reference<css::presentation::XPresentationSupplier> xPS ( rxController->getModel(), UNO_QUERY_THROW); + + Reference<css::presentation::XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW); + + xSlideShowController = xPresentation->getController(); + } + catch(RuntimeException&) + { + } + + return xSlideShowController; +} +} + namespace sdext::presenter { //===== PresenterSlideShowView ================================================ @@ -57,7 +85,7 @@ PresenterSlideShowView::PresenterSlideShowView ( mpPresenterController(std::move(xPresenterController)), mxViewId(std::move(xViewId)), mxController(rxController), - mxSlideShowController(PresenterHelper::GetSlideShowController(rxController)), + mxSlideShowController(lcl_GetSlideShowController(rxController)), mbIsViewAdded(false), mnPageAspectRatio(28.0/21.0), maBroadcaster(m_aMutex), commit 17f86b2241c853ece57f72a593daf2b6ea678abe Author: Michael Weghorn <[email protected]> AuthorDate: Wed Feb 26 14:38:35 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 27 07:57:46 2025 +0100 sd presenter: Define full screen URL where it's needed The Provide access to frequently used strings of the drawing framework. comment looks outdated, because sdext::presenter::PresenterHelper::msFullScreenPaneURL is only used in a single place. Turn it into a constexpr variable in that source file instead. Change-Id: I70738df9ab127c9332f0ee40db24eb6b291d9f85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182236 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sd/source/console/PresenterHelper.cxx b/sd/source/console/PresenterHelper.cxx index 76bec0ecee7d..73758fdeacfd 100644 --- a/sd/source/console/PresenterHelper.cxx +++ b/sd/source/console/PresenterHelper.cxx @@ -28,9 +28,6 @@ using namespace ::com::sun::star::presentation; namespace sdext::presenter { -constexpr OUStringLiteral msPaneURLPrefix( u"private:resource/pane/"); -const OUString PresenterHelper::msFullScreenPaneURL( msPaneURLPrefix + "FullScreenPane"); - Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowController ( const Reference<frame::XController>& rxController) { diff --git a/sd/source/console/PresenterHelper.hxx b/sd/source/console/PresenterHelper.hxx index 69fc57333941..851d799542c1 100644 --- a/sd/source/console/PresenterHelper.hxx +++ b/sd/source/console/PresenterHelper.hxx @@ -26,12 +26,9 @@ namespace sdext::presenter { /** Collection of helper functions that do not fit in anywhere else. - Provide access to frequently used strings of the drawing framework. */ namespace PresenterHelper { -extern const OUString msFullScreenPaneURL; - /** Return the slide show controller of a running presentation that has the same document as the given framework controller. @return diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index ab46c2988c8a..b7018ffb6b5c 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -48,6 +48,8 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::presentation; using namespace ::com::sun::star::drawing::framework; +constexpr OUString FULL_SCREEN_PANE_URL = u"private:resource/pane/FullScreenPane"_ustr; + namespace sdext::presenter { namespace { @@ -574,7 +576,7 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( return ResourceId::create( Reference<XComponentContext>(mxContextWeak), - PresenterHelper::msFullScreenPaneURL + FULL_SCREEN_PANE_URL + "?FullScreen=" + fullScreenStr + "&ScreenNumber="
