Bug 105760 - TextCursor.gotoPreviousWord fails when quote is at start of paragraph
Summary: TextCursor.gotoPreviousWord fails when quote is at start of paragraph
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-05 04:46 UTC by Jordi
Modified: 2024-02-16 16:00 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jordi 2017-02-05 04:46:56 UTC
Description:
Given the following text,

One two Three.
"Four" five!
Six seven eight;

the following code will terminate when it encounters the paragraph starting with quotes. 


	ovc = ThisComponent.currentcontroller.getViewCursor()
	otc = ThisComponent.getText().createTextCursor()
	
	otc.gotoRange(ovc,false)
	
	Dim wc
	wc=0
	
	While otc.gotoPreviousWord(true)
		wc = wc + 1
	wend
	
	Print wc
	ovc.gotoRange(otc,false)

BUT if the quote is on in the begining of the paragraph, it does not stop. For example,

One two.
Three "Four" five!
Six seven eight;

This issue occurs with straight quotes, curly quotes and with Greek '«' quotes.


Steps to Reproduce:
1.Copy text above with quotes in the begining of the paragraph
2.Run macro
3.

Actual Results:  
gotoPreviousWord returns false 

Expected Results:
It should return true


Reproducible: Always

User Profile Reset: yes; tested on fresh install in vm

Additional Info:
Also tested on 5.2.5.1 with the same behaviour.


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Jordi 2017-02-05 04:50:20 UTC
Please amend "Steps to reproduce" as follows,

1. Copy text above
2. Move Visual Cursor to the end of the text
3. Run macro
Comment 2 Buovjaga 2017-02-12 14:01:58 UTC
I reproduce. It does not select the all the text, when "Four" is at the start of a paragraph.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: ac8197327d3ef4f3c94fb0746393863404df086b
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 11th 2016

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 3 QA Administrators 2018-02-13 03:33:04 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2020-02-14 02:31:11 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2022-02-14 03:28:54 UTC Comment hidden (obsolete)
Comment 6 Jordi 2022-02-15 20:07:29 UTC
Confirmed that bug is present in LO 3.3
Comment 7 QA Administrators 2024-02-16 03:12:54 UTC Comment hidden (obsolete)
Comment 8 Jordi 2024-02-16 16:00:00 UTC
Still present with latest stable version,

Version: 7.6.5.1 (X86_64) / LibreOffice Community
Build ID: 7d3edae2c3c6b0c6667bcb9e3f9988f28eb82295
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-AU (en_AU); UI: en-GB
Calc: CL threaded