LibreOffice Module dbaccess (master) 1
QueryTabConnUndoAction.cxx
Go to the documentation of this file.
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
21#include "QTableConnection.hxx"
22#include <QueryTableView.hxx>
25#include <strings.hrc>
26
27using namespace dbaui;
28
29OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
30{
32 { // I have the connection -> delete
33 m_pOwner->DeselectConn(m_pConnection);
34 m_pConnection.disposeAndClear();
35 }
36}
37
39 : OQueryDesignUndoAction(pOwner, pCommentID)
40 , m_pConnection(nullptr)
41 , m_bOwnerOfConn(false)
42{
43}
44
46 : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION)
47{
48}
49
51{
52 static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection);
53 SetOwnership(true);
54}
55
57{
58 static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection);
59 SetOwnership(false);
60}
61
63 : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION)
64{
65}
66
68{
69 static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection);
70 SetOwnership(false);
71}
72
74{
75 static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection);
76 SetOwnership(true);
77}
78
80 : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW)
81{
82}
83
85
87{
88 static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin(m_pTabWin, this);
89 SetOwnership(true);
90}
91
93{
94 static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin(m_pTabWin, this, true);
95 SetOwnership(false);
96}
97
99 : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE)
100{
101}
102
104
106{
107 static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin(m_pTabWin, this, true);
108 SetOwnership(false);
109}
110
112{
113 static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin(m_pTabWin, this);
114 SetOwnership(true);
115}
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OQueryAddTabConnUndoAction(OQueryTableView *pOwner)
OQueryDelTabConnUndoAction(OQueryTableView *pOwner)
VclPtr< OJoinTableView > m_pOwner
OQueryTabConnUndoAction(OQueryTableView *pOwner, TranslateId pCommentID)
VclPtr< OQueryTableConnection > m_pConnection
OQueryTabWinDelUndoAct(OQueryTableView *pOwner)
OQueryTabWinShowUndoAct(OQueryTableView *pOwner)
VclPtr< OQueryTableWindow > m_pTabWin
SvLinkSource * pOwner