summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/drawview.cxx
diff options
context:
space:
mode:
authorSteve Yin <steve_y@apache.org>2013-12-02 15:54:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-02 16:41:08 +0000
commitb41332475783c31136673fb44cf4c411bb0148f8 (patch)
tree39ba57867ed6ae3f39e60c38180f800542067b49 /sc/source/ui/view/drawview.cxx
parent23fdf75cd6e6cb37bfeac08f503a15d07d9beda9 (diff)
Integrate branch of IAccessible2
Conflicts: everything Change-Id: I3d8cf956f511a0d953a1cefe83b6ef987806da25
Diffstat (limited to 'sc/source/ui/view/drawview.cxx')
-rw-r--r--sc/source/ui/view/drawview.cxx94
1 files changed, 94 insertions, 0 deletions
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 18cd6fec9e38..c4a4da24a741 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -628,6 +628,90 @@ void ScDrawView::UpdateUserViewOptions()
}
}
+SdrObject* ScDrawView::GetObjectByName(const OUString& rName)
+{
+ SfxObjectShell* pShell = pDoc->GetDocumentShell();
+ if (pShell)
+ {
+ SdrModel* pDrawLayer = GetModel();
+ sal_uInt16 nTabCount = pDoc->GetTableCount();
+ for (sal_uInt16 i=0; i<nTabCount; i++)
+ {
+ SdrPage* pPage = pDrawLayer->GetPage(i);
+ DBG_ASSERT(pPage,"Page ?");
+ if (pPage)
+ {
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ SdrObject* pObject = aIter.Next();
+ while (pObject)
+ {
+ if ( ScDrawLayer::GetVisibleName( pObject ) == rName )
+ {
+ return pObject;
+ }
+ pObject = aIter.Next();
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+//realize multi-selection of objects
+//==================================================
+sal_Bool ScDrawView::SelectCurrentViewObject( const OUString& rName )
+{
+ sal_uInt16 nObjectTab = 0;
+ SdrObject* pFound = NULL;
+ sal_Bool bUnMark=sal_False;
+ SfxObjectShell* pShell = pDoc->GetDocumentShell();
+ if (pShell)
+ {
+ SdrModel* pDrawLayer = GetModel();
+ sal_uInt16 nTabCount = pDoc->GetTableCount();
+ for (sal_uInt16 i=0; i<nTabCount && !pFound; i++)
+ {
+ SdrPage* pPage = pDrawLayer->GetPage(i);
+ DBG_ASSERT(pPage,"Page ?");
+ if (pPage)
+ {
+ SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
+ SdrObject* pObject = aIter.Next();
+ while (pObject && !pFound)
+ {
+ if ( ScDrawLayer::GetVisibleName( pObject ) == rName )
+ {
+ pFound = pObject;
+ nObjectTab = i;
+ }
+ pObject = aIter.Next();
+ }
+ }
+ }
+ }
+ if ( pFound )
+ {
+ ScTabView* pView = pViewData->GetView();
+ if ( nObjectTab != nTab ) // Tabelle umschalten
+ pView->SetTabNo( nObjectTab );
+ DBG_ASSERT( nTab == nObjectTab, "Tabellen umschalten hat nicht geklappt" );
+ pView->ScrollToObject( pFound );
+ if ( pFound->GetLayer() == SC_LAYER_BACK &&
+ !pViewData->GetViewShell()->IsDrawSelMode() &&
+ !pDoc->IsTabProtected( nTab ) &&
+ !pViewData->GetSfxDocShell()->IsReadOnly() )
+ {
+ SdrLayer* pLayer = GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_BACK);
+ if (pLayer)
+ SetLayerLocked( pLayer->GetName(), sal_False );
+ }
+ SdrPageView* pPV = GetSdrPageView();
+ bUnMark = IsObjMarked(pFound);
+ MarkObj( pFound, pPV, bUnMark);
+ }
+ return ( bUnMark );
+}
+
sal_Bool ScDrawView::SelectObject( const OUString& rName )
{
UnmarkAll();
@@ -689,6 +773,16 @@ sal_Bool ScDrawView::SelectObject( const OUString& rName )
return ( pFound != NULL );
}
+//If object is marked , return true , else return false .
+sal_Bool ScDrawView::GetObjectIsMarked( SdrObject* pObject )
+{
+ sal_Bool bisMarked =false;
+ if (pObject )
+ {
+ bisMarked = IsObjMarked(pObject);
+ }
+ return bisMarked;
+}
bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions)
{