You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by js...@apache.org on 2012/09/12 10:30:43 UTC
svn commit: r1383844 - in /incubator/ooo/trunk/main:
desktop/source/app/appinit.cxx desktop/source/app/cmdlineargs.cxx
desktop/source/app/cmdlineargs.hxx desktop/source/app/cmdlinehelp.cxx
vcl/inc/svdata.hxx vcl/inc/vcl/svapp.hxx vcl/source/app/svapp.cxx
Author: jsc
Date: Wed Sep 12 08:30:42 2012
New Revision: 1383844
URL: http://svn.apache.org/viewvc?rev=1383844&view=rev
Log:
#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
Modified:
incubator/ooo/trunk/main/desktop/source/app/appinit.cxx
incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.cxx
incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.hxx
incubator/ooo/trunk/main/desktop/source/app/cmdlinehelp.cxx
incubator/ooo/trunk/main/vcl/inc/svdata.hxx
incubator/ooo/trunk/main/vcl/inc/vcl/svapp.hxx
incubator/ooo/trunk/main/vcl/source/app/svapp.cxx
Modified: incubator/ooo/trunk/main/desktop/source/app/appinit.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/appinit.cxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/appinit.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/appinit.cxx Wed Sep 12 08:30:42 2012
@@ -263,7 +263,11 @@ void Desktop::RegisterServices( Referenc
if ( bHeadlessMode )
Application::EnableHeadlessMode();
- if ( conDcp.getLength() > 0 )
+ // ConversionMode
+ if ( pCmdLine->IsConversionMode() )
+ Application::EnableConversionMode();
+
+ if ( conDcp.getLength() > 0 )
{
// accept incoming connections (scripting and one rvp)
RTL_LOGFILE_CONTEXT( aLog, "desktop (lo119109) desktop::Desktop::createAcceptor()" );
Modified: incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.cxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.cxx Wed Sep 12 08:30:42 2012
@@ -416,6 +416,14 @@ sal_Bool CommandLineArgs::InterpretComma
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, 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 )
{
#if defined(ENABLE_QUICKSTART_APPLET)
@@ -690,6 +698,12 @@ sal_Bool CommandLineArgs::IsHeadless() c
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
{
osl::MutexGuard aMutexGuard( m_aMutex );
Modified: incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.hxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.hxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/cmdlineargs.hxx Wed Sep 12 08:30:42 2012
@@ -43,6 +43,7 @@ class CommandLineArgs
CMD_BOOLPARAM_PLUGIN,
CMD_BOOLPARAM_SERVER,
CMD_BOOLPARAM_HEADLESS,
+ CMD_BOOLPARAM_CONVERSIONMODE,
CMD_BOOLPARAM_QUICKSTART,
CMD_BOOLPARAM_NOQUICKSTART,
CMD_BOOLPARAM_TERMINATEAFTERINIT,
@@ -129,6 +130,7 @@ class CommandLineArgs
sal_Bool IsBean() const;
sal_Bool IsServer() const;
sal_Bool IsHeadless() const;
+ sal_Bool IsConversionMode() const;
sal_Bool IsQuickstart() const;
sal_Bool IsNoQuickstart() const;
sal_Bool IsTerminateAfterInit() const;
Modified: incubator/ooo/trunk/main/desktop/source/app/cmdlinehelp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/source/app/cmdlinehelp.cxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/source/app/cmdlinehelp.cxx (original)
+++ incubator/ooo/trunk/main/desktop/source/app/cmdlinehelp.cxx Wed Sep 12 08:30:42 2012
@@ -56,25 +56,26 @@ namespace desktop
"\n"\
"Options:\n";
const char *aCmdLineHelp_left =
- "-minimized \n"\
- "-invisible \n"\
- "-norestore \n"\
- "-quickstart \n"\
- "-nologo \n"\
- "-nolockcheck \n"\
- "-nodefault \n"\
- "-headless \n"\
- "-help/-h/-? \n"\
- "-writer \n"\
- "-calc \n"\
- "-draw \n"\
- "-impress \n"\
- "-base \n"\
- "-math \n"\
- "-global \n"\
- "-web \n"\
- "-o \n"\
- "-n \n";
+ "-minimized \n"\
+ "-invisible \n"\
+ "-norestore \n"\
+ "-quickstart \n"\
+ "-nologo \n"\
+ "-nolockcheck \n"\
+ "-nodefault \n"\
+ "-headless \n"\
+ "-conversionmode \n"\
+ "-help/-h/-? \n"\
+ "-writer \n"\
+ "-calc \n"\
+ "-draw \n"\
+ "-impress \n"\
+ "-base \n"\
+ "-math \n"\
+ "-global \n"\
+ "-web \n"\
+ "-o \n"\
+ "-n \n";
const char *aCmdLineHelp_right =
"keep startup bitmap minimized.\n"\
"no startup screen, no default document and no UI.\n"\
@@ -84,6 +85,7 @@ namespace desktop
"don't check for remote instances using the installation\n"\
"don't start with an empty document\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"\
"create new text document.\n"\
"create new spreadsheet document.\n"\
Modified: incubator/ooo/trunk/main/vcl/inc/svdata.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/svdata.hxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/svdata.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/svdata.hxx Wed Sep 12 08:30:42 2012
@@ -155,24 +155,26 @@ struct ImplSVAppData
ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners
- sal_uLong mnLastInputTime; // GetLastInputTime()
- sal_uInt16 mnDispatchLevel; // DispatchLevel
- sal_uInt16 mnModalMode; // ModalMode Count
- sal_uInt16 mnModalDialog; // ModalDialog Count
- sal_uInt16 mnAccessCount; // AccessHdl Count
- sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
- sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
+ sal_uLong mnLastInputTime; // GetLastInputTime()
+ sal_uInt16 mnDispatchLevel; // DispatchLevel
+ sal_uInt16 mnModalMode; // ModalMode Count
+ sal_uInt16 mnModalDialog; // ModalDialog Count
+ sal_uInt16 mnAccessCount; // AccessHdl Count
+ sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
+ sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
- sal_Bool mbInAppMain; // is Application::Main() on stack
- 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
+ sal_Bool mbInAppMain; // is Application::Main() on stack
+ 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
long mnDefaultLayoutBorder; // default value in pixel for layout distances used
// 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.
Only meaningful if showing IME status windows can be toggled on and off
Modified: incubator/ooo/trunk/main/vcl/inc/vcl/svapp.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/svapp.hxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/svapp.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/svapp.hxx Wed Sep 12 08:30:42 2012
@@ -243,7 +243,7 @@ public:
virtual void Main() = 0;
- virtual sal_Bool QueryExit();
+ virtual sal_Bool QueryExit();
virtual void UserEvent( sal_uLong nEvent, void* pEventData );
@@ -264,11 +264,11 @@ public:
static void InitAppRes( const ResId& rResId );
- static sal_uInt16 GetCommandLineParamCount();
+ static sal_uInt16 GetCommandLineParamCount();
static XubString GetCommandLineParam( sal_uInt16 nParam );
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 Execute();
@@ -278,23 +278,23 @@ public:
static void EndYield();
static vos::IMutex& GetSolarMutex();
static vos::OThread::TThreadIdentifier GetMainThreadIdentifier();
- static sal_uLong ReleaseSolarMutex();
+ static sal_uLong ReleaseSolarMutex();
static void AcquireSolarMutex( sal_uLong nCount );
static void EnableNoYieldMode( bool i_bNoYield );
static void AddPostYieldListener( const Link& i_rListener );
static void RemovePostYieldListener( const Link& i_rListener );
- static sal_Bool IsInMain();
- static sal_Bool IsInExecute();
- static sal_Bool IsShutDown();
- static sal_Bool IsInModalMode();
- static sal_uInt16 GetModalModeCount();
-
- static sal_uInt16 GetDispatchLevel();
- static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
- static sal_uLong GetLastInputInterval();
- static sal_Bool IsUICaptured();
- static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
+ static sal_Bool IsInMain();
+ static sal_Bool IsInExecute();
+ static sal_Bool IsShutDown();
+ static sal_Bool IsInModalMode();
+ static sal_uInt16 GetModalModeCount();
+
+ static sal_uInt16 GetDispatchLevel();
+ static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
+ static sal_uLong GetLastInputInterval();
+ static sal_Bool IsUICaptured();
+ static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame );
@@ -323,20 +323,20 @@ public:
static void RemoveKeyListener( const Link& rKeyListener );
static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
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 PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
+ static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
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( 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, const Link& rLink, void* pCaller = NULL );
+ static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = 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, const Link& rLink, void* pCaller = NULL );
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 );
virtual void AppEvent( const ApplicationEvent& rAppEvent );
@@ -384,14 +384,14 @@ public:
static const LocaleDataWrapper& GetAppLocaleDataWrapper();
- static sal_Bool InsertAccel( Accelerator* pAccel );
+ static sal_Bool InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel );
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 sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
+ static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
static void RemoveEventHook( sal_uLong nId );
static long CallEventHooks( NotifyEvent& rEvt );
static long CallPreNotify( NotifyEvent& rEvt );
@@ -401,12 +401,12 @@ public:
static Help* GetHelp();
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 sal_Bool IsAutoMnemonicEnabled();
+ static sal_Bool IsAutoMnemonicEnabled();
- static sal_uLong GetReservedKeyCodeCount();
+ static sal_uLong GetReservedKeyCodeCount();
static const KeyCode* GetReservedKeyCode( sal_uLong i );
static String GetReservedKeyCodeDescription( sal_uLong i );
@@ -414,10 +414,10 @@ public:
static Window* GetDefDialogParent();
static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True );
- static sal_Bool IsDialogCancelEnabled();
+ static sal_Bool IsDialogCancelEnabled();
static void SetSystemWindowMode( sal_uInt16 nMode );
- static sal_uInt16 GetSystemWindowMode();
+ static sal_uInt16 GetSystemWindowMode();
static void SetDialogScaleX( short nScale );
static short GetDialogScaleX();
@@ -437,10 +437,14 @@ public:
static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl();
- static sal_Bool IsAccessibilityEnabled();
+ static sal_Bool IsAccessibilityEnabled();
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 ,
const String& sMessage);
Modified: incubator/ooo/trunk/main/vcl/source/app/svapp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/app/svapp.cxx?rev=1383844&r1=1383843&r2=1383844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/app/svapp.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/app/svapp.cxx Wed Sep 12 08:30:42 2012
@@ -1974,6 +1974,19 @@ sal_Bool Application::IsHeadlessModeEnab
return IsDialogCancelEnabled();
}
+
+void Application::EnableConversionMode( bool bEnableConv )
+{
+ ImplGetSVData()->maAppData.mbConversionMode = bEnableConv;
+}
+
+// -----------------------------------------------------------------------
+
+bool Application::IsConversionModeEnabled()
+{
+ return ImplGetSVData()->maAppData.mbConversionMode;
+}
+
// -----------------------------------------------------------------------
void Application::ShowNativeErrorBox(const String& sTitle ,