cid#1640468 Dereference after null check
[LibreOffice.git] / dbaccess / source / ui / inc / RelationController.hxx
blobd4aa52faf080ce9ae140a25434fa1c1dc9df2420
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <memory>
22 #include <string_view>
24 #include "JoinController.hxx"
26 namespace weld
28 class WaitObject;
31 namespace dbaui
33 class ORelationController : public OJoinController
35 css::uno::Reference< css::container::XNameAccess > m_xTables;
36 std::unique_ptr<weld::WaitObject> m_xWaitObject;
37 sal_Int32 m_nThreadEvent;
38 bool m_bRelationsPossible;
39 protected:
40 // all the features which should be handled by this class
41 virtual void describeSupportedFeatures() override;
42 // state of a feature. 'feature' may be the handle of a css::util::URL somebody requested a dispatch interface for OR a toolbar slot.
43 virtual FeatureState GetState(sal_uInt16 nId) const override;
44 // execute a feature
45 virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override;
47 void loadData();
48 TTableWindowData::value_type existsTable(std::u16string_view _rComposedTableName) const;
50 // load the window positions out of the datasource
51 void loadLayoutInformation();
52 public:
53 ORelationController(const css::uno::Reference< css::uno::XComponentContext >& _rM);
55 virtual ~ORelationController() override;
57 void mergeData(const TTableConnectionData& _aConnectionData);
59 virtual bool Construct(vcl::Window* pParent) override;
61 // XServiceInfo
62 virtual OUString SAL_CALL getImplementationName() override;
63 virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
65 // OJoinController overridables
66 virtual bool allowViews() const override;
67 virtual bool allowQueries() const override;
69 private:
70 // ask the user if the design should be saved when it is modified
71 virtual short saveModified() override;
72 virtual void reset() override;
73 virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override;
74 virtual OUString getPrivateTitle( ) const override;
75 DECL_LINK( OnThreadFinished, void*, void );
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */