Such a functionality will not be added to a standard installation for obvious reasons - the user would be much too likely kill his valuable documents… But it easy to add that functionality by adding a little Macro.
' closes and deletes the currently active document
' don't use it unless you're OK loosing all your data
' this macro comes with no warrenty whatsoever.
' ALWAYS HAVE A BACKUP
Sub closeAndDelete
Dim fileurl as String
Dim answer as Integer
oDoc = ThisComponent
If oDoc.hasLocation() Then
fileurl = oDoc.getLocation()
If FileExists(fileurl) Then
answer = msgBox("Do you really want to delete the file"+Chr$(13)+ _
"»"+fileurl+"« ?", 4+48+256, "Confirm deletion")
If answer = 6 Then
' user asked for it, so kill it with fire...
oDoc.close(true)
Kill(fileurl)
EndIf
Else
msgBox("Error - file "+Chr$(13)+"»"+fileurl+"« does not exist?", 0)
exit Sub
EndIf
Else
' document wasn't saved, just close the document
If oDoc.isModified() Then
answer = msgBox("Do you really want to throw away your changes?",4+48+256)
If answer <> 6 Then
' abort if answer is not yes
exit Sub
EndIf
EndIf
oDoc.close(true)
EndIf
End Sub
To add it, choose Tools | Macros → Organize → LibreOffice Basic and select Module1 below “My Macros” (or create a seperate module if you wish) and choose Edit and copy’n’paste the above macro into the editor and hit the save button.
To assign that macro to a keyboard shortcut, menu entry or toolbar button, go to **Tools | Customize ** and select the appropriate section (menu, shortcut or toolbar) to add it. You’ll find the Macros at the very bottom in the command/function selection area.