diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-27 11:06:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-30 10:49:27 +0200 |
commit | 6e35794cad555485955c3b43593497dcdbf29840 (patch) | |
tree | 430c0299f21fb62faf6d0ba5e04410fafdda14d2 /sc | |
parent | a6e02f6337f038a445b858bb91bf14d1a14768e4 (diff) |
terminate XDesktop properly in unit tests
So that the UNO constructor work can continue - where we need the
desktop to be disposed properly so that all UNO constructors objects
have their dispose() called, and they can clean up their global state.
We detect this case by changing a SAL_WARN to an assert in
Desktop::disposing()
(*) in ~ScTabViewShell, don't call EnterHandler, because that tries to
create EditEngine's and other stuff, which crashes
(*) Need a fake singleton so that the servicemanager calls dispose()
on the AnalysAddIn and we can clear the global variable there.
Change-Id: Id13b51e17afc16fcbbc65d64281cdf847e4a58cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99640
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 6 |
2 files changed, 3 insertions, 12 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index bf09da9872f2..62e356ddb6d2 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -30,7 +30,6 @@ public: ScFiltersTest(); virtual void setUp() override; - virtual void tearDown() override; void testTdf64229(); void testTdf36933(); @@ -178,8 +177,6 @@ void ScFiltersTest::testTdf91979() int nRowHeight = ScViewData::ToPixel(pDoc->GetRowHeight(0, 0), aViewData.GetPPTY()); CPPUNIT_ASSERT_EQUAL(static_cast<long>((MAXCOL - 1) * nColWidth), aPos.getX()); CPPUNIT_ASSERT_EQUAL(static_cast<long>(10000 * nRowHeight), aPos.getY()); - - xComponent->dispose(); } /* @@ -516,12 +513,6 @@ void ScFiltersTest::setUp() CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is()); } -void ScFiltersTest::tearDown() -{ - uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose(); - test::BootstrapFixture::tearDown(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index a07e05d70739..60d1573f6dd6 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1755,9 +1755,6 @@ ScTabViewShell::~ScTabViewShell() if (mpInputHandler) { mpInputHandler->SetDocumentDisposing(true); - // We end edit mode, before destroying the input handler and the edit engine - // and before end listening (in order to call ScTabViewShell::KillEditView()) - mpInputHandler->EnterHandler(); } ScDocShell* pDocSh = GetViewData().GetDocShell(); @@ -1770,6 +1767,9 @@ ScTabViewShell::~ScTabViewShell() RemoveSubShell(); // all SetWindow(nullptr); + // need kill editview or we will touch the editengine after it has been freed by the ScInputHandler + KillEditView(true); + pFontworkBarShell.reset(); pExtrusionBarShell.reset(); pCellShell.reset(); |