build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / dbaccess / source / ui / uno / unoadmin.cxx
bloba7cf4676a0aa115a45dcffaaca273c0733a06db6
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 .
20 #include "dbustrings.hrc"
21 #include <toolkit/awt/vclxwindow.hxx>
22 #include "dbu_reghelper.hxx"
23 #include "unoadmin.hxx"
24 #include "dbadmin.hxx"
25 #include <comphelper/extract.hxx>
26 #include <comphelper/processfactory.hxx>
27 #include <cppuhelper/typeprovider.hxx>
28 #include <comphelper/property.hxx>
29 #include <osl/diagnose.h>
30 #include <vcl/msgbox.hxx>
32 // --- needed because of the solar mutex
33 #include <osl/mutex.hxx>
34 #include <vcl/svapp.hxx>
37 namespace dbaui
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::lang;
42 using namespace ::com::sun::star::beans;
44 ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _rxORB)
45 :ODatabaseAdministrationDialogBase(_rxORB)
46 ,m_pDatasourceItems(nullptr)
47 ,m_pItemPool(nullptr)
48 ,m_pItemPoolDefaults(nullptr)
49 ,m_pCollection(nullptr)
52 m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB);
53 ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection);
56 ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
58 if (m_pDialog)
60 ::osl::MutexGuard aGuard(m_aMutex);
61 if (m_pDialog)
63 destroyDialog();
64 ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults);
68 delete m_pCollection;
69 m_pCollection = nullptr;
73 void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue)
75 PropertyValue aProperty;
76 if (_rValue >>= aProperty)
78 if (aProperty.Name == "InitialSelection")
80 m_aInitialSelection = aProperty.Value;
82 else if (aProperty.Name == "ActiveConnection")
84 m_xActiveConnection.set(aProperty.Value,UNO_QUERY);
86 else
87 ODatabaseAdministrationDialogBase::implInitialize(_rValue);
89 else
90 ODatabaseAdministrationDialogBase::implInitialize(_rValue);
93 } // namespace dbaui
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */