diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-07-01 12:38:26 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-07-01 12:38:26 +0000 |
commit | c61212262b196ab43c3f5ecaea312a849180a4b1 (patch) | |
tree | 995e7d7208ab6c79e645c7021f1b252ae6da68a6 /sd/source/ui/view/drviews1.cxx | |
parent | 09896044e5eac867e002a9d4338da878446c73e4 (diff) |
INTEGRATION: CWS impress144 (1.79.40); FILE MERGED
2008/06/09 13:15:19 cl 1.79.40.3: fixed windows build on wntmsci12 compiler
2008/06/09 11:34:57 cl 1.79.40.2: fixed shadow local
2008/06/05 07:37:32 af 1.79.40.1: #i83888# Prevent nested calls to SwitchPage().
Diffstat (limited to 'sd/source/ui/view/drviews1.cxx')
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 075a6f5fd764..5dbfe34babf1 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: drviews1.cxx,v $ - * $Revision: 1.79 $ + * $Revision: 1.80 $ * * This file is part of OpenOffice.org. * @@ -38,6 +38,7 @@ #include <com/sun/star/embed/EmbedStates.hpp> #include "comphelper/anytostring.hxx" +#include "comphelper/scopeguard.hxx" #include "cppuhelper/exc_hlp.hxx" #include "rtl/ref.hxx" @@ -110,8 +111,10 @@ #include <boost/bind.hpp> #ifdef _MSC_VER +#if (_MSC_VER < 1400) #pragma optimize ( "", off ) #endif +#endif using namespace com::sun::star; @@ -883,8 +886,21 @@ BOOL DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) |* \************************************************************************/ +void LclResetFlag (bool& rbFlag) {rbFlag = false;} + BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage) { + /** Under some circumstances there are nested calls to SwitchPage() and + may crash the application (activation of form controls when the + shell of the edit view is not on top of the shell stack, see issue + 83888 for details.) Therefore the nested calls are ignored (they + would jump to the wrong page anyway.) + */ + if (mbIsInSwitchPage) + return FALSE; + mbIsInSwitchPage = true; + comphelper::ScopeGuard aGuard (::boost::bind(LclResetFlag, ::boost::ref(mbIsInSwitchPage))); + if (GetActiveWindow()->IsInPaint()) { // Switching the current page while a Paint is being executed is @@ -923,7 +939,7 @@ BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage) if (IsSwitchPageAllowed()) { - ModifyGuard aGuard( GetDoc() ); + ModifyGuard aGuard2( GetDoc() ); bOK = TRUE; @@ -963,8 +979,10 @@ BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage) { SdrPageView* pPV = mpDrawView->GetSdrPageView(); - if (pPV && pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() ) && - pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1)) + SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage()); + if (pPV + && pNewPage == pCurrentPage + && pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1)) { // this slide is already visible return TRUE; @@ -1404,6 +1422,8 @@ sal_Int8 DrawViewShell::ExecuteDrop ( } // end of namespace sd #ifdef _MSC_VER +#if (_MSC_VER < 1400) #pragma optimize ( "", on ) #endif +#endif |