Tag: cws_src680_dba202a
User: oj      
Date: 05/11/25 04:19:21

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

Log:
 #127169# check column pos

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.64&r2=1.64.14.1
Delta lines:  +21 -12
---------------------
--- SelectionBrowseBox.cxx      24 Oct 2005 08:32:22 -0000      1.64
+++ SelectionBrowseBox.cxx      25 Nov 2005 12:19:17 -0000      1.64.14.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SelectionBrowseBox.cxx,v $
  *
- *  $Revision: 1.64 $
+ *  $Revision: 1.64.14.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/10/24 08:32:22 $
+ *  last change: $Author: oj $ $Date: 2005/11/25 12:19:17 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -35,8 +35,8 @@
 #ifndef DBAUI_QUERYDESIGN_OSELECTIONBROWSEBOX_HXX
 #include "SelectionBrowseBox.hxx"
 #endif
-#ifndef _DBAUI_MODULE_DBU_HXX_
-#include "moduledbu.hxx"
+#ifndef _DBAUI_MODULE_HELPER_DBU_HXX_
+#include "ModuleHelper.hxx"
 #endif
 #ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_
 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
@@ -524,10 +524,15 @@
 void OSelectionBrowseBox::InitController(CellControllerRef& rController, long 
nRow, sal_uInt16 nColId)
 {
        DBG_CHKTHIS(OSelectionBrowseBox,NULL);
+       OSL_ENSURE(nColId != BROWSER_INVALIDID,"An Invalid Id was set!");
+       if ( nColId == BROWSER_INVALIDID )
+               return;
        OQueryController* pController = 
static_cast<OQueryController*>(static_cast<OQueryController*>(getDesignView()->getController()));
 
-       
-       OTableFieldDescRef pEntry = getFields()[GetColumnPos(nColId)-1];
+       USHORT nPos = GetColumnPos(nColId);
+       if ( nPos == 0 || nPos == BROWSER_ENDOFSELECTION || nPos > 
getFields().size() )
+               return;
+       OTableFieldDescRef pEntry = getFields()[nPos-1];
        DBG_ASSERT(pEntry.isValid(), "OSelectionBrowseBox::InitController : 
keine FieldDescription !");
        long nCellIndex = GetRealRow(nRow);
 
@@ -963,6 +968,7 @@
                // fuer die Undo-Action
                String strOldCellContents,sNewValue;
                long nRow = GetRealRow(GetCurRow());
+               sal_Bool bAppendRow = sal_False;
                switch (nRow)
                {
                        case BROW_VIS_ROW:
@@ -1231,17 +1237,20 @@
                                pEntry->SetCriteria(nIdx, aCrit);
                                sNewValue = pEntry->GetCriteria(nIdx);
                                if(aCrit.getLength() && nRow >= 
(GetRowCount()-1))
-                               {
-                                       RowInserted( GetRowCount()-1, 1, TRUE );
-                                       m_bVisibleRow.push_back(sal_True);
-                                       ++m_nVisibleCount;
-                               }
+                                       bAppendRow = sal_True;
                        }
                }
                if(!bError && Controller())
                        Controller()->ClearModified();
 
                RowModified(GetCurRow(), GetCurColumnId());
+
+               if ( bAppendRow )
+               {
+                       RowInserted( GetRowCount()-1, 1, TRUE );
+                       m_bVisibleRow.push_back(sal_True);
+                       ++m_nVisibleCount;
+               }
 
                if(!bError)
                {




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

Reply via email to