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

Generated by: LCOV version 1.11