summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorSteve Yin <steve_y@apache.org>2013-11-28 12:09:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-11-28 13:32:30 +0000
commitcc5518ca61b209408a9d5262bbdcc39efccdd72d (patch)
tree23f4be456f58a52ad53a3aaab82894b91a4f797d /sd/source/ui/view
parent0a05120e1a08c29b3495878d2a3b5fb30d344c6c (diff)
Integrate branch of IAccessible2
Change-Id: Ibf3be46e8619c2dce9636e8a90a6703f3e28ba33
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/Outliner.cxx11
-rw-r--r--sd/source/ui/view/drviews4.cxx38
-rw-r--r--sd/source/ui/view/drviews5.cxx6
-rw-r--r--sd/source/ui/view/outlnvsh.cxx8
-rw-r--r--sd/source/ui/view/sdwindow.cxx29
-rw-r--r--sd/source/ui/view/tabcontr.cxx5
-rw-r--r--sd/source/ui/view/viewshel.cxx35
7 files changed, 131 insertions, 1 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 3701a1e2a7b1..d68bb7800ae0 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -515,6 +515,17 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
RestoreStartPosition ();
mnStartPageIndex = (sal_uInt16)-1;
}
+
+ SfxChildWindow *pChildWin =
+ SfxViewFrame::Current()->GetChildWindow(
+ SvxSearchDialogWrapper::GetChildWindowId());
+ if (pChildWin)
+ {
+ SvxSearchDialog* pSearchDlg =
+ ((SvxSearchDialog*)(pChildWin->GetWindow()));
+ pSearchDlg->SetDocWin( pViewShell->GetActiveWindow() );
+ pSearchDlg->SetSrchFlag();
+ }
}
else
mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index a0d0dc019ee2..eff3e14d70f7 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -64,6 +64,7 @@
#include <svx/svditer.hxx>
+#include <navigatr.hxx>
namespace sd {
#define PIPETTE_RANGE 0
@@ -189,6 +190,12 @@ sal_Bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
else
{
bRet = ViewShell::KeyInput(rKEvt, pWin);
+ //If object is marked , the corresponding entry is set true , else
+ //the corresponding entry is set false .
+ if(KEY_TAB == rKEvt.GetKeyCode().GetCode())
+ {
+ FreshNavigatrTree();
+ }
}
}
@@ -231,6 +238,31 @@ void DrawViewShell::StartRulerDrag (
}
}
+//If object is marked , the corresponding entry is set true ,
+//else the corresponding entry is set false .
+void DrawViewShell::FreshNavigatrEntry()
+{
+ sal_uInt16 nId = SID_NAVIGATOR;
+ SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId );
+ if( pWindow )
+ {
+ SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) );
+ if( pNavWin )
+ pNavWin->FreshEntry();
+ }
+}
+
+void DrawViewShell::FreshNavigatrTree()
+{
+ sal_uInt16 nId = SID_NAVIGATOR;
+ SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId );
+ if( pWindow )
+ {
+ SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) );
+ if( pNavWin )
+ pNavWin->FreshTree( GetDoc() );
+ }
+}
void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt,
::sd::Window* pWin)
@@ -251,6 +283,9 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt,
{
ViewShell::MouseButtonDown(rMEvt, pWin);
+ //If object is marked , the corresponding entry is set true ,
+ //else the corresponding entry is set false .
+ FreshNavigatrTree();
if ( mbPipette )
( (SvxBmpMask*) GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->PipetteClicked();
}
@@ -402,6 +437,9 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
}
else
ViewShell::MouseButtonUp(rMEvt, pWin);
+ //If object is marked , the corresponding entry is set true ,
+ //else the corresponding entry is set false .
+ FreshNavigatrTree();
}
}
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 674485591401..dbefd03303af 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -606,6 +606,12 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex)
// Tell the draw view and the tab control of the new active layer.
mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex)));
pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex));
+ SdUnoDrawView* pUnoDrawView = new SdUnoDrawView (
+ *this,
+ *GetView());
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer();
+ GetViewShellBase().GetDrawController().fireChangeLayer( &rLayer );
+ delete pUnoDrawView;
}
}
}
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index f7878572fd54..94a5d040347a 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -214,6 +214,8 @@ OutlineViewShell::OutlineViewShell (
SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OutlineText));
+ m_StrOldPageName = OUString();
+
doShow();
}
@@ -1385,6 +1387,12 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
sal_Int32 nIndex = aLayoutStr.indexOf(SD_LT_SEPARATOR);
if (nIndex != -1)
aLayoutStr = aLayoutStr.copy(0, nIndex);
+ //Now, CurrentPage property change is already sent for DrawView and OutlineView, so it is not necessary to send again here
+ if(m_StrOldPageName!=aPageStr)
+ {
+ GetViewShellBase().GetDrawController().fireSwitchCurrentPage(nPos);
+ m_StrOldPageName = aPageStr;
+ }
}
rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index fdcd2b125796..a8ddedf67c83 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -39,6 +39,8 @@
#include "AccessibleDrawDocumentView.hxx"
#include "WindowUpdater.hxx"
+#include <vcl/svapp.hxx>
+
namespace sd {
#define SCROLL_LINE_FACT 0.05 ///< factor for line scrolling
@@ -1031,8 +1033,22 @@ void Window::DropScroll(const Point& rMousePos)
::com::sun::star::accessibility::XAccessible>
Window::CreateAccessible (void)
{
+ // If current viewshell is PresentationViewShell, just return empty because the correct ShowWin will be created later.
+ if (mpViewShell && mpViewShell->ISA(PresentationViewShell))
+ {
+ return ::Window::CreateAccessible ();
+ }
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible(sal_False);
+ if (xAcc.get())
+ {
+ return xAcc;
+ }
if (mpViewShell != NULL)
- return mpViewShell->CreateAccessibleDocumentView (this);
+ {
+ xAcc = mpViewShell->CreateAccessibleDocumentView (this);
+ SetAccessible(xAcc);
+ return xAcc;
+ }
else
{
OSL_TRACE ("::sd::Window::CreateAccessible: no view shell");
@@ -1040,6 +1056,17 @@ void Window::DropScroll(const Point& rMousePos)
}
}
+// MT: Removed Windows::SwitchView() introduced with IA2 CWS.
+// There are other notifications for this when the active view has chnaged, so
+// please update the code to use that event mechanism
+void Window::SwitchView()
+{
+ if (mpViewShell)
+ {
+ mpViewShell->SwitchViewFireFocus(GetAccessible(sal_False));
+ }
+}
+
OUString Window::GetSurroundingText() const
{
if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 0dec8d62bf2a..84f170e862f3 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -79,6 +79,7 @@ TabControl::TabControl(DrawViewShell* pViewSh, Window* pParent) :
TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_SIZEABLE | WB_DRAG) ),
DragSourceHelper( this ),
DropTargetHelper( this ),
+ RrePageID(1),
pDrViewSh(pViewSh),
bInternalMove(sal_False)
{
@@ -110,6 +111,10 @@ void TabControl::MouseButtonDown(const MouseEvent& rMEvt)
Point aPos = PixelToLogic( rMEvt.GetPosPixel() );
sal_uInt16 aPageId = GetPageId(aPos);
+ //initialize
+ if(RrePageID!=aPageId)
+ pDrViewSh->FreshNavigatrEntry();
+ RrePageID=aPageId;
if (aPageId == 0)
{
SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
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