LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/dbaccess/source/ui/uno - unoadmin.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 28 39.3 %
Date: 2013-07-09 Functions: 4 7 57.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : 
      21             : #include "dbustrings.hrc"
      22             : #include <toolkit/awt/vclxwindow.hxx>
      23             : #include "dbu_reghelper.hxx"
      24             : #ifndef _DBAUI_UNOADMIN_
      25             : #include "unoadmin.hxx"
      26             : #endif
      27             : #include "dbadmin.hxx"
      28             : #include <comphelper/extract.hxx>
      29             : #include <comphelper/processfactory.hxx>
      30             : #include <cppuhelper/typeprovider.hxx>
      31             : #include <comphelper/property.hxx>
      32             : #include <osl/diagnose.h>
      33             : #include <vcl/msgbox.hxx>
      34             : 
      35             : // --- needed because of the solar mutex
      36             : #include <osl/mutex.hxx>
      37             : #include <vcl/svapp.hxx>
      38             : // ---
      39             : 
      40             : //.........................................................................
      41             : namespace dbaui
      42             : {
      43             : //.........................................................................
      44             : 
      45             :     using namespace ::com::sun::star::uno;
      46             :     using namespace ::com::sun::star::lang;
      47             :     using namespace ::com::sun::star::beans;
      48             : 
      49             : //=========================================================================
      50             : DBG_NAME(ODatabaseAdministrationDialog)
      51             : //-------------------------------------------------------------------------
      52           2 : ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _rxORB)
      53             :     :ODatabaseAdministrationDialogBase(_rxORB)
      54             :     ,m_pDatasourceItems(NULL)
      55             :     ,m_pItemPool(NULL)
      56             :     ,m_pItemPoolDefaults(NULL)
      57           2 :     ,m_pCollection(NULL)
      58             : {
      59             :     DBG_CTOR(ODatabaseAdministrationDialog,NULL);
      60             : 
      61           2 :     m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB);
      62           2 :     ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection);
      63           2 : }
      64             : 
      65             : //-------------------------------------------------------------------------
      66           4 : ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
      67             : {
      68             :     // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor,
      69             :     // so this virtual-method-call the base class does does not work, we're already dead then ...
      70           2 :     if (m_pDialog)
      71             :     {
      72           0 :         ::osl::MutexGuard aGuard(m_aMutex);
      73           0 :         if (m_pDialog)
      74           0 :             destroyDialog();
      75             :     }
      76             : 
      77           2 :     delete m_pCollection;
      78           2 :     m_pCollection = NULL;
      79             : 
      80             :     DBG_DTOR(ODatabaseAdministrationDialog,NULL);
      81           2 : }
      82             : //-------------------------------------------------------------------------
      83           0 : void ODatabaseAdministrationDialog::destroyDialog()
      84             : {
      85           0 :     ODatabaseAdministrationDialogBase::destroyDialog();
      86           0 :     ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults);
      87           0 : }
      88             : //------------------------------------------------------------------------------
      89           0 : void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue)
      90             : {
      91           0 :     PropertyValue aProperty;
      92           0 :     if (_rValue >>= aProperty)
      93             :     {
      94           0 :         if (0 == aProperty.Name.compareToAscii("InitialSelection"))
      95             :         {
      96           0 :             m_aInitialSelection = aProperty.Value;
      97             :         }
      98           0 :         else if (0 == aProperty.Name.compareToAscii("ActiveConnection"))
      99             :         {
     100           0 :             m_xActiveConnection.set(aProperty.Value,UNO_QUERY);
     101             :         }
     102             :         else
     103           0 :             ODatabaseAdministrationDialogBase::implInitialize(_rValue);
     104             :     }
     105             :     else
     106           0 :         ODatabaseAdministrationDialogBase::implInitialize(_rValue);
     107           0 : }
     108             : 
     109             : //.........................................................................
     110          12 : }   // namespace dbaui
     111             : //.........................................................................
     112             : 
     113             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10