Bug 62398 - FILESAVE: Cursor saved six characters to the left when document is reopened
Summary: FILESAVE: Cursor saved six characters to the left when document is reopened
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: x86 (IA32) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-16 06:35 UTC by grofaty
Modified: 2015-04-16 14:19 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
sample file for cursor postion (8.87 KB, application/vnd.oasis.opendocument.text)
2013-03-16 06:39 UTC, grofaty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description grofaty 2013-03-16 06:35:54 UTC
Using LibreOffice v4.0.1.2 on Windows XP. I would like to preserve the cursor position when document is saved and reopened. I have noticed that cursor is preserved in correct line, but it is placed exactly 6 characters to the left instead of the real save position.

Steps to reproduce
1. Open Writer new document.
2. Tools | Options | LibreOffice | User Data. Make sure First/Last name fields are filed in.
Note: If this data fields are empty then LibreOffice does not remember cursor position on save. This is correct behavior, because LibreOffice remembers cursor position by user - so if multiple user are editing the same document each gets opened at the position he/she saved the file. If fields (user ownership data) are empty then LibreOffice does not know if each of the save was performed by the same user. To reduce confusion it just opens at the first character in first line.
3. Now type in (or copy bellow) some text like:
987654321AA123456789
987654321BB123456789
987654321CC123456789
4. Place the cursor between BB characters (line 2) and save the document using ODF format.
5. Close document.
6. Reopen document.
Problem appears: What you can notice is that cursor is opened in line 2 between number 6 and 5. So cursor was remembered exactly 6 characters to the left.

Expected is to reopen at the position that was saved so between BB characters.

What works: It correctly reopens at the line it was saved, but it incorrectly reopens at exact cursor position inside line.

Additional tests:
You can test the same saving inside AA or CC, save, reopen document and you will see the cursor is remembered 6 characters to the left in every row you save. The only exception is if cursor is placed before 6 character in the line. For example put cursor inside 8 and 7 in third line and save/reopen the document. If cursor is placed before 6 character in the line it is opened at position 1 in saved line. So correct line, but incorrect character position in line.
Comment 1 grofaty 2013-03-16 06:39:22 UTC
Created attachment 76598 [details]
sample file for cursor postion
Comment 2 Pedro 2013-03-18 17:31:38 UTC
I can't replicate the problem with your sample file.

However, using a similarly named file from a bug I reported some time ago, I can confirm that the cursor is not in the expected position

https://bugs.freedesktop.org/show_bug.cgi?id=51217

These two bugs are either the same or closely related :)
Comment 3 grofaty 2013-03-29 14:38:20 UTC
I have tried to replicate the same problem on the same system and I can't replicate this problem anymore = very strange. Also opening attached file opens without a problem. Don't know what happened, just can't replicate anymore...

If I manage to replicate the problem again, I will write more detailed info. I suggest to close this bug report as invalid or something.
Comment 4 retired 2013-03-29 14:55:08 UTC
Set to WORKSFORME since I also can't reproduce this and at the moment it is also working for the bug reporter.

grofaty: if this should re-appear please re-open this bug.