User: hr      
Date: 05/09/23 05:19:21

Modified:
 /dba/dbaccess/source/ui/browser/
  brwctrlr.cxx

Log:
 INTEGRATION: CWS dba201b (1.87.2); FILE MERGED
 2005/09/21 07:53:21 oj 1.87.2.3: RESYNC: (1.87-1.88); FILE MERGED
 2005/07/15 06:06:56 oj 1.87.2.2: #i51888# allow the remove of a filter if the 
statement contains an error
 2005/07/11 13:37:13 fs 1.87.2.1: merging CWS dba201 into CWS dba201b

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.88&r2=1.89
Delta lines:  +66 -33
---------------------
--- brwctrlr.cxx        8 Sep 2005 14:25:38 -0000       1.88
+++ brwctrlr.cxx        23 Sep 2005 12:19:18 -0000      1.89
@@ -306,18 +306,23 @@
 };
 
 
+DBG_NAME(FormControllerImpl)
 //------------------------------------------------------------------
 
SbaXDataBrowserController::FormControllerImpl::FormControllerImpl(SbaXDataBrowserController*
 m_pOwner)
        :m_pOwner(m_pOwner)
        ,m_bActive(sal_False)
        ,m_aActivateListeners(m_pOwner->getMutex())
 {
+    DBG_CTOR(FormControllerImpl,NULL);
+
        OSL_ENSURE(m_pOwner, 
"SbaXDataBrowserController::FormControllerImpl::FormControllerImpl : invalid 
Owner !");
 }
 
 //------------------------------------------------------------------
 SbaXDataBrowserController::FormControllerImpl::~FormControllerImpl()
 {
+
+    DBG_DTOR(FormControllerImpl,NULL);
 }
 
 //------------------------------------------------------------------
@@ -503,6 +508,7 @@
        OGenericUnoController::release();
 }
 
+DBG_NAME(SbaXDataBrowserController)
 
//------------------------------------------------------------------------------
 SbaXDataBrowserController::SbaXDataBrowserController(const Reference< 
::com::sun::star::lang::XMultiServiceFactory >& _rM)
        :OGenericUnoController(_rM)
@@ -518,6 +524,8 @@
        ,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, 
OnAsyncGetCellFocus))
        ,m_pFormControllerImpl(NULL)
 {
+    DBG_CTOR(SbaXDataBrowserController,NULL);
+
        // create the form controller aggregate
        ::comphelper::increment(m_refCount);
        {
@@ -538,6 +546,8 @@
                Reference< XInterface >  xEmpty;
                m_xFormControllerImpl->setDelegator(xEmpty);
        }
+
+    DBG_DTOR(SbaXDataBrowserController,NULL);
 }
 // 
-----------------------------------------------------------------------------
 void SbaXDataBrowserController::deleteView()
@@ -765,16 +775,7 @@
 void SbaXDataBrowserController::addModelListeners(const Reference< 
::com::sun::star::awt::XControlModel > & _xGridControlModel)
 {
        // ... all the grid columns
-       Reference< ::com::sun::star::container::XIndexContainer >  
xColumns(getControlModel(), UNO_QUERY);
-       if (xColumns.is())
-       {
-               sal_Int32 nCount = xColumns->getCount();
-               for (sal_uInt16 i=0; i < nCount; ++i)
-               {
-                       Reference< XPropertySet >  
xCol(xColumns->getByIndex(i),UNO_QUERY);
-                       AddColumnListener(xCol);
-               }
-       }
+       addColumnListeners(_xGridControlModel);
 
        // (we are interested in all columns the grid has (and only in these) 
so we have to listen to the container, too)
        Reference< ::com::sun::star::container::XContainer >  
xColContainer(_xGridControlModel, UNO_QUERY);
@@ -1426,12 +1427,23 @@
                // no chance without a view
                if (!getBrowserView() || !getBrowserView()->getVclControl())
                        return aReturn;
-               // no chance without valid models
-               if (isValid() && !isValidCursor())
+
+               switch (nId)
+               {
+                       case ID_BROWSER_REMOVEFILTER:
+                               if (!m_xParser.is())
+                                       break;
+                               // any filter or sort order set ?
+                               aReturn.bEnabled = 
m_xParser->getFilter().getLength() || m_xParser->getHavingClause().getLength() 
|| m_xParser->getOrder().getLength();
                        return aReturn;
+                               break;
+               }
                // no chance while loading the form
                if (PendingLoad())
                        return aReturn;
+               // no chance without valid models
+               if (isValid() && !isValidCursor())
+                       return aReturn;         
 
                switch (nId)
                {
@@ -1509,13 +1521,6 @@
                                }
                                break;
 
-                       case ID_BROWSER_REMOVEFILTER:
-                               if (!m_xParser.is())
-                                       break;
-                               // any filter or sort order set ?
-                               aReturn.bEnabled = 
m_xParser->getFilter().getLength() || m_xParser->getHavingClause().getLength() 
|| m_xParser->getOrder().getLength();
-                               break;
-
                        case ID_BROWSER_REFRESH:
                                //      aReturn.bEnabled = isValidCursor();
                                aReturn.bEnabled = sal_True;
@@ -1826,7 +1831,7 @@
                                Reference< XPropertySet >  
xActiveSet(getRowSet(), UNO_QUERY);
                                sal_Bool bApplied = 
::comphelper::getBOOL(xActiveSet->getPropertyValue(PROPERTY_APPLYFILTER));
                                
xActiveSet->setPropertyValue(PROPERTY_APPLYFILTER, 
::comphelper::makeBoolAny(sal_Bool(!bApplied)));
-                               reloadForm(Reference< XLoadable >(xActiveSet, 
UNO_QUERY));
+                               reloadForm(m_xLoadable);
                        }
                        InvalidateFeature(ID_BROWSER_FILTERED);
                        break;
@@ -2006,22 +2011,25 @@
                        if (!SaveModified())
                                break;
 
+                       sal_Bool bNeedPostReload = preReloadForm();
                        // reset the filter and the sort property simutaneously 
so only _one_ new statement has to be
                        // sent
                        Reference< XPropertySet >  xSet(getRowSet(), UNO_QUERY);
+                       if ( xSet.is() )
+                       {
                        
xSet->setPropertyValue(PROPERTY_FILTER,makeAny(::rtl::OUString()));
                        
xSet->setPropertyValue(PROPERTY_HAVING_CLAUSE,makeAny(::rtl::OUString()));
                        
xSet->setPropertyValue(PROPERTY_ORDER,makeAny(::rtl::OUString()));
-                       {
-                               WaitObject aWO(getBrowserView());
+                       }
                                try
                                {
-                                       reloadForm(Reference< XLoadable 
>(getRowSet(), UNO_QUERY));
+                               reloadForm(m_xLoadable);
+                               if ( bNeedPostReload )
+                                       postReloadForm();
                                }
                                catch(Exception&)
                                {
                                }
-                       }
                        InvalidateFeature(ID_BROWSER_REMOVEFILTER);
                        InvalidateFeature(ID_BROWSER_FILTERED);
                }
@@ -2030,7 +2038,7 @@
                case ID_BROWSER_REFRESH:
                        if ( SaveModified( ) )
                        {
-                               if (!reloadForm(Reference< XLoadable 
>(getRowSet(), UNO_QUERY)))
+                               if (!reloadForm(m_xLoadable))
                                        criticalFail();
                        }
                        break;
@@ -2614,11 +2622,14 @@
        void implDispose();
 };
 
+DBG_NAME(LoadFormHelper)
 
//------------------------------------------------------------------------------
 LoadFormHelper::LoadFormHelper(const Reference< XRowSet > & _rxForm)
        :m_xForm(_rxForm)
        ,m_eState(STARTED)
 {
+    DBG_CTOR(LoadFormHelper,NULL);
+
        Reference< ::com::sun::star::form::XLoadable > (m_xForm, 
UNO_QUERY)->addLoadListener(this);
        m_xForm->addRowSetListener(this);
 }
@@ -2628,6 +2639,8 @@
 {
        ::osl::MutexGuard aGuard(m_aAccessSafety);
        implDispose();
+
+    DBG_DTOR(LoadFormHelper,NULL);
 }
 
 
//------------------------------------------------------------------------------
@@ -2942,6 +2955,26 @@
                        _xLayoutManager->doLayout();
                }
        }
+}
+// 
-----------------------------------------------------------------------------
+void SbaXDataBrowserController::addColumnListeners(const Reference< 
::com::sun::star::awt::XControlModel > & _xGridControlModel)
+{
+// ... all the grid columns
+       Reference< ::com::sun::star::container::XIndexContainer >  
xColumns(_xGridControlModel, UNO_QUERY);
+       if (xColumns.is())
+       {
+               sal_Int32 nCount = xColumns->getCount();
+               for (sal_uInt16 i=0; i < nCount; ++i)
+               {
+                       Reference< XPropertySet >  
xCol(xColumns->getByIndex(i),UNO_QUERY);
+                       AddColumnListener(xCol);
+               }
+       }
+}
+// 
-----------------------------------------------------------------------------
+sal_Bool SbaXDataBrowserController::InitializeGridModel(const Reference< 
::com::sun::star::form::XFormComponent > & xGrid)
+{
+       return sal_True;
 }
 //..................................................................
 }      // namespace dbaui




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

Reply via email to