Tag: cws_src680_titles02
User: oj      
Date: 2007-12-17 15:29:59+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasedocument.cxx
   dba/dbaccess/source/core/dataaccess/databasedocument.hxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
   dba/dbaccess/source/inc/dbustrings.hrc
   dba/dbaccess/source/shared/dbustrings.cxx
   dba/dbaccess/source/ui/browser/dbloader.cxx
   dba/dbaccess/source/ui/browser/genericcontroller.cxx
   dba/dbaccess/source/ui/browser/unodatbr.cxx
   dba/dbaccess/source/ui/inc/querycontroller.hxx
   dba/dbaccess/source/ui/misc/databaseobjectview.cxx
   dba/dbaccess/source/ui/misc/singledoccontroller.cxx
   dba/dbaccess/source/ui/misc/uiservices.cxx
   dba/dbaccess/source/ui/querydesign/querycontroller.cxx
   dba/dbaccess/source/ui/tabledesign/TableController.cxx

Log:
 #i45617# title feature

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: databasedocument.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.36.8.1&r2=1.36.8.2
Delta lines:  +12 -9
--------------------
--- databasedocument.cxx        2007-12-10 11:38:15+0000        1.36.8.1
+++ databasedocument.cxx        2007-12-17 15:29:53+0000        1.36.8.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.cxx,v $
  *
- *  $Revision: 1.36.8.1 $
+ *  $Revision: 1.36.8.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:38:15 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1203,6 +1203,8 @@
         // expected to listen for our disposal, and disconnect then
         DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: 
there still are controllers!" );
         impl_disposeControllerFrames_nothrow();
+        m_xModuleManager.clear();
+        m_xTitleHelper.clear();
     }
 
        m_pImpl.clear();
@@ -1340,13 +1342,14 @@
 {
     ModelMethodGuard aGuard( *this );
 
+    if ( !m_xModuleManager.is() )
+        m_xModuleManager.set( m_pImpl->m_xServiceFactory->createInstance( 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager"))
 ), UNO_QUERY_THROW );
+
+    ::rtl::OUString sModuleId = m_xModuleManager->identify( _xComponent );
+
     uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
 
-    uno::Reference< XServiceInfo> xInfo(_xComponent,uno::UNO_QUERY);
-    ::rtl::OUString sImplName;
-    if ( xInfo.is() )
-        sImplName = xInfo->getImplementationName();
-    TNumberedController::iterator aFind = 
m_aNumberedControllers.find(sImplName);
+    TNumberedController::iterator aFind = 
m_aNumberedControllers.find(sModuleId);
     if ( aFind == m_aNumberedControllers.end() )
     {
         uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* 
>(this), uno::UNO_QUERY_THROW);
@@ -1356,7 +1359,7 @@
         pHelper->setOwner          (xThis);
         //pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
 
-        
m_aNumberedControllers.insert(TNumberedController::value_type(sImplName,xNumberedControllers));
+        
m_aNumberedControllers.insert(TNumberedController::value_type(sModuleId,xNumberedControllers));
     }
     else
         xNumberedControllers = aFind->second;
@@ -1451,7 +1454,7 @@
 // css.frame.XUntitledNumbers
 ::rtl::OUString SAL_CALL ODatabaseDocument::getUntitledPrefix()    throw 
(uno::RuntimeException)
 {
-    return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "));
+    return ::rtl::OUString();/*RTL_CONSTASCII_USTRINGPARAM(" : "));*/
 }
 
 //------------------------------------------------------------------

File [changed]: databasedocument.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.hxx?r1=1.14.18.1&r2=1.14.18.2
Delta lines:  +5 -3
-------------------
--- databasedocument.hxx        2007-12-10 11:38:16+0000        1.14.18.1
+++ databasedocument.hxx        2007-12-17 15:29:54+0000        1.14.18.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.hxx,v $
  *
- *  $Revision: 1.14.18.1 $
+ *  $Revision: 1.14.18.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:38:16 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -74,7 +74,7 @@
 #ifndef _COM_SUN_STAR_VIEW_XPRINTABLE_HPP_
 #include <com/sun/star/view/XPrintable.hpp>
 #endif
-
+#include <com/sun/star/frame/XModuleManager.hpp>
 #include <cppuhelper/compbase10.hxx>
 #include <cppuhelper/implbase3.hxx>
 
@@ -148,6 +148,8 @@
 
        ::com::sun::star::uno::WeakReference< 
::com::sun::star::container::XNameAccess >        m_xForms;
        ::com::sun::star::uno::WeakReference< 
::com::sun::star::container::XNameAccess >        m_xReports;
+    /** @short  such module manager is used to classify new opened documents. 
*/
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager 
>         m_xModuleManager;
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle >        
         m_xTitleHelper;
     TNumberedController                                                        
         m_aNumberedControllers;
 

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.50.8.1&r2=1.50.8.2
Delta lines:  +18 -19
---------------------
--- documentdefinition.cxx      2007-12-10 11:38:16+0000        1.50.8.1
+++ documentdefinition.cxx      2007-12-17 15:29:54+0000        1.50.8.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.cxx,v $
  *
- *  $Revision: 1.50.8.1 $
+ *  $Revision: 1.50.8.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:38:16 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -66,6 +66,7 @@
 #ifndef _COMPHELPER_CLASSIDS_HXX
 #include <comphelper/classids.hxx>
 #endif
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
 #ifndef _COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
 #include <com/sun/star/awt/XTopWindow.hpp>
 #endif
@@ -1686,28 +1687,26 @@
 void ODocumentDefinition::updateDocumentTitle()
 {
     ::rtl::OUString sName = m_pImpl->m_aProps.aTitle;
+    if ( m_pImpl->m_pDataSource )
+    {
     if ( !sName.getLength() )
     {
         if ( m_bForm )
                    sName = DBACORE_RESSTRING( RID_STR_FORM );
            else
                    sName = DBACORE_RESSTRING( RID_STR_REPORT );
-        Reference<XNameAccess> xName(m_xParentContainer,UNO_QUERY);
-        sName = ::dbtools::createUniqueName(xName,sName);
+            Reference< XUntitledNumbers > 
xUntitledProvider(m_pImpl->m_pDataSource->getModel_noCreate(), UNO_QUERY      );
+            if ( xUntitledProvider.is() )
+                sName += ::rtl::OUString::valueOf( 
xUntitledProvider->leaseNumber(getComponent()) );
     }
 
+        Reference< XTitle > 
xDatabaseDocumentModel(m_pImpl->m_pDataSource->getModel_noCreate(),uno::UNO_QUERY);
+        if ( xDatabaseDocumentModel.is() )
+            sName = sName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - 
")) + xDatabaseDocumentModel->getTitle();
+    }
     Reference< XTitle> xTitle(getComponent(),UNO_QUERY);
     if ( xTitle.is() )
         xTitle->setTitle(sName);
-       /*Reference<XModel> xModel(getComponent(),UNO_QUERY);
-               if ( xModel.is() )
-               {
-                       Sequence<PropertyValue> aArgs = xModel->getArgs();
-                       ::comphelper::MediaDescriptor aHelper(aArgs);
-            aHelper[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"DocumentTitle" ) )] <<= m_pImpl->m_aProps.aTitle;
-                       aHelper >> aArgs;
-                       xModel->attachResource(xModel->getURL(),aArgs);
-               }*/
 }
 //........................................................................
 }      // namespace dbaccess

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

File [changed]: dbustrings.hrc
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/inc/dbustrings.hrc?r1=1.14&r2=1.14.8.1
Delta lines:  +4 -3
-------------------
--- dbustrings.hrc      2007-11-21 15:44:12+0000        1.14
+++ dbustrings.hrc      2007-12-17 15:29:54+0000        1.14.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbustrings.hrc,v $
  *
- *  $Revision: 1.14 $
+ *  $Revision: 1.14.8.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:44:12 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -49,6 +49,7 @@
        //= URLs
        //============================================================
        DECLARE_CONSTASCII_USTRING(URL_COMPONENT_QUERYDESIGN);
+    DECLARE_CONSTASCII_USTRING(URL_COMPONENT_VIEWDESIGN);
        DECLARE_CONSTASCII_USTRING(URL_COMPONENT_TABLEDESIGN);
        DECLARE_CONSTASCII_USTRING(URL_COMPONENT_FORMGRIDVIEW);
        DECLARE_CONSTASCII_USTRING(URL_COMPONENT_DATASOURCEBROWSER);

Directory: /dba/dbaccess/source/shared/
=======================================

File [changed]: dbustrings.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/shared/dbustrings.cxx?r1=1.14&r2=1.14.8.1
Delta lines:  +11 -10
---------------------
--- dbustrings.cxx      2007-11-21 15:48:56+0000        1.14
+++ dbustrings.cxx      2007-12-17 15:29:54+0000        1.14.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbustrings.cxx,v $
  *
- *  $Revision: 1.14 $
+ *  $Revision: 1.14.8.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:48:56 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -46,6 +46,7 @@
        //= URLs
        //============================================================
        IMPLEMENT_CONSTASCII_USTRING(URL_COMPONENT_QUERYDESIGN, 
".component:DB/QueryDesign");
+    IMPLEMENT_CONSTASCII_USTRING(URL_COMPONENT_VIEWDESIGN,          
".component:DB/ViewDesign");
        IMPLEMENT_CONSTASCII_USTRING(URL_COMPONENT_TABLEDESIGN, 
".component:DB/TableDesign");
        IMPLEMENT_CONSTASCII_USTRING(URL_COMPONENT_FORMGRIDVIEW, 
".component:DB/FormGridView");
        IMPLEMENT_CONSTASCII_USTRING(URL_COMPONENT_DATASOURCEBROWSER, 
".component:DB/DataSourceBrowser");

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

File [changed]: dbloader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.31&r2=1.31.28.1
Delta lines:  +5 -3
-------------------
--- dbloader.cxx        2007-08-17 13:34:32+0000        1.31
+++ dbloader.cxx        2007-12-17 15:29:54+0000        1.31.28.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbloader.cxx,v $
  *
- *  $Revision: 1.31 $
+ *  $Revision: 1.31.28.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/08/17 13:34:32 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -249,6 +249,8 @@
                
xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser")),UNO_QUERY);
        else if ( (bAttachModel = 
(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == 
URL_COMPONENT_QUERYDESIGN)) )// construct the control
                
xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OQueryDesign")),UNO_QUERY);
+    else if ( (bAttachModel = 
(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == 
URL_COMPONENT_VIEWDESIGN)) )// construct the control
+               
xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OViewDesign")),UNO_QUERY);
        else if ( (bAttachModel = 
(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == 
URL_COMPONENT_TABLEDESIGN)) ) // construct the control
                
xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OTableDesign")),UNO_QUERY);
        else if ( (bAttachModel = 
(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == 
URL_COMPONENT_RELATIONDESIGN)) )// construct the control

File [changed]: genericcontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.81.18.1&r2=1.81.18.2
Delta lines:  +11 -4
--------------------
--- genericcontroller.cxx       2007-12-10 11:38:43+0000        1.81.18.1
+++ genericcontroller.cxx       2007-12-17 15:29:54+0000        1.81.18.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: genericcontroller.cxx,v $
  *
- *  $Revision: 1.81.18.1 $
+ *  $Revision: 1.81.18.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:38:43 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -178,6 +178,7 @@
        ,m_bReadOnly(sal_False)
        ,m_bFrameUiActive(sal_False)
        ,m_bCurrentlyModified(sal_False)
+    ,m_bExternalTitle(sal_False)
 {
     DBG_CTOR(OGenericUnoController,NULL);
 
@@ -1333,14 +1334,14 @@
 
     if ( ! m_xTitleHelper.is ())
     {
-        Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), 
UNO_QUERY      );
+        //Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), 
UNO_QUERY      );
         Reference< XController >      xThis(static_cast< XController* >(this), 
UNO_QUERY_THROW);
     
         ::framework::TitleHelper* pHelper = new 
::framework::TitleHelper(m_xServiceFactory);
         m_xTitleHelper.set( static_cast< ::cppu::OWeakObject* >(pHelper), 
UNO_QUERY_THROW);
     
         pHelper->setOwner                   (xThis            );
-        pHelper->connectWithUntitledNumbers (xUntitledProvider);
+        //pHelper->connectWithUntitledNumbers (xUntitledProvider);
     }
 
     return m_xTitleHelper;
@@ -1351,6 +1352,9 @@
 ::rtl::OUString SAL_CALL OGenericUnoController::getTitle()
     throw (RuntimeException)
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
+    if ( m_bExternalTitle )
+        return impl_getTitleHelper_throw()->getTitle ();
     return getPrivateTitle() + impl_getTitleHelper_throw()->getTitle ();
 }
 
@@ -1359,6 +1363,9 @@
 void SAL_CALL OGenericUnoController::setTitle(const ::rtl::OUString& sTitle)
     throw (RuntimeException)
 {
+    vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+       ::osl::MutexGuard aGuard(m_aMutex);
+    m_bExternalTitle = sal_True;
     impl_getTitleHelper_throw()->setTitle (sTitle);
 }
     

File [changed]: unodatbr.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/unodatbr.cxx?r1=1.192.8.1&r2=1.192.8.2
Delta lines:  +6 -5
-------------------
--- unodatbr.cxx        2007-12-10 11:38:44+0000        1.192.8.1
+++ unodatbr.cxx        2007-12-17 15:29:55+0000        1.192.8.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: unodatbr.cxx,v $
  *
- *  $Revision: 1.192.8.1 $
+ *  $Revision: 1.192.8.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:38:44 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -3687,10 +3687,11 @@
                INetURLObject aURL(sTitle);
                if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
                        sTitle = 
aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET);
-               if(sName.getLength())
+               if ( sName.getLength() )
                {
-                       sTitle += ::rtl::OUString::createFromAscii(": ");
-                       sTitle += sName;
+                       sName += ::rtl::OUString::createFromAscii(" - ");
+                       sName += sTitle;
+            sTitle = sName;
                }
        }
 

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

File [changed]: querycontroller.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/querycontroller.hxx?r1=1.38.10.1&r2=1.38.10.2
Delta lines:  +6 -5
-------------------
--- querycontroller.hxx 2007-12-10 11:39:01+0000        1.38.10.1
+++ querycontroller.hxx 2007-12-17 15:29:55+0000        1.38.10.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: querycontroller.hxx,v $
  *
- *  $Revision: 1.38.10.1 $
+ *  $Revision: 1.38.10.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:39:01 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -95,7 +95,8 @@
                ::rtl::OUString m_sUpdateCatalogName;   // catalog for update 
data
                ::rtl::OUString m_sUpdateSchemaName;    // schema for update 
data
                ::rtl::OUString m_sUpdateTableName;     // table for update data
-               ::rtl::OUString m_sName;                            // name of 
the query
+               mutable ::rtl::OUString 
+                        m_sName;                           // name of the query
 
                sal_Int32               m_nVisibleRows;         // which rows 
the selection browse should show
                sal_Int32               m_nSplitPos;            // the position 
of the splitter
@@ -132,6 +133,7 @@
                void loadViewSettings(const ::com::sun::star::uno::Sequence< 
::com::sun::star::beans::PropertyValue>& _rViewProps);     
                ::rtl::OUString translateStatement( bool _bFireStatementChange 
= true );
                
+        ::rtl::OUString getDefaultName() const;
 
        protected:
                // all the features which should be handled by this class
@@ -220,7 +222,6 @@
         // OJoinController overridables
         virtual bool allowViews() const;
         virtual bool allowQueries() const;
-
     private:
         DECL_LINK( OnExecuteAddTable, void* );
        };

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

File [changed]: databaseobjectview.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/databaseobjectview.cxx?r1=1.6&r2=1.6.8.1
Delta lines:  +4 -4
-------------------
--- databaseobjectview.cxx      2007-11-21 16:08:55+0000        1.6
+++ databaseobjectview.cxx      2007-12-17 15:29:55+0000        1.6.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databaseobjectview.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.6.8.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 16:08:55 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -236,7 +236,7 @@
        QueryDesigner::QueryDesigner( const Reference< XMultiServiceFactory >& 
_rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication,
                const Reference< XFrame >& _rxParentFrame,
         bool _bCreateView, sal_Bool _bPreferSQLView )
-               :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, 
static_cast< ::rtl::OUString >( URL_COMPONENT_QUERYDESIGN ) )
+        :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, 
static_cast< ::rtl::OUString >( _bCreateView ? URL_COMPONENT_VIEWDESIGN : 
URL_COMPONENT_QUERYDESIGN ) )
         ,m_nCommandType( _bCreateView ? CommandType::TABLE : 
CommandType::QUERY )
                ,m_bPreferSQLView( _bPreferSQLView )
        {

File [changed]: singledoccontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/singledoccontroller.cxx?r1=1.22.58.1&r2=1.22.58.2
Delta lines:  +33 -3
--------------------
--- singledoccontroller.cxx     2007-12-10 11:39:01+0000        1.22.58.1
+++ singledoccontroller.cxx     2007-12-17 15:29:55+0000        1.22.58.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: singledoccontroller.cxx,v $
  *
- *  $Revision: 1.22.58.1 $
+ *  $Revision: 1.22.58.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:39:01 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,6 +45,7 @@
 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
 #include "dbustrings.hrc"
 #endif
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
 #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #endif
@@ -100,6 +101,7 @@
 #ifndef _DBAUI_COMMON_TYPES_HXX_
 #include "commontypes.hxx"
 #endif
+#include <rtl/ustrbuf.hxx>
 //........................................................................
 namespace dbaui
 {
@@ -130,12 +132,14 @@
                                                m_xFormatter;   // a number 
formatter working with the connection's NumberFormatsSupplier
                ModelControllerConnector
                         m_aModelConnector;
+        sal_Int32       m_nDocStartNumber;
                sal_Bool                m_bSuspended     : 1;   // is true when 
the controller was already suspended
                sal_Bool                m_bEditable              : 1;   // is 
the control readonly or not
                sal_Bool                m_bModified              : 1;   // is 
the data modified
 
         OSingleDocumentControllerImpl() : 
-            m_bSuspended( sal_False )
+            m_nDocStartNumber(1)
+            ,m_bSuspended( sal_False )
                    ,m_bEditable(sal_True)
                    ,m_bModified(sal_False)
         {
@@ -470,6 +474,11 @@
         Reference< XOfficeDatabaseDocument > xOfficeDoc( _rxModel, UNO_QUERY );
         m_pImpl->m_xDataSource.set( xOfficeDoc.is() ? 
xOfficeDoc->getDataSource() : Reference<XDataSource>(), UNO_QUERY );
 
+        Reference< XUntitledNumbers > xUntitledProvider(_rxModel, UNO_QUERY    
  );
+        m_pImpl->m_nDocStartNumber = 1;
+        if ( xUntitledProvider.is() )
+            m_pImpl->m_nDocStartNumber = 
xUntitledProvider->leaseNumber(static_cast<XWeak*>(this));
+
         return sal_True;
        }
        // 
-----------------------------------------------------------------------------
@@ -522,6 +531,27 @@
         return uno::Reference< frame::XModel 
>(dbaui::getDataSourceOrModel(m_pImpl->m_xDataSource),uno::UNO_QUERY);
     }
     // 
-----------------------------------------------------------------------------
+    // XTitle
+    ::rtl::OUString SAL_CALL OSingleDocumentController::getTitle()
+        throw (uno::RuntimeException)
+    {
+        ::osl::MutexGuard aGuard(m_aMutex);
+        if ( m_bExternalTitle )
+            return impl_getTitleHelper_throw()->getTitle ();
+        
+        ::rtl::OUStringBuffer sTitle;
+        sTitle.append( getPrivateTitle() );
+        sTitle.appendAscii(" - ");
+        Reference< XTitle > xTitle(getPrivateModel(),uno::UNO_QUERY);
+        if ( xTitle.is() )
+            sTitle.append( xTitle->getTitle() );
+        return sTitle.makeStringAndClear();
+    }
+    // 
-----------------------------------------------------------------------------
+    sal_Int32 OSingleDocumentController::getCurrentStartNumber() const
+    {
+        return m_pImpl->m_nDocStartNumber;
+    }
 //........................................................................
 }      // namespace dbaui
 //........................................................................

File [changed]: uiservices.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/uiservices.cxx?r1=1.25&r2=1.25.18.1
Delta lines:  +5 -3
-------------------
--- uiservices.cxx      2007-09-26 14:52:14+0000        1.25
+++ uiservices.cxx      2007-12-17 15:29:55+0000        1.25.18.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: uiservices.cxx,v $
  *
- *  $Revision: 1.25 $
+ *  $Revision: 1.25.18.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:52:14 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -69,6 +69,7 @@
 extern "C" void SAL_CALL createRegistryInfo_OInteractionHandler();
 extern "C" void SAL_CALL createRegistryInfo_SbaXGridControl();
 extern "C" void SAL_CALL createRegistryInfo_OQueryControl();
+extern "C" void SAL_CALL createRegistryInfo_OViewControl();
 extern "C" void SAL_CALL createRegistryInfo_OTableControl();
 extern "C" void SAL_CALL createRegistryInfo_ORelationControl();
 extern "C" void SAL_CALL createRegistryInfo_ComposerDialogs();
@@ -99,6 +100,7 @@
                createRegistryInfo_OInteractionHandler();
                createRegistryInfo_SbaXGridControl();
                createRegistryInfo_OQueryControl();
+        createRegistryInfo_OViewControl();
                createRegistryInfo_OTableControl();
                createRegistryInfo_ORelationControl();
                createRegistryInfo_ComposerDialogs();

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

File [changed]: querycontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/querycontroller.cxx?r1=1.112.8.1&r2=1.112.8.2
Delta lines:  +50 -18
---------------------
--- querycontroller.cxx 2007-12-10 11:39:02+0000        1.112.8.1
+++ querycontroller.cxx 2007-12-17 15:29:55+0000        1.112.8.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: querycontroller.cxx,v $
  *
- *  $Revision: 1.112.8.1 $
+ *  $Revision: 1.112.8.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:39:02 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -102,6 +102,50 @@
 {
        static ::dbaui::OMultiInstanceAutoRegistration< 
::dbaui::OQueryController > aAutoRegistration;
 }
+namespace dbaui
+{
+    using namespace ::com::sun::star::uno;
+    using namespace ::com::sun::star::beans;
+    using namespace ::com::sun::star::frame;
+    using namespace ::com::sun::star::util;
+    using namespace ::com::sun::star::lang;
+
+    class OViewController : public OQueryController
+    {
+        
//------------------------------------------------------------------------------
+        virtual ::rtl::OUString SAL_CALL getImplementationName() throw( 
RuntimeException )
+        {
+               return getImplementationName_Static();
+        }
+        
//-------------------------------------------------------------------------
+        virtual Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() 
throw(RuntimeException)
+        {
+               return getSupportedServiceNames_Static();
+        }
+    public:
+        OViewController(const Reference< XMultiServiceFactory >& _rM) : 
OQueryController(_rM){}
+
+        // need by registration
+           static ::rtl::OUString getImplementationName_Static() throw( 
RuntimeException )
+        {
+               return 
::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OViewDesign");
+        }
+           static Sequence< ::rtl::OUString > 
getSupportedServiceNames_Static(void) throw( RuntimeException )
+        {
+            Sequence< ::rtl::OUString> aSupported(1);
+               aSupported.getArray()[0] = 
::rtl::OUString::createFromAscii("com.sun.star.sdb.ViewDesign");
+               return aSupported;
+        }
+           static Reference< XInterface > SAL_CALL Create(const Reference< 
XMultiServiceFactory >& _rM)
+        {
+            return *(new OViewController(_rM));
+        }
+    };
+}
+extern "C" void SAL_CALL createRegistryInfo_OViewControl()
+{
+       static ::dbaui::OMultiInstanceAutoRegistration< 
::dbaui::OViewController > aAutoRegistration;
+}
 
 namespace dbaui
 {
@@ -899,11 +943,9 @@
         {
                        ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
                        ::osl::MutexGuard aGuard(m_aMutex);
-                   if ( !sName.getLength() )
-                   {                           
                            String aDefaultName = String( ModuleRes( 
editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) );
-                           sName = aDefaultName.GetToken( 0, ' ' );
-                   }
+                       sName = aDefaultName.GetToken(0,' ');
+            sName += ::rtl::OUString::valueOf(getCurrentStartNumber());
         }
        }
     return sName;
@@ -1229,21 +1271,11 @@
        sal_Bool bNew = _bSaveAs || !_xElements->hasByName( m_sName );
        if(bNew)
        {
-               Reference<XDatabaseMetaData> xMetaData;
-               if(isConnected())
-                       xMetaData = getMetaData();
                String aDefaultName;
                if ( ( _bSaveAs && !bNew ) || ( bNew && m_sName.getLength() ) )
                        aDefaultName = String( m_sName );
                else
-               {
-                       String aName = String( ModuleRes( editingView() ? 
STR_VIEW_TITLE : STR_QRY_TITLE ) );
-                       aName = aName.GetToken(0,' ');
-                       if ( editingView() && isConnected() )
-                               aDefaultName = 
::dbaui::createDefaultName(xMetaData,_xElements,aName);
-                       else
-                               aDefaultName = 
String(::dbtools::createUniqueName(_xElements,aName));
-               }
+            aDefaultName = getPrivateTitle( );
 
         DynamicTableOrQueryNameCheck aNameChecker( getConnection(), 
CommandType::QUERY );
                OSaveAsDlg aDlg(

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

File [changed]: TableController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TableController.cxx?r1=1.114.26.1&r2=1.114.26.2
Delta lines:  +4 -7
-------------------
--- TableController.cxx 2007-12-10 11:39:02+0000        1.114.26.1
+++ TableController.cxx 2007-12-17 15:29:56+0000        1.114.26.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TableController.cxx,v $
  *
- *  $Revision: 1.114.26.1 $
+ *  $Revision: 1.114.26.2 $
  *
- *  last change: $Author: oj $ $Date: 2007/12/10 11:39:02 $
+ *  last change: $Author: oj $ $Date: 2007/12/17 15:29:56 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -426,11 +426,7 @@
                        if (_bSaveAs && !bNew)
                                 aDefaultName = String(m_sName);
                        else
-                       {
-                               String aName = String(ModuleRes(STR_TBL_TITLE));
-                               aName = aName.GetToken(0,' ');
-                               aDefaultName = 
::dbaui::createDefaultName(getConnection()->getMetaData(),xTables,aName);
-                       }
+                aDefaultName = getPrivateTitle();
 
             DynamicTableOrQueryNameCheck aNameChecker( getConnection(), 
CommandType::TABLE );
                        OSaveAsDlg aDlg( getView(), CommandType::TABLE, 
getORB(), getConnection(), aDefaultName, aNameChecker );
@@ -1646,6 +1642,7 @@
                {
             String aName = String(ModuleRes(STR_TBL_TITLE));
                        sTitle = aName.GetToken(0,' ');
+            sTitle += ::rtl::OUString::valueOf(getCurrentStartNumber());
                }
        }
        catch(Exception)




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

Reply via email to