summaryrefslogtreecommitdiff
path: root/wizards/source/tools/Debug.xba
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-10-01 14:41:55 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-10-01 14:41:55 +0000
commit9030ca8eb80b1627fc543c269583d96a9077ac06 (patch)
tree21b0d27a00c7488a1264e8c5ff35e5ea66b6177f /wizards/source/tools/Debug.xba
parent28c4b12a54fbd424958b728b06dbf11a7eb181b0 (diff)
#91427# Sub GetDocumentType now with exception handling
Diffstat (limited to 'wizards/source/tools/Debug.xba')
-rw-r--r--wizards/source/tools/Debug.xba27
1 files changed, 27 insertions, 0 deletions
diff --git a/wizards/source/tools/Debug.xba b/wizards/source/tools/Debug.xba
index ea03e82e967a..eea9c5ef5fff 100644
--- a/wizards/source/tools/Debug.xba
+++ b/wizards/source/tools/Debug.xba
@@ -174,4 +174,31 @@ Sub ShowCommands(oLocObject as Object)
Msgbox(&quot;Sorry, No &apos;QueryCommands&apos; - Property attached to the object&quot;, 16, GetProductName())
Resume LEAVEPROC
LEAVEPROC:
+End Sub
+
+
+Sub ProtectCurrentSheets()
+Dim oDocument as Object
+Dim sDocType as String
+Dim iResult as Integer
+Dim oSheets as Object
+Dim i as Integer
+Dim bDoProtect as Boolean
+ oDocument = StarDesktop.ActiveFrame.Controller.Model
+ sDocType = GetDocumentType(oDocument)
+ If sDocType = &quot;scalc&quot; Then
+ oSheets = oDocument.Sheets
+ bDoProtect = False
+ For i = 0 To oSheets.Count-1
+ If Not oSheets(i).IsProtected Then
+ bDoProtect = True
+ End If
+ Next i
+ If bDoProtect Then
+ iResult = Msgbox( &quot;Do you want to protect all sheets of this document?&quot;,35, GetProductName())
+ If iResult = 6 Then
+ ProtectSheets(oDocument.Sheets)
+ End If
+ End If
+ End If
End Sub</script:module> \ No newline at end of file