Kaydet (Commit) 1b5ea3ef authored tarafından Noel Power's avatar Noel Power

Updates needed for document support (improved support for refresh)

üst df0fb4af
...@@ -41,12 +41,54 @@ REM ------ Storage Refresh Function ------ ...@@ -41,12 +41,54 @@ REM ------ Storage Refresh Function ------
sub RefreshUserScripts() sub RefreshUserScripts()
' TDB - change Menu bindings to allow user to refresh all, user, share or document script
RefreshAppScripts( "USER" )
end sub
sub RefreshAllScripts()
RefreshAppScripts( "USER" )
RefreshAppScripts( "SHARE" )
RefreshDocumentScripts
end sub
sub RefreshAppScripts( appName as String )
On Error Goto ErrorHandler
smgr = getProcessServiceManager()
context = smgr.getPropertyValue( "DefaultContext" )
scriptstoragemgr = context.getValueByName( "/singletons/drafts.com.sun.star.script.framework.storage.theScriptStorageManager" )
scriptstoragemgr.refreshScriptStorage( appName )
Exit sub
ErrorHandler:
reset
MsgBox ("Error: Unable to refresh Java (scripts)" + chr$(10) + chr$(10)+ "Detail: " & error$ + chr$(10) + chr$(10)+ "Action: Please restart Office",0,"Error" )
end sub
sub RefreshDocumentScripts()
On Error Goto ErrorHandler
smgr = getProcessServiceManager() smgr = getProcessServiceManager()
context = smgr.getPropertyValue( "DefaultContext" ) context = smgr.getPropertyValue( "DefaultContext" )
scriptstoragemgr = context.getValueByName( "/singletons/drafts.com.sun.star.script.framework.storage.theScriptStorageManager" ) scriptstoragemgr = context.getValueByName( "/singletons/drafts.com.sun.star.script.framework.storage.theScriptStorageManager" )
storage = scriptstoragemgr.getScriptStorage( 1 ) oDocURL = ThisComponent.GetCurrentController.getModel.getURL
storage.refresh()
On Error Goto ErrorHandlerDoc
scriptstoragemgr.refreshScriptStorage( oDocURL )
Exit sub
ErrorHandlerDoc:
reset
' Ignore document script errors as it will happen when refreshing an unsaved doc
Exit sub
ErrorHandler:
reset
MsgBox ("Error: Unable to refresh Java (scripts)" + chr$(10) + chr$(10)+ "Detail: " & error$ + chr$(10) + chr$(10)+ "Action: Please restart Office",0,"Error" )
end sub end sub
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment