Bug 123043 - Type character detection on variable name should be Unicode-aware
Summary: Type character detection on variable name should be Unicode-aware
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: himajin100000
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-29 20:13 UTC by himajin100000
Modified: 2019-05-08 17:25 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
document to be used for STR (9.59 KB, application/vnd.oasis.opendocument.text)
2019-01-29 21:18 UTC, himajin100000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description himajin100000 2019-01-29 20:13:17 UTC
Description:
see steps to reproduce

Steps to Reproduce:
1. Open the attached odt(Suffix.odt) file
2. Tools->Macros->Organize Macro->LibreOfficeDev Basic
3. Select Suffix.odt/Standard/Module1
4. Click Edit Button
5. You will find Sub Main(). This subroutine has one variable named "住所"  ,whose meaning is "address" in Japanese".

note: non-ascii character name is possible only when the code has "Option VBASupport 1"

6. This variable name consists of two characters. U+4F4F and U+6240. 
Also, please note that '@' character, which is used for type character,is U+0040

Type Characters
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/type-characters

7. Select the variable name and Copy it. Then paste the name into "Watch:" in the bottomside of the IDE and press Enter.

Actual Results:
Variable '住', not '住所', is registered as the watched variable.

Expected Results:
Variable '住所' is registered as the watched variable.


Reproducible: Always


User Profile Reset: No



Additional Info:
possible source code pointers:

https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/baside2b.cxx?r=6256797d#90
https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/baside2b.cxx?r=6256797d#161

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 13279b94080d87dde51bc8b8c669212bf71cacca
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-01-23_04:38:36
Locale: ja-JP (ja_JP); UI-Language: en-US
Calc: threaded
Comment 1 himajin100000 2019-01-29 20:20:42 UTC
Honestly I don't know why the code is performing cSuffix check twice. Isn't once enough?
Comment 2 himajin100000 2019-01-29 21:18:22 UTC
Created attachment 148742 [details]
document to be used for STR
Comment 3 himajin100000 2019-01-29 21:19:16 UTC
How idiot I was! I didn't notice that I've forgotten to attach the document
Comment 4 himajin100000 2019-01-30 02:09:29 UTC
>Honestly I don't know why the code is performing cSuffix check twice. Isn't once enough?

I was misrundertanding. the second one is for rIndex, not for rVar.

>How idiot I was!

typo: How idiot => What an idiot
Comment 5 himajin100000 2019-04-21 18:07:30 UTC
Submisssion done.
https://gerrit.libreoffice.org/#/c/71013/
Comment 6 Commit Notification 2019-04-23 10:52:31 UTC
Tomoyuki Kubota committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/47d25dc5abe000ce751cb1e4dbd1f85f7198ca05%5E%21

tdf#123043 make type character detection unicode-aware

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 himajin100000 2019-05-08 17:25:10 UTC
Marking RESOLVED FIXED