LCOV - code coverage report
Current view: top level - dbaccess/source/ui/querydesign - QueryTabConnUndoAction.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 56 1.8 %
Date: 2014-11-03 Functions: 2 21 9.5 %
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             : #include "QueryTabConnUndoAction.hxx"
      21             : #include "QTableConnection.hxx"
      22             : #include <tools/debug.hxx>
      23             : #include "QueryTableView.hxx"
      24             : #include "QueryAddTabConnUndoAction.hxx"
      25             : #include "QueryTabWinShowUndoAct.hxx"
      26             : #include "dbu_qry.hrc"
      27             : 
      28             : using namespace dbaui;
      29             : 
      30           0 : OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
      31             : {
      32           0 :     if (m_bOwnerOfConn)
      33             :     {   // I have the connection -> delete
      34           0 :         m_pOwner->DeselectConn(m_pConnection);
      35           0 :         delete m_pConnection;
      36             :     }
      37           0 : }
      38             : 
      39           0 : OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID)
      40             :     :OQueryDesignUndoAction(pOwner, nCommentID)
      41             :     ,m_pConnection(NULL)
      42           0 :     ,m_bOwnerOfConn(false)
      43             : {
      44           0 : }
      45             : 
      46           0 : OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner)
      47           0 :     : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION)
      48             : {
      49           0 : }
      50             : 
      51           0 : void OQueryAddTabConnUndoAction::Undo()
      52             : {
      53           0 :     static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
      54           0 :     SetOwnership(true);
      55           0 : }
      56             : 
      57           0 : void OQueryAddTabConnUndoAction::Redo()
      58             : {
      59           0 :     static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
      60           0 :     SetOwnership(false);
      61           0 : }
      62             : 
      63           0 : OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner)
      64           0 :     : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION)
      65             : {
      66           0 : }
      67             : 
      68           0 : void OQueryDelTabConnUndoAction::Undo()
      69             : {
      70           0 :     static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
      71           0 :     SetOwnership(false);
      72           0 : }
      73             : 
      74           0 : void OQueryDelTabConnUndoAction::Redo()
      75             : {
      76           0 :     static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
      77           0 :     SetOwnership(true);
      78           0 : }
      79             : 
      80           0 : OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner)
      81           0 :  : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW)
      82             : {
      83           0 : }
      84             : 
      85           0 : OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct()
      86             : {
      87           0 : }
      88             : 
      89           0 : void OQueryTabWinShowUndoAct::Undo()
      90             : {
      91           0 :     static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this);
      92           0 :     SetOwnership(true);
      93           0 : }
      94             : 
      95           0 : void OQueryTabWinShowUndoAct::Redo()
      96             : {
      97           0 :     static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,true);
      98           0 :     SetOwnership(false);
      99           0 : }
     100             : 
     101           0 : OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner)
     102           0 :  : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE)
     103             : {
     104           0 : }
     105             : 
     106           0 : OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct()
     107             : {
     108           0 : }
     109             : 
     110           0 : void OQueryTabWinDelUndoAct::Undo()
     111             : {
     112           0 :     static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,true );
     113           0 :     SetOwnership(false);
     114           0 : }
     115             : 
     116           0 : void OQueryTabWinDelUndoAct::Redo()
     117             : {
     118           0 :     static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this );
     119           0 :     SetOwnership(true);
     120          72 : }
     121             : 
     122             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10