[Libreoffice-bugs] [Bug 103350] Paste from Clipboard - it changes format of whole word as per last letter on previous line
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Aug 12 15:36:36 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=103350
--- Comment #6 from Kamil Landa <kamlan at post.cz> ---
Solution via macro.
Sub resetAndPaste 'reset attributes before paste via inserted space
dim document as object, dispatcher as object
document=thisComponent.CurrentController.Frame
dispatcher=createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name="Text" : args1(0).Value=" "
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
'insert space
dim args2(1) as new com.sun.star.beans.PropertyValue
args2(0).Name="Count" : args2(0).Value=1
args2(1).Name="Select" : args2(1).Value=true
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args2())
'select space
dispatcher.executeDispatch(document, ".uno:ResetAttributes", "", 0,
Array()) 'reset attributes (need if cursor is at start of line)
dim args4(1) as new com.sun.star.beans.PropertyValue
args4(0).Name="Count" : args4(0).Value=1
args4(1).Name="Select" : args4(1).Value=false
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args4())
'back to end of space
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args4()) 'go
to start of space
dispatcher.executeDispatch(document, ".uno:ResetAttributes", "", 0,
Array()) 'reset attributes (need if cursor isn't at start of line and before
space is formatted text)
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
'Ctrl+V
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array())
'delete space
End Sub
Verze: 6.2.6.1 (x64)
ID sestavení: 1f09ad467b449704e317fb11998b9a2ad7184670
Vlákna CPU: 8; OS: Windows 10.0; Vykreslování UI: výchozí; VCL: win;
Národní prostředí: cs-CZ (cs_CZ); Jazyk UI: cs-CZ
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190812/d8e88769/attachment.html>
More information about the Libreoffice-bugs
mailing list