Bug 147323 - a opendocument macro doesn't work correctly any more
Summary: a opendocument macro doesn't work correctly any more
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All Linux (All)
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-09 16:08 UTC by Duns
Modified: 2023-03-26 13:23 UTC (History)
2 users (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 Duns 2022-02-09 16:08:00 UTC
In these last days LibreWriter has a bug executing a macro (set as Open Document).
Opening a document the focus goes on the bookmark "here", set with another macro in CloseDocument, which create that bookmark where the cursor is.
This macro had always worked, but now, when I open a document with Writer, at the beginning the focus goes, as expected, to the bookmark "here", but after few seconds it goes elsewhere.

The cursor is always in the supposed place, so, by the left arrow, I am quickly on the desired place. But it is a strange behavior, quite annoying.



Version: 7.3.0.3 / LibreOffice Community
Build ID: 30(Build:3)
CPU threads: 2; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: it-IT (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.0~rc3-0ubuntu0.20.04.1~lo1
Calc: threaded
Comment 1 m_a_riosv 2022-02-10 00:00:02 UTC
Please ask your question in https://ask.libreoffice.org/.
And show there what is your macro and better a sample file.

And if you want to open the document where you left it, you only need to have some fields for the user data, covered in Menu/Tools/Options/LibreOffice/General
Comment 2 Duns 2022-02-10 08:10:03 UTC
No: I am speaking not about a new macro, but about one *already working* in the past, and *for years*.  
It is only in the last few days that I have this problem: and that's way I think that is a bug.
Consider also that that macro works as expected *manually* (after opening a file): and that is another reason for I think that is a bug.
Comment 3 QA Administrators 2022-02-11 03:41:57 UTC Comment hidden (obsolete)
Comment 4 Duns 2022-02-11 07:18:05 UTC
(In reply to m.a.riosv from comment #1)

> And if you want to open the document where you left it, you only need to
> have some fields for the user data, covered in
> Menu/Tools/Options/LibreOffice/General

But, in this you are right: now (unlike in the past), even without a macro, a document is opened focusing the point where was closed. 
Therefore my macro is now not necessary. 
However, it is curious that it is not only not necessary, but also dangerous, so to say :)
Something has changed...
Comment 5 m_a_riosv 2022-02-11 08:26:03 UTC
That is the reason I commented to ask in the forum, there are a very helpful people.
The better it's to add to the question the file with the macro, otherwise no one can help to find the issue.
Comment 6 Duns 2022-02-11 08:39:10 UTC Comment hidden (obsolete)
Comment 7 Timur 2022-03-21 13:31:36 UTC
Duns, you should either attach file with those macros or close the bug.
Comment 8 Duns 2022-03-22 17:33:44 UTC Comment hidden (obsolete)
Comment 9 Duns 2022-03-22 17:34:06 UTC Comment hidden (obsolete)
Comment 10 Duns 2022-03-22 17:36:02 UTC
I re-write my post, because of my typing errors. Sorry (could you delete it?).
Yes, your tip worked, but recently I have a file (just one) that doesn't opens where it was closed. But it opens at the beginning of document (odt).  
It has embedded my personal data, so I don't understand this strange behavior.
Comment 11 QA Administrators 2022-03-23 03:38:41 UTC Comment hidden (obsolete)
Comment 12 Timur 2022-03-23 07:46:13 UTC
This started as a macro bug and turned out it's not or some other issue.
Bug report is single original issue so I close this. We don't know the cause. 
AS for opening, that's different, maybe bug 146988.
Comment 13 Duns 2022-03-23 15:49:23 UTC
That bug is quite different. At the present I have problem only with one file (and I don't know why).  
You asked my macro. Here you are:

sub vai_qui

If ThisComponent.supportsService("com.sun.star.text.TextDocument") Then

oBookmarks = ThisComponent.getBookmarks()
If NOT oBookmarks.hasByName("qui") Then
   Exit Sub  
End If

ViewCursor = ThisComponent.CurrentController.getviewCursor()
Bookmark = ThisComponent.Bookmarks.getByName("qui").Anchor
ViewCursor.gotorange(Bookmark, False)

else
   Exit Sub  
End If

end sub

With this macro on opening document I before I go to the right point, but after a few seconds I go elsewhere (without any reason).
Comment 14 Justin L 2022-09-23 20:43:44 UTC
LibreOffice returns to the last saved position
A.) if you save in ODT format
B.) you have an user name specified in options - User Data.
Comment 15 Duns 2022-09-24 06:37:29 UTC
Usually. But not always.
Comment 16 Timur 2022-09-26 12:52:23 UTC
"Reopened" is wrong status, when known fix doesn't work.
This bug was never confirmed, not it has steps for independent test. 
So you have a problem with only one file. 
Did you try opening multiple times without macro, to see if really bug 146988?
This cannot stay open unless you attach a file, without personal info.
Comment 17 QA Administrators 2023-03-26 03:23:36 UTC Comment hidden (obsolete)
Comment 18 Duns 2023-03-26 07:57:43 UTC
recently I didn't notice this bug. Therefore it seems solved.