User: kz      
Date: 2008-04-04 14:53:39+0000
Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 INTEGRATION: CWS titles02 (1.50.8); FILE MERGED
 2008/03/13 10:45:30 oj 1.50.8.3: #i45909# #i45617# #i71469# title changes
 2008/02/12 13:24:48 as 1.50.8.2: RESYNC: (1.50-1.53); FILE MERGED
 2007/12/10 11:38:43 oj 1.50.8.1: #i45909# #i45617# #i71469# change title 
handling

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.56&r2=1.57
Delta lines:  +99 -51
---------------------
--- AppController.cxx   2008-03-11 08:48:04+0000        1.56
+++ AppController.cxx   2008-04-04 14:53:36+0000        1.57
@@ -70,6 +70,15 @@
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
 #include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/container/XHierarchicalNameContainer.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/util/XFlushable.hpp>
+#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include <com/sun/star/awt/XTopWindow.hpp>
 /** === end UNO includes === **/
 
 #ifndef _TOOLS_DEBUG_HXX
@@ -236,6 +245,7 @@
 //........................................................................
 using namespace ::dbtools;
 using namespace ::svx;
+using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::view;
@@ -364,7 +374,7 @@
 
        
::std::for_each(m_aCurrentContainers.begin(),m_aCurrentContainers.end(),XContainerFunctor(this));
        m_aCurrentContainers.clear();
-
+    m_aSpecialSubFrames.clear();
        m_aDocuments.clear();
 
        if ( getView() )
@@ -516,6 +526,13 @@
                                
::std::compose1(::std::bind2nd(::std::equal_to<Reference<XComponent> 
>(),xComp),::std::select1st<TDocuments::value_type>()));
                        if ( aFind != m_aDocuments.end() )
                                m_aDocuments.erase(aFind);
+
+            TFrames::iterator aFind2 = 
::std::find_if(m_aSpecialSubFrames.begin(),m_aSpecialSubFrames.end(),
+                               
::std::compose1(::std::bind2nd(::std::equal_to<Reference<XComponent> >(),xComp),
+                    
::std::compose1(::std::select2nd<TTypeFrame>(),::std::select2nd<TFrames::value_type>())));
+                       if ( aFind2 != m_aSpecialSubFrames.end() )
+                               m_aSpecialSubFrames.erase(aFind2);
+            
                }
                if ( xContainer.is() )
                {
@@ -1135,7 +1152,8 @@
                                                        {
                                                                
xStore->storeAsURL(aURL.GetMainURL( INetURLObject::NO_DECODE 
),Sequence<PropertyValue>());
                                                                m_sDatabaseName 
= ::rtl::OUString();
-                                                               updateTitle();
+                                                               
/*updateTitle();*/
+                                                               
m_bCurrentlyModified = sal_False;
                                                                
InvalidateFeature(ID_BROWSER_SAVEDOC);
                                 if ( getContainer()->getElementType() == 
E_NONE )
                                 {
@@ -1273,15 +1291,18 @@
                                InvalidateAll();
                                break;
                        case SID_DB_APP_DSRELDESIGN:
+                if ( 
!impl_activateSubFrame_throw(::rtl::OUString(),SID_DB_APP_DSRELDESIGN,OLinkedDocumentsAccess::OPEN_DESIGN)
 )
                                {
                                        SharedConnection xConnection( 
ensureConnection() );
                                        if ( xConnection.is() )
                                        {
-                                               RelationDesigner aDesigner( 
getORB(), this, getFrame() );
+                                           RelationDesigner aDesigner( 
getORB(), this, m_xCurrentFrame );
                         Reference< XDataSource > xDataSource( m_xDataSource, 
UNO_QUERY );
                                                Reference< XComponent > 
xComponent( aDesigner.createNew( xDataSource ), UNO_QUERY );
                                                addDocumentListener( 
xComponent, NULL );
-                                       }
+                        
m_aSpecialSubFrames.insert(TFrames::value_type(::rtl::OUString(),
+                            
TTypeFrame(TTypeOpenMode(SID_DB_APP_DSRELDESIGN,OLinkedDocumentsAccess::OPEN_DESIGN),xComponent)));
+                                   } // if ( xConnection.is() )
                                }
                                break;
                        case SID_DB_APP_DSUSERADMIN:
@@ -1770,6 +1791,9 @@
        case E_QUERY:
        case E_TABLE:
        {
+        if ( !impl_activateSubFrame_throw(_sName,_eType,_eOpenMode) )
+        {
+
                SharedConnection xConnection( ensureConnection() );
                if ( !xConnection.is() )
             break;
@@ -1784,23 +1808,23 @@
                        if ( _eType == E_TABLE )
                        {
                 if ( impl_isAlterableView_nothrow( _sName ) )
-                    pDesigner.reset( new QueryDesigner( getORB(), this, 
getFrame(), true, bQuerySQLMode ) );
+                        pDesigner.reset( new QueryDesigner( getORB(), this, 
m_xCurrentFrame, true, bQuerySQLMode ) );
                 else
-                    pDesigner.reset( new TableDesigner( getORB(), this, 
getFrame() ) );
+                        pDesigner.reset( new TableDesigner( getORB(), this, 
m_xCurrentFrame ) );
                        }
                        else if ( _eType == E_QUERY )
                        {
-                pDesigner.reset( new QueryDesigner( getORB(), this, 
getFrame(), false, bQuerySQLMode ) );
+                    pDesigner.reset( new QueryDesigner( getORB(), this, 
m_xCurrentFrame, false, bQuerySQLMode ) );
                        }
                        else if ( _eType == E_REPORT )
                        {
-                               pDesigner.reset( new ReportDesigner( 
getORB(),this, getFrame() ) );
+                                   pDesigner.reset( new ReportDesigner( 
getORB(),this, m_xCurrentFrame ) );
                        }
                        aDataSource <<= m_xDataSource;
                }
                else
                {
-                       pDesigner.reset( new ResultSetBrowser( getORB(), this, 
getFrame(), _eType == E_TABLE ) );
+                           pDesigner.reset( new ResultSetBrowser( getORB(), 
this, m_xCurrentFrame, _eType == E_TABLE ) );
 
                        aArgs.realloc(1);
                        aArgs[0].Name = PROPERTY_SHOWMENU;
@@ -1811,6 +1835,9 @@
 
                Reference< XComponent > xComponent( pDesigner->openExisting( 
aDataSource, _sName, aArgs ), UNO_QUERY );
                addDocumentListener( xComponent, NULL );
+            m_aSpecialSubFrames.insert(TFrames::value_type(_sName,
+                            
TTypeFrame(TTypeOpenMode(_eType,_eOpenMode),xComponent)));
+        }
        }
        break;
 
@@ -2664,7 +2691,6 @@
     
     return makeAny(aCurrentSelection);
 }
-
 // 
-----------------------------------------------------------------------------
 void OApplicationController::impl_migrateScripts_nothrow()
 {
@@ -2692,6 +2718,28 @@
     }
 }
 
+// 
-----------------------------------------------------------------------------
+bool OApplicationController::impl_activateSubFrame_throw(const 
::rtl::OUString& _sName,const sal_Int32 _nKind,const 
OLinkedDocumentsAccess::EOpenMode _eOpenMode) const
+{
+    bool bFound = false;
+    TFrames::const_iterator aFind = m_aSpecialSubFrames.find(_sName);
+    for(;aFind != m_aSpecialSubFrames.end();++aFind)
+    {
+        if ( aFind->second.first.first == _nKind && aFind->second.first.second 
== _eOpenMode )
+        {
+            const Reference< XFrame> xFrame(aFind->second.second,UNO_QUERY);
+            if ( xFrame.is() )
+            {
+                Reference< awt::XTopWindow> 
xTopWindow(xFrame->getContainerWindow(),UNO_QUERY);
+                if ( xTopWindow.is() )
+                    xTopWindow->toFront();
+                bFound = true;
+            }
+            break;
+        } // if ( aFind->second.first.first == _nKind && 
aFind->second.first.second == _eOpenMode )
+    } // while ( aFind != m_aSpecialSubFrames.end() )
+    return bFound;
+}
 //........................................................................
 }      // namespace dbaui
 //........................................................................




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

Reply via email to