bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / querydesign / QueryTabConnUndoAction.cxx
blobd09f60dd4400d656544c1b28d78d0434791733c3
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 "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"
28 using namespace dbaui;
30 DBG_NAME(OQueryTabConnUndoAction)
31 // ------------------------------------------------------------------------------------------------
32 OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
34 DBG_DTOR(OQueryTabConnUndoAction,NULL);
35 if (m_bOwnerOfConn)
36 { // I have the connection -> delete
37 m_pOwner->DeselectConn(m_pConnection);
38 delete m_pConnection;
42 // ------------------------------------------------------------------------------------------------
43 OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID)
44 :OQueryDesignUndoAction(pOwner, nCommentID)
45 ,m_pConnection(NULL)
46 ,m_bOwnerOfConn(sal_False)
48 DBG_CTOR(OQueryTabConnUndoAction,NULL);
50 // -----------------------------------------------------------------------------
51 OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner)
52 : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION)
55 // -----------------------------------------------------------------------------
56 void OQueryAddTabConnUndoAction::Undo()
58 static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
59 SetOwnership(sal_True);
61 // -----------------------------------------------------------------------------
62 void OQueryAddTabConnUndoAction::Redo()
64 static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
65 SetOwnership(sal_False);
67 // -----------------------------------------------------------------------------
68 OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner)
69 : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION)
72 // -----------------------------------------------------------------------------
73 void OQueryDelTabConnUndoAction::Undo()
75 static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
76 SetOwnership(sal_False);
78 // -----------------------------------------------------------------------------
79 void OQueryDelTabConnUndoAction::Redo()
81 static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
82 SetOwnership(sal_True);
84 // -----------------------------------------------------------------------------
85 OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner)
86 : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW)
89 // -----------------------------------------------------------------------------
90 OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct()
93 // -----------------------------------------------------------------------------
94 void OQueryTabWinShowUndoAct::Undo()
96 static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this);
97 SetOwnership(sal_True);
99 // -----------------------------------------------------------------------------
100 void OQueryTabWinShowUndoAct::Redo()
102 static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,sal_True);
103 SetOwnership(sal_False);
105 // -----------------------------------------------------------------------------
106 OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner)
107 : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE)
110 // -----------------------------------------------------------------------------
111 OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct()
114 // -----------------------------------------------------------------------------
115 void OQueryTabWinDelUndoAct::Undo()
117 static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,sal_True );
118 SetOwnership(sal_False);
120 // -----------------------------------------------------------------------------
121 void OQueryTabWinDelUndoAct::Redo()
123 static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this );
124 SetOwnership(sal_True);
126 // -----------------------------------------------------------------------------
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */