offapi/UnoApi_offapi.mk | 1 offapi/com/sun/star/text/ContentControls.idl | 39 --------------------------- sw/source/core/inc/unocontentcontrol.hxx | 8 +---- sw/source/core/unocore/unocontentcontrol.cxx | 12 -------- 4 files changed, 2 insertions(+), 58 deletions(-)
New commits: commit 27028df8b36f2e838e3a06b141e2d6952543c11b Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Nov 10 08:58:11 2022 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Nov 14 10:26:00 2022 +0100 sw content controls: drop not needed XServiceInfo impl As noted in <https://gerrit.libreoffice.org/c/core/+/142454/3#message-18fe8bb36fc24d317ad16dd25e236ed51c88a910>, introducing a dedicated css.text.ContentControls service is actually not needed and client code should be fine with just an "anonymous" object returned by getContentControls() + implementing XIndexAccess. Remove it before somebody starts to depend on it. Let's rather have a bit of inconsistency (e.g. SwXFootnotes implements XServiceInfo, while SwXContentControls not) than an XServiceInfo implementation that we'll have to support from now on, without a user. (cherry picked from commit 652df8c733f381cac4e22286acd12a2ec72d41ae) Change-Id: Ifde4fb6bcafdffabb189447415b89b01c9675296 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142668 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index b3eabdb25023..52d517290347 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -1347,7 +1347,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,com/sun/star/text,\ ChainedTextFrame \ ChapterNumberingRule \ ContentControl \ - ContentControls \ ContentIndex \ ContentIndexMark \ Defaults \ diff --git a/offapi/com/sun/star/text/ContentControls.idl b/offapi/com/sun/star/text/ContentControls.idl deleted file mode 100644 index d544b4ee767f..000000000000 --- a/offapi/com/sun/star/text/ContentControls.idl +++ /dev/null @@ -1,39 +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 . - */ - - module com { module sun { module star { module text { - -/** provides access to the content controls of a (text) - document. - - @since LibreOffice 7.5 - */ -service ContentControls -{ - - /** provides access to the content controls of the document. - */ - interface com::sun::star::container::XIndexAccess; - -}; - - -}; }; }; }; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/unocontentcontrol.hxx b/sw/source/core/inc/unocontentcontrol.hxx index 90d408a7964d..fef07498abe8 100644 --- a/sw/source/core/inc/unocontentcontrol.hxx +++ b/sw/source/core/inc/unocontentcontrol.hxx @@ -158,7 +158,8 @@ public: }; /// UNO wrapper around SwContentControlManager. -class SwXContentControls final : public SwSimpleIndexAccessBaseClass, public SwUnoCollection +class SwXContentControls final : public cppu::WeakImplHelper<css::container::XIndexAccess>, + public SwUnoCollection { ~SwXContentControls() override; @@ -172,11 +173,6 @@ public: // XElementAccess css::uno::Type SAL_CALL getElementType() override; sal_Bool SAL_CALL hasElements() override; - - // XServiceInfo - OUString SAL_CALL getImplementationName() override; - sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; - css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unocontentcontrol.cxx b/sw/source/core/unocore/unocontentcontrol.cxx index c67dc8193de9..827a6c4568ae 100644 --- a/sw/source/core/unocore/unocontentcontrol.cxx +++ b/sw/source/core/unocore/unocontentcontrol.cxx @@ -1422,16 +1422,4 @@ sal_Bool SwXContentControls::hasElements() return !GetDoc()->GetContentControlManager().IsEmpty(); } -OUString SwXContentControls::getImplementationName() { return "SwXContentControls"; } - -sal_Bool SwXContentControls::supportsService(const OUString& rServiceName) -{ - return cppu::supportsService(this, rServiceName); -} - -uno::Sequence<OUString> SwXContentControls::getSupportedServiceNames() -{ - return { "com.sun.star.text.ContentControls" }; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */