Tag: cws_src680_qiq
User: fs      
Date: 06/05/12 04:11:04

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

Log:
 #i51143# callback from the AddTabDialog now via dedicated interface

File Changes:

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

File [changed]: JoinDesignView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinDesignView.cxx?r1=1.17&r2=1.17.118.1
Delta lines:  +83 -10
---------------------
--- JoinDesignView.cxx  23 Sep 2005 12:42:13 -0000      1.17
+++ JoinDesignView.cxx  12 May 2006 11:11:02 -0000      1.17.118.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: JoinDesignView.cxx,v $
  *
- *  $Revision: 1.17 $
+ *  $Revision: 1.17.118.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:42:13 $
+ *  last change: $Author: fs $ $Date: 2006/05/12 11:11:02 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -97,7 +97,6 @@
 #endif
 //     #include <com/sun/star/util/URL.hdl>
 
-using namespace ::dbaui;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::i18n;
@@ -105,16 +104,89 @@
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::util;
-DBG_NAME(OJoinDesignView)
 
+namespace dbaui
+{
+
+// 
=============================================================================
+// = AddTableDialogContext
+// 
=============================================================================
+class AddTableDialogContext : public IAddTableDialogContext
+{
+    OJoinTableView& m_rView;
+
+public:
+    AddTableDialogContext( OJoinTableView& _rView )
+        :m_rView( _rView )
+    {
+    }
+
+    // IAddTableDialogContext
+    virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XConnection >
+                    getConnection() const;
+    virtual bool    allowViews() const;
+    virtual bool    allowQueries() const;
+    virtual bool    allowAddition() const;
+    virtual void    addTableWindow( const String& _rQualifiedTableName, const 
String& _rAliasName );
+    virtual void    onWindowClosing( const Window* _pWindow );
+};
+
+// 
-----------------------------------------------------------------------------
+Reference< XConnection > AddTableDialogContext::getConnection() const
+{
+    return m_rView.getDesignView()->getController()->getConnection();
+}
+
+// 
-----------------------------------------------------------------------------
+bool AddTableDialogContext::allowViews() const
+{
+    return m_rView.getDesignView()->getController()->allowViews();
+}
+
+// 
-----------------------------------------------------------------------------
+bool AddTableDialogContext::allowQueries() const
+{
+    return m_rView.getDesignView()->getController()->allowQueries();
+}
+
+// 
-----------------------------------------------------------------------------
+bool AddTableDialogContext::allowAddition() const
+{
+       return  m_rView.IsAddAllowed();
+}
+
+// 
-----------------------------------------------------------------------------
+void AddTableDialogContext::addTableWindow( const String& 
_rQualifiedTableName, const String& _rAliasName )
+{
+    m_rView.AddTabWin( _rQualifiedTableName, _rAliasName, TRUE );
+}
+
+// 
-----------------------------------------------------------------------------
+void AddTableDialogContext::onWindowClosing( const Window* _pWindow )
+{
+    ::dbaui::notifySystemWindow(
+        m_rView.getDesignView(), const_cast< Window* >( _pWindow ), 
::comphelper::mem_fun( &TaskPaneList::RemoveWindow ) );
+
+    if ( m_rView.getDesignView() && m_rView.getDesignView()->getController() )
+    {
+           m_rView.getDesignView()->getController()->InvalidateFeature( 
ID_BROWSER_ADDTABLE );
+        if ( m_rView.getDesignView()->getController()->getView() )
+               
m_rView.getDesignView()->getController()->getView()->GrabFocus();
+    }
+}
+
+
+// 
=============================================================================
+// = OJoinDesignView
+// 
=============================================================================
+// 
-----------------------------------------------------------------------------
 OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController* 
_pController,const Reference< XMultiServiceFactory >& _rFactory)
        :ODataView(_pParent,_pController,_rFactory)
        ,m_pController(_pController)
        ,m_pTableView(NULL)
        ,m_pAddTabDlg(NULL)
+    ,m_pDialogContext( NULL )
 {
-    DBG_CTOR(OJoinDesignView,NULL);
-
        m_pScrollWindow = new OScrollWindowHelper(this);
 }
 // 
-----------------------------------------------------------------------------
@@ -128,8 +200,6 @@
        m_pTableView = NULL;
        ::std::auto_ptr<Window> aT1(m_pAddTabDlg);
        m_pAddTabDlg = NULL;    
-
-    DBG_DTOR(OJoinDesignView,NULL);
 }
 // -------------------------------------------------------------------------
 void OJoinDesignView::Construct()
@@ -138,7 +208,8 @@
        m_pScrollWindow->Show();
        m_pTableView->Show();
        
-       m_pAddTabDlg = new OAddTableDlg(m_pScrollWindow,m_pTableView);
+    m_pDialogContext.reset( new AddTableDialogContext( *m_pTableView ) );
+    m_pAddTabDlg = new OAddTableDlg( m_pScrollWindow, *m_pDialogContext );
        SetBackground( Wallpaper( 
Application::GetSettings().GetStyleSettings().GetFaceColor()) );
 
        ODataView::Construct();
@@ -191,3 +262,5 @@
                ODataView::KeyInput(rEvt);
 }
 // 
-----------------------------------------------------------------------------
+
+}   // namespace dbaui
\ No newline at end of file




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

Reply via email to