https://issues.apache.org/ooo/show_bug.cgi?id=123385

            Bug ID: 123385
        Issue Type: DEFECT
           Summary: getString and setString lack symmetry : CR --> CRLF
           Product: Writer
           Version: 4.0.0
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: programming
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 81675
  --> https://issues.apache.org/ooo/attachment.cgi?id=81675&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 on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

Reply via email to