Tag: cws_src680_qiq
User: fs      
Date: 06/06/19 02:25:12

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

Log:
 #i51143# adjust the title of the .uno:AddTable command, depending on whether 
we are also allowed to add queries

File Changes:

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

File [changed]: JoinController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinController.cxx?r1=1.37.10.2&r2=1.37.10.3
Delta lines:  +24 -12
---------------------
--- JoinController.cxx  17 May 2006 11:45:29 -0000      1.37.10.2
+++ JoinController.cxx  19 Jun 2006 09:25:10 -0000      1.37.10.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: JoinController.cxx,v $
  *
- *  $Revision: 1.37.10.2 $
+ *  $Revision: 1.37.10.3 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/17 11:45:29 $
+ *  last change: $Author: fs $ $Date: 2006/06/19 09:25:10 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -144,6 +144,8 @@
 #include "UITools.hxx"
 #endif
 
+#include <boost/optional.hpp>
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::beans;
@@ -333,22 +335,35 @@
        switch (_nId)
        {
                case ID_BROWSER_EDITDOC:
-                       aReturn.aState = ::cppu::bool2any(isEditable());
+                       aReturn.bChecked = isEditable();
                        break;
                case ID_BROWSER_SAVEDOC:
                        aReturn.bEnabled = isConnected() && isModified();
                        break;
                case ID_BROWSER_ADDTABLE:
-                       if (aReturn.bEnabled = getView() && const_cast< 
OJoinController* >( this )->getJoinView()->getTableView()->IsAddAllowed())
-                               aReturn.aState = ::cppu::bool2any( 
m_pAddTableDialog && m_pAddTableDialog->IsVisible() );
-                       else
-                               aReturn.aState = ::cppu::bool2any(sal_False);
+            aReturn.bEnabled = ( getView() != NULL )
+                            && const_cast< OJoinController* >( this 
)->getJoinView()->getTableView()->IsAddAllowed();
+            aReturn.bChecked = aReturn.bEnabled && m_pAddTableDialog != NULL 
&& m_pAddTableDialog->IsVisible() ;
+            aReturn.sTitle = OAddTableDlg::getDialogTitleForContext( 
impl_getDialogContext() );
                        break;
+
                default:
                        aReturn = OJoinController_BASE::GetState(_nId);
        }
        return aReturn;
 }
+
+// 
-----------------------------------------------------------------------------
+AddTableDialogContext& OJoinController::impl_getDialogContext() const
+{
+    if ( !m_pDialogContext.get() )
+    {
+        OJoinController* pNonConstThis = const_cast< OJoinController* >( this 
);
+        pNonConstThis->m_pDialogContext.reset( new AddTableDialogContext( 
*pNonConstThis ) );
+    }
+    return *m_pDialogContext;
+}
+
 // 
-----------------------------------------------------------------------------
 void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue 
>& aArgs)
 {
@@ -378,10 +393,7 @@
                        break;
                case ID_BROWSER_ADDTABLE:
                        if ( !m_pAddTableDialog )
-            {
-                m_pDialogContext.reset( new AddTableDialogContext( *this ) );
-                               m_pAddTableDialog = new OAddTableDlg( 
getView(), *m_pDialogContext );
-            }
+                               m_pAddTableDialog = new OAddTableDlg( 
getView(), impl_getDialogContext() );
 
             if ( m_pAddTableDialog->IsVisible() )
                        {




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

Reply via email to