https://bugs.documentfoundation.org/show_bug.cgi?id=121325

            Bug ID: 121325
           Summary: 4-argument form of Mid() BASIC function broken in 6.x
                    (worked in 4.x and OO)
           Product: LibreOffice
           Version: 6.1.3.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
The 4-argument form of the BASIC instruction Mid(str,start,len,repl) is
supposed to replace the selected sub-string with the specified replacement
text.  However starting with 6.1 it produces the wrong result if the
replacement text is shorter than the selected text: the extra characters are
not deleted.

Note: The documentation says that the replacement text will be truncated if it
is *longer* than the specified substring.  However it is allowed to be shorter,
in which case the extra character(s) should be deleted.

Documentation is at
 
https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide/Strings_(Runtime_Library)
  [search for "replaces three"]

I will attach a spreadsheet with a small macro which demonstrates the bug.

Steps to Reproduce:
1. Open attached "MidBugDemo.ods" spreadsheet
2. Enable macros & run the macro at <filename>->Standard->Module1->BugDemo
(detailed instructions are in the spreadsheet)

Actual Results:
MyString = "This was my text"
Mid(MyString, 6, 3, "is")
RESULT IS "This iss my text" (wrong)


Expected Results:
Should get "This is my text"


Reproducible: Always


User Profile Reset: No



Additional Info:

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to