https://bugs.freedesktop.org/show_bug.cgi?id=69931
Priority: medium
Bug ID: 69931
Assignee: [email protected]
Summary: [Writer] getString and setString lack symmetry : CR
--> CRLF
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
Hardware: Other
Status: UNCONFIRMED
Version: unspecified
Component: BASIC
Product: LibreOffice
Created attachment 86802
--> https://bugs.freedesktop.org/attachment.cgi?id=86802&action=edit
GetString converts CR to CRLF
Hi,
Appended file uses following (very basic!) macro :
Sub Main
doc = ThisComponent
source = doc.CurrentSelection(0)
dest = doc.Text.End
dest.SetString(source.GetString)
End Sub
Selecting entire text and pushing button ought to append a second copy.
But a linefeed is added after each end of paragraph.
Seems that GetString converts CR to CRLF, but SetString does not reverse the
process.
Not deadly indeed, but annoying for anybody unaware of the problem.
A possible workaround :
Sub Main
doc = ThisComponent
source = doc.CurrentSelection(0)
dest = doc.Text.End
dest.SetString(Join(Split(source.GetString,Chr(13)&Chr(10)),Chr(13)))
End Sub
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs