chart2/source/controller/main/ChartController.cxx | 1 editeng/source/editeng/impedit.cxx | 1 include/vcl/dndlistenercontainer.hxx | 23 ---------- include/vcl/window.hxx | 4 - sc/source/ui/view/tabview3.cxx | 1 solenv/clang-format/excludelist | 2 svx/source/svdraw/svdedxv.cxx | 1 toolkit/source/awt/vclxtoolkit.cxx | 3 - vcl/inc/pch/precompiled_vcl.hxx | 2 vcl/source/app/salvtables.cxx | 1 vcl/source/control/edit.cxx | 8 +-- vcl/source/control/listbox.cxx | 2 vcl/source/edit/textview.cxx | 5 +- vcl/source/treelist/transfer2.cxx | 6 +- vcl/source/window/dndeventdispatcher.cxx | 48 +++++++++++----------- vcl/source/window/dndlistenercontainer.cxx | 38 ----------------- vcl/source/window/dockwin.cxx | 2 vcl/source/window/mouse.cxx | 11 +---- vcl/source/window/stacking.cxx | 1 vcl/source/window/window.cxx | 2 vcl/source/window/winproc.cxx | 29 ++++++++++++- 21 files changed, 80 insertions(+), 111 deletions(-)
New commits: commit fcee7631232dc0ad0d8d73f3ac9f5e8c663e4d77 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jul 24 12:06:06 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jul 24 15:45:01 2025 +0200 vcl dnd: Consolidate drop target retrieval, avoid casting Return a reference to the concrete DNDListenerContainer instance instead of one to the abstract css::datatransfer::dnd::XDropTarget interface in Window::GetDropTarget. This allows to drop Window::GetDragGestureRecognizer which was returning a reference to the css::datatransfer::dnd::XDragGestureRecognizer interface for the exact same object, so can now use Window::GetDropTarget directly instead, which drops the need to query for the other interface. DNDEventDispatcher was already assuming that a DNDListenerContainer object was returned and casting to that, which is no longer needed now. Change-Id: Ib7ea7cdb0650ba2410b112774f475b4799901538 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188271 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index a0d161d72618..5f013d759351 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -67,6 +67,7 @@ #include <svx/sidebar/SelectionChangeHandler.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <utility> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <osl/mutex.hxx> diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 743fb87bdded..36d23bd09f20 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp> #include <comphelper/lok.hxx> #include <editeng/flditem.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <svl/intitem.hxx> #include <vcl/inputctx.hxx> #include <vcl/transfer.hxx> diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 7ce9ccfc8fc3..0e378b225b2e 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -41,6 +41,7 @@ struct SystemEnvData; struct SystemParentData; class ImplBorderWindow; class Timer; +class DNDListenerContainer; class DockingManager; class Scrollable; class FixedText; @@ -1219,9 +1220,8 @@ public: void SetCreatedWithToolkit( bool b ); // Drag and Drop interfaces - css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget(); + rtl::Reference<DNDListenerContainer> GetDropTarget(); css::uno::Reference< css::datatransfer::dnd::XDragSource > GetDragSource(); - css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer(); // Clipboard/Selection interfaces css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard(); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index fb9622a45725..5655e85efe68 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -30,6 +30,7 @@ #include <sfx2/lokhelper.hxx> #include <sfx2/viewfrm.hxx> #include <vcl/cursor.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/uitest/logger.hxx> #include <vcl/uitest/eventdescription.hxx> #include <sal/log.hxx> diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 951d991e8a35..ca575912232e 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -42,6 +42,7 @@ #include <vcl/canvastools.hxx> #include <vcl/commandevent.hxx> #include <vcl/cursor.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/weld.hxx> #include <vcl/window.hxx> #include <comphelper/lok.hxx> diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index bdb8ebb83a6a..93de7b710139 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -61,6 +61,7 @@ #include <rtl/process.h> #include <sal/log.hxx> #include <tools/link.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/idletask.hxx> #include <vcl/unohelp.hxx> #include <vcl/wintypes.hxx> @@ -2067,7 +2068,7 @@ css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL V VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( window ); if( pWindow ) - return pWindow->GetDragGestureRecognizer(); + return pWindow->GetDropTarget(); return css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer >(); } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index ec2e9c27db31..28bc54a48fa6 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -50,6 +50,7 @@ #include <tools/helpers.hxx> #include <vcl/abstdlg.hxx> #include <vcl/builder.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/toolkit/combobox.hxx> #include <vcl/toolkit/dialog.hxx> #include <vcl/toolkit/fixed.hxx> diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 670abff58fa0..04269032e6a9 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -24,6 +24,7 @@ #include <vcl/builder.hxx> #include <vcl/cursor.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/event.hxx> #include <vcl/ptrstyle.hxx> #include <vcl/specialchars.hxx> @@ -211,12 +212,9 @@ void Edit::dispose() if ( mxDnDListener.is() ) { - if ( GetDragGestureRecognizer().is() ) - { - GetDragGestureRecognizer()->removeDragGestureListener( mxDnDListener ); - } if ( GetDropTarget().is() ) { + GetDropTarget()->removeDragGestureListener(mxDnDListener); GetDropTarget()->removeDropTargetListener( mxDnDListener ); } @@ -301,7 +299,7 @@ void Edit::ImplInit(vcl::Window* pParent, WinBits nStyle) SetPointer( PointerStyle::Text ); ApplySettings(*GetOutDev()); - css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDGR = GetDragGestureRecognizer(); + css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDGR = GetDropTarget(); if ( xDGR.is() ) { xDGR->addDragGestureListener( mxDnDListener ); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 5a71a6d951b7..6dc023c7968a 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -19,6 +19,7 @@ #include <vcl/builder.hxx> #include <vcl/commandevent.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/event.hxx> #include <vcl/toolkit/lstbox.hxx> #include <vcl/settings.hxx> @@ -32,7 +33,6 @@ #include <dndeventdispatcher.hxx> #include <comphelper/lok.hxx> -#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> #include <boost/property_tree/ptree.hpp> #include <tools/json_writer.hxx> diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index b4b19c851fc6..c4a8015ec6a4 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -21,6 +21,7 @@ #include <i18nutil/searchopt.hxx> #include <o3tl/string_view.hxx> #include <utility> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/textview.hxx> #include <vcl/texteng.hxx> #include <vcl/settings.hxx> @@ -149,11 +150,11 @@ TextView::TextView(ExtTextEngine* pEng, vcl::Window* pWindow) pWindow->GetOutDev()->SetLineColor(); - if ( pWindow->GetDragGestureRecognizer().is() ) + if (pWindow->GetDropTarget().is()) { mxDnDListener = new vcl::unohelper::DragAndDropWrapper(this); - pWindow->GetDragGestureRecognizer()->addDragGestureListener(mxDnDListener); + pWindow->GetDropTarget()->addDragGestureListener(mxDnDListener); pWindow->GetDropTarget()->addDropTargetListener(mxDnDListener); pWindow->GetDropTarget()->setActive( true ); pWindow->GetDropTarget()->setDefaultActions( css::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE ); diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx index ce2c2073ba79..e8c8642fd2a0 100644 --- a/vcl/source/treelist/transfer2.cxx +++ b/vcl/source/treelist/transfer2.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> #include <com/sun/star/uno/DeploymentException.hpp> #include <svl/urlbmk.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/transfer.hxx> #include <svdata.hxx> @@ -69,9 +70,8 @@ void SAL_CALL DragSourceHelper::DragGestureListener::dragGestureRecognized( cons mrParent.StartDrag( rDGE.DragAction, aPtPixel ); } - -DragSourceHelper::DragSourceHelper( vcl::Window* pWindow ) : - mxDragGestureRecognizer( pWindow->GetDragGestureRecognizer() ) +DragSourceHelper::DragSourceHelper(vcl::Window* pWindow) + : mxDragGestureRecognizer(pWindow->GetDropTarget()) { if( mxDragGestureRecognizer.is() ) { diff --git a/vcl/source/window/dndeventdispatcher.cxx b/vcl/source/window/dndeventdispatcher.cxx index f7673d7df0a2..8897d22d5384 100644 --- a/vcl/source/window/dndeventdispatcher.cxx +++ b/vcl/source/window/dndeventdispatcher.cxx @@ -258,16 +258,16 @@ sal_Int32 DNDEventDispatcher::fireDragEnterEvent( vcl::Window *pWindow, SolarMutexClearableGuard aSolarGuard; // query DropTarget from window - Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); - if( xDropTarget.is() ) + if (pDropTarget.is()) { // retrieve relative mouse position Point relLoc = pWindow->ScreenToOutputPixel( rLocation ); aSolarGuard.clear(); - n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDragEnterEvent( - xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions, aFlavorList ); + n = pDropTarget->fireDragEnterEvent(xContext, nDropAction, relLoc.X(), relLoc.Y(), + nSourceActions, aFlavorList); } } @@ -286,16 +286,16 @@ sal_Int32 DNDEventDispatcher::fireDragOverEvent( vcl::Window *pWindow, SolarMutexClearableGuard aSolarGuard; // query DropTarget from window - Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); - if( xDropTarget.is() ) + if (pDropTarget.is()) { // retrieve relative mouse position Point relLoc = pWindow->ScreenToOutputPixel( rLocation ); aSolarGuard.clear(); - n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDragOverEvent( - xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions ); + n = pDropTarget->fireDragOverEvent(xContext, nDropAction, relLoc.X(), relLoc.Y(), + nSourceActions); } } @@ -311,12 +311,12 @@ sal_Int32 DNDEventDispatcher::fireDragExitEvent( vcl::Window *pWindow ) SolarMutexClearableGuard aGuard; // query DropTarget from window - Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); aGuard.clear(); - if( xDropTarget.is() ) - n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDragExitEvent(); + if (pDropTarget.is()) + n = pDropTarget->fireDragExitEvent(); } return n; @@ -334,16 +334,16 @@ sal_Int32 DNDEventDispatcher::fireDropActionChangedEvent( vcl::Window *pWindow, SolarMutexClearableGuard aGuard; // query DropTarget from window - Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); - if( xDropTarget.is() ) + if (pDropTarget.is()) { // retrieve relative mouse position Point relLoc = pWindow->ScreenToOutputPixel( rLocation ); aGuard.clear(); - n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDropActionChangedEvent( - xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions ); + n = pDropTarget->fireDropActionChangedEvent(xContext, nDropAction, relLoc.X(), + relLoc.Y(), nSourceActions); } } @@ -362,19 +362,19 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( vcl::Window *pWindow, SolarMutexClearableGuard aGuard; // query DropTarget from window - Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); // window may be destroyed in drop event handler VclPtr<vcl::Window> xPreventDelete = pWindow; - if( xDropTarget.is() ) + if (pDropTarget.is()) { // retrieve relative mouse position Point relLoc = pWindow->ScreenToOutputPixel( rLocation ); aGuard.clear(); - n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDropEvent( - xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions, xTransferable ); + n = pDropTarget->fireDropEvent(xContext, nDropAction, relLoc.X(), relLoc.Y(), + nSourceActions, xTransferable); } } @@ -393,16 +393,16 @@ sal_Int32 DNDEventDispatcher::fireDragGestureEvent( vcl::Window *pWindow, SolarMutexClearableGuard aGuard; // query DropTarget from window - Reference< XDragGestureRecognizer > xDragGestureRecognizer = pWindow->GetDragGestureRecognizer(); + rtl::Reference<DNDListenerContainer> pDropTarget = pWindow->GetDropTarget(); - if( xDragGestureRecognizer.is() ) + if (pDropTarget.is()) { // retrieve relative mouse position Point relLoc = pWindow->ScreenToOutputPixel( rOrigin ); aGuard.clear(); - n = static_cast < DNDListenerContainer * > ( xDragGestureRecognizer.get() )->fireDragGestureEvent( - nDragAction, relLoc.X(), relLoc.Y(), xSource, event ); + n = pDropTarget->fireDragGestureEvent(nDragAction, relLoc.X(), relLoc.Y(), xSource, + event); } } diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 2119531b6113..aa639fa4e774 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -652,10 +652,10 @@ void Window::ImplStartDnd() GetDropTarget(); } -Reference< css::datatransfer::dnd::XDropTarget > Window::GetDropTarget() +rtl::Reference<DNDListenerContainer> Window::GetDropTarget() { if( !mpWindowImpl ) - return Reference< css::datatransfer::dnd::XDropTarget >(); + return {}; if( ! mpWindowImpl->mxDNDListenerContainer.is() ) { @@ -737,11 +737,6 @@ Reference< css::datatransfer::dnd::XDragSource > Window::GetDragSource() #endif } -Reference< css::datatransfer::dnd::XDragGestureRecognizer > Window::GetDragGestureRecognizer() -{ - return Reference< css::datatransfer::dnd::XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY ); -} - } /* namespace vcl */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 4ab141a2ca66..138811c9173c 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <vcl/dndlistenercontainer.hxx> #include <vcl/syswin.hxx> #include <vcl/window.hxx> #include <vcl/taskpanelist.hxx> commit e69481201ec6b877e08e540e64f3ca271c71588e Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jul 24 11:24:38 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jul 24 15:44:55 2025 +0200 vcl dnd: Move DNDListenerContainer decl to include/vcl Move the class declaration to the global vcl include dir, in preparation of using the class directly in some places instead of references to the abstract UNO interfaces it implements in an upcoming commit. Change-Id: I89ecd2b8915b1cbd4be9d857024ed8bbceca6211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188270 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/inc/dndlistenercontainer.hxx b/include/vcl/dndlistenercontainer.hxx similarity index 100% rename from vcl/inc/dndlistenercontainer.hxx rename to include/vcl/dndlistenercontainer.hxx diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index bb2ed57b1587..ac8c0b44e734 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6141,6 +6141,7 @@ include/vcl/cvtgrf.hxx include/vcl/decoview.hxx include/vcl/dibtools.hxx include/vcl/dndhelp.hxx +include/vcl/dndlistenercontainer.hxx include/vcl/dockingarea.hxx include/vcl/dockwin.hxx include/vcl/embeddedfontshelper.hxx @@ -14151,7 +14152,6 @@ vcl/inc/canvasbitmap.hxx vcl/inc/debugevent.hxx vcl/inc/displayconnectiondispatch.hxx vcl/inc/dndeventdispatcher.hxx -vcl/inc/dndlistenercontainer.hxx vcl/inc/factory.hxx vcl/inc/fltcall.hxx vcl/inc/font/FontSelectPattern.hxx diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index 3d87bca95728..631773e80adc 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -283,7 +283,6 @@ #include <ImplOutDevData.hxx> #include <accel.hxx> #include <brdwin.hxx> -#include <dndlistenercontainer.hxx> #include <drawmode.hxx> #include <fontattributes.hxx> #include <impfontcache.hxx> @@ -327,6 +326,7 @@ #include <vcl/decoview.hxx> #include <vcl/dibtools.hxx> #include <vcl/dllapi.h> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/dockwin.hxx> #include <vcl/event.hxx> #include <vcl/filter/PngImageReader.hxx> diff --git a/vcl/source/window/dndeventdispatcher.cxx b/vcl/source/window/dndeventdispatcher.cxx index c57841c1fdfa..f7673d7df0a2 100644 --- a/vcl/source/window/dndeventdispatcher.cxx +++ b/vcl/source/window/dndeventdispatcher.cxx @@ -18,10 +18,10 @@ */ #include <dndeventdispatcher.hxx> -#include <dndlistenercontainer.hxx> #include <sal/log.hxx> #include <osl/mutex.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> diff --git a/vcl/source/window/dndlistenercontainer.cxx b/vcl/source/window/dndlistenercontainer.cxx index 2c5a8bbef830..f3f5b6cda0e5 100644 --- a/vcl/source/window/dndlistenercontainer.cxx +++ b/vcl/source/window/dndlistenercontainer.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <dndlistenercontainer.hxx> +#include <vcl/dndlistenercontainer.hxx> using namespace ::cppu; using namespace ::com::sun::star::uno; diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index e1bd2285f23d..05c11a339dcc 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -19,6 +19,7 @@ #include <tools/time.hxx> #include <sal/log.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/event.hxx> #include <vcl/toolkit/floatwin.hxx> #include <vcl/layout.hxx> @@ -33,7 +34,6 @@ #include <svdata.hxx> #include <window.h> #include <brdwin.hxx> -#include <dndlistenercontainer.hxx> #include "impldockingwrapper.hxx" diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 015bbada0af7..2119531b6113 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -26,6 +26,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vcl/ITiledRenderable.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/cursor.hxx> @@ -41,7 +42,6 @@ #include <salframe.hxx> #include <salinst.hxx> -#include <dndlistenercontainer.hxx> #include <dndeventdispatcher.hxx> #include <com/sun/star/datatransfer/dnd/XDragSource.hpp> diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 983d159898cf..9d402cf3fc3a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -24,6 +24,7 @@ #include <sal/types.h> #include <comphelper/diagnose_ex.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/salgtype.hxx> #include <vcl/event.hxx> #include <vcl/cursor.hxx> @@ -58,7 +59,6 @@ #include <toolbox.h> #include <brdwin.hxx> #include <helpwin.hxx> -#include <dndlistenercontainer.hxx> #include <dndeventdispatcher.hxx> #include <com/sun/star/accessibility/AccessibleRelation.hpp> diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index dc2c1dfeeee6..801ef8499d9f 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -29,6 +29,7 @@ #include <dndeventdispatcher.hxx> #include <comphelper/lok.hxx> #include <vcl/QueueInfo.hxx> +#include <vcl/dndlistenercontainer.hxx> #include <vcl/timer.hxx> #include <vcl/event.hxx> #include <vcl/GestureEventPan.hxx> @@ -56,7 +57,6 @@ #include <window.h> #include <helpwin.hxx> #include <brdwin.hxx> -#include <dndlistenercontainer.hxx> #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> #include <com/sun/star/datatransfer/dnd/XDragSource.hpp> commit 734ff49f50df4fb5b4d7e61280285041669dd015 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jul 24 11:17:49 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jul 24 15:44:49 2025 +0200 vcl dnd: Move GenericDropTarget{Drag,Drop}Context to winproc.cxx These classes are only used there (for the LOK case), so move them there instead of having them in the same header as the more widely used DNDListenerContainer class. This prepares for making dndlistenercontainer.hxx a global vcl header. Change-Id: I73095cea57f0eccfc8acf9fd5f41cf8868cc6b04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188269 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/inc/dndlistenercontainer.hxx b/vcl/inc/dndlistenercontainer.hxx index 3bd0fdc22734..a359796d1894 100644 --- a/vcl/inc/dndlistenercontainer.hxx +++ b/vcl/inc/dndlistenercontainer.hxx @@ -27,29 +27,6 @@ #include <comphelper/compbase.hxx> #include <comphelper/interfacecontainer4.hxx> -class GenericDropTargetDropContext : - public ::cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDropContext> -{ -public: - GenericDropTargetDropContext(); - - // XDropTargetDropContext - virtual void SAL_CALL acceptDrop( sal_Int8 dragOperation ) override; - virtual void SAL_CALL rejectDrop() override; - virtual void SAL_CALL dropComplete( sal_Bool success ) override; -}; - -class GenericDropTargetDragContext : - public ::cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDragContext> -{ -public: - GenericDropTargetDragContext(); - - // XDropTargetDragContext - virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) override; - virtual void SAL_CALL rejectDrag() override; -}; - class DNDListenerContainer final : public ::comphelper::WeakComponentImplHelper< css::datatransfer::dnd::XDragGestureRecognizer, diff --git a/vcl/source/window/dndlistenercontainer.cxx b/vcl/source/window/dndlistenercontainer.cxx index df8b6114f93b..2c5a8bbef830 100644 --- a/vcl/source/window/dndlistenercontainer.cxx +++ b/vcl/source/window/dndlistenercontainer.cxx @@ -417,40 +417,4 @@ void SAL_CALL DNDListenerContainer::dropComplete( sal_Bool success ) } } -/* - * GenericDropTargetDropContext - */ - -GenericDropTargetDropContext::GenericDropTargetDropContext() -{ -} - -void GenericDropTargetDropContext::acceptDrop( sal_Int8 /*dragOperation*/ ) -{ -} - -void GenericDropTargetDropContext::rejectDrop() -{ -} - -void GenericDropTargetDropContext::dropComplete( sal_Bool /*success*/ ) -{ -} - -/* - * GenericDropTargetDragContext - */ - -GenericDropTargetDragContext::GenericDropTargetDragContext() -{ -} - -void GenericDropTargetDragContext::acceptDrag( sal_Int8 /*dragOperation*/ ) -{ -} - -void GenericDropTargetDragContext::rejectDrag() -{ -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index fdb13c52eb95..dc2c1dfeeee6 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -64,6 +64,33 @@ #define IMPL_MIN_NEEDSYSWIN 49 +namespace +{ + +class GenericDropTargetDropContext + : public ::cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDropContext> +{ +public: + GenericDropTargetDropContext() {} + + // XDropTargetDropContext + virtual void SAL_CALL acceptDrop(sal_Int8 /*dragOperation*/) override {} + virtual void SAL_CALL rejectDrop() override {} + virtual void SAL_CALL dropComplete(sal_Bool /*success*/) override {} +}; + +class GenericDropTargetDragContext + : public ::cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDragContext> +{ +public: + GenericDropTargetDragContext() {} + + // XDropTargetDragContext + virtual void SAL_CALL acceptDrag(sal_Int8 /*dragOperation*/) override {} + virtual void SAL_CALL rejectDrag() override {} +}; +} + bool ImplCallPreNotify( NotifyEvent& rEvt ) { return rEvt.GetWindow()->CompatPreNotify( rEvt );
