diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-19 20:21:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:02:22 +0200 |
commit | 2d92504b2d8ff04b2fd8cea4fe4897cfbf82621f (patch) | |
tree | 9e4486e321be44fae72c7c35f92da0bc4d2a8a18 /sc/source/ui/uitest/uiobject.cxx | |
parent | 54d5931880e141fb3eb963da7040035569cfd8f3 (diff) |
uitest: allow activating OLE objects
Change-Id: I960f5d644afb9392f8b3fe1d2f393c499af57bdb
Diffstat (limited to 'sc/source/ui/uitest/uiobject.cxx')
-rw-r--r-- | sc/source/ui/uitest/uiobject.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sc/source/ui/uitest/uiobject.cxx b/sc/source/ui/uitest/uiobject.cxx index 84808c435dfc..4405fd9afc00 100644 --- a/sc/source/ui/uitest/uiobject.cxx +++ b/sc/source/ui/uitest/uiobject.cxx @@ -74,6 +74,14 @@ ScDrawView* ScGridWinUIObject::getDrawView() return pDrawView; } +ScTabViewShell* ScGridWinUIObject::getViewShell() +{ + ScViewData* pViewData = mxGridWindow->getViewData(); + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + + return pViewShell; +} + void ScGridWinUIObject::execute(const OUString& rAction, const StringMap& rParameters) { @@ -125,6 +133,28 @@ void ScGridWinUIObject::execute(const OUString& rAction, SAL_WARN("sc.uitest", "unknown selection method"); } } + else if (rAction == "ACTIVATE") + { + ScDrawView* pDrawView = getDrawView(); + const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList(); + if (rMarkList.GetMarkCount() == 1) + { + SdrMark* pMark = rMarkList.GetMark(0); + SdrObject* pObj = pMark->GetMarkedSdrObj(); + sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + if (nSdrObjKind == OBJ_OLE2) + { + ScTabViewShell* pViewShell = getViewShell(); + pViewShell->ActivateObject( static_cast<SdrOle2Obj*>(pObj), 0 ); + } + else + { + SAL_WARN("sc.uitest", "can't activate non-ole objects"); + } + } + else + SAL_WARN("sc.uitest", "can't activate the current selection"); + } else { WindowUIObject::execute(rAction, rParameters); |