diff options
author | Gregor Hartmann <gh@openoffice.org> | 2008-02-15 10:28:59 +0000 |
---|---|---|
committer | Gregor Hartmann <gh@openoffice.org> | 2008-02-15 10:28:59 +0000 |
commit | 2815aaeb30c5795526124c428ab0442d342b3148 (patch) | |
tree | 2052e7e64ee945ad771d3cd23b9aa9b664e96951 /automation | |
parent | 889c47dab12d08228eceb4f7ab03dd28a6535d94 (diff) |
#i85769#refine ResetSafeReschedule to count executes on modaldialogs
Diffstat (limited to 'automation')
-rw-r--r-- | automation/source/server/server.cxx | 14 | ||||
-rw-r--r-- | automation/source/server/sta_list.cxx | 5 | ||||
-rw-r--r-- | automation/source/server/statemnt.hxx | 8 |
3 files changed, 20 insertions, 7 deletions
diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx index 014534865e7f..08aa7dfae0da 100644 --- a/automation/source/server/server.cxx +++ b/automation/source/server/server.cxx @@ -4,9 +4,9 @@ * * $RCSfile: server.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2007-07-24 11:29:18 $ + * last change: $Author: gh $ $Date: 2008-02-15 11:28:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -678,7 +678,15 @@ IMPL_LINK( ImplRemoteControl, CommandHdl, Application*, EMPTYARG ) if ( StatementList::bExecuting ) m_pDbgWin->AddText( "In Execute " ); if ( StatementList::IsInReschedule() ) - m_pDbgWin->AddText( "In Reschedule " ); + { + m_pDbgWin->AddText( "In Reschedule FocusWindow: 0x" ); + m_pDbgWin->AddText( + String::CreateFromInt64( + sal::static_int_cast< sal_Int64 >( + reinterpret_cast< sal_IntPtr >(GetpApp()->GetFocusWindow())), + 16 )); + m_pDbgWin->AddText( " " ); + } m_pDbgWin->AddText( "Leaving CommandHdl\n" ); #endif return 0; // Garnicht erst irgendwelchen bldsinn machen diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index 7a27a7ed6754..79e5f0b26a01 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -4,9 +4,9 @@ * * $RCSfile: sta_list.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: kz $ $Date: 2007-06-19 14:36:39 $ + * last change: $Author: gh $ $Date: 2008-02-15 11:28:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -95,6 +95,7 @@ TTProfiler *StatementList::pProfiler = NULL; StatementList *StatementList::pFirst = NULL; BOOL StatementList::bReadingCommands = FALSE; BOOL StatementList::bIsInReschedule = FALSE; +USHORT StatementList::nModalCount = 0; Window *StatementList::pLastFocusWindow = NULL; BOOL StatementList::bWasDragManager = FALSE; BOOL StatementList::bWasPopupMenu = FALSE; diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx index 3ebf7731f888..c6c1b49761ae 100644 --- a/automation/source/server/statemnt.hxx +++ b/automation/source/server/statemnt.hxx @@ -4,9 +4,9 @@ * * $RCSfile: statemnt.hxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: hr $ $Date: 2007-06-27 21:00:57 $ + * last change: $Author: gh $ $Date: 2008-02-15 11:28:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -208,6 +208,7 @@ protected: static StatementList *pCurrentProfileStatement; static BOOL bIsInReschedule; + static USHORT nModalCount; static Window *pLastFocusWindow; // Wenn dieses sich ndert wird Safe Reschedule abgebrochen static BOOL bWasDragManager; // Wenn dieses sich ndert wird Safe Reschedule abgebrochen static BOOL bWasPopupMenu; // Wenn dieses sich ndert wird Safe Reschedule abgebrochen @@ -225,6 +226,7 @@ public: static BOOL IsInReschedule() { return bIsInReschedule; } void SafeReschedule( BOOL bYield = FALSE ) // Setzt Flag, so da nicht schon der nchste Befehl ausgefhrt wird { + nModalCount = Application::GetModalModeCount(); bIsInReschedule = TRUE; pLastFocusWindow = GetpApp()->GetFocusWindow(); bWasDragManager = false /*!= DragManager::GetDragManager()*/; @@ -241,6 +243,7 @@ public: bWasDragManager = FALSE; pLastFocusWindow = NULL; bIsInReschedule = FALSE; + nModalCount = 0; } static BOOL MaybeResetSafeReschedule() { // Implementierung mu hier zwar nicht sein, ist aber bersichtlicher so @@ -248,6 +251,7 @@ public: return FALSE; if ( pLastFocusWindow != GetpApp()->GetFocusWindow() + || ( Application::GetModalModeCount() > nModalCount ) // || ( DragManager::GetDragManager() && !bWasDragManager ) || ( PopupMenu::GetActivePopupMenu() && !bWasPopupMenu ) || ( StarBASIC::IsRunning() && !bBasicWasRunning ) ) |