diff options
author | Andre Fischer <af@apache.org> | 2013-05-27 11:18:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-28 17:03:22 +0100 |
commit | 0143805a565418d2a114c16b7eeba3b784176d9e (patch) | |
tree | 6334f551f1971c252c00730dffcc7a640198ef30 /sd | |
parent | Resolves: #i120589# Improved detection of missing perl modules (diff) | |
download | core-0143805a565418d2a114c16b7eeba3b784176d9e.tar.gz core-0143805a565418d2a114c16b7eeba3b784176d9e.zip |
Resolves: #i122332# Don't change sidebar context when switching...
to other application window
(cherry picked from commit 604502e2a4b53f35aedbf0205598a9b691c0d532)
Conflicts:
sd/source/ui/view/drviewsa.cxx
sfx2/inc/sfx2/shell.hxx
sfx2/source/control/shell.cxx
svx/inc/svx/sidebar/SelectionAnalyzer.hxx
svx/inc/svx/sidebar/SelectionChangeHandler.hxx
Change-Id: Id3c427e02714ef0d6686a78094e2f7f3b390a693
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 18 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsa.cxx | 36 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 2 |
6 files changed, 38 insertions, 37 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 6d91b187e81f..8dfdea6af7cf 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -24,7 +24,6 @@ #include "tools/AsynchronousCall.hxx" #include <sfx2/viewfac.hxx> #include <sfx2/viewsh.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include "TabControl.hxx" #include "pres.hxx" #include <svx/sidebar/SelectionChangeHandler.hxx> @@ -362,6 +361,8 @@ public: */ virtual bool RelocateToParentWindow (::Window* pParentWindow); + ::rtl::OUString GetSidebarContextName (void) const; + protected: DrawView* mpDrawView; SdPage* mpActualPage; @@ -487,8 +488,6 @@ private: const sal_uInt16 nSnapLineIndex, const Point& rMouseLocation); - ::sfx2::sidebar::EnumContext::Context GetContextForSelection (void) const; - using ViewShell::Notify; ::std::auto_ptr< AnnotationManager > mpAnnotationManager; diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 43ff8248132e..e9c627f5e460 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -51,6 +51,7 @@ #include "SdUnoSlideView.hxx" #include "ViewShellManager.hxx" #include "Window.hxx" +#include "drawview.hxx" #include <sfx2/app.hxx> #include <sfx2/msg.hxx> #include <sfx2/objface.hxx> @@ -62,6 +63,7 @@ #include <svx/svxids.hrc> #include <sfx2/sidebar/EnumContext.hxx> #include <svx/sidebar/ContextChangeEventMultiplexer.hxx> +#include <svx/sidebar/SelectionAnalyzer.hxx> #include <com/sun/star/drawing/framework/XControllerManager.hpp> #include <com/sun/star/drawing/framework/ResourceId.hpp> #include <cppuhelper/bootstrap.hxx> @@ -563,23 +565,20 @@ void SlideSorterViewShell::Activate (sal_Bool bIsMDIActivate) switch (eMainViewShellType) { case ViewShell::ST_IMPRESS: + case ViewShell::ST_SLIDE_SORTER: + case ViewShell::ST_NOTES: eContext = EnumContext::Context_DrawPage; if (pMainViewShell->ISA(DrawViewShell)) { - DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell && (pDrawViewShell->GetEditMode()== EM_MASTERPAGE)) - eContext = EnumContext::Context_MasterPage; + DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); + if (pDrawViewShell != NULL) + eContext = EnumContext::GetContextEnum(pDrawViewShell->GetSidebarContextName()); } break; - case ViewShell::ST_SLIDE_SORTER: eContext = EnumContext::Context_SlidesorterPage; break; - case ViewShell::ST_NOTES: - eContext = EnumContext::Context_NotesPage; - break; - default: break; } @@ -593,9 +592,6 @@ void SlideSorterViewShell::Activate (sal_Bool bIsMDIActivate) void SlideSorterViewShell::Deactivate (sal_Bool /*bIsMDIActivate*/) { - ContextChangeEventMultiplexer::NotifyContextChange( - &GetViewShellBase(), - EnumContext::Context_Default); } diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 876eab309070..26ad764b4fbe 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -114,9 +114,9 @@ void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli ) } -void DrawViewShell::Deactivate(sal_Bool bIsMDIActivate) +void DrawViewShell::Deactivate(sal_Bool /*bIsMDIActivate*/) { - ViewShell::Deactivate(bIsMDIActivate); + // Do not forward to ViewShell::Deactivate() to prevent a context change. } namespace @@ -459,13 +459,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) Invalidate( SID_NOTES_MASTERPAGE ); Invalidate( SID_HANDOUT_MASTERPAGE ); - if (meEditMode == EM_PAGE) - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_DrawPage)); - else if (mePageKind == PK_HANDOUT) - - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_HandoutPage)); - else - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_MasterPage)); + SetContextName(GetSidebarContextName()); } } diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 22872581c7f3..1caab1a55f7e 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -125,7 +125,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas , mbIsLayerModeActive(false) , mbIsInSwitchPage(false) , mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( - ::boost::bind(&DrawViewShell::GetContextForSelection, this), + ::boost::bind(&DrawViewShell::GetSidebarContextName, this), uno::Reference<frame::XController>(&rViewShellBase.GetDrawController()), sfx2::sidebar::EnumContext::Context_Default)) { @@ -137,12 +137,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas mpSelectionChangeHandler->Connect(); - if (mpFrameView->GetViewShEditMode(mePageKind) == EM_PAGE) - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_DrawPage)); - else if (mePageKind == PK_HANDOUT) - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_HandoutPage)); - else - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_MasterPage)); + SetContextName(GetSidebarContextName()); doShow(); } @@ -833,13 +828,28 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet ) -EnumContext::Context DrawViewShell::GetContextForSelection (void) const +::rtl::OUString DrawViewShell::GetSidebarContextName (void) const { - return ::svx::sidebar::SelectionAnalyzer::GetContextForSelection_SD( - mpDrawView->GetMarkedObjectList(), - meEditMode == EM_MASTERPAGE, - mePageKind == PK_HANDOUT, - mePageKind == PK_NOTES); + ::svx::sidebar::SelectionAnalyzer::ViewType eViewType (::svx::sidebar::SelectionAnalyzer::VT_Standard); + switch (mePageKind) + { + case PK_HANDOUT: + eViewType = ::svx::sidebar::SelectionAnalyzer::VT_Handout; + break; + case PK_NOTES: + eViewType = ::svx::sidebar::SelectionAnalyzer::VT_Notes; + break; + case PK_STANDARD: + if (meEditMode == EM_MASTERPAGE) + eViewType = ::svx::sidebar::SelectionAnalyzer::VT_Master; + else + eViewType = ::svx::sidebar::SelectionAnalyzer::VT_Standard; + break; + } + return EnumContext::GetContextName( + ::svx::sidebar::SelectionAnalyzer::GetContextForSelection_SD( + mpDrawView->GetMarkedObjectList(), + eViewType)); } diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 494101834ce8..80f8b3d6ed42 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -363,6 +363,8 @@ void OutlineViewShell::Activate( sal_Bool bIsMDIActivate ) } ViewShell::Activate( bIsMDIActivate ); + SfxShell::BroadcastContextForActivation(true); + pOlView->SetLinks(); pOlView->ConnectToApplication(); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 6fe1ba2cded2..19ab22046487 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -304,7 +304,7 @@ void ViewShell::Exit (void) */ void ViewShell::Activate(sal_Bool bIsMDIActivate) { - SfxShell::Activate(bIsMDIActivate); + // Do not forward to SfxShell::Activate() /* According to MI, nobody is allowed to call GrabFocus, who does not exactly know from which window the focus is grabbed. Since Activate() |