From 3aad0eac0e2a919255f47a7e26a9b04fce08646c Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 27 Jul 2026 13:42:14 +0200 Subject: [PATCH] tdf#172275 tdf#172831 cui: Drop unused CustomNotebookbarGenerator This class is unused now after Change-Id: If15d1519cea179596bd72aaf5354d01f89ccb9e7 Author: Michael Weghorn Date: Mon Jul 27 13:38:37 2026 +0200 tdf#172275 tdf#172831 cui: Drop unused SvxConfigPage::m_s{App,File}Name Drop it. Change-Id: Ic670d1db42f2262ee67d87b84819bf0aab8d9c30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208673 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- compilerplugins/clang/unusedmethods.results | 2 - cui/Library_cui.mk | 1 - .../customize/CustomNotebookbarGenerator.cxx | 93 ------------------- cui/source/inc/CustomNotebookbarGenerator.hxx | 34 ------- 4 files changed, 130 deletions(-) delete mode 100644 cui/source/customize/CustomNotebookbarGenerator.cxx delete mode 100644 cui/source/inc/CustomNotebookbarGenerator.hxx diff --git a/compilerplugins/clang/unusedmethods.results b/compilerplugins/clang/unusedmethods.results index f26e0b6fbd85..4c9c104a43f4 100644 --- a/compilerplugins/clang/unusedmethods.results +++ b/compilerplugins/clang/unusedmethods.results @@ -120,8 +120,6 @@ cppuhelper/inc/interfacecontainer4.hxx:277 void cppuhelper::OInterfaceContainerHelper4::NotifySingleListener::operator()(const Reference &) const cui/source/dialogs/SpellAttrib.hxx:73 _Bool svx::SpellErrorDescription::operator==(const struct svx::SpellErrorDescription &) const -cui/source/inc/CustomNotebookbarGenerator.hxx:30 - CustomNotebookbarGenerator::CustomNotebookbarGenerator() cui/source/inc/fileextcheckdlg.hxx:32 void FileExtCheckDialog::LinkStubOnOkClick(void *,weld::Button &) cui/source/inc/fileextcheckdlg.hxx:32 diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index fa6f8dfa3ed1..02bd6c3d11ea 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -113,7 +113,6 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/customize/SvxConfigPageHelper \ cui/source/customize/SvxMenuConfigPage \ cui/source/customize/SvxToolbarConfigPage \ - cui/source/customize/CustomNotebookbarGenerator \ cui/source/dialogs/about \ $(call gb_Helper_optional,EXTENSIONS, \ cui/source/dialogs/AdditionsDialog) \ diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx deleted file mode 100644 index 0ac85c1f7b51..000000000000 --- a/cui/source/customize/CustomNotebookbarGenerator.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace css; - -CustomNotebookbarGenerator::CustomNotebookbarGenerator() {} - -static OUString lcl_activeAppName(vcl::EnumContext::Application eApp) -{ - switch (eApp) - { - case vcl::EnumContext::Application::Writer: - return u"ActiveWriter"_ustr; - case vcl::EnumContext::Application::Calc: - return u"ActiveCalc"_ustr; - case vcl::EnumContext::Application::Impress: - return u"ActiveImpress"_ustr; - case vcl::EnumContext::Application::Draw: - return u"ActiveDraw"_ustr; - default: - return OUString(); - } -} - -static OUString lcl_getAppName(vcl::EnumContext::Application eApp) -{ - switch (eApp) - { - case vcl::EnumContext::Application::Writer: - return u"Writer"_ustr; - case vcl::EnumContext::Application::Calc: - return u"Calc"_ustr; - case vcl::EnumContext::Application::Impress: - return u"Impress"_ustr; - case vcl::EnumContext::Application::Draw: - return u"Draw"_ustr; - default: - return OUString(); - } -} - -void CustomNotebookbarGenerator::getFileNameAndAppName(OUString& sAppName, - OUString& sNotebookbarUIFileName) -{ - SfxViewFrame* pFrame = SfxViewFrame::Current(); - if (!pFrame) - return; - - const auto& xContext = comphelper::getProcessComponentContext(); - utl::OConfigurationTreeRoot aRoot(xContext, u"org.openoffice.Office.UI.ToolbarMode/"_ustr, - false); - const Reference& xFrame = pFrame->GetFrame().GetFrameInterface(); - const Reference xModuleManager = frame::ModuleManager::create(xContext); - - vcl::EnumContext::Application eApp - = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame)); - OUString sActiveAppName(lcl_activeAppName(eApp)); - sAppName = lcl_getAppName(eApp); - const Any aValue = aRoot.getNodeValue(sActiveAppName); - aValue >>= sNotebookbarUIFileName; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/CustomNotebookbarGenerator.hxx b/cui/source/inc/CustomNotebookbarGenerator.hxx deleted file mode 100644 index fce63f71498f..000000000000 --- a/cui/source/inc/CustomNotebookbarGenerator.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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 . - */ - -#pragma once - -#include -#include - -using namespace css::uno; - -class CustomNotebookbarGenerator -{ -public: - CustomNotebookbarGenerator(); - static void getFileNameAndAppName(OUString& sAppName, OUString& sNotebookbarUIFileName); -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */