summaryrefslogtreecommitdiff
path: root/wizards/source/tools/Debug.xba
diff options
context:
space:
mode:
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("Sorry, No 'QueryCommands' - Property attached to the object", 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 = "scalc" 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( "Do you want to protect all sheets of this document?",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