User: hr      
Date: 05/09/23 05:44:02

Modified:
 /dba/dbaccess/source/ui/querydesign/
  SelectionBrowseBox.cxx

Log:
 INTEGRATION: CWS dba201b (1.61.44); FILE MERGED
 2005/09/21 10:13:27 oj 1.61.44.2: RESYNC: (1.61-1.62); FILE MERGED
 2005/07/06 10:36:26 oj 1.61.44.1: #123168# check if we are in undo mode

File Changes:

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: SelectionBrowseBox.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx?r1=1.62&r2=1.63
Delta lines:  +34 -22
---------------------
--- SelectionBrowseBox.cxx      8 Sep 2005 16:27:44 -0000       1.62
+++ SelectionBrowseBox.cxx      23 Sep 2005 12:43:59 -0000      1.63
@@ -178,6 +178,7 @@
                                   ,m_bStopTimer(sal_False)
                                   ,m_bWasEditing(sal_False)
                                   ,m_bDisableErrorBox(sal_False)
+                                  ,m_bInUndoMode(sal_False)
 {
        DBG_CTOR(OSelectionBrowseBox,NULL);
        SetHelpId(HID_CTL_QRYDGNCRIT);
@@ -352,7 +353,7 @@
                rFields.insert(rFields.begin() + nNewPos - 1,pOldEntry);
 
                // create the undo action
-               if ( _bCreateUndo )
+               if ( !m_bInUndoMode && _bCreateUndo )
                {
                        OTabFieldMovedUndoAct* pUndoAct = new 
OTabFieldMovedUndoAct(this);
                        pUndoAct->SetColumnPosition( nOldPos + 1);
@@ -985,6 +986,7 @@
                                        {
                                                strOldCellContents = 
pEntry->GetField();
                                                bListAction = sal_True;
+                                               if ( !m_bInUndoMode )
                                                
static_cast<OQueryController*>(getDesignView()->getController())->getUndoMgr()->EnterListAction(String(),String());
 
                                                USHORT nPos = 
m_pFieldCell->GetEntryPos(aFieldName);
@@ -1013,6 +1015,7 @@
                                if ( bError )
                                {
                                        sNewValue = aFieldName;
+                                       if ( !m_bInUndoMode )
                                        
static_cast<OQueryController*>(getDesignView()->getController())->getUndoMgr()->LeaveListAction();
                                        bListAction = sal_False;
                                }
@@ -1246,7 +1249,7 @@
                CheckFreeColumns(nDummy);
        }
 
-       if ( bListAction )
+       if ( bListAction && !m_bInUndoMode )
                
static_cast<OQueryController*>(getDesignView()->getController())->getUndoMgr()->LeaveListAction();
 
        return pEntry != NULL && !bError;
@@ -1351,10 +1354,13 @@
        pDesc->SetColWidth( (sal_uInt16)GetColumnWidth(nColumnId) );    // hat 
er sich vorher leider nicht gemerkt
 
        // UndoAction erzeugen
+       if ( !m_bInUndoMode )
+       {
        OTabFieldDelUndoAct* pUndoAction = new OTabFieldDelUndoAct( this );
        pUndoAction->SetTabFieldDescr(pDesc);
        pUndoAction->SetColumnPosition(nPos);
        pController->addUndoActionAndInvalidate( pUndoAction );
+       }
 
        RemoveColumn(nColumnId);
 
@@ -1678,11 +1684,14 @@
        // Spalte einfuegen
        InsertColumn( pEntry, _nColumnPostion );
 
+       if ( !m_bInUndoMode )
+       {
        // UndoAction erzeugen
        OTabFieldCreateUndoAct* pUndoAction = new OTabFieldCreateUndoAct( this 
);
        pUndoAction->SetTabFieldDescr( pEntry );
        pUndoAction->SetColumnPosition(_nColumnPostion);
        getDesignView()->getController()->addUndoActionAndInvalidate( 
pUndoAction );
+       }
 
        return pEntry;
 }
@@ -2271,7 +2280,7 @@
 {
        DBG_CHKTHIS(OSelectionBrowseBox,NULL);
        //      DBG_ASSERT(nCellIndex < (GetRowCount()-1),"CellIndex ist zu 
gross");
-       if ( GetCurColumnId() == nColId )
+       if ( GetCurColumnId() == nColId && !m_bInUndoMode )
                SaveModified();
 
        USHORT nPos = GetColumnPos(nColId);
@@ -2393,13 +2402,16 @@
        
static_cast<OQueryController*>(getDesignView()->getController())->setModified();
        EditBrowseBox::ColumnResized(nColId);
 
-       if (pEntry.isValid())
+       if ( pEntry.isValid())
+       {
+               if ( !m_bInUndoMode )
        {
                // create the undo action
                OTabFieldSizedUndoAct* pUndo = new OTabFieldSizedUndoAct(this);
                pUndo->SetColumnPosition( nPos );
                pUndo->SetOriginalWidth(pEntry->GetColWidth());
                
getDesignView()->getController()->addUndoActionAndInvalidate(pUndo);
+               }
                pEntry->SetColWidth(sal_uInt16(GetColumnWidth(nColId)));
        }
 }
@@ -2522,7 +2534,7 @@
 // 
-----------------------------------------------------------------------------
 void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const 
String& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction)
 {
-       if ( !_rNewValue.Equals(_rOldValue) )
+       if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) )
        {
                if ( !_bListAction )
                {
@@ -2535,7 +2547,7 @@
 // 
-----------------------------------------------------------------------------
 void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const 
String& _rNewValue,sal_Int32 _nRow)
 {
-       if ( !_rNewValue.Equals(_rOldValue) )
+       if ( !m_bInUndoMode && !_rNewValue.Equals(_rOldValue) )
        {
                OTabFieldCellModifiedUndoAct* pUndoAct = new 
OTabFieldCellModifiedUndoAct(this);
                pUndoAct->SetCellIndex(_nRow);




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to