Hi again,

since i got no answer:
is my question hard to understand (bad formulation) or is there simply no possibility to achieve this.

This is what I do to insert text on drop. But it is always inserted at the wrong cursor position. It is inserted where the cursor has been before d&d started. Not where the cursor was positioned during d&d.

void  DropTargetListener::drop(const ::cssdd::DropTargetDropEvent& dtde)
{
        /*
        getting the TextDocument and TextViewCursorSupplier here
        ...
        */
        ::css::uno::Reference< ::css::text::XTextRange > textRange (            
  
                textViewCursor, ::css::uno::UNO_QUERY);
        ::css::uno::Reference< ::css::text::XText > xText =
                textRange->getText();                                
        ::css::uno::Reference< ::css::text::XSimpleText > simpleText (
                xText, ::css::uno::UNO_QUERY);
        simpleText ->insertString( textRange ,
                ::rtl::OUString::createFromAscii("DROP"), sal_False);
}

Any help appreciated
Sascha

Sascha Jensen schrieb:
Hi,

i have send this mail to [EMAIL PROTECTED] before but I was adviced that here might be a better place to ask this question.

My question si about TextCursor position during a drag and drop operation. I use d&d in OOo Writer where i would like to insert some text at the cursors position that is displayed while dragging over the document.

I use the TextViewCursor available at the TextViewCursorSupplier of the Document. But the TextViewCursor always has the same position as before the d&d operation is started. I can see that special cursor that visualizes the potential drop position. Also I can get some coordinates from the DropTargetDragEvent in ::com::sun::star::datatransfer::dnd::XDropTargetListener::dragOver. But it seems to me that can I neither get that special cursor nor apply the DropTargetDragEvent location to a cursor.

So my questions are:
1. Can I somehow get the cursor that vizualizes the potential drop position or is that cursor destroyed before the drop is performed?

2. Is there a way to apply coordinates/position to a TextViewCursor?

3. Am I overlooking some possibilities?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to