summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/viewshel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/view/viewshel.cxx')
-rw-r--r--sd/source/ui/view/viewshel.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index d19b099ffcfe..cb0924591b5c 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -79,6 +79,7 @@
#include <editeng/eeitem.hxx>
#include <svl/poolitem.hxx>
#include <glob.hrc>
+#include "AccessibleDocumentViewBase.hxx"
namespace sd { namespace ui { namespace table {
extern SfxShell* CreateTableObjectBar( ViewShell& rShell, ::sd::View* pView );
@@ -435,6 +436,7 @@ sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
bReturn = (sal_Bool)GetViewShell()->KeyInput(rKEvt);
}
+ sal_Int32 OriCount = GetView()->GetMarkedObjectList().GetMarkCount();
if(!bReturn)
{
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
@@ -464,6 +466,12 @@ sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
}
}
}
+ sal_Int32 EndCount = GetView()->GetMarkedObjectList().GetMarkCount();
+ // Here, oriCount or endCount must have one value=0, another value > 0, then to switch focus between Document and shape objects
+ if(bReturn && (OriCount + EndCount > 0) && (OriCount * EndCount == 0))
+ {
+ SwitchActiveViewFireFocus();
+ }
if(!bReturn && GetActiveWindow())
{
@@ -1527,6 +1535,33 @@ bool ViewShell::RelocateToParentWindow (::Window* pParentWindow)
return true;
}
+void ViewShell::SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc )
+{
+ if (xAcc.get())
+ {
+ ::accessibility::AccessibleDocumentViewBase* pBase = static_cast< ::accessibility::AccessibleDocumentViewBase* >(xAcc.get());
+ if (pBase)
+ {
+ pBase->SwitchViewActivated();
+ }
+ }
+}
+void ViewShell::SwitchActiveViewFireFocus()
+{
+ if (mpContentWindow)
+ {
+ SwitchViewFireFocus(mpContentWindow->GetAccessible(sal_False));
+ }
+}
+// move these two methods from DrawViewShell.
+void ViewShell::fireSwitchCurrentPage(sal_Int32 pageIndex)
+{
+ GetViewShellBase().GetDrawController().fireSwitchCurrentPage(pageIndex);
+}
+void ViewShell::NotifyAccUpdate( )
+{
+ GetViewShellBase().GetDrawController().NotifyAccUpdate();
+}
} // end of namespace sd