summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-08-27 13:24:58 +0000
committerOcke Janssen <oj@openoffice.org>2001-08-27 13:24:58 +0000
commitc70fd2cc0c998df9f9d9bed38ac546c60d649d2d (patch)
tree300d365ffb01d383ae9473e1a5e3ade61d4c21df /dbaccess/source
parent26b53995540a281b68c46aba49cc53fd9e07d5d1 (diff)
#91566# enable undo/redo for table movement
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx5
-rw-r--r--dbaccess/source/ui/inc/QueryTableView.hxx10
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx73
-rw-r--r--dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx17
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx10
-rw-r--r--dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx15
-rw-r--r--dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx20
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx90
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx5
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx19
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx17
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx20
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx37
14 files changed, 211 insertions, 137 deletions
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 5c129a445b42..13818abd3a97 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JoinTableView.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-07-26 07:11:01 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,6 +134,7 @@ namespace dbaui
,public IDragTransferableListener
,public DropTargetHelper
{
+ friend class OJoinMoveTabWinUndoAct;
public:
DECLARE_STL_USTRINGACCESS_MAP(OTableWindow*,OTableWindowMap);
private:
diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx
index 330005d0b37c..707e6d68a3ab 100644
--- a/dbaccess/source/ui/inc/QueryTableView.hxx
+++ b/dbaccess/source/ui/inc/QueryTableView.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTableView.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-07-06 09:55:43 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,12 +96,6 @@ namespace dbaui
protected:
virtual void ConnDoubleClicked(OTableConnection* pConnection);
virtual void KeyInput(const KeyEvent& rEvt);
-
- // wird nach Verschieben/Groessenaenderung der TabWins aufgerufen (die Standardimplementation reicht die neuen Daten einfach
- // an die Daten des Wins weiter)
- virtual void TabWinMoved(OTableWindow* pWhich, const Point& ptOldPosition);
- virtual void TabWinSized(OTableWindow* ptWhich, const Point& ptOldPosition, const Size& szOldSize);
-
public:
TYPEINFO();
OQueryTableView(Window* pParent,OQueryDesignView* pView);
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 20752a09147c..caf33b2f0dcb 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JoinTableView.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: oj $ $Date: 2001-08-15 13:19:03 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -106,6 +106,12 @@
#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#endif
+#ifndef DBAUI_OQUERYMOVETABWINUNDOACT_HXX
+#include "QueryMoveTabWinUndoAct.hxx"
+#endif
+#ifndef DBAUI_QUERYSIZETABWINUNDOACT_HXX
+#include "QuerySizeTabWinUndoAct.hxx"
+#endif
#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
#endif
@@ -436,39 +442,40 @@ void OJoinTableView::EnsureVisible(const OTableWindow* _pWin)
BOOL bFitsHor = (aUpperLeft.X() >= 0) && (aLowerRight.X() <= aSize.Width());
BOOL bFitsVert = (aUpperLeft.Y() >= 0) && (aLowerRight.Y() <= aSize.Height());
- if (bFitsHor && bFitsVert)
- // nothing to do
- return;
-
- long nScrollX(0);
- if (!bFitsHor)
+ if (!bFitsHor || !bFitsVert)
{
- // ensure the visibility of the right border
- if (aLowerRight.X() > aSize.Width())
- nScrollX = (aLowerRight.X() - aSize.Width() + TABWIN_SPACING_X);
+ long nScrollX(0);
+ if (!bFitsHor)
+ {
+ // ensure the visibility of the right border
+ if (aLowerRight.X() > aSize.Width())
+ nScrollX = (aLowerRight.X() - aSize.Width() + TABWIN_SPACING_X);
- // ensure the cisibility of the left border (higher priority)
- if (aUpperLeft.X() - nScrollX < 0)
- nScrollX = aUpperLeft.X() - TABWIN_SPACING_X;
- }
+ // ensure the cisibility of the left border (higher priority)
+ if (aUpperLeft.X() - nScrollX < 0)
+ nScrollX = aUpperLeft.X() - TABWIN_SPACING_X;
+ }
- long nScrollY(0);
- if (!bFitsVert)
- {
- // lower border
- if (aLowerRight.Y() > aSize.Height())
- nScrollY = (aLowerRight.Y() - aSize.Height() + TABWIN_SPACING_Y);
+ long nScrollY(0);
+ if (!bFitsVert)
+ {
+ // lower border
+ if (aLowerRight.Y() > aSize.Height())
+ nScrollY = (aLowerRight.Y() - aSize.Height() + TABWIN_SPACING_Y);
- // upper border
- if (aUpperLeft.Y() - nScrollY < 0)
- nScrollY = aUpperLeft.Y() - TABWIN_SPACING_Y;
- }
+ // upper border
+ if (aUpperLeft.Y() - nScrollY < 0)
+ nScrollY = aUpperLeft.Y() - TABWIN_SPACING_Y;
+ }
- if (nScrollX)
- Scroll(nScrollX, TRUE, TRUE);
+ if (nScrollX)
+ Scroll(nScrollX, TRUE, TRUE);
- if (nScrollY)
- Scroll(nScrollY, FALSE, TRUE);
+ if (nScrollY)
+ Scroll(nScrollY, FALSE, TRUE);
+ }
+
+ Invalidate(INVALIDATE_NOCHILDREN);
}
//------------------------------------------------------------------------------
@@ -1141,6 +1148,10 @@ void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPositi
DBG_CHKTHIS(OJoinTableView,NULL);
Point ptThumbPos(GetHScrollBar()->GetThumbPos(), GetVScrollBar()->GetThumbPos());
ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel() + ptThumbPos);
+
+ SfxUndoAction* pUndoAction = new OJoinMoveTabWinUndoAct(this, ptOldPosition, ptWhich);
+ m_pView->getController()->getUndoMgr()->AddUndoAction(pUndoAction);
+ m_pView->getController()->InvalidateFeature(ID_BROWSER_UNDO);
}
//------------------------------------------------------------------------
@@ -1149,6 +1160,10 @@ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPositi
DBG_CHKTHIS(OJoinTableView,NULL);
ptWhich->GetData()->SetSize(ptWhich->GetSizePixel());
ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel());
+
+ SfxUndoAction* pUndoAction = new OJoinSizeTabWinUndoAct(this, ptOldPosition, szOldSize, ptWhich);
+ m_pView->getController()->getUndoMgr()->AddUndoAction(pUndoAction);
+ m_pView->getController()->InvalidateFeature(ID_BROWSER_UNDO);
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx
index 9650e431a046..0282d81ed9f9 100644
--- a/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryAddTabConnUndoAction.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryAddTabConnUndoAction.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:24:34 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,13 +70,14 @@ namespace dbaui
// ================================================================================================
// OQueryAddTabConnUndoAction - Undo-Klasse fuer Einfuegen einer Connection
+ class OQueryTableView;
class OQueryAddTabConnUndoAction : public OQueryTabConnUndoAction
{
public:
- OQueryAddTabConnUndoAction(OQueryTableView* pOwner) : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION) { }
+ OQueryAddTabConnUndoAction(OQueryTableView* pOwner);
- virtual void Undo() { m_pOwner->DropConnection(m_pConnection); SetOwnership(TRUE); }
- virtual void Redo() { m_pOwner->GetConnection(m_pConnection); SetOwnership(FALSE); }
+ virtual void Undo();
+ virtual void Redo();
};
// ================================================================================================
@@ -85,10 +86,10 @@ namespace dbaui
class OQueryDelTabConnUndoAction : public OQueryTabConnUndoAction
{
public:
- OQueryDelTabConnUndoAction(OQueryTableView* pOwner) : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION) { }
+ OQueryDelTabConnUndoAction(OQueryTableView* pOwner);
- virtual void Undo() { m_pOwner->GetConnection(m_pConnection); SetOwnership(FALSE); }
- virtual void Redo() { m_pOwner->DropConnection(m_pConnection); SetOwnership(TRUE); }
+ virtual void Undo();
+ virtual void Redo();
};
}
#endif // DBAUI_QUERYADDTABCONNUNDOACTION_HXX
diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
index 4d3ce263e51e..8738ce14bc8d 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryDesignUndoAction.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:24:42 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,14 +70,14 @@ namespace dbaui
// ================================================================================================
// OQueryDesignUndoAction - Undo-Basisklasse fuer Aktionen im graphischen Abfrageentwurf (ohne Feldliste)
- class OQueryTableView;
+ class OJoinTableView;
class OQueryDesignUndoAction : public OCommentUndoAction
{
protected:
- OQueryTableView* m_pOwner; // in diesem Container spielt sich alles ab
+ OJoinTableView* m_pOwner; // in diesem Container spielt sich alles ab
public:
- OQueryDesignUndoAction(OQueryTableView* pOwner, USHORT nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { }
+ OQueryDesignUndoAction(OJoinTableView* pOwner, USHORT nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { }
};
}
#endif // DBAUI_QUERYDESIGNUNDOACTION_HXX
diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
index b0d83447e2e5..6852acb6760b 100644
--- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryMoveTabWinUndoAct.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:25:03 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,15 +62,15 @@
#ifndef DBAUI_OQUERYMOVETABWINUNDOACT_HXX
#include "QueryMoveTabWinUndoAct.hxx"
#endif
-#ifndef DBAUI_QUERYTABLEVIEW_HXX
-#include "QueryTableView.hxx"
+#ifndef DBAUI_JOINTABLEVIEW_HXX
+#include "JoinTableView.hxx"
#endif
#ifndef DBAUI_QUERY_TABLEWINDOW_HXX
#include "QTableWindow.hxx"
#endif
using namespace dbaui;
//------------------------------------------------------------------------------
-void OQueryMoveTabWinUndoAct::TogglePosition()
+void OJoinMoveTabWinUndoAct::TogglePosition()
{
Point ptFrameScrollPos(m_pOwner->GetHScrollBar()->GetThumbPos(), m_pOwner->GetVScrollBar()->GetThumbPos());
Point ptNext = m_pTabWin->GetPosPixel() + ptFrameScrollPos;
diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
index ea7230811dd3..dd37c71fc74f 100644
--- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryMoveTabWinUndoAct.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:34:05 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,23 +77,24 @@ namespace dbaui
// ================================================================================================
// OQueryMoveTabWinUndoAct - Undo-Klasse fuer Verschieben eines TabWins
class OQueryTableWindow;
- class OQueryMoveTabWinUndoAct : public OQueryDesignUndoAction
+ class OTableWindow;
+ class OJoinMoveTabWinUndoAct : public OQueryDesignUndoAction
{
- Point m_ptNextPosition;
- OQueryTableWindow* m_pTabWin;
+ Point m_ptNextPosition;
+ OTableWindow* m_pTabWin;
protected:
void TogglePosition();
public:
- OQueryMoveTabWinUndoAct(OQueryTableView* pOwner, const Point& ptOriginalPosition, OQueryTableWindow* pTabWin);
+ OJoinMoveTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPosition, OTableWindow* pTabWin);
virtual void Undo() { TogglePosition(); }
virtual void Redo() { TogglePosition(); }
};
// ------------------------------------------------------------------------------------------------
- inline OQueryMoveTabWinUndoAct::OQueryMoveTabWinUndoAct(OQueryTableView* pOwner, const Point& ptOriginalPosition, OQueryTableWindow* pTabWin)
+ inline OJoinMoveTabWinUndoAct::OJoinMoveTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPosition, OTableWindow* pTabWin)
:OQueryDesignUndoAction(pOwner, STR_QUERY_UNDO_MOVETABWIN)
,m_ptNextPosition(ptOriginalPosition)
,m_pTabWin(pTabWin)
diff --git a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
index 997692ff2259..c35d5323bb7d 100644
--- a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QuerySizeTabWinUndoAct.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:21:06 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,18 +73,18 @@ namespace dbaui
// ================================================================================================
// OQuerySizeTabWinUndoAct - Undo-Klasse fuer Groessenveraenderung eines TabWins
- class OQueryTableWindow;
- class OQuerySizeTabWinUndoAct : public OQueryDesignUndoAction
+ class OTableWindow;
+ class OJoinSizeTabWinUndoAct : public OQueryDesignUndoAction
{
- Point m_ptNextPosition;
- Size m_szNextSize;
- OQueryTableWindow* m_pTabWin;
+ Point m_ptNextPosition;
+ Size m_szNextSize;
+ OTableWindow* m_pTabWin;
protected:
inline void ToggleSizePosition();
public:
- OQuerySizeTabWinUndoAct(OQueryTableView* pOwner, const Point& ptOriginalPos, const Size& szOriginalSize, OQueryTableWindow* pTabWin);
+ OJoinSizeTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPos, const Size& szOriginalSize, OTableWindow* pTabWin);
// Nebenbedingung : es darf nicht gescrollt worden sein, waehrend die neue Groesse/Position ermittelt wurde, das heisst, die Position
// hier sind physische, nicht logische Koordinaten
// (im Gegensatz zur QueryMoveTabWinUndoAct)
@@ -94,7 +94,7 @@ namespace dbaui
};
//------------------------------------------------------------------------------
- inline OQuerySizeTabWinUndoAct::OQuerySizeTabWinUndoAct(OQueryTableView* pOwner, const Point& ptOriginalPos, const Size& szOriginalSize, OQueryTableWindow* pTabWin)
+ inline OJoinSizeTabWinUndoAct::OJoinSizeTabWinUndoAct(OJoinTableView* pOwner, const Point& ptOriginalPos, const Size& szOriginalSize, OTableWindow* pTabWin)
:OQueryDesignUndoAction(pOwner, STR_QUERY_UNDO_SIZETABWIN)
,m_ptNextPosition(ptOriginalPos)
,m_szNextSize(szOriginalSize)
@@ -103,7 +103,7 @@ namespace dbaui
}
//------------------------------------------------------------------------------
- inline void OQuerySizeTabWinUndoAct::ToggleSizePosition()
+ inline void OJoinSizeTabWinUndoAct::ToggleSizePosition()
{
Point ptNext = m_pTabWin->GetPosPixel();
Size szNext = m_pTabWin->GetSizePixel();
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
index 3b21a8d0fba7..4126d7280b4e 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTabConnUndoAction.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:25:10 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,9 +67,22 @@
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
+#ifndef DBAUI_QUERYTABLEVIEW_HXX
+#include "QueryTableView.hxx"
+#endif
+#ifndef DBAUI_QUERYADDTABCONNUNDOACTION_HXX
+#include "QueryAddTabConnUndoAction.hxx"
+#endif
+#ifndef DBAUI_QUERYTABWINSHOWUNDOACT_HXX
+#include "QueryTabWinShowUndoAct.hxx"
+#endif
+#ifndef _DBU_RESOURCE_HRC_
+#include "dbu_resource.hrc"
+#endif
+
using namespace dbaui;
-DBG_NAME(OQueryTabConnUndoAction);
+DBG_NAME(OQueryTabConnUndoAction)
// ------------------------------------------------------------------------------------------------
OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
{
@@ -89,5 +102,72 @@ OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, USHORT
{
DBG_CTOR(OQueryTabConnUndoAction,NULL);
}
-
-
+// -----------------------------------------------------------------------------
+OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner)
+ : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_INSERTCONNECTION)
+{
+}
+// -----------------------------------------------------------------------------
+void OQueryAddTabConnUndoAction::Undo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
+ SetOwnership(TRUE);
+}
+// -----------------------------------------------------------------------------
+void OQueryAddTabConnUndoAction::Redo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
+ SetOwnership(FALSE);
+}
+// -----------------------------------------------------------------------------
+OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner)
+ : OQueryTabConnUndoAction(pOwner, STR_QUERY_UNDO_REMOVECONNECTION)
+{
+}
+// -----------------------------------------------------------------------------
+void OQueryDelTabConnUndoAction::Undo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
+ SetOwnership(FALSE);
+}
+// -----------------------------------------------------------------------------
+void OQueryDelTabConnUndoAction::Redo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
+ SetOwnership(TRUE);
+}
+// -----------------------------------------------------------------------------
+OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner)
+ : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW)
+{
+}
+// -----------------------------------------------------------------------------
+void OQueryTabWinShowUndoAct::Undo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this);
+ SetOwnership(TRUE);
+}
+// -----------------------------------------------------------------------------
+void OQueryTabWinShowUndoAct::Redo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,sal_True);
+ SetOwnership(FALSE);
+}
+// -----------------------------------------------------------------------------
+OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner)
+ : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE)
+{
+}
+// -----------------------------------------------------------------------------
+void OQueryTabWinDelUndoAct::Undo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,sal_True );
+ SetOwnership(FALSE);
+}
+// -----------------------------------------------------------------------------
+void OQueryTabWinDelUndoAct::Redo()
+{
+ static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this );
+ SetOwnership(TRUE);
+}
+// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
index e5d728ce21b8..db3498388690 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTabConnUndoAction.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:34:12 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,7 @@
namespace dbaui
{
class OQueryTableConnection;
+ class OQueryTableView;
class OQueryTabConnUndoAction : public OQueryDesignUndoAction
{
protected:
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx
index 26cfe7f031b4..399deb6dd805 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinShowUndoAct.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTabWinShowUndoAct.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 16:17:40 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,9 +65,6 @@
#ifndef DBAUI_QUERYTABWINUNDOACT_HXX
#include "QueryTabWinUndoAct.hxx"
#endif
-#ifndef _DBU_RESOURCE_HRC_
-#include "dbu_resource.hrc"
-#endif
namespace dbaui
{
@@ -77,10 +74,10 @@ namespace dbaui
class OQueryTabWinShowUndoAct : public OQueryTabWinUndoAct
{
public:
- OQueryTabWinShowUndoAct(OQueryTableView* pOwner) : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINSHOW) { }
+ OQueryTabWinShowUndoAct(OQueryTableView* pOwner);
- virtual void Undo() { m_pOwner->HideTabWin(m_pTabWin, this); SetOwnership(TRUE); }
- virtual void Redo() { m_pOwner->ShowTabWin(m_pTabWin, this,sal_True); SetOwnership(FALSE); }
+ virtual void Undo();
+ virtual void Redo();
};
// ================================================================================================
@@ -89,10 +86,10 @@ namespace dbaui
class OQueryTabWinDelUndoAct : public OQueryTabWinUndoAct
{
public:
- OQueryTabWinDelUndoAct(OQueryTableView* pOwner) : OQueryTabWinUndoAct(pOwner, STR_QUERY_UNDO_TABWINDELETE) { }
+ OQueryTabWinDelUndoAct(OQueryTableView* pOwner);
- virtual void Undo() { m_pOwner->ShowTabWin( m_pTabWin, this,sal_True ); SetOwnership(FALSE); }
- virtual void Redo() { m_pOwner->HideTabWin( m_pTabWin, this ); SetOwnership(TRUE); }
+ virtual void Undo();
+ virtual void Redo();
};
}
#endif // DBAUI_QUERYTABWINSHOWUNDOACT_HXX
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index 3d438e7d4307..ef5f67bb26f4 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTabWinUndoAct.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-05 09:34:19 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,9 +79,21 @@
#ifndef DBAUI_QUERYDESIGNFIELDUNDOACT_HXX
#include "QueryDesignFieldUndoAct.hxx"
#endif
+#ifndef DBAUI_QUERYTABLEVIEW_HXX
+#include "QueryTableView.hxx"
+#endif
using namespace dbaui;
+DBG_NAME(OQueryTabWinUndoAct )
+// ------------------------------------------------------------------------------------------------
+OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID)
+ :OQueryDesignUndoAction(pOwner, nCommentID)
+ ,m_pTabWin(NULL)
+ ,m_bOwnerOfObjects(FALSE)
+{
+ DBG_CTOR(OQueryTabWinUndoAct ,NULL);
+}
//==============================================================================
OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
{
@@ -102,6 +114,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
}
m_vTableConnection.clear();
}
+ DBG_DTOR(OQueryTabWinUndoAct ,NULL);
}
//------------------------------------------------------------------------------
void OTabFieldCellModifiedUndoAct::Undo()
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
index 94e6eb7054a6..9c4b10a00e40 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTabWinUndoAct.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2001-02-06 13:31:44 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,9 +64,10 @@
#ifndef DBAUI_QUERYDESIGNUNDOACTION_HXX
#include "QueryDesignUndoAction.hxx"
#endif
-#ifndef _VECTOR_
+#ifndef INCLUDED_VECTOR
+#define INCLUDED_VECTOR
#include <vector>
-#endif
+#endif // INCLUDED_VECTOR
#include <algorithm>
@@ -77,6 +78,7 @@ namespace dbaui
class OQueryTableWindow;
class OTableConnection;
+ class OQueryTableView;
class OQueryTabWinUndoAct : public OQueryDesignUndoAction
{
protected:
@@ -107,17 +109,11 @@ namespace dbaui
void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
void RemoveConnection( OTableConnection* pConnection )
{
- m_vTableConnection.erase(::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),pConnection));
+ m_vTableConnection.erase(::std::remove(m_vTableConnection.begin(),m_vTableConnection.end(),pConnection),m_vTableConnection.end());
}
};
- // ------------------------------------------------------------------------------------------------
- inline OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID)
- :OQueryDesignUndoAction(pOwner, nCommentID)
- ,m_pTabWin(NULL)
- ,m_bOwnerOfObjects(FALSE)
- {
- }
+
}
#endif // DBAUI_QUERYTABWINUNDOACT_HXX
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 4a5c528e496f..42af85ef8672 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTableView.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: oj $ $Date: 2001-08-09 13:30:50 $
+ * last change: $Author: oj $ $Date: 2001-08-27 14:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,18 +89,12 @@
#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
#endif
-#ifndef DBAUI_OQUERYMOVETABWINUNDOACT_HXX
-#include "QueryMoveTabWinUndoAct.hxx"
-#endif
#ifndef DBAUI_QUERYADDTABCONNUNDOACTION_HXX
#include "QueryAddTabConnUndoAction.hxx"
#endif
#ifndef DBAUI_QUERYTABWINSHOWUNDOACT_HXX
#include "QueryTabWinShowUndoAct.hxx"
#endif
-#ifndef DBAUI_QUERYSIZETABWINUNDOACT_HXX
-#include "QuerySizeTabWinUndoAct.hxx"
-#endif
#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
#endif
@@ -146,6 +140,9 @@
#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#include "QueryDesignView.hxx"
#endif
+#ifndef _DBU_RESOURCE_HRC_
+#include "dbu_resource.hrc"
+#endif
using namespace dbaui;
using namespace ::com::sun::star::uno;
@@ -186,7 +183,7 @@ TYPEINIT1(OQueryTableView, OJoinTableView);
//==================================================================
// class OQueryTableView
//==================================================================
-DBG_NAME(OQueryTableView);
+DBG_NAME(OQueryTableView)
//------------------------------------------------------------------------
OQueryTableView::OQueryTableView( Window* pParent,OQueryDesignView* pView)
: OJoinTableView( pParent,pView)
@@ -224,28 +221,6 @@ sal_Int32 OQueryTableView::CountTableAlias(const String& rName, sal_Int32& rMax)
return nRet;
}
-
-
-//------------------------------------------------------------------------
-void OQueryTableView::TabWinMoved(OTableWindow* pWhich, const Point& ptOldPosition)
-{
- DBG_CHKTHIS(OQueryTableView,NULL);
- OJoinTableView::TabWinMoved(pWhich, ptOldPosition);
-
- SfxUndoAction* pUndoAction = new OQueryMoveTabWinUndoAct(this, ptOldPosition, static_cast< OQueryTableWindow*>(pWhich));
- m_pView->getController()->getUndoMgr()->AddUndoAction(pUndoAction);
-}
-
-//------------------------------------------------------------------------
-void OQueryTableView::TabWinSized(OTableWindow* pWhich, const Point& ptOldPosition, const Size& szOldSize)
-{
- DBG_CHKTHIS(OQueryTableView,NULL);
- OJoinTableView::TabWinSized(pWhich, ptOldPosition, szOldSize);
-
- SfxUndoAction* pUndoAction = new OQuerySizeTabWinUndoAct(this, ptOldPosition, szOldSize, static_cast< OQueryTableWindow*>(pWhich));
- m_pView->getController()->getUndoMgr()->AddUndoAction(pUndoAction);
-}
-
//------------------------------------------------------------------------
void OQueryTableView::ReSync()
{