diff options
author | Behrend Cornelius <bc@openoffice.org> | 2002-11-13 11:28:15 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2002-11-13 11:28:15 +0000 |
commit | 000c034b9f44f10387c37c76b7995a9f1888cd1a (patch) | |
tree | fde90c3c88b0c495e07ccff76954e4ddc8d834a0 /wizards/source/tools | |
parent | 8fcfb5d64982711607c677c9590eb2890bd2cf04 (diff) |
#104755# 'disposeDocument' added
Diffstat (limited to 'wizards/source/tools')
-rw-r--r-- | wizards/source/tools/Misc.xba | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba index e254aa33043b..fa0722097305 100644 --- a/wizards/source/tools/Misc.xba +++ b/wizards/source/tools/Misc.xba @@ -208,7 +208,7 @@ Dim oUcb as Object Else GetPathSettings = sPath End If - + End Function @@ -266,7 +266,7 @@ Dim oLocResSrv as Object If bResObjectexists Then oResSrv = oLocResSrv End If - + End Sub @@ -737,9 +737,9 @@ Function isHighContrast(oPeer as Object) Dim myLuminance as Double UIColor = oPeer.getProperty( "DisplayBackgroundColor" ) - myRed = Red (UIColor) + myRed = Red (UIColor) myGreen = Green (UIColor) - myBlue = Blue (UIColor) + myBlue = Blue (UIColor) myLuminance = (( myBlue*28 + myGreen*151 + myRed*77 ) / 256 ) isHighContrast = false If myLuminance <= 25 Then isHighContrast = true @@ -781,7 +781,30 @@ NOMODULEINSTALLED: Resume GOON End If End If -GOON: - CreateNewDocument = oDocument -End Function -</script:module>
\ No newline at end of file +GOON: + CreateNewDocument = oDocument +End Function + + +' This Sub has been used in order to ensure that after disposing a document +' from the backing window it is returned to the backing window, so the +' office won't be closed +Sub DisposeDocument(oDocument as Object) +Dim dispatcher as Object +Dim parser as Object +Dim disp as Object +Dim url as new com.sun.star.util.URL +Dim NoArgs() as New com.sun.star.beans.PropertyValue +Dim oFrame as Object + If Not IsNull(oDocument) Then + oDocument.setModified(false) + parser = createUnoService("com.sun.star.util.URLTransformer") + url.Complete = ".uno:CloseDoc" + parser.parseStrict(url) + oFrame = oDocument.CurrentController.Frame + disp = oFrame.queryDispatch(url,"_self", com.sun.star.util.SearchFlags.NORM_WORD_ONLY) + disp.dispatch(url, NoArgs()) + End If +End Sub + +</script:module> |