vcl/unx/generic/dtrans/X11_clipboard.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1d8ff7bd62249ad0f825eaca18ea524d9d7c6c2e
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Mar 19 18:50:54 2025 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Wed Mar 19 20:43:25 2025 +0100

    XClipboardOwner::lostOwnership is documented to take the old content
    
    ...so passing in the clear()'ed m_aContents is apparently a bug introduced 
in
    4df7758dbd43c722bab9e3b0f0b21c16a4311937 "INTEGRATION: CWS vcl17 (1.9.52); 
FILE
    MERGED".  (But convert back to the name xTrans introduced there; it looks 
more
    meaningful than the xKeepAlive to which it had been renamed in
    b9fe4f26eaf1099b8d0907b8d9cbf52c86914466 "rename some local variables".)
    
    Change-Id: I05254d7f06a956655fdc215c8956aa5f207de42f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183137
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx 
b/vcl/unx/generic/dtrans/X11_clipboard.cxx
index 1a0e5c685c71..769fb9cc41b6 100644
--- a/vcl/unx/generic/dtrans/X11_clipboard.cxx
+++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx
@@ -116,7 +116,7 @@ void X11Clipboard::clearContents()
     // copy member references on stack so they can be called
     // without having the mutex
     Reference< XClipboardOwner > xOwner( m_aOwner );
-    Reference< XTransferable > xKeepAlive( m_aContents );
+    Reference< XTransferable > xTrans( m_aContents );
     // clear members
     m_aOwner.clear();
     m_aContents.clear();
@@ -126,7 +126,7 @@ void X11Clipboard::clearContents()
 
     // inform previous owner of lost ownership
     if ( xOwner.is() )
-        xOwner->lostOwnership(xThis, m_aContents);
+        xOwner->lostOwnership(xThis, xTrans);
 }
 
 Reference< XTransferable > SAL_CALL X11Clipboard::getContents()

Reply via email to