summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-03-02 14:53:33 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-04-17 16:06:12 +0100
commit67b4c0b556c2bc586d0a2d63d0fd6efa32a6c25c (patch)
tree6b9ddae76faf51b79967217e5a70824cd5d4c2dc /sfx2
parent9e215ad344f0f1df681617072ad5af093eb6944a (diff)
ExecuteQuerySaveDocument: return NO when headless instead of CANCEL
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/QuerySaveDocument.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx
index ff670d66d43d..7ac2b6771809 100644
--- a/sfx2/source/doc/QuerySaveDocument.cxx
+++ b/sfx2/source/doc/QuerySaveDocument.cxx
@@ -33,9 +33,14 @@
#include <sfx2/sfxuno.hxx>
#include "doc.hrc"
#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
// -----------------------------------------------------------------------------
short ExecuteQuerySaveDocument(Window* _pParent,const String& _rTitle)
{
+ if (Application::IsHeadlessModeEnabled())
+ { // don't block Desktop::terminate() if there's no user to ask
+ return RET_NO;
+ }
String aText( SfxResId( STR_QUERY_SAVE_DOCUMENT ) );
aText.SearchAndReplace( DEFINE_CONST_UNICODE( "$(DOC)" ),
_rTitle );