From a854500861e469835b8d1fd37ac86b1b514c43a6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 12 Jun 2020 15:16:52 +0100 Subject: PopupMenuFloatingWindow is now unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie8fa026becb1899e466fb0e7dbb987290788aaf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96207 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- accessibility/source/helper/acc_factory.cxx | 15 +----- include/vcl/popupmenuwindow.hxx | 46 ------------------ osx/soffice.xcodeproj/project.pbxproj | 2 - solenv/clang-format/blacklist | 2 - vcl/Library_vcl.mk | 1 - vcl/qt5/Qt5AccessibleWidget.cxx | 1 - vcl/source/window/accessibility.cxx | 10 +--- vcl/source/window/popupmenuwindow.cxx | 74 ----------------------------- 8 files changed, 3 insertions(+), 148 deletions(-) delete mode 100644 include/vcl/popupmenuwindow.hxx delete mode 100644 vcl/source/window/popupmenuwindow.cxx diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 02d75771fb98..3ede3d7157df 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -57,7 +57,6 @@ #include #include #include -#include #include @@ -328,19 +327,7 @@ Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLX else if ( nType == WindowType::BORDERWINDOW && hasFloatingChild( pWindow ) ) { - // The logic here has to match that of Window::GetAccessibleParentWindow in - // vcl/source/window/window.cxx to avoid PopupMenuFloatingWindow - // becoming a11y parents of themselves - vcl::Window* pChild = pWindow->GetAccessibleChildWindow(0); - if (PopupMenuFloatingWindow::isPopupMenu(pChild)) - { - // Get the accessible context from the child window. - Reference xAccessible = pChild->CreateAccessible(); - if (xAccessible.is()) - xContext = xAccessible->getAccessibleContext(); - } - else - xContext = new FloatingWindowAccessible( _pXWindow ); + xContext = new FloatingWindowAccessible( _pXWindow ); } else if ( ( nType == WindowType::HELPTEXTWINDOW ) || ( nType == WindowType::FIXEDLINE ) ) diff --git a/include/vcl/popupmenuwindow.hxx b/include/vcl/popupmenuwindow.hxx deleted file mode 100644 index 42488c2ee206..000000000000 --- a/include/vcl/popupmenuwindow.hxx +++ /dev/null @@ -1,46 +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_VCL_POPUPMENUWINDOW_HXX -#define INCLUDED_VCL_POPUPMENUWINDOW_HXX - -#include -#include - -class VCL_DLLPUBLIC PopupMenuFloatingWindow : public FloatingWindow -{ -private: - struct SAL_DLLPRIVATE ImplData; - std::unique_ptr mpImplData; -public: - PopupMenuFloatingWindow( vcl::Window* pParent ); - virtual ~PopupMenuFloatingWindow() override; - virtual void dispose() override; - - sal_uInt16 GetMenuStackLevel() const; - void SetMenuStackLevel( sal_uInt16 nLevel ); - bool IsPopupMenu() const; - - //determine if a given window is an activated PopupMenuFloatingWindow - static bool isPopupMenu(const vcl::Window *pWindow); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/osx/soffice.xcodeproj/project.pbxproj b/osx/soffice.xcodeproj/project.pbxproj index 98cf4cd9096a..42f20e8847ea 100644 --- a/osx/soffice.xcodeproj/project.pbxproj +++ b/osx/soffice.xcodeproj/project.pbxproj @@ -133,7 +133,6 @@ BE2DAD11182FAB5200A4D2F7 /* mnemonicengine.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mnemonicengine.cxx; path = ../vcl/source/window/mnemonicengine.cxx; sourceTree = ""; }; BE2DAD12182FAB5200A4D2F7 /* mouseevent.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mouseevent.cxx; path = ../vcl/source/window/mouseevent.cxx; sourceTree = ""; }; BE2DAD13182FAB5200A4D2F7 /* msgbox.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = msgbox.cxx; path = ../vcl/source/window/msgbox.cxx; sourceTree = ""; }; - BE2DAD14182FAB5200A4D2F7 /* popupmenuwindow.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = popupmenuwindow.cxx; path = ../vcl/source/window/popupmenuwindow.cxx; sourceTree = ""; }; BE2DAD15182FAB5200A4D2F7 /* printdlg.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = printdlg.cxx; path = ../vcl/source/window/printdlg.cxx; sourceTree = ""; }; BE2DAD16182FAB5200A4D2F7 /* scrwnd.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = scrwnd.cxx; path = ../vcl/source/window/scrwnd.cxx; sourceTree = ""; }; BE2DAD17182FAB5200A4D2F7 /* scrwnd.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = scrwnd.hxx; path = ../vcl/source/window/scrwnd.hxx; sourceTree = ""; }; @@ -802,7 +801,6 @@ BE2DAD11182FAB5200A4D2F7 /* mnemonicengine.cxx */, BE2DAD12182FAB5200A4D2F7 /* mouseevent.cxx */, BE2DAD13182FAB5200A4D2F7 /* msgbox.cxx */, - BE2DAD14182FAB5200A4D2F7 /* popupmenuwindow.cxx */, BE2DAD15182FAB5200A4D2F7 /* printdlg.cxx */, BE2DAD16182FAB5200A4D2F7 /* scrwnd.cxx */, BE2DAD17182FAB5200A4D2F7 /* scrwnd.hxx */, diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 1a1e268591ae..739d49d9ea30 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -7410,7 +7410,6 @@ include/vcl/pdfextoutdevdata.hxx include/vcl/pdfwriter.hxx include/vcl/pngread.hxx include/vcl/pngwrite.hxx -include/vcl/popupmenuwindow.hxx include/vcl/print.hxx include/vcl/prntypes.hxx include/vcl/ptrstyle.hxx @@ -17302,7 +17301,6 @@ vcl/source/window/mnemonic.cxx vcl/source/window/mnemonicengine.cxx vcl/source/window/mouse.cxx vcl/source/window/paint.cxx -vcl/source/window/popupmenuwindow.cxx vcl/source/window/printdlg.cxx vcl/source/window/scrwnd.cxx vcl/source/window/seleng.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 4ee0873bd189..430cc4d9c0b5 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -159,7 +159,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/mouse \ vcl/source/window/NotebookBarAddonsMerger \ vcl/source/window/OptionalBox \ - vcl/source/window/popupmenuwindow \ vcl/source/window/printdlg \ vcl/source/window/scrwnd \ vcl/source/window/seleng \ diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx index 829e7e3a818d..ccca1cd2072f 100644 --- a/vcl/qt5/Qt5AccessibleWidget.cxx +++ b/vcl/qt5/Qt5AccessibleWidget.cxx @@ -53,7 +53,6 @@ #include #include #include -#include using namespace css; using namespace css::accessibility; diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index ddcfd56aaa73..169c69451c5f 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -130,14 +129,9 @@ vcl::Window* Window::GetAccessibleParentWindow() const pParent = pWorkWin; } // If this is a floating window which has a native border window, then that border should be reported as - // the accessible parent, unless the floating window is a PopupMenuFloatingWindow - - // The logic here has to match that of AccessibleFactory::createAccessibleContext in - // accessibility/source/helper/acc_factory.cxx to avoid PopupMenuFloatingWindow - // becoming a11y parents of themselves + // the accessible parent else if( GetType() == WindowType::FLOATINGWINDOW && - mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && - !PopupMenuFloatingWindow::isPopupMenu(this)) + mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) { pParent = mpWindowImpl->mpBorderWindow; } diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx deleted file mode 100644 index f85298e63642..000000000000 --- a/vcl/source/window/popupmenuwindow.cxx +++ /dev/null @@ -1,74 +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 - -#include - -struct PopupMenuFloatingWindow::ImplData -{ - sal_uInt16 mnMenuStackLevel; // Store the stack level of a popup menu. 0 = top-level menu. - - ImplData(); -}; - -PopupMenuFloatingWindow::ImplData::ImplData() : - mnMenuStackLevel( ::std::numeric_limits::max() ) -{ -} - -PopupMenuFloatingWindow::PopupMenuFloatingWindow( vcl::Window* pParent ) : - FloatingWindow(pParent, WB_SYSTEMFLOATWIN | WB_SYSTEMWINDOW | WB_NOBORDER ), - mpImplData(new ImplData) -{ -} - -PopupMenuFloatingWindow::~PopupMenuFloatingWindow() -{ - disposeOnce(); -} - -void PopupMenuFloatingWindow::dispose() -{ - mpImplData.reset(); - FloatingWindow::dispose(); -} - -sal_uInt16 PopupMenuFloatingWindow::GetMenuStackLevel() const -{ - return mpImplData->mnMenuStackLevel; -} - -void PopupMenuFloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) -{ - mpImplData->mnMenuStackLevel = nLevel; -} - -bool PopupMenuFloatingWindow::IsPopupMenu() const -{ - return mpImplData->mnMenuStackLevel != ::std::numeric_limits::max(); -} - -bool PopupMenuFloatingWindow::isPopupMenu(const vcl::Window *pWindow) -{ - const PopupMenuFloatingWindow* pChild = dynamic_cast(pWindow); - return pChild && pChild->IsPopupMenu(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit