Tag: cws_src680_dba22a
User: fs      
Date: 2006/11/15 00:49:53

Modified:
   dba/dbaccess/source/ui/app/AppController.cxx
   dba/dbaccess/source/ui/app/AppController.hxx
   dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx
   dba/dbaccess/source/ui/app/IAppElementNotification.hxx
   dba/dbaccess/source/ui/browser/unodatbr.cxx
   dba/dbaccess/source/ui/control/dbtreelistbox.cxx
   dba/dbaccess/source/ui/dlg/adtabdlg.cxx
   dba/dbaccess/source/ui/inc/dbtreelistbox.hxx
   dba/dbaccess/source/ui/inc/unodatbr.hxx

Log:
 #142997#
 modified the double-click handling in the DBTreeListBox
 various stack trace reports suggest there are scenarios where a double click
 handler somehow destroys/corrupts the list box and/or its entries, but the
 subsequent default handling in the SvListBox class accesses those corrupted
 entities.
 Since we're not able to reproduce any of those crashs, the handling in the
 DBTreeListBox and its clients now is as follows:
 If a double click is handled, then the DBTreeListBox::DoubleClickHdl will
 return 0, this way causing the SvListBox to *not* process the double
 click event further.

File Changes:

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

File [changed]: AppController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.37&r2=1.37.2.1
Delta lines:  +6 -4
-------------------
--- AppController.cxx   18 Oct 2006 13:29:46 -0000      1.37
+++ AppController.cxx   15 Nov 2006 08:49:48 -0000      1.37.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppController.cxx,v $
  *
- *  $Revision: 1.37 $
+ *  $Revision: 1.37.2.1 $
  *
- *  last change: $Author: ihi $ $Date: 2006/10/18 13:29:46 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1612,7 +1612,7 @@
        return sal_True;
 }
 // 
-----------------------------------------------------------------------------
-void OApplicationController::onEntryDoubleClick(SvTreeListBox* _pTree)
+bool OApplicationController::onEntryDoubleClick(SvTreeListBox* _pTree)
 {
        OSL_ENSURE(_pTree != NULL,"Who called me without a svtreelsiboc! ->GPF 
");
        if ( getContainer() && getContainer()->isLeaf(_pTree->GetHdlEntry()) )
@@ -1620,12 +1620,14 @@
                try
                {
                        openElement( getContainer()->getQualifiedName( 
_pTree->GetHdlEntry() ), getContainer()->getElementType() );
+            return true;    // handled
                }
                catch(const Exception&)
                {
                        OSL_ENSURE(0,"Could not open element!");
                }
        }
+    return false;   // not handled
 }
 // 
-----------------------------------------------------------------------------
 Reference< XComponent > OApplicationController::openElement(const 
::rtl::OUString& _sName,ElementType _eType,OLinkedDocumentsAccess::EOpenMode 
_eOpenMode)

File [changed]: AppController.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.hxx?r1=1.15&r2=1.15.8.1
Delta lines:  +4 -4
-------------------
--- AppController.hxx   5 Oct 2006 12:59:20 -0000       1.15
+++ AppController.hxx   15 Nov 2006 08:49:48 -0000      1.15.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppController.hxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.15.8.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/10/05 12:59:20 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -522,7 +522,7 @@
                void refreshTables();
 
                /// @see 
<method>IApplicationElementNotification::onEntryDoubleClick</method>
-               virtual void onEntryDoubleClick(SvTreeListBox* _pTree);
+               virtual bool onEntryDoubleClick(SvTreeListBox* _pTree);
                /// @see 
<method>IApplicationElementNotification::onCreationClick</method>
                virtual void onCreationClick(const ::rtl::OUString& _sCommand);
                /// @see 
<method>IApplicationElementNotification::onContainerSelect</method>

File [changed]: AppDetailPageHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx?r1=1.18&r2=1.18.2.1
Delta lines:  +6 -6
-------------------
--- AppDetailPageHelper.cxx     12 Oct 2006 13:34:48 -0000      1.18
+++ AppDetailPageHelper.cxx     15 Nov 2006 08:49:48 -0000      1.18.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppDetailPageHelper.cxx,v $
  *
- *  $Revision: 1.18 $
+ *  $Revision: 1.18.2.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/10/12 13:34:48 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -454,7 +454,7 @@
        if ( getElementType() == E_TABLE )
        {
         const OTableTreeListBox& rTreeView = dynamic_cast< const 
OTableTreeListBox& >( *m_pLists[nPos] );
-        sComposedName = rTreeView.getQualifiedTableName( _pEntry );
+        sComposedName = rTreeView.getQualifiedTableName( pEntry );
        }
        else
        {
@@ -872,8 +872,8 @@
 // 
-----------------------------------------------------------------------------
 IMPL_LINK(OAppDetailPageHelper, OnEntryDoubleClick, SvTreeListBox*, _pTree)
 {
-       
getBorderWin().getView()->getElementNotification()->onEntryDoubleClick(_pTree);
-       return 1L;
+       bool bHandled = 
getBorderWin().getView()->getElementNotification()->onEntryDoubleClick(_pTree);
+    return bHandled ? 1L : 0L;
 }
 // 
-----------------------------------------------------------------------------
 IMPL_LINK(OAppDetailPageHelper, OnDeSelectHdl, SvTreeListBox*, _pTree)

File [changed]: IAppElementNotification.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/IAppElementNotification.hxx?r1=1.4&r2=1.4.210.1
Delta lines:  +7 -4
-------------------
--- IAppElementNotification.hxx 8 Sep 2005 14:23:30 -0000       1.4
+++ IAppElementNotification.hxx 15 Nov 2006 08:49:49 -0000      1.4.210.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: IAppElementNotification.hxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.4.210.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 14:23:30 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -64,8 +64,11 @@
                /** called when the handle 
<method>OApplicationDetailView::OnEntryDoubleClick</method> was called.
                        @param  _pTree
                                The tree list box.
+            @return
+                <TRUE/> if the double click event has been handled by the 
called, and should not
+                be processed further.
                */
-               virtual void onEntryDoubleClick(SvTreeListBox* _pTree) = 0;
+               virtual bool onEntryDoubleClick(SvTreeListBox* _pTree) = 0;
 
                /** called when the handle 
<method>OApplicationSwapWindow::OnContainerSelectHdl</method> was called.
                        @param  _pTree

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

File [changed]: unodatbr.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/unodatbr.cxx?r1=1.182&r2=1.182.2.1
Delta lines:  +3 -17
--------------------
--- unodatbr.cxx        18 Oct 2006 13:30:44 -0000      1.182
+++ unodatbr.cxx        15 Nov 2006 08:49:49 -0000      1.182.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: unodatbr.cxx,v $
  *
- *  $Revision: 1.182 $
+ *  $Revision: 1.182.2.1 $
  *
- *  last change: $Author: ihi $ $Date: 2006/10/18 13:30:44 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -571,7 +571,6 @@
                m_pTreeModel->SetCompareHdl(LINK(this, SbaTableQueryBrowser, 
OnTreeEntryCompare));
                m_pTreeView->setModel(m_pTreeModel);
                m_pTreeView->setSelectHdl(LINK(this, SbaTableQueryBrowser, 
OnSelectEntry));
-               m_pTreeView->getListBox()->SetDoubleClickHdl(LINK(this, 
SbaTableQueryBrowser, OnEntryDoubleClicked));
 
                // TODO
                
getBrowserView()->getVclControl()->GetDataWindow().SetUniqueId(UID_DATABROWSE_DATAWINDOW);
@@ -2276,19 +2275,6 @@
 
        return bSuccess;
 }
-//------------------------------------------------------------------------------
-IMPL_LINK(SbaTableQueryBrowser, OnEntryDoubleClicked, SvLBoxEntry*, 
/*_pEntry*/)
-{
-       SvLBoxEntry* pSelected = m_pTreeView->getListBox()->FirstSelected();
-       if (!pSelected)
-       {
-               DBG_ERROR("SbaTableQueryBrowser::OnEntryDoubleClicked: invalid 
selection!");
-               return 0L;
-       }
-
-       return 1L;
-};
-
 
//------------------------------------------------------------------------------
 sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& 
_rDescriptor,sal_Bool _bSelectDirect)
 {

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

File [changed]: dbtreelistbox.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/control/dbtreelistbox.cxx?r1=1.14&r2=1.14.2.1
Delta lines:  +12 -3
--------------------
--- dbtreelistbox.cxx   12 Oct 2006 13:36:23 -0000      1.14
+++ dbtreelistbox.cxx   15 Nov 2006 08:49:49 -0000      1.14.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtreelistbox.cxx,v $
  *
- *  $Revision: 1.14 $
+ *  $Revision: 1.14.2.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/10/12 13:36:23 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -496,6 +496,15 @@
        
        return FALSE;  // we never want that the base change our text
 }
+
+// 
-----------------------------------------------------------------------------
+BOOL DBTreeListBox::DoubleClickHdl()
+{
+       long nResult = aDoubleClickHdl.Call( this );
+    // continue default processing if the DoubleClickHandler didn't handle it
+    return nResult == 0;
+}
+
 // 
-----------------------------------------------------------------------------
 void scrollWindow(DBTreeListBox* _pListBox, const Point& _rPos,sal_Bool _bUp)
 {

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

File [changed]: adtabdlg.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/adtabdlg.cxx?r1=1.26&r2=1.26.10.1
Delta lines:  +9 -7
-------------------
--- adtabdlg.cxx        5 Oct 2006 13:04:05 -0000       1.26
+++ adtabdlg.cxx        15 Nov 2006 08:49:50 -0000      1.26.10.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: adtabdlg.cxx,v $
  *
- *  $Revision: 1.26 $
+ *  $Revision: 1.26.10.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/10/05 13:04:05 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:50 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -439,12 +439,14 @@
 IMPL_LINK( OAddTableDlg, TableListDoubleClickHdl, void*, /*EMPTY_ARG*/ )
 {
        if ( impl_isAddAllowed() )
+    {
                impl_addTable();
-
        if ( !impl_isAddAllowed() )
                Close();
+        return 1L;  // handled
+    }
 
-       return 0;
+       return 0L;  // not handled
 }
 
 
//------------------------------------------------------------------------------

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

File [changed]: dbtreelistbox.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/dbtreelistbox.hxx?r1=1.7&r2=1.7.10.1
Delta lines:  +6 -4
-------------------
--- dbtreelistbox.hxx   5 Oct 2006 13:05:38 -0000       1.7
+++ dbtreelistbox.hxx   15 Nov 2006 08:49:50 -0000      1.7.10.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtreelistbox.hxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.7.10.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/10/05 13:05:38 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:50 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -164,6 +164,8 @@
                virtual BOOL    EditingEntry( SvLBoxEntry* pEntry, Selection& );
                virtual BOOL    EditedEntry( SvLBoxEntry* pEntry, const 
XubString& rNewText );
 
+           virtual BOOL        DoubleClickHdl();
+
                virtual PopupMenu* CreateContextMenu( void );
                virtual void    ExcecuteContextMenuAction( USHORT 
nSelectedPopupEntry );
 

File [changed]: unodatbr.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/unodatbr.hxx?r1=1.66&r2=1.66.10.1
Delta lines:  +3 -4
-------------------
--- unodatbr.hxx        5 Oct 2006 13:06:53 -0000       1.66
+++ unodatbr.hxx        15 Nov 2006 08:49:51 -0000      1.66.10.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: unodatbr.hxx,v $
  *
- *  $Revision: 1.66 $
+ *  $Revision: 1.66.10.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/10/05 13:06:53 $
+ *  last change: $Author: fs $ $Date: 2006/11/15 08:49:51 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -383,7 +383,6 @@
                String          GetEntryText( SvLBoxEntry* _pEntry ) const;
 
                // is called when a table or a query was selected
-               DECL_LINK( OnEntryDoubleClicked, SvLBoxEntry* );
                DECL_LINK( OnSelectEntry, SvLBoxEntry* );
                DECL_LINK( OnExpandEntry, SvLBoxEntry* );
 




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

Reply via email to