[Solved] Show "Save changes before closing?" - Impress

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
HCL
Posts: 22
Joined: Thu Jul 22, 2021 3:55 am

[Solved] Show "Save changes before closing?" - Impress

Post by HCL »

I modified the texts on a slide.

But it is not shown the message "Save changes before closing?" when close the file.

Is there any way to showing this message?

This message was shown on Writer and Calc, but Impress not.
 Edit: Moved from Extensions forum; that forum is for 'Discussions about using 3rd party extension with OpenOffice.org'. You seem to want a macro solution. 
Last edited by HCL on Fri Aug 06, 2021 1:59 am, edited 1 time in total.
OpenOffice 3.1 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32594
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Show "Save changes before closing?" message - Impress

Post by Hagar Delest »

Quite weird. I guess that you use the same method to close your Impress file as with the other components.
You can try to reset your OpenOffice user profile.

Note: I move the topic to the Impress forum, I don't see how it is linked to macros.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
HCL
Posts: 22
Joined: Thu Jul 22, 2021 3:55 am

Re: Show "Save changes before closing?" message - Impress

Post by HCL »

Please back this question to the extension forum.

I asked about developing a addon for Impress.
OpenOffice 3.1 on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32594
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Show "Save changes before closing?" message - Impress

Post by Hagar Delest »

Then same reply as your other topic: please detail what you've developed so far and/or post the code.

Our divination skills are sometimes pretty limited.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31264
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Show "Save changes before closing?" message - Impress

Post by Villeroy »

There is util.XModifiable with method setModified(bool) to mark a document as modified or not: https://api.libreoffice.org/docs/idl/re ... iable.html
And another interface util.XModifiable2 with methods for testing and setting modifiability: https://api.libreoffice.org/docs/idl/re ... able2.html
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
HCL
Posts: 22
Joined: Thu Jul 22, 2021 3:55 am

Re: Show "Save changes before closing?" message - Impress

Post by HCL »

Thank you for your reply, Villeroy.

I could display the message.

Code: Select all

		XComponentContext context;
		XMultiComponentFactory manager = context.getServiceManager();
		Object desktop_obj = manager.createInstanceWithContext(
				"com.sun.star.frame.Desktop", context);
		XDesktop desktop = UnoRuntime.queryInterface(XDesktop.class, desktop_obj);
		XModifiable mod = UnoRuntime.queryInterface(XModifiable.class, desktop.getCurrentComponent());
		mod.setModified(true);
OpenOffice 3.1 on Windows 10
Post Reply