diff options
author | Jan Holesovsky <kendy@collabora.com> | 2019-01-25 14:40:40 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-01-30 07:29:52 +0100 |
commit | b6b28931435e44aca92b8c0e1659f701e3ed1a87 (patch) | |
tree | 722eaccb5cbb0e596f9d75bd6176d47708f61a7f /sw | |
parent | c2c60eb9969716ef91a83952203948b5e334ec85 (diff) |
sw: Ctrl + shape insertion was not setting up the layer.
The consequence was that the shapes were inserted into the background
layer.
The problem was particularly visible with the LOK, but reproducible on
the desktop too.
Includes unit test.
Change-Id: I16137331f944101e25679ec8c4a034bea658bc57
Reviewed-on: https://gerrit.libreoffice.org/66917
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 6bd016702026..be14c00a8ba6 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -470,10 +470,14 @@ void SwTiledRenderingTest::testInsertShape() comphelper::dispatchCommand(".uno:BasicShapes.circle", uno::Sequence<beans::PropertyValue>()); // check that the shape was inserted in the visible area, not outside - SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + IDocumentDrawModelAccess &rDrawModelAccess = pWrtShell->GetDoc()->getIDocumentDrawModelAccess(); + SdrPage* pPage = rDrawModelAccess.GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT_EQUAL(tools::Rectangle(2736, 868, 7264, 3132), pObject->GetSnapRect()); + // check that it is in the foreground layer + CPPUNIT_ASSERT_EQUAL(rDrawModelAccess.GetHeavenId().get(), pObject->GetLayer().get()); + comphelper::LibreOfficeKit::setActive(false); } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e7486384e692..126c95074b9e 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -3147,6 +3147,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const } } SdrPageView* pPageView = pDrawView->GetSdrPageView(); + SdrCreateView::SetupObjLayer(pPageView, pDrawView->GetActiveLayer(), pObj); pDrawView->InsertObjectAtView(pObj, *pPageView); } ImpEndCreate(); |