summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-03-02 14:53:33 +0100
committerMichael Stahl <mstahl@redhat.com>2012-03-03 00:05:29 +0100
commiteb237af5aa0a5d8616e4a8ddd1e528433bdd0f82 (patch)
treefd15d10541d5f2a31327fd8320065b606f077a88 /sfx2
parent90f7a3ada68f309a9d3201183ef552e59f9558fb (diff)
ExecuteQuerySaveDocument: return NO when headless instead of CANCEL
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 );