cid#1636690 Dereference after null check
[LibreOffice.git] / cui / qa / unit / cui-dialogs-test_4.cxx
blob157ffa8b37658afc004db9f800a9afb6d8ff806a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
11 #include <test/screenshot_test.hxx>
12 #include <vcl/abstdlg.hxx>
14 using namespace ::com::sun::star;
16 /// Test opening a dialog in cui
17 class CuiDialogsTest4 : public ScreenshotTest
19 private:
20 /// helper method to populate KnownDialogs, called in setUp(). Needs to be
21 /// written and has to add entries to KnownDialogs
22 virtual void registerKnownDialogsByID(mapType& rKnownDialogs) override;
24 /// dialog creation for known dialogs by ID. Has to be implemented for
25 /// each registered known dialog
26 virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
28 public:
29 CuiDialogsTest4();
31 // try to open a dialog
32 void openAnyDialog();
34 CPPUNIT_TEST_SUITE(CuiDialogsTest4);
35 CPPUNIT_TEST(openAnyDialog);
36 CPPUNIT_TEST_SUITE_END();
39 CuiDialogsTest4::CuiDialogsTest4() {}
41 void CuiDialogsTest4::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
43 // leave empty should be in CuiDialogTest if any
46 VclPtr<VclAbstractDialog> CuiDialogsTest4::createDialogByID(sal_uInt32 /*nID*/) { return nullptr; }
48 void CuiDialogsTest4::openAnyDialog()
50 /// process input file containing the UXMLDescriptions of the dialogs to dump
51 processDialogBatchFile(u"cui/qa/unit/data/cui-dialogs-test_4.txt");
54 CPPUNIT_TEST_SUITE_REGISTRATION(CuiDialogsTest4);
56 CPPUNIT_PLUGIN_IMPLEMENT();
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */