wizards/source/scriptforge/SF_UI.xba | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit a6e4216153dc01c0643105f10105ea29b4017e43 Author: Jean-Pierre Ledure <[email protected]> AuthorDate: Mon Feb 16 11:29:52 2026 +0100 Commit: Jean-Pierre Ledure <[email protected]> CommitDate: Mon Feb 16 14:35:15 2026 +0100 ScriptForge (UI) fix no active frame in StarDesktop Sometimes, - headless mode - client/server mode from python scripts via pipe or socket - ... the StarDesktop object has punctually no active frame set. This caused inopportune aborts in the ScriptForge code: "Object variable not set", when maximizing/minimizing the frame. The request should simply be ignored. Change-Id: Ifd38207cdeb4c5c4f40c58cca561f8131e8aed51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199466 Reviewed-by: Jean-Pierre Ledure <[email protected]> Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_UI.xba b/wizards/source/scriptforge/SF_UI.xba index 3ff5c5b56b39..a28b9d4e3b2a 100644 --- a/wizards/source/scriptforge/SF_UI.xba +++ b/wizards/source/scriptforge/SF_UI.xba @@ -131,6 +131,8 @@ Dim oComp As Object ' com.sun.star.lang.XComponent ActiveWindow = "" End If End With + Else + ActiveWindow = "" End If End Function ' ScriptForge.SF_UI.ActiveWindow @@ -918,7 +920,7 @@ Try: Loop Else vWindow = SF_UI._IdentifyWindow(StarDesktop.CurrentComponent) - bFound = True + bFound = Not IsNull(vWindow.Frame) End If If bFound Then @@ -974,7 +976,7 @@ Try: Loop Else vWindow = SF_UI._IdentifyWindow(StarDesktop.CurrentComponent) - bFound = True + bFound = Not IsNull(vWindow.Frame) End If If bFound Then @@ -1317,7 +1319,7 @@ Try: Next i Set oDispatch = SF_Utils._GetUNOService("DispatchHelper") If SF_String.StartsWith(Command, cstPrefix) Then sCommand = Command Else sCommand = cstPrefix & Command - oDispatch.executeDispatch(StarDesktop.ActiveFrame, sCommand, "", 0, vProps) + If Not IsNull (StarDesktop.ActiveFrame) Then oDispatch.executeDispatch(StarDesktop.ActiveFrame, sCommand, "", 0, vProps) Finally: SF_Utils._ExitFunction(cstThisSub)
