<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Paste from Clipboard - it changes format of whole word as per last letter on previous line"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=103350#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Paste from Clipboard - it changes format of whole word as per last letter on previous line"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=103350">bug 103350</a>
from <span class="vcard"><a class="email" href="mailto:kamlan@post.cz" title="Kamil Landa <kamlan@post.cz>"> <span class="fn">Kamil Landa</span></a>
</span></b>
<pre>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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>