https://bugs.freedesktop.org/show_bug.cgi?id=69931

          Priority: medium
            Bug ID: 69931
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: [Writer] getString and setString lack symmetry : CR
                    --> CRLF
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: j.tro...@hotmail.fr
          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
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to