Tag: cws_src680_odbmacros2
User: fs      
Date: 2008-03-06 10:18:00+0000
Modified:
   dba/dbaccess/source/ui/browser/brwctrlr.cxx

Log:
 manual resync to 1.104 to prevent conflicts at integration time

File Changes:

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

File [changed]: brwctrlr.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/brwctrlr.cxx?r1=1.102.2.5&r2=1.102.2.6
Delta lines:  +58 -3
--------------------
--- brwctrlr.cxx        2008-02-06 08:34:36+0000        1.102.2.5
+++ brwctrlr.cxx        2008-03-06 10:17:57+0000        1.102.2.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: brwctrlr.cxx,v $
  *
- *  $Revision: 1.102.2.5 $
+ *  $Revision: 1.102.2.6 $
  *
- *  last change: $Author: fs $ $Date: 2008/02/06 08:34:36 $
+ *  last change: $Author: fs $ $Date: 2008/03/06 10:17:57 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -595,6 +595,8 @@
        implDescribeSupportedFeature( ".uno:FilterCrit",                
SID_FM_FILTERCRIT,      CommandGroup::CONTROLS );
        implDescribeSupportedFeature( ".uno:Sortup",                    
ID_BROWSER_SORTUP,      CommandGroup::CONTROLS );
        implDescribeSupportedFeature( ".uno:SortDown",                  
ID_BROWSER_SORTDOWN,    CommandGroup::CONTROLS );
+    implDescribeSupportedFeature( ".uno:FormSlots/deleteRecord",    
SID_FM_DELETEROWS,      CommandGroup::EDIT );
+    implDescribeSupportedFeature( ".uno:FormSlots/insertRecord",    
ID_BROWSER_INSERT_ROW,  CommandGroup::INSERT );
 }
 
//------------------------------------------------------------------------------
 sal_Bool SbaXDataBrowserController::Construct(Window* pParent)
@@ -1414,6 +1416,26 @@
                                aReturn.bEnabled = nCount != 0;
                        }
                        break;
+            case ID_BROWSER_INSERT_ROW:
+                {
+                    // check if it is available
+                                   Reference< XPropertySet >  
xDataSourceSet(getRowSet(), UNO_QUERY);
+                                   if (!xDataSourceSet.is())
+                                           break;      // no datasource -> no 
edit mode
+
+                                   sal_Int32 nDataSourcePrivileges = 
::comphelper::getINT32(xDataSourceSet->getPropertyValue(PROPERTY_PRIVILEGES));
+                                   aReturn.bEnabled = ((nDataSourcePrivileges 
& ::com::sun::star::sdbcx::Privilege::INSERT) != 0) && 
::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowInserts")));
+                }
+                break;
+            case SID_FM_DELETEROWS:
+                {
+                                   Reference< XPropertySet >  
xFormSet(getRowSet(), UNO_QUERY);
+                                   sal_Int32 nCount = 
::comphelper::getINT32(xFormSet->getPropertyValue(PROPERTY_ROWCOUNT));
+                    sal_Bool bNew = sal_False;
+                    xFormSet->getPropertyValue(PROPERTY_ISNEW) >>= bNew;
+                                   aReturn.bEnabled = nCount != 0 && !bNew;
+                           }
+                break;
 
                        case ID_BROWSER_PASTE:
                        case ID_BROWSER_COPY:
@@ -1781,6 +1803,39 @@
 
        switch (nId)
        {
+        case ID_BROWSER_INSERT_ROW:
+            try
+            {
+                if (SaveModified())
+                {
+                                       getRowSet()->afterLast();
+                    // check if it is available
+                                   Reference< XResultSetUpdate >  
xUpdateCursor(getRowSet(), UNO_QUERY_THROW);
+                    xUpdateCursor->moveToInsertRow();
+                }
+            }
+            catch(Exception&)
+            {
+                OSL_ENSURE(0,"Exception caught!");
+            }
+            break;
+        case SID_FM_DELETEROWS:
+            
+            if (SaveModified())
+            {
+                               SbaGridControl* pVclGrid = 
getBrowserView()->getVclControl();
+                               if ( pVclGrid )
+                               {
+                                       if( !pVclGrid->GetSelectRowCount() )
+                                       {
+                                               pVclGrid->DeactivateCell();
+                                               
pVclGrid->SelectRow(pVclGrid->GetCurRow());
+                                       }
+                                       pVclGrid->DeleteSelectedRows();
+                               }
+            }
+            break;
+
                case ID_BROWSER_FILTERED:
                        if (SaveModified())
                        {




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

Reply via email to