You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/04/14 19:38:41 UTC

[Issue 123385] getString returns LF (Chr(10)) instead of CR (Chr(13)) for a paragraph break

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

mroe <mr...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|getString and setString     |getString returns LF
                   |lack symmetry : CR --> CRLF |(Chr(10)) instead of CR
                   |                            |(Chr(13)) for a paragraph
                   |                            |break

--- Comment #2 from mroe <mr...@gmx.net> ---
Remember: Writer <> (simple) Texteditor!

An end of a paragraph is not represented by a character like Chr( 13 ) rather
than as format entry like in HTML: <p>My text.</p>

Changing the given code to:

Option Explicit
Sub Main
 Dim doc As Object
 Dim source As Object
 Dim dest As Object
 Dim s As String
 Dim s1 As String
 Dim c As String
 Dim i As Integer
 doc = ThisComponent
 source = doc.CurrentSelection(0)
 s = source.GetString
 For i = 1 To Len( s )
   c = Mid( s, i, 1 )
   s1 = s1 & c & " : " & ASC( c ) & Chr( 10 )
 Next i
 dest = doc.Text.End
 dest.SetString( s )
End Sub

With this code you will see that a paragraph break is shown only as line feed
Chr( 10 ). (The empty line is the representation of the line break ASC( Chr( 10
))!)

If one select
end.</p><p>Next paragraph
source.getString() should return
"end." & Chr(13) & "Next paragraph"
and not
"end." & Chr(10) & "Next paragraph"

like at this time.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.
You are watching all issue changes.