| Summary: | : Basic: missing Help for functions Replace and StrConv | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Gerhard Weydt <gerhard.weydt> |
| Component: | Documentation | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | himajin100000, olivier.hallot, xiscofauli |
| Priority: | medium | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.documentfoundation.org/show_bug.cgi?id=114263 | ||
| Whiteboard: | target:6.3.0 target:7.2.0 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | 124184 | ||
| Bug Blocks: | 127597 | ||
|
Description
Gerhard Weydt
2019-03-13 22:31:57 UTC
For information: StrConv seems to be VBA-only function. A QA test of the current implementation is available in https://opengrok.libreoffice.org/xref/core/basic/qa/vba_tests/strconv.vb?r=b9d75dea The commented tests obvioulsy fails and were nuked to prevent build break. Olivier Hallot committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/+/e6dfe7b36ebfda217fe89c18b656d2eee72c18ce%5E%21 tdf#124066, tdf#114263 BASIC Replace function Help (In reply to Olivier Hallot from comment #1) > For information: > > StrConv seems to be VBA-only function. > > A QA test of the current implementation is available in > > https://opengrok.libreoffice.org/xref/core/basic/qa/vba_tests/strconv. > vb?r=b9d75dea > > The commented tests obvioulsy fails and were nuked to prevent build break. I've had a closer look at the QA test program and I must say, it leaves some serious questions: for a start, only a minor question: VBA support is only needed when using the constants vb...; using the numbers (the only information I had when testing, based on Andrew Pitonyak's OOME) the code works correctly. The errorHandler contains two problems: The string ...(False)... in the first line causes a syntax error: the opening bracket is obviously interpreted as preceding the parameters of the function, and then the part nafter the closing bracket does not confirm to the syntax rules. The code runs correctly if the brackets are left out or if the closing bracket is moved to the end of the line. The line "verify_testStrConv = result" is missing in the errorHandler. Hence, the correct value assigned to the variable "result" is overwritten by the first statement of doUnitTest, where the return value of verify_testStrConv still is an empty string. Now to the tests in verify_testStrConv: For the conversion to "wide" the string used for comparison has nothing to do with the actual result: The string presented by msgbox is: "ABCDEVB¥ì¥¹¥¥å©`". Using this for comparison yields an OK. But using this as input for the conversion to narrow doesn't work. Obviously there are some limitations for strings to be entered in Basic. Using the output of the conversion to wide, though, directly as input for the conversion to narrow, does work. I tested this by reading and replacing the content of a test document, where support of fonts is given, and it worked perfecty. Probaly the same applies to the conversion between Hiragana/Katagana: the conversion works fine when randomly chosen characters out of the Hiragana range and back again; but I don't understand the strings used in the QA program. Conversion from/to Unicode works in my constellation, too. But this is a simple, European situation. Conclusions: Help for modes up to 3 could be safey published. For modes up to 32 the function seems to work correctly, but the test code ha to be adjusted, if it should be activated (which should be desirable, otherwise it would be useless). For modes 64 and 128 the code seems to me correct, but I can only test the quite simple case of a european installation. Someone with a deeper knowledge of codepages and string representations should hav a ookat it. Until the QA test is implemented and validates StrConv(), it is not advisable to publish any documentation of the function. It can lead to errors and expose issues on quality. Therefore I am making this bug dependent of bug#124184. StrConv in LO does not implement handling its third argument (LCID). Without that, there's no way to create useful unit tests (since everything is system-dependent, and so different on different systems). If someone wants to implement that, the code is SbRtl_StrConv in basic/source/runtime/methods.cxx; LCIDs (MS thing [1]) is represented in LO by LanguageType (include/i18nlangtag/lang.h), so it's directly usable in the SbRtl_StrConv function, that also internally uses a LanguageType value hardcoded to LANGUAGE_SYSTEM. [1] https://msdn.microsoft.com/en-us/goglobal/bb964664 Dear Olivier Hallot, This bug has been in ASSIGNED status for more than 3 months without any activity. Resetting it to NEW. Please assign it back to yourself if you're still working on this. Olivier Hallot committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/68a8e252d2600cabc694d9c489ec641dbd3c902a tdf#124066 Help for VBA StrConv function Alain Romedenne committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/e5ac483bab252537ccbd087e6a133230cb8bae70 tdf#141474 tdf#124066 Basic keyword arguments explanations |