Bug 123256 - ViewCursor and TextCursor returns wrong PageStyleName
Summary: ViewCursor and TextCursor returns wrong PageStyleName
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-08 09:16 UTC by Georgy Litvinov
Modified: 2021-05-26 04:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document with big paragraph. First page style set to "First page", others to default. (21.01 KB, application/vnd.oasis.opendocument.text)
2019-02-08 09:19 UTC, Georgy Litvinov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Litvinov 2019-02-08 09:16:57 UTC
Description:
If cursor placed inside big paragraph (a few pages) cursors PageStyleName property shows wrong page style name (shows style of the page where paragraph starts).
So I haven't found a way to get current valid page style name.

Steps to Reproduce:
1. Create big paragraph
2. Set first page style to First Page
3. go to second page. Check cursor's property

Actual Results:
page style name of page where paragraph starts

Expected Results:
current page style name


Reproducible: Always


User Profile Reset: No



Additional Info:
Macor to reproduce 
Sub wrongPageStyleName
	Dim oViewCursor As Object
	oViewCursor = ThisComponent.CurrentController.getViewCursor()
	oViewCursor.goToStart(false)
	MsgBox "First page style is rigth "+oViewCursor.pageStyleName
	oViewCursor.jumpToNextPage()
	MsgBox "Second page style is wrong (at start)) "+oViewCursor.pageStyleName
	oViewCursor.jumpToEndOfPage()
	MsgBox "Second page style is wrong (at end)) "+oViewCursor.pageStyleName

End Sub
Comment 1 Georgy Litvinov 2019-02-08 09:19:12 UTC
Created attachment 149013 [details]
Test document with big paragraph. First page style set to "First page", others to default.
Comment 2 Xisco Faulí 2019-03-22 10:47:03 UTC
I can reproduce it in

Version: 6.3.0.0.alpha0+
Build ID: f8ca6e0a59bff51fcb09af4fa6d9cd458b32f223
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

and


LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

however, I don't know whether it's an issue or not...

@Miklos, do you know why on second page it returns the page style from page 1 ?
Comment 3 Miklos Vajna 2019-04-24 08:38:03 UTC
Yes, this is indeed a bug, at least in the ViewCursor case.

I think the reason for the current behavior is that we fetch the paragraph properties for the cursor and expose PageStyleName based on a that, which means that in case the paragraph spans over multiple pages, we expose the page style of the first page. So the behavior is not too surprising, but the ViewCursor (which is aware of pages) could be indeed fixed to take multi-page paragraphs into account.
Comment 4 QA Administrators 2021-04-24 04:09:53 UTC Comment hidden (obsolete)
Comment 5 BogdanB 2021-05-26 04:51:43 UTC
Looks ok in
Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 42d2b2d55a27f11153ea1713737d93540a19211d
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded