how can i set zoom default?

Libreoffice 1:5.1.6~rc2-0ubuntu1~xenial2 el-GR (el_GR.UTF-8)
this states that :Zoom is stored in the document in LibreOffice. I have an odb with a “switchboard” (simple form not connected to a table or so). From that I open (using macros in buttons) some reports. Reports are opened (as title in them states) as readonly. If I change the zoom in the report and close it (not saving anything), the zoom in the switchboard is not changing (which is OK). If after that I close the “switchboard” (having the “default” zoom) and reopen it the zoom has changed to the previously closed report (which was closed before closing the “switchboard”, which had a standard zoom).
I use this for opening the switchboard:

Sub OpenMyForm(frmName As String)

Dim ObjTypeWhat

ObjTypeWhat = com.sun.star.sdb.application.DatabaseObject.FORM
If ThisDatabaseDocument.FormDocuments.hasbyname(frmName) Then 'Check the form exists
	ThisDataBaseDocument.CurrentController.Connect() 'If the form exists connect to the database
	ThisDatabaseDocument.CurrentController.loadComponent(ObjTypeWhat, frmName, FALSE) 'Open the form
Else
	Error1(frmName)
End if

clearthings:
set ObjTypeWhat = Nothing
End Sub

And I have attached to open event of switchboard:

Sub HideAllMenuToolbars()

Dim xCurrentController as Object
Dim xLayoutManager as Object
’ If Design mode, just exit the routine and display standard menu and toolbars’
xCurrentController = thisComponent.CurrentController
If xCurrentController.isFormDesignMode Then
Exit Sub
End If
xLayoutManager = thisComponent.CurrentController.Frame.LayoutManager
xLayoutManager.visible = false
clearthings:
set xLayoutManager = Nothing
set xCurrentController = Nothing
End Sub

Hello,

This is a Bug under certain conditions and you should file a Bug report (file here).

The link provided is correct - the zoom factor for the document can be found in the “settings.xml” file within the document.

The problem occurs in many different ways. First there is a setting in Tools->Options->Load/Save->General - “Load user-specific settings with the document”. Have not found any difference with this on or off (probably should leave on) and not even quite sure what its’ purpose is. Your problem, and the most consistent, is when a previously unsaved document has the zoom factor raised above 105%, even if it is not saved. Other documents will then open at this raised percentage. The strange part is if this new unsaved document has the zoom factor lowered to, let’s say 70%, when another document is opened it starts at 70% but corrects itself to what is in the settings.xml file. Now there are other circumstances, but the list seems to grow the longer you look. As stated, it is a bug & you should report.

In the meantime, you can overcome this with a macro attached to the Open Document event of the form:

Sub SetZoom
	ThisComponent.CurrentController.getViewSettings().ZoomValue = 100
End Sub

This sets the zoom to 100%.

If this answers your question please click on the :heavy_check_mark: (upper left area of answer).

1 Like

@xoristzatziki Haven’t seen any response. Has this answered your question? I there still a problem? If not, please click on the :heavy_check_mark: to indicate the question has been answered.

I already done (as my profile indicates) as best answer. The interface sucks, so I do not know what else to do to help you get more points.

Sorry you don’t get it. It’s not points at all. It’s letting other people looking for an answer know that an accepted answer was provided to this question. But the majority of people don’t even respond let alone mark the question when the answer was provided.