Tag: cws_src680_titles02
User: oj      
Date: 2007-12-10 11:38:18+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasedocument.cxx
   dba/dbaccess/source/core/dataaccess/databasedocument.hxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx

Log:
 #i45909# #i45617# #i71469# change title handling

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&r2=1.36.8.1
Delta lines:  +192 -11
----------------------
--- databasedocument.cxx        2007-11-21 15:37:45+0000        1.36
+++ databasedocument.cxx        2007-12-10 11:38:15+0000        1.36.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.cxx,v $
  *
- *  $Revision: 1.36 $
+ *  $Revision: 1.36.8.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:37:45 $
+ *  last change: $Author: oj $ $Date: 2007/12/10 11:38:15 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -47,6 +47,8 @@
 #include <comphelper/documentconstants.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/enumhelper.hxx>
+#include <comphelper/numberedcollection.hxx>
+#include <framework/titlehelper.hxx>
 #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
 #include <com/sun/star/embed/XTransactedObject.hpp>
 #endif
@@ -202,6 +204,48 @@
                dispose();
        }
 }
+//------------------------------------------------------------------------------
+Any SAL_CALL ODatabaseDocument::queryInterface(const Type& _rType) throw 
(RuntimeException)
+{
+       Any aReturn = ODatabaseDocument_OfficeDocument::queryInterface(_rType);
+       if (!aReturn.hasValue())
+               aReturn = ODatabaseDocument_Title::queryInterface(_rType);
+       return aReturn;
+}
+//------------------------------------------------------------------------------
+void SAL_CALL ODatabaseDocument::acquire(  ) throw ()
+{
+       ODatabaseDocument_OfficeDocument::acquire();
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL ODatabaseDocument::release(  ) throw ()
+{
+       ODatabaseDocument_OfficeDocument::release();
+}
+//------------------------------------------------------------------------------
+Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) throw 
(RuntimeException)
+{
+       return ::comphelper::concatSequences(
+               ODatabaseDocument_OfficeDocument::getTypes(),
+               ODatabaseDocument_Title::getTypes()
+       );
+}
+//------------------------------------------------------------------------------
+Sequence< sal_Int8 > SAL_CALL ODatabaseDocument::getImplementationId(  ) throw 
(RuntimeException)
+{
+       static ::cppu::OImplementationId * pId = 0;
+       if (! pId)
+       {
+               ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+               if (! pId)
+               {
+                       static ::cppu::OImplementationId aId;
+                       pId = &aId;
+               }
+       }
+       return pId->getImplementationId();
+}
 
 // 
-----------------------------------------------------------------------------
 // local functions
@@ -701,20 +745,20 @@
 // 
-----------------------------------------------------------------------------
 
 // ::com::sun::star::document::XEventBroadcaster
-void SAL_CALL ODatabaseDocument::addEventListener(const css::uno::Reference< 
css::document::XEventListener >& _xListener ) throw (css::uno::RuntimeException)
+void SAL_CALL ODatabaseDocument::addEventListener(const uno::Reference< 
document::XEventListener >& _xListener ) throw (uno::RuntimeException)
 {
        
::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed);
     m_aDocEventListeners.addInterface(_xListener);
 }
 // 
-----------------------------------------------------------------------------
-void SAL_CALL ODatabaseDocument::removeEventListener( const 
css::uno::Reference< css::document::XEventListener >& _xListener ) throw 
(css::uno::RuntimeException)
+void SAL_CALL ODatabaseDocument::removeEventListener( const uno::Reference< 
document::XEventListener >& _xListener ) throw (uno::RuntimeException)
 {
        
::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed);
     m_aDocEventListeners.removeInterface(_xListener);
 }
 // 
-----------------------------------------------------------------------------
 // ::com::sun::star::document::XEventListener
-void SAL_CALL ODatabaseDocument::notifyEvent( const 
css::document::EventObject& aEvent ) throw (css::uno::RuntimeException)
+void SAL_CALL ODatabaseDocument::notifyEvent( const document::EventObject& 
aEvent ) throw (uno::RuntimeException)
 {
     ModelMethodGuard aGuard( *this );
     // used only to forward external events (e.g. for doc creation) from the 
frame loader
@@ -1114,9 +1158,9 @@
 {
        try
        {
-               css::document::EventObject aEvt(*this, _sEventName);
+               document::EventObject aEvt(*this, _sEventName);
         _rGuard.clear();
-        m_aDocEventListeners.notifyEach( 
&css::document::XEventListener::notifyEvent, aEvt );
+        m_aDocEventListeners.notifyEach( 
&document::XEventListener::notifyEvent, aEvt );
        }
        catch(Exception&)
        {
@@ -1143,7 +1187,7 @@
                impl_notifyEvent( "OnUnload", aGuard );
         }
 
-           css::lang::EventObject aDisposeEvent(static_cast<XWeak*>(this));
+           lang::EventObject aDisposeEvent(static_cast<XWeak*>(this));
            m_aModifyListeners.disposeAndClear( aDisposeEvent );
            m_aCloseListener.disposeAndClear( aDisposeEvent );
            m_aDocEventListeners.disposeAndClear( aDisposeEvent );
@@ -1170,12 +1214,12 @@
     ::cppu::WeakComponentImplHelperBase::dispose();
 }
 // 
-----------------------------------------------------------------------------
-void SAL_CALL ODatabaseDocument::addEventListener( const Reference< 
css::lang::XEventListener >& _xListener ) throw (RuntimeException)
+void SAL_CALL ODatabaseDocument::addEventListener( const Reference< 
lang::XEventListener >& _xListener ) throw (RuntimeException)
 {
        ::cppu::WeakComponentImplHelperBase::addEventListener(_xListener);
 }
 // 
-----------------------------------------------------------------------------
-void SAL_CALL ODatabaseDocument::removeEventListener( const Reference< 
css::lang::XEventListener >& _xListener ) throw (RuntimeException)
+void SAL_CALL ODatabaseDocument::removeEventListener( const Reference< 
lang::XEventListener >& _xListener ) throw (RuntimeException)
 {
        ::cppu::WeakComponentImplHelperBase::removeEventListener(_xListener);
 }
@@ -1272,6 +1316,143 @@
     return Reference< XController >();
 }
 // 
-----------------------------------------------------------------------------
+//=============================================================================
+uno::Reference< frame::XTitle > ODatabaseDocument::impl_getTitleHelper_throw()
+{
+    ModelMethodGuard aGuard( *this );
+
+    if ( ! m_xTitleHelper.is ())
+    {
+        uno::Reference< frame::XUntitledNumbers >    
xDesktop(m_pImpl->m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
 css::uno::UNO_QUERY_THROW);
+        uno::Reference< frame::XModel >              xThis   (getThis(), 
uno::UNO_QUERY_THROW);
+    
+        ::framework::TitleHelper* pHelper = new 
::framework::TitleHelper(m_pImpl->m_xServiceFactory);
+        m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pHelper), 
uno::UNO_QUERY_THROW);
+        pHelper->setOwner                   (xThis   );
+        pHelper->connectWithUntitledNumbers (xDesktop);
+    }
+    
+    return m_xTitleHelper;
+}
+
+//=============================================================================
+uno::Reference< frame::XUntitledNumbers > 
ODatabaseDocument::impl_getUntitledHelper_throw(const uno::Reference< 
uno::XInterface >& _xComponent)
+{
+    ModelMethodGuard aGuard( *this );
+
+    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);
+    if ( aFind == m_aNumberedControllers.end() )
+    {
+        uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* 
>(this), uno::UNO_QUERY_THROW);
+        ::comphelper::NumberedCollection* pHelper = new 
::comphelper::NumberedCollection();
+        xNumberedControllers.set(static_cast< ::cppu::OWeakObject* >(pHelper), 
uno::UNO_QUERY_THROW);
+    
+        pHelper->setOwner          (xThis);
+        //pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
+
+        
m_aNumberedControllers.insert(TNumberedController::value_type(sImplName,xNumberedControllers));
+    }
+    else
+        xNumberedControllers = aFind->second;
+    
+    return xNumberedControllers;
+}
+
+//=============================================================================
+// css.frame.XTitle
+::rtl::OUString SAL_CALL ODatabaseDocument::getTitle()
+    throw (uno::RuntimeException)
+{
+    // SYNCHRONIZED ->
+    ModelMethodGuard aGuard( *this );
+
+    return impl_getTitleHelper_throw()->getTitle ();
+}
+
+//=============================================================================
+// css.frame.XTitle
+void SAL_CALL ODatabaseDocument::setTitle( const ::rtl::OUString& sTitle )
+    throw (uno::RuntimeException)
+{
+    // SYNCHRONIZED ->
+    ModelMethodGuard aGuard( *this );
+
+    impl_getTitleHelper_throw()->setTitle (sTitle);
+}
+
+//=============================================================================
+// css.frame.XTitleChangeBroadcaster
+void SAL_CALL ODatabaseDocument::addTitleChangeListener( const uno::Reference< 
frame::XTitleChangeListener >& xListener )
+    throw (uno::RuntimeException)
+{
+    // SYNCHRONIZED ->
+    ModelMethodGuard aGuard( *this );
+   
+    uno::Reference< frame::XTitleChangeBroadcaster > 
xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
+    if (xBroadcaster.is ())
+        xBroadcaster->addTitleChangeListener (xListener);
+}
+    
+//=============================================================================
+// css.frame.XTitleChangeBroadcaster
+void SAL_CALL ODatabaseDocument::removeTitleChangeListener( const 
uno::Reference< frame::XTitleChangeListener >& xListener )
+    throw (uno::RuntimeException)
+{
+    // SYNCHRONIZED ->
+    ModelMethodGuard aGuard( *this );
+
+    uno::Reference< frame::XTitleChangeBroadcaster > 
xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
+    if (xBroadcaster.is ())
+        xBroadcaster->removeTitleChangeListener (xListener);
+}
+
+//=============================================================================
+// css.frame.XUntitledNumbers
+::sal_Int32 SAL_CALL ODatabaseDocument::leaseNumber( const uno::Reference< 
uno::XInterface >& xComponent )
+    throw (lang::IllegalArgumentException,
+           uno::RuntimeException         )
+{
+       // object already disposed?
+    ModelMethodGuard aGuard( *this );
+    
+    return impl_getUntitledHelper_throw(xComponent)->leaseNumber (xComponent);
+}
+               
+//=============================================================================
+// css.frame.XUntitledNumbers
+void SAL_CALL ODatabaseDocument::releaseNumber( ::sal_Int32 nNumber )
+    throw (lang::IllegalArgumentException,
+           uno::RuntimeException         )
+{
+       // object already disposed?
+    ModelMethodGuard aGuard( *this );
+    
+    impl_getUntitledHelper_throw()->releaseNumber (nNumber);
+}
+               
+//=============================================================================
+// css.frame.XUntitledNumbers
+void SAL_CALL ODatabaseDocument::releaseNumberForComponent( const 
uno::Reference< uno::XInterface >& xComponent )
+    throw (lang::IllegalArgumentException,
+           uno::RuntimeException         )
+{
+       // object already disposed?
+    ModelMethodGuard aGuard( *this );
+    impl_getUntitledHelper_throw(xComponent)->releaseNumberForComponent 
(xComponent);
+}
+
+//=============================================================================
+// css.frame.XUntitledNumbers
+::rtl::OUString SAL_CALL ODatabaseDocument::getUntitledPrefix()    throw 
(uno::RuntimeException)
+{
+    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&r2=1.14.18.1
Delta lines:  +55 -6
--------------------
--- databasedocument.hxx        2007-09-26 14:40:04+0000        1.14
+++ databasedocument.hxx        2007-12-10 11:38:16+0000        1.14.18.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.hxx,v $
  *
- *  $Revision: 1.14 $
+ *  $Revision: 1.14.18.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:40:04 $
+ *  last change: $Author: oj $ $Date: 2007/12/10 11:38:16 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -44,6 +44,18 @@
 #ifndef _COM_SUN_STAR_FRAME_XMODEL2_HPP_
 #include <com/sun/star/frame/XModel2.hpp>
 #endif
+#ifndef _COM_SUN_STAR_FRAME_XTITLE_HPP_
+#include <com/sun/star/frame/XTitle.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XTITLECHANGEBROADCASTER_HPP_
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XUNTITLEDNUMBERS_HPP_
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+#endif
+
 #ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_
 #include <com/sun/star/util/XModifiable.hpp>
 #endif
@@ -62,9 +74,10 @@
 #ifndef _COM_SUN_STAR_VIEW_XPRINTABLE_HPP_
 #include <com/sun/star/view/XPrintable.hpp>
 #endif
-#ifndef _CPPUHELPER_COMPBASE10_HXX_
+
 #include <cppuhelper/compbase10.hxx>
-#endif
+#include <cppuhelper/implbase3.hxx>
+
 #ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
 #include <com/sun/star/document/XEventListener.hpp>
 #endif
@@ -114,9 +127,16 @@
                             //,        
::com::sun::star::document::XStorageBasedDocument
                                                        >       
ODatabaseDocument_OfficeDocument; 
 
+typedef ::cppu::ImplHelper3<    ::com::sun::star::frame::XTitle
+                            ,  ::com::sun::star::frame::XTitleChangeBroadcaster
+                            ,  ::com::sun::star::frame::XUntitledNumbers
+                            >   ODatabaseDocument_Title;
+
 class ODatabaseDocument        :public ModelDependentComponent             // 
ModelDependentComponent must be first!
                         ,public ODatabaseDocument_OfficeDocument
+                        ,public ODatabaseDocument_Title
 {
+    DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< 
::com::sun::star::frame::XUntitledNumbers >,TNumberedController);
     ::com::sun::star::uno::Reference< 
::com::sun::star::ui::XUIConfigurationManager>   m_xUIConfigurationManager;
 
     ::cppu::OInterfaceContainerHelper                                          
                        m_aModifyListeners;
@@ -128,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;
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle >        
         m_xTitleHelper;
+    TNumberedController                                                        
         m_aNumberedControllers;
 
     void setMeAsParent(const ::com::sun::star::uno::Reference< 
::com::sun::star::container::XNameAccess >& _xName);
 
@@ -212,6 +234,10 @@
     // ModelDependentComponent overridables
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XInterface > getThis();
 
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle >        
     impl_getTitleHelper_throw();
+    ::com::sun::star::uno::Reference< 
::com::sun::star::frame::XUntitledNumbers >   impl_getUntitledHelper_throw(
+        const ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XInterface >& _xComponent = 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >());
+
 private:
        ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl);
     // Do NOT create those documents directly, always use 
ODatabaseModelImpl::getModel. Reason is that
@@ -242,6 +268,15 @@
        static ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XInterface >
                SAL_CALL Create(const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory >&);
 
+    // XInterface
+       virtual ::com::sun::star::uno::Any      SAL_CALL queryInterface(const 
::com::sun::star::uno::Type& _rType) throw 
(::com::sun::star::uno::RuntimeException);
+       virtual void SAL_CALL acquire(  ) throw ();
+       virtual void SAL_CALL release(  ) throw ();
+
+    // XTypeProvider
+       virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 
SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
+       virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 
getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
+
        // XEventListener
        virtual void SAL_CALL disposing( const 
::com::sun::star::lang::EventObject& Source ) 
throw(::com::sun::star::uno::RuntimeException);
 
@@ -318,6 +353,20 @@
     // XOfficeDatabaseDocument
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XDataSource > SAL_CALL getDataSource() throw 
(::com::sun::star::uno::RuntimeException);
 
+    // XTitle
+    virtual ::rtl::OUString SAL_CALL getTitle(  ) throw 
(::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw 
(::com::sun::star::uno::RuntimeException);
+
+    // XTitleChangeBroadcaster
+    virtual void SAL_CALL addTitleChangeListener( const 
::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener 
>& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL removeTitleChangeListener( const 
::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener 
>& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+    // XUntitledNumbers
+    virtual ::sal_Int32 SAL_CALL leaseNumber( const 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& 
xComponent ) throw (::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) throw 
(::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL releaseNumberForComponent( const 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& 
xComponent ) throw (::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::uno::RuntimeException);
+    virtual ::rtl::OUString SAL_CALL getUntitledPrefix(  ) throw 
(::com::sun::star::uno::RuntimeException);
+
     /** clears the given object container
 
         Clearing is done via disposal - the method calls XComponent::dispose 
at the given object,

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.50&r2=1.50.8.1
Delta lines:  +27 -17
---------------------
--- documentdefinition.cxx      2007-11-21 15:39:30+0000        1.50
+++ documentdefinition.cxx      2007-12-10 11:38:16+0000        1.50.8.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.cxx,v $
  *
- *  $Revision: 1.50 $
+ *  $Revision: 1.50.8.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:39:30 $
+ *  last change: $Author: oj $ $Date: 2007/12/10 11:38:16 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -81,6 +81,7 @@
 #ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
 #include <com/sun/star/frame/XModel.hpp>
 #endif
+#include <com/sun/star/frame/XTitle.hpp>
 #ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
 #include <com/sun/star/frame/XController.hpp>
 #endif
@@ -946,6 +947,8 @@
                     
xModule->setIdentifier(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.FormDesign")));
                                else if ( !xReportDefinition.is() )
                     
xModule->setIdentifier(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.TextReportDesign")));
+
+                updateDocumentTitle();
             }
 
             bool bIsAliveNewStyleReport = ( !m_bOpenInDesign && 
xReportDefinition.is() );
@@ -1204,6 +1207,8 @@
                                        aRequest.Name = DBACORE_RESSTRING( 
RID_STR_REPORT );
                                aRequest.Name = 
::dbtools::createUniqueName(xName,aRequest.Name);
                        }
+            else if ( xName->hasByName(aRequest.Name) )
+                aRequest.Name = 
::dbtools::createUniqueName(xName,aRequest.Name);
 
                        aRequest.Content.set(m_xParentContainer,UNO_QUERY);
                        OInteractionRequest* pRequest = new 
OInteractionRequest(makeAny(aRequest));
@@ -1272,8 +1277,7 @@
 namespace
 {
     // 
.........................................................................
-    void    lcl_putLoadArgs( ::comphelper::NamedValueCollection& _io_rArgs, 
const bool _bSuppressMacros, const bool _bReadOnly,
-        const ::rtl::OUString& _rDocTitle )
+    void    lcl_putLoadArgs( ::comphelper::NamedValueCollection& _io_rArgs, 
const bool _bSuppressMacros, const bool _bReadOnly)
     {
         if ( _bSuppressMacros )
         {
@@ -1290,11 +1294,6 @@
         }
 
         _io_rArgs.put( "ReadOnly", _bReadOnly );
-
-        if ( _rDocTitle.getLength() )
-           {
-            _io_rArgs.put( "DocumentTitle", _rDocTitle );
-           }
     }
 }
 
@@ -1314,7 +1313,7 @@
         aMediaDesc.put( "ComponentData", aDocumentContext );
        }
 
-    lcl_putLoadArgs( aMediaDesc, _bSuppressMacros, _bReadOnly, 
m_pImpl->m_aProps.aTitle );
+    lcl_putLoadArgs( aMediaDesc, _bSuppressMacros, _bReadOnly);
 
        if ( m_pInterceptor )
        {
@@ -1491,7 +1490,7 @@
                Sequence<PropertyValue> aArgs = xModel->getArgs();
 
         ::comphelper::NamedValueCollection aMediaDesc( aArgs );
-        lcl_putLoadArgs( aMediaDesc, _bSuppressMacros, _bReadOnly, 
m_pImpl->m_aProps.aTitle );
+        lcl_putLoadArgs( aMediaDesc, _bSuppressMacros, _bReadOnly);
 
                aMediaDesc >>= aArgs;
                xModel->attachResource( xModel->getURL(), aArgs );
@@ -1686,9 +1685,21 @@
 // 
-----------------------------------------------------------------------------
 void ODocumentDefinition::updateDocumentTitle()
 {
-       if ( m_pImpl->m_aProps.aTitle.getLength() )
+    ::rtl::OUString sName = m_pImpl->m_aProps.aTitle;
+    if ( !sName.getLength() )
        {
-               Reference<XModel> xModel(getComponent(),UNO_QUERY);
+        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< 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();
@@ -1696,8 +1707,7 @@
             aHelper[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"DocumentTitle" ) )] <<= m_pImpl->m_aProps.aTitle;
                        aHelper >> aArgs;
                        xModel->attachResource(xModel->getURL(),aArgs);
-               }
-       }
+               }*/
 }
 //........................................................................
 }      // namespace dbaccess




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

Reply via email to