diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 31 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsj.cxx | 9 |
2 files changed, 14 insertions, 26 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 56487deb5c76..5fabb1fe3038 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2581,31 +2581,12 @@ void SdTiledRenderingTest::testRegenerateDiagram() SdPage* pActualPage = pXImpressDocument->GetDocShell()->GetViewShell()->GetActualPage(); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pActualPage->GetObj(0)->GetSubList()->GetObjCount()); - // select diagram - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB); - Scheduler::ProcessEventsToIdle(); - - // enter group - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F3); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F3); - Scheduler::ProcessEventsToIdle(); - - // select shape and delete - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::DELETE); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DELETE); - Scheduler::ProcessEventsToIdle(); - - // exit group - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | awt::Key::F3); - pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | awt::Key::F3); - Scheduler::ProcessEventsToIdle(); + // For new Diagram funcionality entering group using UI is not allowed as long + // as the group shape is a diagram. Do the same as before done by triggering UI + // events directly in the model + // Remove and free top-left entry (Box showing "A") + SdrObject* pTopLeftRemoved = pActualPage->GetObj(0)->GetSubList()->RemoveObject(1); + SdrObject::Free(pTopLeftRemoved); // select diagram pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB); diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 9f9a52012c3d..40dd8dca8214 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -132,12 +132,19 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) /* If it is not a group object or 3D object, we disable "enter group". */ - if( !( ( dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && nInv == SdrInventor::Default ) || + const auto* pIsGroup(dynamic_cast<const SdrObjGroup*>(pObj)); + if( !( ( pIsGroup != nullptr && nInv == SdrInventor::Default ) || ( dynamic_cast< const E3dScene* >(pObj) != nullptr ) ) ) { rSet.DisableItem( SID_ENTER_GROUP ); } + // Don't allow enter Diagrams + if(nullptr != pIsGroup && pIsGroup->isDiagram()) + { + rSet.DisableItem( SID_ENTER_GROUP ); + } + // If it is not a group object, we disable "ungroup" if(dynamic_cast< const SdrObjGroup *>( pObj ) == nullptr || nInv != SdrInventor::Default) { |