Kaydet (Commit) 392eeb61 authored tarafından Jürgen Schmidt's avatar Jürgen Schmidt

#120683# add new cmd line arg -conversionmode to enavle further optimization

Patch By: jsc
Review By: hdu

-This line, and those below, will be ignored--

M    main/desktop/source/app/cmdlinehelp.cxx
M    main/desktop/source/app/cmdlineargs.cxx
M    main/desktop/source/app/cmdlineargs.hxx
M    main/desktop/source/app/appinit.cxx
M    main/vcl/source/app/svapp.cxx
M    main/vcl/inc/vcl/svapp.hxx
M    main/vcl/inc/svdata.hxx
üst bbadc49c
...@@ -263,6 +263,10 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr ) ...@@ -263,6 +263,10 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
if ( bHeadlessMode ) if ( bHeadlessMode )
Application::EnableHeadlessMode(); Application::EnableHeadlessMode();
// ConversionMode
if ( pCmdLine->IsConversionMode() )
Application::EnableConversionMode();
if ( conDcp.getLength() > 0 ) if ( conDcp.getLength() > 0 )
{ {
// accept incoming connections (scripting and one rvp) // accept incoming connections (scripting and one rvp)
......
...@@ -416,6 +416,14 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& ...@@ -416,6 +416,14 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True ); SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
return sal_True; return sal_True;
} }
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-conversionmode" )) == sal_True )
{
// ConversionMode means also headless and invisibile, so set these parameters to true!
SetBoolParam_Impl( CMD_BOOLPARAM_HEADLESS, sal_True );
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
SetBoolParam_Impl( CMD_BOOLPARAM_CONVERSIONMODE, sal_True );
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True ) else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
{ {
#if defined(ENABLE_QUICKSTART_APPLET) #if defined(ENABLE_QUICKSTART_APPLET)
...@@ -690,6 +698,12 @@ sal_Bool CommandLineArgs::IsHeadless() const ...@@ -690,6 +698,12 @@ sal_Bool CommandLineArgs::IsHeadless() const
return m_aBoolParams[ CMD_BOOLPARAM_HEADLESS ]; return m_aBoolParams[ CMD_BOOLPARAM_HEADLESS ];
} }
sal_Bool CommandLineArgs::IsConversionMode() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
return m_aBoolParams[ CMD_BOOLPARAM_CONVERSIONMODE ];
}
sal_Bool CommandLineArgs::IsQuickstart() const sal_Bool CommandLineArgs::IsQuickstart() const
{ {
osl::MutexGuard aMutexGuard( m_aMutex ); osl::MutexGuard aMutexGuard( m_aMutex );
......
...@@ -43,6 +43,7 @@ class CommandLineArgs ...@@ -43,6 +43,7 @@ class CommandLineArgs
CMD_BOOLPARAM_PLUGIN, CMD_BOOLPARAM_PLUGIN,
CMD_BOOLPARAM_SERVER, CMD_BOOLPARAM_SERVER,
CMD_BOOLPARAM_HEADLESS, CMD_BOOLPARAM_HEADLESS,
CMD_BOOLPARAM_CONVERSIONMODE,
CMD_BOOLPARAM_QUICKSTART, CMD_BOOLPARAM_QUICKSTART,
CMD_BOOLPARAM_NOQUICKSTART, CMD_BOOLPARAM_NOQUICKSTART,
CMD_BOOLPARAM_TERMINATEAFTERINIT, CMD_BOOLPARAM_TERMINATEAFTERINIT,
...@@ -129,6 +130,7 @@ class CommandLineArgs ...@@ -129,6 +130,7 @@ class CommandLineArgs
sal_Bool IsBean() const; sal_Bool IsBean() const;
sal_Bool IsServer() const; sal_Bool IsServer() const;
sal_Bool IsHeadless() const; sal_Bool IsHeadless() const;
sal_Bool IsConversionMode() const;
sal_Bool IsQuickstart() const; sal_Bool IsQuickstart() const;
sal_Bool IsNoQuickstart() const; sal_Bool IsNoQuickstart() const;
sal_Bool IsTerminateAfterInit() const; sal_Bool IsTerminateAfterInit() const;
......
...@@ -56,25 +56,26 @@ namespace desktop ...@@ -56,25 +56,26 @@ namespace desktop
"\n"\ "\n"\
"Options:\n"; "Options:\n";
const char *aCmdLineHelp_left = const char *aCmdLineHelp_left =
"-minimized \n"\ "-minimized \n"\
"-invisible \n"\ "-invisible \n"\
"-norestore \n"\ "-norestore \n"\
"-quickstart \n"\ "-quickstart \n"\
"-nologo \n"\ "-nologo \n"\
"-nolockcheck \n"\ "-nolockcheck \n"\
"-nodefault \n"\ "-nodefault \n"\
"-headless \n"\ "-headless \n"\
"-help/-h/-? \n"\ "-conversionmode \n"\
"-writer \n"\ "-help/-h/-? \n"\
"-calc \n"\ "-writer \n"\
"-draw \n"\ "-calc \n"\
"-impress \n"\ "-draw \n"\
"-base \n"\ "-impress \n"\
"-math \n"\ "-base \n"\
"-global \n"\ "-math \n"\
"-web \n"\ "-global \n"\
"-o \n"\ "-web \n"\
"-n \n"; "-o \n"\
"-n \n";
const char *aCmdLineHelp_right = const char *aCmdLineHelp_right =
"keep startup bitmap minimized.\n"\ "keep startup bitmap minimized.\n"\
"no startup screen, no default document and no UI.\n"\ "no startup screen, no default document and no UI.\n"\
...@@ -84,6 +85,7 @@ namespace desktop ...@@ -84,6 +85,7 @@ namespace desktop
"don't check for remote instances using the installation\n"\ "don't check for remote instances using the installation\n"\
"don't start with an empty document\n"\ "don't start with an empty document\n"\
"like invisible but no userinteraction at all.\n"\ "like invisible but no userinteraction at all.\n"\
"enable further optimization for document conversion, includes enabled headless mode.\n"\
"show this message and exit.\n"\ "show this message and exit.\n"\
"create new text document.\n"\ "create new text document.\n"\
"create new spreadsheet document.\n"\ "create new spreadsheet document.\n"\
......
...@@ -155,24 +155,26 @@ struct ImplSVAppData ...@@ -155,24 +155,26 @@ struct ImplSVAppData
ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
ImplEventHook* mpFirstEventHook; // Event-Hooks ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners VclEventListeners2* mpPostYieldListeners; // post yield listeners
sal_uLong mnLastInputTime; // GetLastInputTime() sal_uLong mnLastInputTime; // GetLastInputTime()
sal_uInt16 mnDispatchLevel; // DispatchLevel sal_uInt16 mnDispatchLevel; // DispatchLevel
sal_uInt16 mnModalMode; // ModalMode Count sal_uInt16 mnModalMode; // ModalMode Count
sal_uInt16 mnModalDialog; // ModalDialog Count sal_uInt16 mnModalDialog; // ModalDialog Count
sal_uInt16 mnAccessCount; // AccessHdl Count sal_uInt16 mnAccessCount; // AccessHdl Count
sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
sal_Bool mbInAppMain; // is Application::Main() on stack sal_Bool mbInAppMain; // is Application::Main() on stack
sal_Bool mbInAppExecute; // is Application::Execute() on stack sal_Bool mbInAppExecute; // is Application::Execute() on stack
sal_Bool mbAppQuit; // is Application::Quit() called sal_Bool mbAppQuit; // is Application::Quit() called
sal_Bool mbSettingsInit; // sal_True: Settings are initialized 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 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 sal_Bool mbNoYield; // Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule // essentially that makes it the same as Application::Reschedule
long mnDefaultLayoutBorder; // default value in pixel for layout distances used long mnDefaultLayoutBorder; // default value in pixel for layout distances used
// in window arrangers // in window arrangers
bool mbConversionMode; // true allows further optimizations during document conversion in different code areas.
/** Controls whether showing any IME status window is toggled on or off. /** Controls whether showing any IME status window is toggled on or off.
Only meaningful if showing IME status windows can be toggled on and off Only meaningful if showing IME status windows can be toggled on and off
......
...@@ -243,7 +243,7 @@ public: ...@@ -243,7 +243,7 @@ public:
virtual void Main() = 0; virtual void Main() = 0;
virtual sal_Bool QueryExit(); virtual sal_Bool QueryExit();
virtual void UserEvent( sal_uLong nEvent, void* pEventData ); virtual void UserEvent( sal_uLong nEvent, void* pEventData );
...@@ -264,11 +264,11 @@ public: ...@@ -264,11 +264,11 @@ public:
static void InitAppRes( const ResId& rResId ); static void InitAppRes( const ResId& rResId );
static sal_uInt16 GetCommandLineParamCount(); static sal_uInt16 GetCommandLineParamCount();
static XubString GetCommandLineParam( sal_uInt16 nParam ); static XubString GetCommandLineParam( sal_uInt16 nParam );
static const XubString& GetAppFileName(); static const XubString& GetAppFileName();
virtual sal_uInt16 Exception( sal_uInt16 nError ); virtual sal_uInt16 Exception( sal_uInt16 nError );
static void Abort( const XubString& rErrorText ); static void Abort( const XubString& rErrorText );
static void Execute(); static void Execute();
...@@ -278,23 +278,23 @@ public: ...@@ -278,23 +278,23 @@ public:
static void EndYield(); static void EndYield();
static vos::IMutex& GetSolarMutex(); static vos::IMutex& GetSolarMutex();
static vos::OThread::TThreadIdentifier GetMainThreadIdentifier(); static vos::OThread::TThreadIdentifier GetMainThreadIdentifier();
static sal_uLong ReleaseSolarMutex(); static sal_uLong ReleaseSolarMutex();
static void AcquireSolarMutex( sal_uLong nCount ); static void AcquireSolarMutex( sal_uLong nCount );
static void EnableNoYieldMode( bool i_bNoYield ); static void EnableNoYieldMode( bool i_bNoYield );
static void AddPostYieldListener( const Link& i_rListener ); static void AddPostYieldListener( const Link& i_rListener );
static void RemovePostYieldListener( const Link& i_rListener ); static void RemovePostYieldListener( const Link& i_rListener );
static sal_Bool IsInMain(); static sal_Bool IsInMain();
static sal_Bool IsInExecute(); static sal_Bool IsInExecute();
static sal_Bool IsShutDown(); static sal_Bool IsShutDown();
static sal_Bool IsInModalMode(); static sal_Bool IsInModalMode();
static sal_uInt16 GetModalModeCount(); static sal_uInt16 GetModalModeCount();
static sal_uInt16 GetDispatchLevel(); static sal_uInt16 GetDispatchLevel();
static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY ); static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
static sal_uLong GetLastInputInterval(); static sal_uLong GetLastInputInterval();
static sal_Bool IsUICaptured(); static sal_Bool IsUICaptured();
static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL ); static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings, virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame ); Window* pFrame );
...@@ -323,20 +323,20 @@ public: ...@@ -323,20 +323,20 @@ public:
static void RemoveKeyListener( const Link& rKeyListener ); static void RemoveKeyListener( const Link& rKeyListener );
static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData ); static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
static void ImplCallEventListeners( VclSimpleEvent* pEvent ); static void ImplCallEventListeners( VclSimpleEvent* pEvent );
static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent ); static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent ); static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent ); static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
static void RemoveMouseAndKeyEvents( Window *pWin ); static void RemoveMouseAndKeyEvents( Window *pWin );
static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId );
static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
static void RemoveUserEvent( sal_uLong nUserEvent ); static void RemoveUserEvent( sal_uLong nUserEvent );
static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority ); static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
static void RemoveIdleHdl( const Link& rLink ); static void RemoveIdleHdl( const Link& rLink );
virtual void AppEvent( const ApplicationEvent& rAppEvent ); virtual void AppEvent( const ApplicationEvent& rAppEvent );
...@@ -384,14 +384,14 @@ public: ...@@ -384,14 +384,14 @@ public:
static const LocaleDataWrapper& GetAppLocaleDataWrapper(); static const LocaleDataWrapper& GetAppLocaleDataWrapper();
static sal_Bool InsertAccel( Accelerator* pAccel ); static sal_Bool InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel ); static void RemoveAccel( Accelerator* pAccel );
static void FlushAccel(); static void FlushAccel();
static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL ); static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
static void RemoveHotKey( sal_uLong nId ); static void RemoveHotKey( sal_uLong nId );
static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL ); static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
static void RemoveEventHook( sal_uLong nId ); static void RemoveEventHook( sal_uLong nId );
static long CallEventHooks( NotifyEvent& rEvt ); static long CallEventHooks( NotifyEvent& rEvt );
static long CallPreNotify( NotifyEvent& rEvt ); static long CallPreNotify( NotifyEvent& rEvt );
...@@ -401,12 +401,12 @@ public: ...@@ -401,12 +401,12 @@ public:
static Help* GetHelp(); static Help* GetHelp();
static void EnableAutoHelpId( sal_Bool bEnabled = sal_True ); static void EnableAutoHelpId( sal_Bool bEnabled = sal_True );
static sal_Bool IsAutoHelpIdEnabled(); static sal_Bool IsAutoHelpIdEnabled();
static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True ); static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True );
static sal_Bool IsAutoMnemonicEnabled(); static sal_Bool IsAutoMnemonicEnabled();
static sal_uLong GetReservedKeyCodeCount(); static sal_uLong GetReservedKeyCodeCount();
static const KeyCode* GetReservedKeyCode( sal_uLong i ); static const KeyCode* GetReservedKeyCode( sal_uLong i );
static String GetReservedKeyCodeDescription( sal_uLong i ); static String GetReservedKeyCodeDescription( sal_uLong i );
...@@ -414,10 +414,10 @@ public: ...@@ -414,10 +414,10 @@ public:
static Window* GetDefDialogParent(); static Window* GetDefDialogParent();
static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True ); static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True );
static sal_Bool IsDialogCancelEnabled(); static sal_Bool IsDialogCancelEnabled();
static void SetSystemWindowMode( sal_uInt16 nMode ); static void SetSystemWindowMode( sal_uInt16 nMode );
static sal_uInt16 GetSystemWindowMode(); static sal_uInt16 GetSystemWindowMode();
static void SetDialogScaleX( short nScale ); static void SetDialogScaleX( short nScale );
static short GetDialogScaleX(); static short GetDialogScaleX();
...@@ -437,10 +437,14 @@ public: ...@@ -437,10 +437,14 @@ public:
static void SetFilterHdl( const Link& rLink ); static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl(); static const Link& GetFilterHdl();
static sal_Bool IsAccessibilityEnabled(); static sal_Bool IsAccessibilityEnabled();
static void EnableHeadlessMode( sal_Bool bEnable = sal_True ); static void EnableHeadlessMode( sal_Bool bEnable = sal_True );
static sal_Bool IsHeadlessModeEnabled(); static sal_Bool IsHeadlessModeEnabled();
static void EnableConversionMode( bool bEnableConv = true );
static bool IsConversionModeEnabled();
static void ShowNativeErrorBox(const String& sTitle , static void ShowNativeErrorBox(const String& sTitle ,
const String& sMessage); const String& sMessage);
......
...@@ -1974,6 +1974,19 @@ sal_Bool Application::IsHeadlessModeEnabled() ...@@ -1974,6 +1974,19 @@ sal_Bool Application::IsHeadlessModeEnabled()
return IsDialogCancelEnabled(); return IsDialogCancelEnabled();
} }
void Application::EnableConversionMode( bool bEnableConv )
{
ImplGetSVData()->maAppData.mbConversionMode = bEnableConv;
}
// -----------------------------------------------------------------------
bool Application::IsConversionModeEnabled()
{
return ImplGetSVData()->maAppData.mbConversionMode;
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void Application::ShowNativeErrorBox(const String& sTitle , void Application::ShowNativeErrorBox(const String& sTitle ,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment