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 /scaddins/source/analysis/analysis.hxx | |
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 'scaddins/source/analysis/analysis.hxx')
-rw-r--r-- | scaddins/source/analysis/analysis.hxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx index 5b9d90bdf172..dbfe11a9c2c0 100644 --- a/scaddins/source/analysis/analysis.hxx +++ b/scaddins/source/analysis/analysis.hxx @@ -27,7 +27,8 @@ #include <com/sun/star/sheet/addin/XAnalysis.hpp> #include <com/sun/star/sheet/XCompatibilityNames.hpp> -#include <cppuhelper/implbase.hxx> +#include <cppuhelper/compbase.hxx> +#include <cppuhelper/basemutex.hxx> #include "analysishelper.hxx" @@ -36,12 +37,14 @@ namespace com::sun::star::lang { class XMultiServiceFactory; } namespace com::sun::star::sheet { struct LocalizedName; } -class AnalysisAddIn : public cppu::WeakImplHelper< +typedef cppu::WeakComponentImplHelper< css::sheet::XAddIn, css::sheet::XCompatibilityNames, css::sheet::addin::XAnalysis, css::lang::XServiceName, - css::lang::XServiceInfo > + css::lang::XServiceInfo > AnalysisAddIn_Base; + +class AnalysisAddIn : private cppu::BaseMutex, public AnalysisAddIn_Base { private: css::lang::Locale aFuncLoc; @@ -75,6 +78,9 @@ public: virtual ~AnalysisAddIn() override; + // XComponent + virtual void SAL_CALL dispose() override; + /// @throws css::uno::RuntimeException /// @throws css::lang::IllegalArgumentException double FactDouble( sal_Int32 nNum ); |