Kaydet (Commit) 3a81c0d4 authored tarafından László Németh's avatar László Németh

tdf#120422 LibreLogo: fix page and line formatting of "magic wand"

Format program lines as paragraphs, instead of a single paragraph
with line breaks:

- basic debug feature "jump to the bad line" works after formatting

- fix 2-page editing area: page break before the LibreLogo program

Now formatting of program lines doesn't depend on the actual regular
expression setting of Search & Replace functionality of Writer,
so this is the intended fix for tdf#100941 "LibreLogo: 'magic wand'
icon inserts incorrect '\n' characters instead of paragraph breaks".

NOTE: setting also AlgorithmType, not only AlgorithmType2 prevents
crashing of LibreOffice at opening Search & Replace dialog after
usage of the "magic wand" icon.

partial revert of the commit b1a6d157
   Resolves: tdf#100941 LibreLogo: replace literal '\n' with newline

Change-Id: I34f581278fdae8d41967800d05662e37b731b59d
Reviewed-on: https://gerrit.libreoffice.org/61610Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
Tested-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 0d4abd0a
......@@ -450,9 +450,9 @@ def __translate__(arg = None):
pagebreak = False
selection.setString(text)
# convert to paragraphs
__dispatcher__(".uno:ExecuteSearch", (__getprop__("SearchItem.SearchString", r"\n"), __getprop__("SearchItem.ReplaceString", "\n"), \
__dispatcher__(".uno:ExecuteSearch", (__getprop__("SearchItem.SearchString", r"\n"), __getprop__("SearchItem.ReplaceString", r"\n"), \
__getprop__("Quiet", True), __getprop__("SearchItem.Command", 3), __getprop__("SearchItem.StyleFamily", 2), \
__getprop__("SearchItem.AlgorithmType2", 1), __getprop__("SearchItem.SearchFlags", 0)))
__getprop__("SearchItem.AlgorithmType", 1), __getprop__("SearchItem.AlgorithmType2", 2), __getprop__("SearchItem.SearchFlags", 0)))
# set 2-page layout
if pagebreak:
selection.getStart().BreakType = 4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment