I'm desperately seeking this in OO/LO. Is there a undocumented feature or plans to implement this?fabiusf wrote:Code: Select all
Option VBASupport 1 ... Application.CellDragAndDrop = False ...
Disable Drag & Drop
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Disable Drag & Drop
Last edited by Penikufesin on Tue Oct 31, 2023 8:04 pm, edited 2 times in total.
- JohnSUN-Pensioner
- Volunteer
- Posts: 876
- Joined: Fri Jan 14, 2011 1:21 pm
- Location: Kyiv, Ukraine
Re: disable cut, copy, paste, paste special, drag & Drop
I'm afraid to know the answer to the question - disable cut, copy, paste, etc. for the entire application? Not for a single document?
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Re: Disable Drag & Drop
It would be fine to disable Drag&Drop for a single document. (users sometimes move cells by accident)
BTW: I miss the original post, but it doesn't matter, subject edited.
BTW: I miss the original post, but it doesn't matter, subject edited.
- JohnSUN-Pensioner
- Volunteer
- Posts: 876
- Joined: Fri Jan 14, 2011 1:21 pm
- Location: Kyiv, Ukraine
Re: Disable Drag & Drop
Ok. What about "protect sheet"?
If this variant is not suitable (why?), it is necessary to intercept mouse events and handle them independently (disconnect the mouse from the PC is simply, IMHO).
Another method - create dialog for users...
If this variant is not suitable (why?), it is necessary to intercept mouse events and handle them independently (disconnect the mouse from the PC is simply, IMHO).
Another method - create dialog for users...
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Re: Disable Drag & Drop
The sheet is protected but a lot of cells are not, because they must be editable. For a lot of applications I prefer direct editing of the sheet instead of creating (possibly a huge number of) dialogs. Only the cell-moving-problem troubles...
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Re: Disable Drag & Drop
A few years later... are there news regarding this topic?
Re: Disable Drag & Drop
Perhaps this page will helpPenikufesin wrote: ↑Wed Mar 01, 2023 1:11 am A few years later... are there news regarding this topic?
viewtopic.php?f=25&t=29977
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Re: Disable Drag & Drop
This looks very complicated. Ad hoc I couldn't get it to work. But thank you.
Re: Disable Drag & Drop
Try running this code - then do a drag and drop. Testing for OpenOffice Calc I get windows(7) for the main window - that may differ for you.
This appears to stop the drag drop but you can use Mri to examine ev.context and look things up in the API to see how it all works for yourself.
This appears to stop the drag drop but you can use Mri to examine ev.context and look things up in the API to see how it all works for yourself.
Code: Select all
Sub StartDragDropListener()
w1 = thiscomponent.CurrentController.frame.componentwindow.accessiblecontext.getaccessiblechild(0).windows(7) '.windows(0
dt =thiscomponent.CurrentController.frame.containerwindow.gettoolkit.getdroptarget(w1)
DDListener = CreateUnoListener("DDListener_","com.sun.star.datatransfer.dnd.XDropTargetListener")
dt.addDropTargetListener(DDListener)
end sub
function DDListener_drop(ev) ' The drag operation has terminated with a drop on this drop target.
ev.context.dropcomplete false
end function
sub DDListener_dragEnter(ev) ' Called when a drag operation has encountered the drop target.
end sub
sub DDListener_dragExit(ev) ' The drag operation has departed the drop target without dropping.
end sub
sub DDListener_dragOver(ev) ' Called when a drag operation is ongoing on the drop target.
end sub
sub DDListener_dropActionChanged(ev) '
end sub
sub DDListener_disposing(ev)
end sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 26
- Joined: Sun Nov 02, 2014 7:03 pm
Re: Disable Drag & Drop
It works, thank you very much!
But you're not sure, wether it is portable? And I'm wondering, why it has to be so complicated:
Code: Select all
w1 = thiscomponent.CurrentController.frame.componentwindow.accessiblecontext.getaccessiblechild(0).windows(7)
dt =thiscomponent.CurrentController.frame.containerwindow.gettoolkit.getdroptarget(w1)
DDListener = CreateUnoListener("DDListener_","com.sun.star.datatransfer.dnd.XDropTargetListener")
dt.addDropTargetListener(DDListener)
Code: Select all
oKeyHandler = createUnoListener("KeyHdl_", "com.sun.star.awt.XKeyHandler")
ThisComponent.getCurrentController.addKeyHandler(oKeyHandler)
Re: Disable Drag & Drop
Unless you can find another way to identify the window I've just got the same suggestions I had in the other thread - to make it more rigorous loop though looking for an AccessibleRole of 40 and its also likely the biggest window (looking for which is how I got the 7)Penikufesin wrote: ↑Fri Mar 03, 2023 1:07 am But you're not sure, wether it is portable? And I'm wondering, why it has to be so complicated:
There are a minuscule number of people wanting what you want here - so no OO developer has implemented an easy way to do it as they have done in Office - that would be my guess.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)