Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a9c1d1a
Kaydet (Commit)
2a9c1d1a
authored
Ara 06, 2011
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make dialogs fail with an exception in headless tests.
üst
f547b2c4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
36 deletions
+85
-36
appinit.cxx
desktop/source/app/appinit.cxx
+1
-1
frame.cxx
framework/source/services/frame.cxx
+4
-5
bootstrapfixture.cxx
test/source/bootstrapfixture.cxx
+3
-0
svdata.hxx
vcl/inc/svdata.hxx
+2
-1
svapp.hxx
vcl/inc/vcl/svapp.hxx
+27
-2
svapp.cxx
vcl/source/app/svapp.cxx
+27
-6
dialog.cxx
vcl/source/window/dialog.cxx
+15
-11
desktopdetector.cxx
vcl/unx/generic/desktopdetect/desktopdetector.cxx
+6
-10
No files found.
desktop/source/app/appinit.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -237,7 +237,7 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
// Headless mode for FAT Office
bHeadlessMode
=
rCmdLine
.
IsHeadless
();
if
(
bHeadlessMode
)
Application
::
EnableHeadlessMode
();
Application
::
EnableHeadlessMode
(
false
);
if
(
conDcp
.
getLength
()
>
0
)
{
...
...
framework/source/services/frame.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -1887,10 +1887,9 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
// (a) Do it after stopWindowListening(). May that force some active/deactive
// notifications which we doesn't need here realy.
// (b) Don't forget to save the old value of IsDialogCancelEnabled() to
// restore it afterwards. We cannot call EnableDialogCancel( sal_False )
// as we would kill the headless mode!
sal_Bool
bCancelDialogs
(
Application
::
IsDialogCancelEnabled
()
);
Application
::
EnableDialogCancel
(
sal_True
);
// restore it afterwards (to not kill headless mode).
Application
::
DialogCancelMode
old
=
Application
::
GetDialogCancelMode
();
Application
::
SetDialogCancelMode
(
Application
::
DIALOG_CANCEL_SILENT
);
// We should be alone for ever and further dispose calls are rejected by lines before ...
// I hope it :-)
...
...
@@ -1969,7 +1968,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
// Don't forget it restore old value -
// otherwhise no dialogs can be shown anymore in other frames.
Application
::
EnableDialogCancel
(
bCancelDialogs
);
Application
::
SetDialogCancelMode
(
old
);
}
/*-****************************************************************************************************//**
...
...
test/source/bootstrapfixture.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -96,6 +96,9 @@ void test::BootstrapFixture::setUp()
aLocalOptions
.
SetUILocaleConfigString
(
aLangISO
);
InitVCL
(
m_xSFactory
);
if
(
Application
::
IsHeadlessModeRequested
())
{
Application
::
EnableHeadlessMode
(
true
);
}
if
(
m_bAssertOnDialog
)
ErrorHandler
::
RegisterDisplay
(
aBasicErrorFunc
);
...
...
vcl/inc/svdata.hxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -42,6 +42,7 @@
#include "vcl/vclevent.hxx"
#include "vcl/sv.h"
#include "vcl/svapp.hxx"
#include "vcl/dllapi.h"
#include "unotools/options.hxx"
...
...
@@ -167,9 +168,9 @@ struct ImplSVAppData
sal_Bool
mbInAppExecute
;
// is Application::Execute() on stack
sal_Bool
mbAppQuit
;
// is Application::Quit() called
sal_Bool
mbSettingsInit
;
// sal_True: Settings are initialized
sal_Bool
mbDialogCancel
;
// sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet
sal_Bool
mbNoYield
;
// Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule
Application
::
DialogCancelMode
meDialogCancel
;
// sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet
long
mnDefaultLayoutBorder
;
// default value in pixel for layout distances used
// in window arrangers
...
...
vcl/inc/vcl/svapp.hxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -29,6 +29,10 @@
#ifndef _SV_SVAPP_HXX
#define _SV_SVAPP_HXX
#include <sal/config.h>
#include <stdexcept>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
#include <tools/string.hxx>
...
...
@@ -140,6 +144,23 @@ public:
class
VCL_DLLPUBLIC
Application
{
public
:
enum
DialogCancelMode
{
DIALOG_CANCEL_OFF
,
///< do not automatically cancel dialogs
DIALOG_CANCEL_SILENT
,
///< silently cancel any dialogs
DIALOG_CANCEL_FATAL
///< cancel any dialogs by throwing a DialogCancelledException
};
class
VCL_DLLPUBLIC
DialogCancelledException
:
virtual
public
std
::
runtime_error
{
public
:
explicit
DialogCancelledException
(
char
const
*
what_arg
)
:
runtime_error
(
what_arg
)
{}
virtual
~
DialogCancelledException
()
throw
();
};
Application
();
virtual
~
Application
();
...
...
@@ -302,7 +323,8 @@ public:
static
void
SetDefDialogParent
(
Window
*
pWindow
);
static
Window
*
GetDefDialogParent
();
static
void
EnableDialogCancel
(
sal_Bool
bDialogCancel
=
sal_True
);
static
DialogCancelMode
GetDialogCancelMode
();
static
void
SetDialogCancelMode
(
DialogCancelMode
mode
);
static
sal_Bool
IsDialogCancelEnabled
();
static
void
SetSystemWindowMode
(
sal_uInt16
nMode
);
...
...
@@ -320,9 +342,12 @@ public:
static
void
SetFilterHdl
(
const
Link
&
rLink
);
static
const
Link
&
GetFilterHdl
();
static
void
EnableHeadlessMode
(
sal_Bool
bEnable
=
sal_True
);
static
void
EnableHeadlessMode
(
bool
dialogsAreFatal
);
static
sal_Bool
IsHeadlessModeEnabled
();
static
bool
IsHeadlessModeRequested
();
///< check command line arguments for --headless
static
void
ShowNativeErrorBox
(
const
String
&
sTitle
,
const
String
&
sMessage
);
...
...
vcl/source/app/svapp.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -37,7 +37,7 @@
#include "rtl/tencinfo.h"
#include "rtl/instance.hxx"
#include "rtl/process.h"
#include "tools/tools.h"
#include "tools/debug.hxx"
...
...
@@ -1539,16 +1539,21 @@ Window* Application::GetDefDialogParent()
// -----------------------------------------------------------------------
void
Application
::
EnableDialogCancel
(
sal_Bool
bDialogCancel
)
Application
::
DialogCancelMode
Application
::
GetDialogCancelMode
()
{
return
ImplGetSVData
()
->
maAppData
.
meDialogCancel
;
}
void
Application
::
SetDialogCancelMode
(
DialogCancelMode
mode
)
{
ImplGetSVData
()
->
maAppData
.
m
bDialogCancel
=
bDialogCancel
;
ImplGetSVData
()
->
maAppData
.
m
eDialogCancel
=
mode
;
}
// -----------------------------------------------------------------------
sal_Bool
Application
::
IsDialogCancelEnabled
()
{
return
ImplGetSVData
()
->
maAppData
.
m
bDialogCancel
;
return
ImplGetSVData
()
->
maAppData
.
m
eDialogCancel
!=
DIALOG_CANCEL_OFF
;
}
// -----------------------------------------------------------------------
...
...
@@ -1765,9 +1770,10 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
// -----------------------------------------------------------------------
void
Application
::
EnableHeadlessMode
(
sal_Bool
bEnable
)
void
Application
::
EnableHeadlessMode
(
bool
dialogsAreFatal
)
{
EnableDialogCancel
(
bEnable
);
SetDialogCancelMode
(
dialogsAreFatal
?
DIALOG_CANCEL_FATAL
:
DIALOG_CANCEL_SILENT
);
}
// -----------------------------------------------------------------------
...
...
@@ -1777,6 +1783,19 @@ sal_Bool Application::IsHeadlessModeEnabled()
return
IsDialogCancelEnabled
();
}
bool
Application
::
IsHeadlessModeRequested
()
{
sal_uInt32
n
=
rtl_getAppCommandArgCount
();
for
(
sal_uInt32
i
=
0
;
i
<
n
;
++
i
)
{
rtl
::
OUString
arg
;
rtl_getAppCommandArg
(
i
,
&
arg
.
pData
);
if
(
arg
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"--headless"
)))
{
return
true
;
}
}
return
false
;
}
// -----------------------------------------------------------------------
void
Application
::
ShowNativeErrorBox
(
const
String
&
sTitle
,
...
...
@@ -1902,4 +1921,6 @@ Application::createFolderPicker( const Reference< uno::XComponentContext >& xSM
return
pSVData
->
mpDefInst
->
createFolderPicker
(
xSM
);
}
Application
::
DialogCancelledException
::~
DialogCancelledException
()
throw
()
{}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/window/dialog.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -34,6 +34,7 @@
#include <brdwin.hxx>
#include <rtl/strbuf.hxx>
#include <sal/log.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
...
...
@@ -53,8 +54,6 @@
// =======================================================================
#ifdef DBG_UTIL
static
rtl
::
OString
ImplGetDialogText
(
Dialog
*
pDialog
)
{
rtl
::
OStringBuffer
aErrorStr
(
rtl
::
OUStringToOString
(
...
...
@@ -72,8 +71,6 @@ static rtl::OString ImplGetDialogText( Dialog* pDialog )
return
aErrorStr
.
makeStringAndClear
();
}
#endif
// =======================================================================
static
sal_Bool
ImplIsMnemonicCtrl
(
Window
*
pWindow
)
...
...
@@ -610,15 +607,22 @@ sal_Bool Dialog::ImplStartExecuteModal()
return
sal_False
;
}
if
(
Application
::
IsDialogCancelEnabled
()
)
switch
(
Application
::
GetDialogCancelMode
()
)
{
#ifdef DBG_UTIL
rtl
::
OStringBuffer
aErrorStr
;
aErrorStr
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"Dialog::StartExecuteModal() is called in a none UI application: "
));
aErrorStr
.
append
(
ImplGetDialogText
(
this
));
OSL_FAIL
(
aErrorStr
.
getStr
());
#endif
case
Application
:
:
DIALOG_CANCEL_OFF
:
break
;
case
Application
:
:
DIALOG_CANCEL_SILENT
:
SAL_INFO
(
"vcl"
,
"Dialog
\"
"
<<
ImplGetDialogText
(
this
).
getStr
()
<<
"
\"
cancelled in silent mode"
);
return
sal_False
;
default
:
assert
(
false
);
// this cannot happen
// fall through
case
Application
:
:
DIALOG_CANCEL_FATAL
:
throw
Application
::
DialogCancelledException
(
ImplGetDialogText
(
this
).
getStr
());
}
#ifdef DBG_UTIL
...
...
vcl/unx/generic/desktopdetect/desktopdetector.cxx
Dosyayı görüntüle @
2a9c1d1a
...
...
@@ -33,10 +33,11 @@
#include <X11/Xatom.h>
#include <tools/postx.h>
#include "rtl/process.h"
#include "rtl/ustrbuf.hxx"
#include "osl/module.h"
#include "osl/process.h"
#include "osl/thread.h"
#include "vcl/svapp.hxx"
#include "vclpluginapi.h"
...
...
@@ -251,22 +252,17 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
const
char
*
pUsePlugin
=
getenv
(
"SAL_USE_VCLPLUGIN"
);
if
(
pUsePlugin
&&
(
strcmp
(
pUsePlugin
,
"svp"
)
==
0
))
if
((
pUsePlugin
&&
(
strcmp
(
pUsePlugin
,
"svp"
)
==
0
))
||
Application
::
IsHeadlessModeRequested
())
pDisplayStr
=
NULL
;
else
{
int
nParams
=
osl_get
CommandArgCount
();
int
nParams
=
rtl_getApp
CommandArgCount
();
OUString
aParam
;
OString
aBParm
;
for
(
int
i
=
0
;
i
<
nParams
;
i
++
)
{
osl_getCommandArg
(
i
,
&
aParam
.
pData
);
if
(
aParam
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"-headless"
)
)
||
aParam
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"--headless"
)
)
)
{
pDisplayStr
=
NULL
;
break
;
}
rtl_getAppCommandArg
(
i
,
&
aParam
.
pData
);
if
(
i
<
nParams
-
1
&&
(
aParam
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"-display"
)
)
||
aParam
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"--display"
)
))
)
{
osl_getCommandArg
(
i
+
1
,
&
aParam
.
pData
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment