Tag: cws_src680_dba203a
User: fs      
Date: 06/03/20 05:44:50

Modified:
 /dba/connectivity/source/drivers/mozab/
  MConnection.cxx, MConnection.hxx

Log:
 #i10000# unxlngi6's boost requires RTTI for boost::shared_ptr, which is 
disabled in mozillasrc sub folder -> move the usage to an impl-structure, away 
from the declaration in the header

File Changes:

Directory: /dba/connectivity/source/drivers/mozab/
==================================================

File [changed]: MConnection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MConnection.cxx?r1=1.19.74.1&r2=1.19.74.2
Delta lines:  +29 -6
--------------------
--- MConnection.cxx     17 Mar 2006 15:37:54 -0000      1.19.74.1
+++ MConnection.cxx     20 Mar 2006 13:44:47 -0000      1.19.74.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: MConnection.cxx,v $
  *
- *  $Revision: 1.19.74.1 $
+ *  $Revision: 1.19.74.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/03/17 15:37:54 $
+ *  last change: $Author: fs $ $Date: 2006/03/20 13:44:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -60,6 +60,12 @@
 #include <connectivity/dbexception.hxx>
 #endif
 
+#ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
+#include <comphelper/officeresourcebundle.hxx>
+#endif
+
+#include <boost/shared_ptr.hpp>
+
 #if OSL_DEBUG_LEVEL > 0
 # define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), 
RTL_TEXTENCODING_ASCII_US).getStr())
 #else /* OSL_DEBUG_LEVEL */
@@ -83,6 +89,19 @@
 using namespace com::sun::star::sdbcx;
 // 
--------------------------------------------------------------------------------
 
+namespace connectivity
+{
+    namespace mozab
+    {
+        // 
=====================================================================
+        // = ConnectionImplData
+        // 
=====================================================================
+        struct ConnectionImplData
+        {
+            ::boost::shared_ptr< ::comphelper::OfficeResourceBundle >   
pResourceBundle;
+        };
+    }
+}
 
 
 // 
-----------------------------------------------------------------------------
@@ -126,6 +145,7 @@
     :OSubComponent<OConnection, 
OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this)
     ,m_xMetaData(NULL)
     ,m_pDriver(_pDriver)
+    ,m_pImplData( new ConnectionImplData )
     ,m_nMaxResultRecords( -1 )
     ,m_aNameMapper(NULL)
     ,m_eSDBCAddressType(SDBCAddress::Unknown)
@@ -139,7 +159,7 @@
             xFactoryProps->getPropertyValue( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
             UNO_QUERY_THROW
         );
-        m_pResourceBundle.reset( new ::comphelper::OfficeResourceBundle( 
xContext, "cnr" ) );
+        m_pImplData->pResourceBundle.reset( new 
::comphelper::OfficeResourceBundle( xContext, "cnr" ) );
     }
     catch( const Exception& )
     {
@@ -534,7 +554,7 @@
        // we noticed that we should be destroied in near future so we have to 
dispose our statements
        ::osl::MutexGuard aGuard(m_aMutex);
 
-    m_pResourceBundle.reset();
+    m_pImplData->pResourceBundle.reset();
 
        for (OWeakRefArray::iterator i = m_aStatements.begin(); 
m_aStatements.end() != i; ++i)
        {
@@ -583,8 +603,11 @@
 
 void OConnection::throwGenericSQLException( sal_Int32 _nErrorResourceId )
 {
-    ::boost::shared_ptr< ::comphelper::OfficeResourceBundle > pResourceBundle( 
m_pResourceBundle );
-        // to prevent multithreading problems
+    ::boost::shared_ptr< ::comphelper::OfficeResourceBundle > pResourceBundle;
+    {
+        ::osl::MutexGuard aGuard( m_aMutex );
+        pResourceBundle = m_pImplData->pResourceBundle;
+    }
 
     OSL_ENSURE( pResourceBundle.get(), "OConnection::throwGenericSQLException: 
no resource bundle?" );
         // this means that we're disposed, and how could anybody request us to 
throw an exception then?

File [changed]: MConnection.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MConnection.hxx?r1=1.13.76.1&r2=1.13.76.2
Delta lines:  +8 -8
-------------------
--- MConnection.hxx     17 Mar 2006 15:37:55 -0000      1.13.76.1
+++ MConnection.hxx     20 Mar 2006 13:44:47 -0000      1.13.76.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: MConnection.hxx,v $
  *
- *  $Revision: 1.13.76.1 $
+ *  $Revision: 1.13.76.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/03/17 15:37:55 $
+ *  last change: $Author: fs $ $Date: 2006/03/20 13:44:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -66,14 +66,11 @@
 #ifndef _CPPUHELPER_WEAKREF_HXX_
 #include <cppuhelper/weakref.hxx>
 #endif
-#ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
-#include <comphelper/officeresourcebundle.hxx>
-#endif
 #ifndef _COM_SUN_STAR_MOZILLA_MOZILLPRODUCTTYPE_HPP_
 #include <com/sun/star/mozilla/MozillaProductType.hpp>
 #endif
 
-#include <boost/shared_ptr.hpp>
+#include <memory>
 
 namespace connectivity
 {
@@ -112,6 +109,7 @@
 
                typedef connectivity::OMetaConnection                           
OConnection_BASE; // implements basics and text encoding
 
+        struct ConnectionImplData;
                class OConnection : public OConnection_BASE,
                                                        public 
connectivity::OSubComponent<OConnection, OConnection_BASE>
                {
@@ -131,8 +129,10 @@
                                                                                
                                //  an operation
                        MozabDriver*                                            
        m_pDriver;              //      Pointer to the owning
                                                                                
                                                        //  driver object
-            ::boost::shared_ptr< ::comphelper::OfficeResourceBundle >
-                                                    m_pResourceBundle;
+            ::std::auto_ptr< ConnectionImplData >   m_pImplData;
+                // This is to be able to hold a boost::shared_ptr. If we would 
hold it as member, it would
+                // not compile the mozillasrc directory, since this directory 
is compiled without RTTI support
+                // and boost seems to require RTTI on some platforms.
             // Store Catalog
             ::com::sun::star::uno::Reference< 
::com::sun::star::sdbcx::XTablesSupplier>                        m_xCatalog;
                        // Start of Additions from the land of mozilla




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

Reply via email to