diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-18 14:12:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-18 14:12:02 +0100 |
commit | 0581718d889a841afd5e4e23f6c61f273a081773 (patch) | |
tree | eb3036dc07e8b7bd673f75e09d2959220755a31b | |
parent | b495eb4dbaf9165414b2082572d96d14dbf38d1f (diff) |
Make sure swui's pSwResMgr is initialized in CppunitTest_sw_dialogs_test
...to avoid -fsanitize=null at
> sw/source/uibase/dbui/dbtree.cxx:147:18: runtime error: reference binding to null pointer of type 'ResMgr'
> #0 0x7fd408581b70 in SwDBTreeList::SwDBTreeList(vcl::Window*, long) sw/source/uibase/dbui/dbtree.cxx:147:18
> #1 0x7fd408594596 in VclPtr<SwDBTreeList> VclPtr<SwDBTreeList>::Create<VclPtr<vcl::Window>&, long&>(VclPtr<vcl::Window>&, long&) include/vcl/vclptr.hxx:138:46
> #2 0x7fd4085827d8 in makeSwDBTreeList sw/source/uibase/dbui/dbtree.cxx:156:1
> #3 0x7fd443044214 in VclBuilder::makeObject(vcl::Window*, rtl::OString const&, rtl::OString const&, std::__debug::map<rtl::OString, rtl::OString, std::less<rtl::OString>, std::allocator<std::pair<rtl::OString const, rtl::OString> > >&) vcl/source/window/builder.cxx:1793:17
Change-Id: I02c5a0017b85254bf34f622b55f7db9d5d546b80
-rw-r--r-- | sw/qa/unit/sw-dialogs-test.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/qa/unit/sw-dialogs-test.cxx b/sw/qa/unit/sw-dialogs-test.cxx index 74acd8cc304c..1fb4f7b57ae1 100644 --- a/sw/qa/unit/sw-dialogs-test.cxx +++ b/sw/qa/unit/sw-dialogs-test.cxx @@ -26,6 +26,7 @@ extern "C" { using Fn = SwAbstractDialogFactory * (*)(); } class SwDialogsTest : public ScreenshotTest { private: + css::uno::Reference<css::lang::XComponent> component_; osl::Module libSwui_; /// helper method to populate KnownDialogs, called in setUp(). Needs to be @@ -61,6 +62,9 @@ SwDialogsTest::~SwDialogsTest() void SwDialogsTest::setUp() { ScreenshotTest::setUp(); + // Make sure the sw library's global pSwResMgr is initialized: + component_ = loadFromDesktop( + "private:factory/swriter", "com.sun.star.text.TextDocument"); // Make sure the swui library's global pSwResMgr is initialized // (alternatively to dynamically loading the library, SwCreateDialogFactory // could be declared in an include file and this CppunitTest link against |