Anonymous avatar Anonymous committed dec7da5

CWS-TOOLING: integrate CWS dba32h
2009-10-12 12:21:44 +0200 msc r276827 : remove warning for issue 102712 because the issue is fixed
2009-10-05 07:14:20 +0200 oj r276658 : #105585# add missing dependency for OOO_UI
2009-10-02 12:50:19 +0200 fs r276632 : #i105505#
If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized.
In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl
call attachResource. This ensures that the model is initialized completely, including firing the necessary
events.
2009-10-02 12:46:12 +0200 fs r276631 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document
2009-10-01 13:09:07 +0200 fs r276596 : do not rely on the name 'Standard' for the one and only form in a document
2009-10-01 12:35:56 +0200 fs r276589 : #i105509# don't rely on default form component names, use indexes
2009-10-01 11:19:18 +0200 fs r276584 : copying the fix for #i105082# into this CWS
2009-10-01 11:13:22 +0200 fs r276583 : improved logs
2009-10-01 11:10:44 +0200 fs r276581 : #i105505#
2009-10-01 08:07:57 +0200 fs r276575 : manual merge of trunk, to allow cwslocalize to run
2009-09-30 22:48:30 +0200 fs r276574 : removed that strange ONLOAD definition
2009-09-30 12:58:18 +0200 fs r276553 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 12:56:45 +0200 fs r276552 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS
2009-09-30 11:47:45 +0200 fs r276549 : #i105235#
2009-09-29 12:27:40 +0200 fs r276521 : #i105367#
2009-09-28 12:08:17 +0200 oj r276485 : #i105371# export version in manifest.xml as well
2009-09-28 12:07:02 +0200 oj r276484 : #i105371# export version in manifest.xml as well
2009-09-28 09:48:01 +0200 oj r276481 : #i105366# init drivers when not empty
2009-09-25 14:31:27 +0200 fs r276466 : CWS-TOOLING: rebase CWS dba32h to trunk@276429 (milestone: DEV300:m60)
2009-09-24 13:52:54 +0200 fs r276422 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document)
2009-09-24 11:42:03 +0200 fs r276413 : #i105234# proper zoom handling for the nav bar
2009-09-24 11:41:40 +0200 fs r276412 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double
2009-09-23 12:21:22 +0200 oj r276377 : remove dos lineends
2009-09-23 11:44:52 +0200 oj r276376 : #i105216# load config on demand
2009-09-23 11:44:19 +0200 oj r276375 : #i105216# load config on demand
2009-09-23 11:43:35 +0200 oj r276374 : #i105216# load config on demand
2009-09-21 09:13:03 +0200 oj r276307 : #i105158# use Thread support
2009-09-18 13:06:50 +0200 fs r276277 : #i105147#
2009-09-18 11:48:23 +0200 oj r276271 : #i105158# new method for thread safety
2009-09-18 10:42:56 +0200 fs r276266 : CWS-TOOLING: rebase CWS dba32h to trunk@276192 (milestone: DEV300:m59)
2009-09-18 08:30:03 +0200 oj r276263 : #i105016# load correct ldap so
2009-09-17 13:42:31 +0200 oj r276240 : change count of check boxes
2009-09-17 13:32:59 +0200 oj r276239 : revert false to true for currency
2009-09-17 09:14:46 +0200 oj r276220 : #i104901# add patch for every issue
2009-09-17 09:10:29 +0200 oj r276219 : #i104901# add patch for every issue
2009-09-11 13:47:49 +0200 oj r276060 : #i104901# fix for indentity
2009-09-11 12:14:14 +0200 fs r276056 : #i104594# allow to render controls without an SdrPageView
2009-09-11 11:49:31 +0200 fs r276055 : CWS-TOOLING: rebase CWS dba32h to trunk@276043 (milestone: DEV300:m58)
2009-09-10 08:41:40 +0200 oj r276021 : #i104911# export variable-set not for repeating sections

Comments (0)

Files changed (39)

connectivity/inc/connectivity/DriversConfig.hxx

-/*************************************************************************
- *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: makefile,v $
- *
- *  $Revision: 1.1 $
- *
- *  last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
-#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
-
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include "connectivity/dbtoolsdllapi.hxx"
-#include <salhelper/singletonref.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <unotools/confignode.hxx>
-
-namespace connectivity
-{
-    typedef struct
-    {
-        ::comphelper::NamedValueCollection aProperties;
-        ::comphelper::NamedValueCollection aFeatures;
-        ::comphelper::NamedValueCollection aMetaData;
-        ::rtl::OUString sDriverFactory;
-        ::rtl::OUString sDriverTypeDisplayName;
-    } TInstalledDriver;
-    DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
-
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: makefile,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+#ifndef CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <salhelper/singletonref.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <unotools/confignode.hxx>
+
+namespace connectivity
+{
+    typedef struct
+    {
+        ::comphelper::NamedValueCollection aProperties;
+        ::comphelper::NamedValueCollection aFeatures;
+        ::comphelper::NamedValueCollection aMetaData;
+        ::rtl::OUString sDriverFactory;
+        ::rtl::OUString sDriverTypeDisplayName;
+    } TInstalledDriver;
+    DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
+
     class DriversConfigImpl
     {
-        ::utl::OConfigurationTreeRoot m_aInstalled;
+        mutable ::utl::OConfigurationTreeRoot   m_aInstalled;
+        mutable TInstalledDrivers       m_aDrivers;
+        void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) const;
     public:
         DriversConfigImpl();
-        void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers);
-    };
-    //
-    // Allows to access all driver which are located in the configuration
-    //
-    class OOO_DLLPUBLIC_DBTOOLS DriversConfig
-    {
-        typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
-        
-        const ::comphelper::NamedValueCollection& impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const;
-    public:
-        DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
-        ~DriversConfig();
-
-        DriversConfig( const DriversConfig& );
-        DriversConfig& operator=( const DriversConfig& );
-
-        ::rtl::OUString getDriverFactoryName(const ::rtl::OUString& _sUrl) const;
-        ::rtl::OUString getDriverTypeDisplayName(const ::rtl::OUString& _sUrl) const;
-        const ::comphelper::NamedValueCollection& getProperties(const ::rtl::OUString& _sURL) const;
-        const ::comphelper::NamedValueCollection& getFeatures(const ::rtl::OUString& _sURL) const;
-        const ::comphelper::NamedValueCollection& getMetaData(const ::rtl::OUString& _sURL) const;
-        ::com::sun::star::uno::Sequence< ::rtl::OUString > getURLs() const;
-    private:
-        TInstalledDrivers   m_aDrivers;
-        OSharedConfigNode   m_aNode;
-    };
-}
-#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+        
+        const TInstalledDrivers& getInstalledDrivers(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) const { Load(_rxORB); return m_aDrivers; }
+    };
+    //
+    // Allows to access all driver which are located in the configuration
+    //
+    class OOO_DLLPUBLIC_DBTOOLS DriversConfig
+    {
+        typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
+        
+        const ::comphelper::NamedValueCollection& impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const;
+    public:
+        DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+        ~DriversConfig();
+
+        DriversConfig( const DriversConfig& );
+        DriversConfig& operator=( const DriversConfig& );
+
+        ::rtl::OUString getDriverFactoryName(const ::rtl::OUString& _sUrl) const;
+        ::rtl::OUString getDriverTypeDisplayName(const ::rtl::OUString& _sUrl) const;
+        const ::comphelper::NamedValueCollection& getProperties(const ::rtl::OUString& _sURL) const;
+        const ::comphelper::NamedValueCollection& getFeatures(const ::rtl::OUString& _sURL) const;
+        const ::comphelper::NamedValueCollection& getMetaData(const ::rtl::OUString& _sURL) const;
+        ::com::sun::star::uno::Sequence< ::rtl::OUString > getURLs() const;
+    private:
+        OSharedConfigNode   m_aNode;
+        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
+    };
+}
+#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED

connectivity/inc/connectivity/dbmetadata.hxx

         /** determines whether in the application UI, empty table folders (aka catalogs/schemas) should be displayed
         */
         bool displayEmptyTableFolders() const;
+
+        /** determines that threads are supported.
+        *
+        * \return <TRUE/> when threads are supported, otherwise <FALSE/>
+        */
+        bool supportsThreads() const;
 	};
 
 //........................................................................

connectivity/source/commontools/DriversConfig.cxx

     }
 }
 // -----------------------------------------------------------------------------
-DriversConfigImpl::DriversConfigImpl()
+DriversConfigImpl::DriversConfigImpl() 
 {
 }
 // -----------------------------------------------------------------------------
-void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers)
+void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB) const
 {
-    if ( !m_aInstalled.isValid() )
+    if ( m_aDrivers.empty() )
     {
-        static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
-        m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
+        if ( !m_aInstalled.isValid() )
+        {
+            static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
+            m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
+        }
+
+	    if ( m_aInstalled.isValid() )
+	    {
+            const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
+		    const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
+		    const ::rtl::OUString* pPatternEnd  = pPatternIter + aURLPatterns.getLength();
+		    for (;pPatternIter != pPatternEnd ; ++pPatternIter)
+		    {
+                TInstalledDriver aInstalledDriver;
+                lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
+                if ( aInstalledDriver.sDriverFactory.getLength() )
+                    m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
+		    }
+	    } // if ( m_aInstalled.isValid() )
     }
-
-	if ( m_aInstalled.isValid() )
-	{
-        const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
-		const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
-		const ::rtl::OUString* pPatternEnd  = pPatternIter + aURLPatterns.getLength();
-		for (;pPatternIter != pPatternEnd ; ++pPatternIter)
-		{
-            TInstalledDriver aInstalledDriver;
-            lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
-            if ( aInstalledDriver.sDriverFactory.getLength() )
-                _rDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
-		}
-	}
 }
 // -----------------------------------------------------------------------------
 DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >& _rxORB)
+:m_xORB(_rxORB)
 {
-    m_aNode->Load(_rxORB,m_aDrivers);
 }
 
 // -----------------------------------------------------------------------------
 {
     if ( this != &_rhs )
     {
-        m_aDrivers = _rhs.m_aDrivers;
         m_aNode = _rhs.m_aNode;
     }
     return *this;
 // -----------------------------------------------------------------------------
 ::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
 {
+    const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
     ::rtl::OUString sRet;
     ::rtl::OUString sOldPattern;
-    TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
-    TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+    TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+    TInstalledDrivers::const_iterator aEnd = rDrivers.end();
     for(;aIter != aEnd;++aIter)
     {
         WildCard aWildCard(aIter->first);
 // -----------------------------------------------------------------------------
 ::rtl::OUString DriversConfig::getDriverTypeDisplayName(const ::rtl::OUString& _sURL) const
 {
+    const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
     ::rtl::OUString sRet;
     ::rtl::OUString sOldPattern;
-    TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
-    TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+    TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+    TInstalledDrivers::const_iterator aEnd = rDrivers.end();
     for(;aIter != aEnd;++aIter)
     {
         WildCard aWildCard(aIter->first);
 // -----------------------------------------------------------------------------
 const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const
 {
+    const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);    
     const ::comphelper::NamedValueCollection* pRet = NULL;
     ::rtl::OUString sOldPattern;
-    TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
-    TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+    TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+    TInstalledDrivers::const_iterator aEnd = rDrivers.end();
     for(;aIter != aEnd;++aIter)
     {
         WildCard aWildCard(aIter->first);
 // -----------------------------------------------------------------------------
 uno::Sequence< ::rtl::OUString > DriversConfig::getURLs() const
 {
-    uno::Sequence< ::rtl::OUString > aRet(m_aDrivers.size());
+    const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
+    uno::Sequence< ::rtl::OUString > aRet(rDrivers.size());
     ::rtl::OUString* pIter = aRet.getArray();
-    TInstalledDrivers::const_iterator aIter = m_aDrivers.begin();
-    TInstalledDrivers::const_iterator aEnd = m_aDrivers.end();
+    TInstalledDrivers::const_iterator aIter = rDrivers.begin();
+    TInstalledDrivers::const_iterator aEnd = rDrivers.end();
     for(;aIter != aEnd;++aIter,++pIter)
     {
         *pIter = aIter->first;

connectivity/source/commontools/dbmetadata.cxx

 #endif
         return doDisplay;
     }
+    //--------------------------------------------------------------------
+    bool DatabaseMetaData::supportsThreads() const
+    {
+        bool bSupported( true );
+        try
+        {
+            Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
+            ::rtl::OUString sConnectionURL( xMeta->getURL() );
+            bSupported = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) != 0;
+        }
+        catch( const Exception& )
+        {
+        	DBG_UNHANDLED_EXCEPTION();
+        }
+        return bSupported;
+    }
 
 //........................................................................
 } // namespace dbtools

connectivity/source/drivers/jdbc/jdbc.xcu

       <node oor:name="Properties">
         <node oor:name="IgnoreCurrency" oor:op="replace">
           <prop oor:name="Value" oor:type="xs:boolean">
-            <value>false</value>
+            <value>true</value>
           </prop>
         </node>
         <node oor:name="TypeInfoSettings" oor:op="replace">

dbaccess/qa/complex/dbaccess/DatabaseDocument.java

 public class DatabaseDocument extends TestCase implements com.sun.star.document.XDocumentEventListener
 {
 
-    private static final String ONLOAD = "OnLoad";
     private static final String _BLANK = "_blank";
     private XComponent m_callbackFactory = null;
     private final ArrayList m_documentEvents = new ArrayList();
         final String macroURI = "vnd.sun.star.script:EventHandlers.all.OnLoad?language=Basic&location=document";
         final XEventsSupplier eventsSupplier = (XEventsSupplier) UnoRuntime.queryInterface(XEventsSupplier.class,
                 databaseDoc);
-        eventsSupplier.getEvents().replaceByName(ONLOAD, new PropertyValue[]
+        eventsSupplier.getEvents().replaceByName("OnLoad", new PropertyValue[]
                 {
                     new PropertyValue("EventType", 0, "Script", PropertyState.DIRECT_VALUE),
                     new PropertyValue("Script", 0, macroURI, PropertyState.DIRECT_VALUE)
         // here) is called before the OnLoad notification is received - since the latter happens from within
         // a Basic macro which is bound to the OnLoad event of the document.
 
-        final String context = ONLOAD;
+        final String context = "OnLoad";
         impl_startObservingEvents(context);
         databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
                 loader.loadComponentFromURL(documentURL, _BLANK, 0, impl_getMacroExecLoadArgs()));
         impl_stopObservingEvents(m_documentEvents, new String[]
                 {
-                    ONLOAD
+                    "OnLoad"
                 }, context);
 
         assureEquals("our provided interaction handler was not called", STATE_ON_LOAD_RECEIVED, m_loadDocState);
         impl_stopObservingEvents(m_globalEvents,
                 new String[]
                 {
-                    "OnLoadFinished", "OnViewCreated", "OnFocus", ONLOAD
+                    "OnLoadFinished", "OnViewCreated", "OnFocus", "OnLoad"
                 }, context);
 
         // closing a document by API
         impl_startObservingEvents("prepare for '" + context + "'");
         databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
                 loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs()));
-        impl_waitForEvent(m_globalEvents, ONLOAD, 5000);
+        impl_waitForEvent(m_globalEvents, "OnLoad", 5000);
         // wait for all events to arrive - OnLoad should be the last one
 
         final XDispatchProvider dispatchProvider = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class,
         impl_startObservingEvents("prepare for '" + context + "'");
         databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
                 loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs()));
-        final int previousOnLoadEventPos = impl_waitForEvent(m_globalEvents, ONLOAD, 5000);
+        final int previousOnLoadEventPos = impl_waitForEvent(m_globalEvents, "OnLoad", 5000);
         // ... and another document ...
         final String otherURL = copyToTempFile(databaseDoc.getURL());
         final XModel otherDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
                 loader.loadComponentFromURL(otherURL, _BLANK, 0, impl_getDefaultLoadArgs()));
-        impl_waitForEvent(m_globalEvents, ONLOAD, 5000, previousOnLoadEventPos + 1);
+        impl_waitForEvent(m_globalEvents, "OnLoad", 5000, previousOnLoadEventPos + 1);
         impl_raise(otherDoc);
 
         // ... and switch between the two
     // --------------------------------------------------------------------------------------------------------
     private void impl_startObservingEvents(String _context)
     {
-        log.println(" " + _context);
+        log.println(" " + _context + " {");
         synchronized (m_documentEvents)
         {
             m_documentEvents.clear();
     // --------------------------------------------------------------------------------------------------------
     private void impl_stopObservingEvents(ArrayList _actualEvents, String[] _expectedEvents, String _context)
     {
-        synchronized (_actualEvents)
+        try
         {
-            int actualEventCount = _actualEvents.size();
-            while (actualEventCount < _expectedEvents.length)
+            synchronized (_actualEvents)
             {
-                // well, it's possible not all events already arrived, yet - finally, some of them
-                // are notified asynchronously
-                // So, wait a few seconds.
-                try
+                int actualEventCount = _actualEvents.size();
+                while (actualEventCount < _expectedEvents.length)
                 {
-                    _actualEvents.wait(5000);
-                }
-                catch (InterruptedException ex)
-                {
+                    // well, it's possible not all events already arrived, yet - finally, some of them
+                    // are notified asynchronously
+                    // So, wait a few seconds.
+                    try
+                    {
+                        _actualEvents.wait(5000);
+                    }
+                    catch (InterruptedException ex)
+                    {
+                    }
+
+                    if (actualEventCount == _actualEvents.size())
+                    // the above wait was left because of the timeout, *not* because an event
+                    // arrived. Okay, we won't wait any longer, this is a failure.
+                    {
+                        break;
+                    }
+                    actualEventCount = _actualEvents.size();
                 }
 
-                if (actualEventCount == _actualEvents.size())
-                // the above wait was left because of the timeout, *not* because an event
-                // arrived. Okay, we won't wait any longer, this is a failure.
+                assureEquals("wrong event count for '" + _context + "'",
+                        _expectedEvents.length, _actualEvents.size());
+
+                for (int i = 0; i < _expectedEvents.length; ++i)
                 {
-                    break;
+                    assureEquals("wrong event at positon " + (i + 1) + " for '" + _context + "'",
+                            _expectedEvents[i], _actualEvents.get(i));
                 }
-                actualEventCount = _actualEvents.size();
             }
-
-            assureEquals("wrong event count for '" + _context + "'",
-                    _expectedEvents.length, _actualEvents.size());
-
-            for (int i = 0; i < _expectedEvents.length; ++i)
-            {
-                assureEquals("wrong event at positon " + (i + 1) + " for '" + _context + "'",
-                        _expectedEvents[i], _actualEvents.get(i));
-            }
+        }
+        finally
+        {
+            log.println(" }");
         }
     }
 
             return;
         }
 
-        if ((_Event.EventName.equals(ONLOAD)) && (m_loadDocState != STATE_NOT_STARTED))
+        if ((_Event.EventName.equals("OnLoad")) && (m_loadDocState != STATE_NOT_STARTED))
         {
             assureEquals("OnLoad event must come *after* invocation of the interaction handler / user!",
                     m_loadDocState, STATE_MACRO_EXEC_APPROVED);

dbaccess/source/core/dataaccess/ModelImpl.cxx

     OSL_PRECOND( !xModel.is(), "ODatabaseModelImpl::createNewModel_deliverOwnership: not to be called if there already is a model!" );
 	if ( !xModel.is() )
     {
+        bool bHadModelBefore = m_bDocumentInitialized;
+
         xModel = ODatabaseDocument::createDatabaseDocument( this, ODatabaseDocument::FactoryAccess() );
         m_xModel = xModel;
 
             DBG_UNHANDLED_EXCEPTION();
         }
 
+        if ( bHadModelBefore )
+        {
+            // do an attachResources
+            // In case the document is loaded regularly, this is not necessary, as our loader will do it.
+            // However, in case that the document is implicitly created by asking the data source for the document,
+            // then nobody would call the doc's attachResource. So, we do it here, to ensure it's in a proper
+            // state, fires all events, and so on.
+            // #i105505# / 2009-10-02 / frank.schoenheit@sun.com
+            xModel->attachResource( xModel->getURL(), m_aArgs );
+        }
+
         if ( _bInitialize )
         {
             try

dbaccess/source/core/dataaccess/databasedocument.cxx

     // #i94840#
     if ( m_pImpl->hadInitializedDocument() )
     {
-        impl_setInitialized();
-        m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
+        // Note we set our init-state to "Initializing", not "Initialized". We're created from inside the ModelImpl,
+        // which is expected to call attachResource in case there was a previous incarnation of the document,
+        // so we can properly finish our initialization then.
+        impl_setInitializing();
+
+        if ( m_pImpl->getURL().getLength() )
+        {
+            // if the previous incarnation of the DatabaseDocument already had an URL, then creating this incarnation
+            // here is effectively loading the document.
+            m_aViewMonitor.onLoadedDocument();
+        }
     }
 }
 
         // should know this before anybody actually uses the object.
         m_bAllowDocumentScripting = ( m_pImpl->determineEmbeddedMacros() != ODatabaseModelImpl::eSubDocumentMacros );
 
+        aGuard.clear();
+        // <- SYNCHRONIZED
         m_aEventNotifier.notifyDocumentEvent( "OnLoadFinished" );
     }
 
     if ( aSaveOpt.IsSaveRelFSys() )
         xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(_rMediaDescriptor.getOrDefault("URL",::rtl::OUString())));
 
+    ::rtl::OUString aVersion;
+    SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion();
+
+    // older versions can not have this property set, it exists only starting from ODF1.2
+    if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
+        aVersion = ODFVER_012_TEXT;
+
+    if ( aVersion.getLength() )
+    {
+        try
+        {
+            xInfoSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Version" )), uno::makeAny( aVersion ) );
+        }
+        catch( uno::Exception& )
+        {
+        }
+    }
+
     sal_Int32 nArgsLen = aDelegatorArguments.getLength();
     aDelegatorArguments.realloc(nArgsLen+1);
     aDelegatorArguments[nArgsLen++] <<= xInfoSet;

dbaccess/source/core/misc/dsntypes.cxx

 #include "core_resource.hxx"
 #include "core_resource.hrc"
 #include <comphelper/documentconstants.hxx>
-#include <connectivity/DriversConfig.hxx>
+
 //.........................................................................
 namespace dbaccess
 {
 DBG_NAME(ODsnTypeCollection)
 //-------------------------------------------------------------------------
 ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory)
-:m_xFactory(_xFactory)
+:m_aDriverConfig(_xFactory)
+,m_xFactory(_xFactory)
 #ifdef DBG_UTIL
 ,m_nLivingIterators(0)
 #endif
 {
 	DBG_CTOR(ODsnTypeCollection,NULL);
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const uno::Sequence< ::rtl::OUString > aURLs = aDriverConfig.getURLs();
+    const uno::Sequence< ::rtl::OUString > aURLs = m_aDriverConfig.getURLs();
     const ::rtl::OUString* pIter = aURLs.getConstArray();
     const ::rtl::OUString* pEnd = pIter + aURLs.getLength();
     for(;pIter != pEnd;++pIter )
     {
         m_aDsnPrefixes.push_back(*pIter);
-        m_aDsnTypesDisplayNames.push_back(aDriverConfig.getDriverTypeDisplayName(*pIter));
+        m_aDsnTypesDisplayNames.push_back(m_aDriverConfig.getDriverTypeDisplayName(*pIter));
     }
 
 	DBG_ASSERT(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(),
 //-------------------------------------------------------------------------
 String ODsnTypeCollection::getTypeDisplayName(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    return aDriverConfig.getDriverTypeDisplayName(_sURL);
+    return m_aDriverConfig.getDriverTypeDisplayName(_sURL);
 }
 //-------------------------------------------------------------------------
 String ODsnTypeCollection::cutPrefix(const ::rtl::OUString& _sURL) const
 // -----------------------------------------------------------------------------
 String ODsnTypeCollection::getMediaType(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("MediaType",::rtl::OUString());
 }
 // -----------------------------------------------------------------------------
 String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const ::rtl::OUString& _sMediaType,const ::rtl::OUString& _sExtension)
 {
     String sURL;
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const uno::Sequence< ::rtl::OUString > aURLs = aDriverConfig.getURLs();
+    const uno::Sequence< ::rtl::OUString > aURLs = m_aDriverConfig.getURLs();
     const ::rtl::OUString* pIter = aURLs.getConstArray();
     const ::rtl::OUString* pEnd = pIter + aURLs.getLength();
     for(;pIter != pEnd;++pIter )
     {
-        const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(*pIter);
+        const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(*pIter);
         if ( aFeatures.getOrDefault("MediaType",::rtl::OUString()) == _sMediaType )
         {
             const ::rtl::OUString sFileExtension = aFeatures.getOrDefault("Extension",::rtl::OUString());
 // -----------------------------------------------------------------------------
 String ODsnTypeCollection::getJavaDriverClass(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getProperties(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getProperties(_sURL);
     return aFeatures.getOrDefault("JavaDriverClass",::rtl::OUString());
 }
 //-------------------------------------------------------------------------
 sal_Bool ODsnTypeCollection::isFileSystemBased(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("FileSystemBased",sal_False);
 }
 // -----------------------------------------------------------------------------
 sal_Bool ODsnTypeCollection::supportsTableCreation(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("SupportsTableCreation",sal_False);
 }
 // -----------------------------------------------------------------------------
 sal_Bool ODsnTypeCollection::supportsBrowsing(const ::rtl::OUString& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("SupportsBrowsing",sal_False);
 }
 // -----------------------------------------------------------------------------
 bool ODsnTypeCollection::needsJVM(const String& _sURL) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("UseJava",sal_False);
 }
 // -----------------------------------------------------------------------------
 Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( const ::rtl::OUString& _sURL ) const
 {
-    ::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aProperties = aDriverConfig.getProperties(_sURL);
+    const ::comphelper::NamedValueCollection& aProperties = m_aDriverConfig.getProperties(_sURL);
     return aProperties.getPropertyValues();
 }
 
 // -----------------------------------------------------------------------------
 String ODsnTypeCollection::getTypeExtension(const ::rtl::OUString& _sURL) const
 {
-	::connectivity::DriversConfig aDriverConfig(m_xFactory);
-    const ::comphelper::NamedValueCollection& aFeatures = aDriverConfig.getMetaData(_sURL);
+    const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
     return aFeatures.getOrDefault("Extension",::rtl::OUString());
 }
 //-------------------------------------------------------------------------

dbaccess/source/filter/xml/dbloader2.cxx

         return;
     }
 
-    if ( !bCreateNew && !xModel->getURL().getLength() )
-	{
+    if ( !bCreateNew )
+    {
+        // We need to XLoadable::load the document if it does not yet have an URL.
+        // If it already *does* have an URL, then it was either passed in the arguments, or a previous incarnation
+        // of that model existed before (which can happen if a model is closed, but an associated DataSource is kept
+        // alive 'til loading the document again).
+        bool bNeedLoad = ( xModel->getURL().getLength() == 0 );
 		try
 		{
             aMediaDesc.put( "FileName", _rURL );
-            Reference< XLoadable > xLoad( xModel, UNO_QUERY_THROW );
+            Sequence< PropertyValue > aResource( aMediaDesc.getPropertyValues() );
 
-            Sequence< PropertyValue > aResource( aMediaDesc.getPropertyValues() );
-            xLoad->load( aResource );
+            if ( bNeedLoad )
+            {
+                Reference< XLoadable > xLoad( xModel, UNO_QUERY_THROW );
+                xLoad->load( aResource );
+            }
+
+            // always attach the resource, even if the document has not been freshly loaded
             xModel->attachResource( _rURL, aResource );
 		}
 		catch(const Exception&)

dbaccess/source/inc/dsntypes.hxx

 #include <comphelper/stl_types.hxx>
 #include "dbadllapi.hxx"
 #include <tools/string.hxx>
+#include <connectivity/DriversConfig.hxx>
 
 //.........................................................................
 namespace dbaccess
 
 	StringVector	m_aDsnTypesDisplayNames;	/// user readable names for the datasource types
 	StringVector	m_aDsnPrefixes;				/// DSN prefixes which determine the type of a datasource
+    ::connectivity::DriversConfig m_aDriverConfig;
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
 
 #ifdef DBG_UTIL

dbaccess/source/ui/dlg/advancedsettings.hrc

 #ifndef DBAUI_ADVANCEDSETTINGS_HRC
 #define DBAUI_ADVANCEDSETTINGS_HRC
 
-#define ADVANCED_CHECKBOX_OPTIONS    13
+#define ADVANCED_CHECKBOX_OPTIONS    14
 #define ADVANCED_LISTBOX_OPTIONS      1
 
 #define ADVANCED_PAGE_X		200

dbaccess/source/ui/dlg/generalpage.cxx

                 // page
                 _inout_rDisplayName = String();
                 break;
-            case ::dbaccess::DST_MYSQL_NATIVE_DIRECT:
-                // do not display the Connector/OOo driver itself, it is always wrapped via the MySQL-Driver, if
-                // this driver is installed
-                if ( m_pCollection->hasDriver( "sdbc:mysql:mysqlc:" ) )
-                    _inout_rDisplayName = String();
-                break;
             default:
                 break;
             }
         }
 
+        if ( eType == ::dbaccess::DST_MYSQL_NATIVE_DIRECT )
+        {
+            // do not display the Connector/OOo driver itself, it is always wrapped via the MySQL-Driver, if
+            // this driver is installed
+            if ( m_pCollection->hasDriver( "sdbc:mysql:mysqlc:" ) )
+                _inout_rDisplayName = String();
+        }
+
         if ( eType ==  ::dbaccess::DST_EMBEDDED_HSQLDB )
             _inout_rDisplayName = String();
 

dbaccess/source/ui/relationdesign/RTableConnectionData.cxx

 
 	// get the name of foreign key // search for columns
 	m_aConnName = ::rtl::OUString();
-	xKey = NULL;
+xKey.clear();
     bool bDropRelation = false;
 	for(sal_Int32 i=0;i<xKeys->getCount();++i)
 	{
                 }                
 			}
 		}
-		xKey = NULL;
+	xKey.clear();
 	} // for(sal_Int32 i=0;i<xKeys->getCount();++i)
     if ( bDropRelation )
     {

dbaccess/source/ui/relationdesign/RelationController.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_dbaccess.hxx"
-#ifndef _DBAU_REGHELPER_HXX_
 #include "dbu_reghelper.hxx"
-#endif
-#ifndef _SFXSIDS_HRC
 #include <sfx2/sfxsids.hrc>
-#endif
-#ifndef _DBU_REL_HRC_
 #include "dbu_rel.hrc"
-#endif
-#ifndef _SV_SVAPP_HXX 
 #include <vcl/svapp.hxx>
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
 #include "browserids.hxx"		   
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_ 
 #include <comphelper/types.hxx>
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
 #include "dbustrings.hrc"
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
 #include <connectivity/dbtools.hxx>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
 #include <comphelper/extract.hxx>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ 
 #include <com/sun/star/container/XChild.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ 
 #include <com/sun/star/container/XNameContainer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_ 
 #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_
 #include <com/sun/star/sdbcx/KeyType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDROP_HPP_ 
 #include <com/sun/star/sdbcx/XDrop.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XALTERTABLE_HPP_
 #include <com/sun/star/sdbcx/XAlterTable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_
 #include <com/sun/star/sdbcx/XAppend.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
 #include <com/sun/star/sdb/SQLContext.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
 #include <com/sun/star/sdbc/SQLWarning.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_
 #include <com/sun/star/sdbc/ColumnValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_
 #include <com/sun/star/sdbc/XRow.hpp>
-#endif
-#ifndef _DBHELPER_DBEXCEPTION_HXX_
 #include <connectivity/dbexception.hxx>
-#endif
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_ 
+#include <connectivity/dbmetadata.hxx>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#endif
-#ifndef _COMPHELPER_STREAMSECTION_HXX_
 #include <comphelper/streamsection.hxx>
-#endif
-#ifndef _COMPHELPER_BASIC_IO_HXX_
 #include <comphelper/basicio.hxx>
-#endif
-#ifndef _COMPHELPER_SEQSTREAM_HXX
 #include <comphelper/seqstream.hxx>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
 #include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HPP_
 #include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _DBAUI_SQLMESSAGE_HXX_
 #include "sqlmessage.hxx"
-#endif
-#ifndef DBAUI_RELATIONCONTROLLER_HXX
 #include "RelationController.hxx"
-#endif
-#ifndef _SV_MSGBOX_HXX 
 #include <vcl/msgbox.hxx>
-#endif
 #include "TableWindowData.hxx"
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
 #include "dbustrings.hrc"
-#endif
-#ifndef DBAUI_TOOLS_HXX
 #include "UITools.hxx"
-#endif
-#ifndef DBAUI_RTABLECONNECTIONDATA_HXX
 #include "RTableConnectionData.hxx"
-#endif
-#ifndef DBAUI_RELATION_TABLEVIEW_HXX
 #include "RelationTableView.hxx"
-#endif
-#ifndef DBAUI_RELATIONDESIGNVIEW_HXX
 #include "RelationDesignView.hxx"
-#endif
-#ifndef _TOOLS_DEBUG_HXX
 #include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
 #include <tools/diagnose_ex.h>
-#endif
-#ifndef _SV_WAITOBJ_HXX
 #include <vcl/waitobj.hxx>
-#endif
 #include <osl/thread.hxx>
 #include <vos/mutex.hxx>
 
 	    {
         }
 
+        /// Working method which should be overridden.
+	    virtual void SAL_CALL run();
+        virtual void SAL_CALL onTerminated();
     protected:
-        virtual ~RelationLoader(){}
-
-	    /// Working method which should be overridden.
-	    virtual void SAL_CALL run();
-	    virtual void SAL_CALL onTerminated();
+        virtual ~RelationLoader(){}	    
+	    
         void loadTableData(const Any& _aTable);
     };
 
             m_vTableData.push_back((*aConnDataIter)->getReferencedTable());
         }
     } // for(;aConnDataIter != aConnDataEnd;++aConnDataIter)
-    --m_nThreadEvent;
-    if ( !m_nThreadEvent )
-        Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
+    if ( m_nThreadEvent )
+    {
+        --m_nThreadEvent;
+        if ( !m_nThreadEvent )
+            Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
+    }
 }
 // -----------------------------------------------------------------------------
 IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ )
 	{
 		if ( !m_xTables.is() )
 			return;
-		// this may take some time
-		const Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
-		const Sequence< ::rtl::OUString> aNames = m_xTables->getElementNames();
+        DatabaseMetaData aMeta(getConnection());
+	    // this may take some time
+	    const Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
+	    const Sequence< ::rtl::OUString> aNames = m_xTables->getElementNames();
         const sal_Int32 nCount = aNames.getLength();
-		const sal_Int32 nMaxElements = (nCount / MAX_THREADS) +1;
-
-        sal_Int32 nStart = 0,nEnd = ::std::min(nMaxElements,nCount);
-		while(nStart != nEnd)
-		{
-            ++m_nThreadEvent;
-            RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,nStart,nEnd);
-            pThread->createSuspended();
-            pThread->setPriority(osl_Thread_PriorityBelowNormal);
-            pThread->resume();
-            nStart = nEnd;
-            nEnd += nMaxElements;
-            nEnd = ::std::min(nEnd,nCount);
-        } // for(;pIter != pEnd;++pIter)
+        if ( aMeta.supportsThreads() )
+        {
+		    const sal_Int32 nMaxElements = (nCount / MAX_THREADS) +1;
+            sal_Int32 nStart = 0,nEnd = ::std::min(nMaxElements,nCount);
+		    while(nStart != nEnd)
+		    {
+                ++m_nThreadEvent;
+                RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,nStart,nEnd);
+                pThread->createSuspended();
+                pThread->setPriority(osl_Thread_PriorityBelowNormal);
+                pThread->resume();
+                nStart = nEnd;
+                nEnd += nMaxElements;
+                nEnd = ::std::min(nEnd,nCount);
+            } // for(;pIter != pEnd;++pIter)
+        } // if ( aMeta.supportsThreads() )
+        else
+        {
+            RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,0,nCount);
+            pThread->run();
+            pThread->onTerminated();
+        }
 	}
 	catch(SQLException& e)
 	{

extensions/source/config/ldap/ldapaccess.cxx

     if ( !s_Ldap_Module )
     {
 #if defined(WIN) || defined(WNT)
-        const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("nsldap32v50.dll"));
+#       define LIBLDAP "nsldap32v50.dll"
 #else
-#ifdef WITH_OPENLDAP
-        const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap.so"));
-#else
-        const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap50.so"));
+#   ifdef WITH_OPENLDAP
+#       define xstr(s) str(s)
+#       define str(s) #s
+#       define LIBLDAP "libldap-" xstr(LDAP_VENDOR_VERSION_MAJOR) "." xstr(LDAP_VENDOR_VERSION_MINOR) ".so." xstr(LDAP_VENDOR_VERSION_MAJOR)
+#   else
+#       define LIBLDAP "libldap50.so"
+#   endif
 #endif
-#endif
+        const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(LIBLDAP));
 
 		// load the dbtools library
 		s_Ldap_Module = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0);

extensions/source/config/ldap/wrapldapinclude.hxx

 
 #ifdef WITH_OPENLDAP
 #include <ldap.h>
+#ifndef LDAP_API
+#    define LDAP_API(rt) rt
+#endif
+#ifndef LDAP_CALL
+#    define LDAP_CALL
+#endif
 #else
 #ifndef LDAP_INCLUDED
 #define LDAP_INCLUDED

forms/qa/integration/forms/FormLayer.java

     }
 
     /* ------------------------------------------------------------------ */
-    /** retrieves a control model with a given access path
+    /** retrieves a control model with a given (integer) access path
+     */
+    public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception
+    {
+        XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+            m_document.getFormComponentTreeRoot() );
+        XPropertySet controlModel = null;
+        int i=0;
+        while ( ( indexAcc != null ) && ( i < _accessPath.length ) )
+        {
+            controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+                indexAcc.getByIndex( _accessPath[i] ) );
+            indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+                controlModel );
+            ++i;
+        }
+        return controlModel;
+    }
+
+    /* ------------------------------------------------------------------ */
+    /** retrieves a control model with a given (string) access path
      */
     public XPropertySet getControlModel( String[] _accessPath ) throws com.sun.star.uno.Exception
     {

forms/qa/integration/forms/FormPropertyBags.java

         m_document = DocumentHelper.loadDocument( m_orb, documentURL );
         m_formLayer = new FormLayer( m_document );
 
-        XPropertySet textFieldModel = m_formLayer.getControlModel( new String[] { "Standard", "TextBox" } );
+        XPropertySet textFieldModel = m_formLayer.getControlModel( new int[] { 0, 0 } );
 
         // all persistent properties should have the expected values
         assure( "persistent properties did not survive reload (1)!", ((String)textFieldModel.getPropertyValue( "SomeBoundText" )).equals( "ChangedBoundText" ) );

forms/source/component/FormComponent.cxx

 //------------------------------------------------------------------------------
 void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException)
 {
-    // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" );
 	// if the DBColumn value changed, transfer it to the control
 	if ( evt.PropertyName.equals( PROPERTY_VALUE ) )
 	{
 	m_bLoaded = sal_True;
 	onConnectedDbColumn( xRowSet );
 
+    // Some derived classes decide to cache the "current" (resp. "last known") control value, so operations like
+    // commitControlValueToDbColumn can be made a no-op when nothing actually changed.
+    // Normally, this cache is kept in sync with the column value, but during a reload, this synchronization is
+    // temporarily disable. To allow the derived classes to update their cache from the current column value,
+    // we call translateDbColumnToControlValue.
+    if ( _bFromReload && hasField() )
+        translateDbColumnToControlValue();
+
     // initially transfer the db column value to the control, if we successfully connected to a database column
 	if ( hasField() )
         initFromField( xRowSet );

hsqldb/makefile.mk

 			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \
 			src$/org$/hsqldb$/Library.java
 
-PATCH_FILES=patches$/accumulated_patches.patch
-
-# ADDITIONAL_FILES=   src$/org$/hsqldb$/Collation.java \
-#                     src$/org$/hsqldb$/TxManager.java \
-#                     src$/org$/hsqldb$/lib$/LongKeyIntValueHashMap.java \
-#                     src$/org$/hsqldb$/persist$/ScaledRAFileInJar.java \
-#                     src$/org$/hsqldb$/test$/TestCollation.java
+PATCH_FILES=patches$/i96823.patch \
+			patches$/i97032.patch \
+			patches$/i103528.patch \
+			patches$/i104901.patch
 
 .IF "$(JAVACISGCJ)"=="yes"
 JAVA_HOME=

hsqldb/patches/accumulated_patches.patch

---- misc/hsqldb/src/org/hsqldb/Expression.java	2008-05-27 17:15:05.000000000 +0200
-+++ misc/build/hsqldb/src/org/hsqldb/Expression.java	2009-01-27 11:42:16.890625000 +0100
-@@ -803,61 +803,62 @@
- 
-             case EXISTS :
-                 buf.append(' ').append(Token.T_EXISTS).append(' ');
--                break;
-+
-+                return buf.toString();
- 
-             case COUNT :
-                 buf.append(' ').append(Token.T_COUNT).append('(');
--                break;
-+                return buf.toString();
- 
-             case SUM :
-                 buf.append(' ').append(Token.T_SUM).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case MIN :
-                 buf.append(' ').append(Token.T_MIN).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case MAX :
-                 buf.append(' ').append(Token.T_MAX).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case AVG :
-                 buf.append(' ').append(Token.T_AVG).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case EVERY :
-                 buf.append(' ').append(Token.T_EVERY).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case SOME :
-                 buf.append(' ').append(Token.T_SOME).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case STDDEV_POP :
-                 buf.append(' ').append(Token.T_STDDEV_POP).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case STDDEV_SAMP :
-                 buf.append(' ').append(Token.T_STDDEV_SAMP).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case VAR_POP :
-                 buf.append(' ').append(Token.T_VAR_POP).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
- 
-             case VAR_SAMP :
-                 buf.append(' ').append(Token.T_VAR_SAMP).append('(');
-                 buf.append(left).append(')');
--                break;
-+                return buf.toString();
-         }
- 
-         throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED);
-@@ -1522,6 +1523,16 @@
-         if (exprType == COLUMN) {
-             return columnName;
-         }
-+        if ( isAggregate(exprType) )
-+        {
-+            try
-+            {
-+                return getDDL();
-+            }
-+            catch(Exception e)
-+            {
-+            }
-+        }
- 
-         return "";
-     }
---- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2008-03-17 17:05:41.000000000 +0100
-+++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2009-01-21 13:09:24.493470142 +0100
-@@ -429,6 +429,7 @@
-             setProperty(hsqldb_log_size, 10);
-             setProperty(sql_enforce_strict_size, true);
-             setProperty(hsqldb_nio_data_file, false);
-+			setProperty(hsqldb_lock_file, true);
-         }
- 
-         // OOo end
---- misc/hsqldb/src/org/hsqldb/Library.java
-+++ misc/build/hsqldb/src/org/hsqldb/Library.java
-@@ -1957,7 +1957,7 @@
-         functionMap.put("bitand", bitand);
-         functionMap.put("bitlength", bitLength);
-         functionMap.put("bitor", bitor);
--        functionMap.put("bitxor", bitor);
-+        functionMap.put("bitxor", bitxor);
-         functionMap.put("character", character);
-         functionMap.put("concat", concat);
-         functionMap.put("cot", cot);

hsqldb/patches/i103528.patch

+--- misc/hsqldb/src/org/hsqldb/Library.java
++++ misc/build/hsqldb/src/org/hsqldb/Library.java
+@@ -1957,7 +1957,7 @@
+         functionMap.put("bitand", bitand);
+         functionMap.put("bitlength", bitLength);
+         functionMap.put("bitor", bitor);
+-        functionMap.put("bitxor", bitor);
++        functionMap.put("bitxor", bitxor);
+         functionMap.put("character", character);
+         functionMap.put("concat", concat);
+         functionMap.put("cot", cot);

hsqldb/patches/i104901.patch

+--- misc/hsqldb/src/org/hsqldb/Table.java	2007-10-19 23:59:07.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Table.java	2009-09-11 13:45:42.939231519 +0200
+@@ -149,10 +149,10 @@
+     Constraint[]      constraintList;                 // constrainst for the table
+     HsqlArrayList[]   triggerLists;                   // array of trigger lists
+     private int[]     colTypes;                       // fredt - types of columns
+-    private int[]     colSizes;                       // fredt - copy of SIZE values for columns
++    int[]     	      colSizes;                       // fredt - copy of SIZE values for columns
+     private int[]     colScales;                      // fredt - copy of SCALE values for columns
+     private boolean[] colNullable;                    // fredt - modified copy of isNullable() values
+-    private Expression[] colDefaults;                 // fredt - expressions of DEFAULT values
++    Expression[] 	  colDefaults;                 // fredt - expressions of DEFAULT values
+     private int[]        defaultColumnMap;            // fred - holding 0,1,2,3,...
+     private boolean      hasDefaultValues;            //fredt - shortcut for above
+     boolean              sqlEnforceSize;              // inherited from the database -
+--- misc/hsqldb/src/org/hsqldb/TableWorks.java	2007-01-14 06:48:16.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/TableWorks.java	2009-09-11 13:47:50.328667463 +0200
+@@ -670,7 +670,8 @@
+             // default expressions can change
+             oldCol.setType(newCol);
+             oldCol.setDefaultExpression(newCol.getDefaultExpression());
+-            table.setColumnTypeVars(colIndex);
++			table.colSizes[colIndex]    = oldCol.getSize();
++            table.colDefaults[colIndex] = oldCol.getDefaultExpression();
+             table.resetDefaultsFlag();
+ 
+             return;

hsqldb/patches/i96823.patch

+--- misc/hsqldb/src/org/hsqldb/Expression.java	2008-05-27 17:15:05.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Expression.java	2009-01-27 11:42:16.890625000 +0100
+@@ -803,61 +803,62 @@
+ 
+             case EXISTS :
+                 buf.append(' ').append(Token.T_EXISTS).append(' ');
+-                break;
++
++                return buf.toString();
+ 
+             case COUNT :
+                 buf.append(' ').append(Token.T_COUNT).append('(');
+-                break;
++                return buf.toString();
+ 
+             case SUM :
+                 buf.append(' ').append(Token.T_SUM).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case MIN :
+                 buf.append(' ').append(Token.T_MIN).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case MAX :
+                 buf.append(' ').append(Token.T_MAX).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case AVG :
+                 buf.append(' ').append(Token.T_AVG).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case EVERY :
+                 buf.append(' ').append(Token.T_EVERY).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case SOME :
+                 buf.append(' ').append(Token.T_SOME).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case STDDEV_POP :
+                 buf.append(' ').append(Token.T_STDDEV_POP).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case STDDEV_SAMP :
+                 buf.append(' ').append(Token.T_STDDEV_SAMP).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case VAR_POP :
+                 buf.append(' ').append(Token.T_VAR_POP).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+ 
+             case VAR_SAMP :
+                 buf.append(' ').append(Token.T_VAR_SAMP).append('(');
+                 buf.append(left).append(')');
+-                break;
++                return buf.toString();
+         }
+ 
+         throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED);
+@@ -1522,6 +1523,16 @@
+         if (exprType == COLUMN) {
+             return columnName;
+         }
++        if ( isAggregate(exprType) )
++        {
++            try
++            {
++                return getDDL();
++            }
++            catch(Exception e)
++            {
++            }
++        }
+ 
+         return "";
+     }

hsqldb/patches/i97032.patch

+--- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2008-03-17 17:05:41.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2009-01-21 13:09:24.493470142 +0100
+@@ -429,6 +429,7 @@
+             setProperty(hsqldb_log_size, 10);
+             setProperty(sql_enforce_strict_size, true);
+             setProperty(hsqldb_nio_data_file, false);
++			setProperty(hsqldb_lock_file, true);
+         }
+ 
+         // OOo end

hsqldb/patches/index.txt

-====================================================================================
-File name
----------
-  patch_file.patch
-
-Description
------------
-  patches HSQL so that ....
-
-Issue
------
-  http://www.openoffice.org/issues/show_bug.cgi?id=?????
-  http://www.openoffice.org/issues/show_bug.cgi?id=85087
-  http://www.openoffice.org/issues/show_bug.cgi?id=97032
-  <summary>
-
-

qadevOOo/runner/util/FormTools.java

 import com.sun.star.awt.Point;
 import com.sun.star.awt.XControlModel;
 import com.sun.star.container.XNameContainer;
+import com.sun.star.container.XIndexContainer;
 import com.sun.star.form.XFormsSupplier;
 import com.sun.star.form.XForm;
 import com.sun.star.form.XLoadable;
         return oControl;
     } // finish createControl
 
-    public static XNameContainer getForms ( XDrawPage oDP ) {
+    public static XNameContainer getForms ( XDrawPage oDP )
+    {
 		XFormsSupplier oFS = (XFormsSupplier) UnoRuntime.queryInterface(
                                                     XFormsSupplier.class,oDP);
 		return oFS.getForms();
     } //finish getForms
 
+    public static XIndexContainer getIndexedForms ( XDrawPage oDP )
+    {
+		XFormsSupplier oFS = (XFormsSupplier) UnoRuntime.queryInterface(
+                                                    XFormsSupplier.class,oDP);
+		return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class,
+            oFS.getForms() );
+    } //finish getIndexedForms
+
     public static void insertForm ( XComponent aDoc, XNameContainer Forms,
                                                                 String aName ) {
         try {
         XLoadable formLoader = null;
 
         try {
-            Object aForm = FormTools.getForms(WriterTools.getDrawPage(aDoc)).getByName("Standard");
+            Object aForm = FormTools.getIndexedForms(WriterTools.getDrawPage(aDoc)).getByIndex(0);
             XForm the_form = null;
             try {
                 the_form = (XForm) AnyConverter.toObject(new Type(XForm.class), aForm);
     	throws com.sun.star.uno.Exception {
 
         XForm the_form = (XForm) AnyConverter.toObject(new Type(XForm.class), 
-            FormTools.getForms(WriterTools.getDrawPage(aDoc)).getByName("Standard"));
+            FormTools.getIndexedForms(WriterTools.getDrawPage(aDoc)).getByIndex(0));
         XPropertySet formProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, the_form);
         formProps.setPropertyValue("DataSourceName",sourceName);
         formProps.setPropertyValue("Command",tableName);

qadevOOo/runner/util/ValueChanger.java

         }
 
     } else
-   {
-     System.out.println("ValueChanger don't know type " + oldValue.getClass());
-   }
+    {
+        System.out.println("ValueChanger don't know type " + oldValue.getClass());
+    }
 
    return newValue;
 

reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java

             final AttributeList attrList = buildAttributeList(attrs);
             xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN);
 
-            if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs) &&
-                tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
+            if ( tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH 
+                    && variables != null 
+                    && !isRepeatingSection()
+                    && ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs)
+                )
             {
                 //LOGGER.debug("Variables-Section in existing cell " + variables);
                 xmlWriter.writeText(variables);
 
         final XmlWriter xmlWriter = getXmlWriter();
         if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
-                isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType))
+            isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType) &&
+            !isRepeatingSection() )
         {
             if (variables != null)
             {

reportbuilder/prj/build.lst

 rpb  reportbuilder\registry\data\org\openoffice\Office\UI                 nmake   -   all rpb_reg_data_ooo_ui rpb_reg_schema_ooo_ui NULL
 rpb  reportbuilder\registry\data\org\openoffice\TypeDetection             nmake   -   all rpb_reg_data_oot NULL
 rpb  reportbuilder\template\en-US\wizard\report				nmake   -   all rpb_template_en_us_wiz_rep NULL
-rpb  reportbuilder\util                                                   nmake   -   all rpb_util rpb_jreport_pe rpb_reg_data_ooo rpb_data_ooOffice rpb_reg_data_oot rpb_template_en_us_wiz_rep NULL
+rpb  reportbuilder\util                                                   nmake   -   all rpb_util rpb_jreport_pe rpb_reg_data_ooo rpb_data_ooOffice rpb_reg_data_oot rpb_template_en_us_wiz_rep rpb_reg_data_ooo_ui NULL
 

reportdesign/source/core/api/ReportDefinition.cxx

     } // if ( aSaveOpt.IsSaveRelFSys() )
     const ::rtl::OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),::rtl::OUString()) );
     xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), uno::makeAny(sHierarchicalDocumentName));
+    ::rtl::OUString aVersion;
+    SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion();
+
+    // older versions can not have this property set, it exists only starting from ODF1.2
+    if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
+        aVersion = ODFVER_012_TEXT;
+
+    if ( aVersion.getLength() )
+    {
+        try
+        {
+            xInfoSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Version" )), uno::makeAny( aVersion ) );
+        }
+        catch( uno::Exception& )
+        {
+        }
+    }
     
     
     sal_Int32 nArgsLen = aDelegatorArguments.getLength();

svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx

     protected:
         ::rtl::Reference< ViewObjectContactOfUnoControl_Impl >    m_pImpl;
 
-    public:
+	public:
+        ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
+
         /// determines whether an XControl already exists, and is currently visible
         bool    isControlVisible() const;
 
         */
 		virtual void ActionChanged();
 
-	protected:
-        ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
+    protected:
         ~ViewObjectContactOfUnoControl();
 
 		// support for Primitive2D
 	};
 
     //====================================================================
-	//= UnoControlDefaultContact
-	//====================================================================
-    class SVX_DLLPRIVATE UnoControlDefaultContact : public ViewObjectContactOfUnoControl
-    {
-    public:
-        UnoControlDefaultContact( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
-        ~UnoControlDefaultContact();
-
-    private:
-        UnoControlDefaultContact();                                             // never implemented
-        UnoControlDefaultContact( const UnoControlDefaultContact& );            // never implemented
-        UnoControlDefaultContact& operator=( const UnoControlDefaultContact& ); // never implemented
-    };
-
-    //====================================================================
-	//= UnoControlWindowContact
-	//====================================================================
-    class SVX_DLLPRIVATE UnoControlWindowContact : public ViewObjectContactOfUnoControl
-    {
-    public:
-        UnoControlWindowContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
-        ~UnoControlWindowContact();
-
-    private:
-        UnoControlWindowContact();                                              // never implemented
-        UnoControlWindowContact( const UnoControlWindowContact& );              // never implemented
-        UnoControlWindowContact& operator=( const UnoControlWindowContact& );   // never implemented
-    };
-
-    //====================================================================
 	//= UnoControlPrintOrPreviewContact
 	//====================================================================
     class SVX_DLLPRIVATE UnoControlPrintOrPreviewContact : public ViewObjectContactOfUnoControl
         virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const;
     };
 
-    //====================================================================
-	//= UnoControlPDFExportContact
-	//====================================================================
-    class SVX_DLLPRIVATE UnoControlPDFExportContact : public ViewObjectContactOfUnoControl
-    {
-    public:
-        UnoControlPDFExportContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
-        ~UnoControlPDFExportContact();
-
-    private:
-        UnoControlPDFExportContact();                                               // never implemented
-        UnoControlPDFExportContact( const UnoControlPDFExportContact& );            // never implemented
-        UnoControlPDFExportContact& operator=( const UnoControlPDFExportContact& ); // never implemented
-    };
-
 //........................................................................
 } } // namespace sdr::contact
 //........................................................................

svx/source/fmcomp/gridctrl.cxx

             Fraction aZoom = GetZoom();
 
             // not all of these controls need to know the new zoom, but to be sure ...
-            Font aFont( IsControlFont() ? GetControlFont() : GetPointFont());
+            Font aFont( GetSettings().GetStyleSettings().GetFieldFont() );
+            if ( IsControlFont() )
+                aFont.Merge( GetControlFont() );
+
             for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
             {
                 pWindows[i]->SetZoom(aZoom);
                 pWindows[i]->SetZoomedPointFont(aFont);
             }
+
+            SetZoomedPointFont( aFont );
+
             // rearrange the controls
             m_nDefaultWidth = ArrangeControls();
         }
     {
 		if ( m_bNavigationBar )
         {
-			m_aBar.SetZoom( GetZoom() );
-
 	        Font aFont = m_aBar.GetSettings().GetStyleSettings().GetFieldFont();
             if ( IsControlFont() )
-            {
                 m_aBar.SetControlFont( GetControlFont() );
-			    aFont.Merge( GetControlFont() );
-            }
             else
                 m_aBar.SetControlFont();
 
-		    m_aBar.SetZoomedPointFont( aFont );
+			m_aBar.SetZoom( GetZoom() );
         }
     }
 

svx/source/form/fmtextcontrolshell.cxx

 	//====================================================================
     static SfxSlotId pTextControlSlots[] =
     {
+        SID_CLIPBOARD_FORMAT_ITEMS,
         SID_CUT,
         SID_COPY,
         SID_PASTE,
 //        SID_TEXTDIRECTION_TOP_TO_BOTTOM,
         SID_ATTR_CHAR_SCALEWIDTH,       /* 911 */
         SID_ATTR_CHAR_RELIEF,
-        SID_CLIPBOARD_FORMAT_ITEMS,     /* 922 */
         SID_ATTR_PARA_LEFT_TO_RIGHT,    /* 950 */
         SID_ATTR_PARA_RIGHT_TO_LEFT,
         0

svx/source/sdr/contact/viewcontactofunocontrol.cxx

 	//--------------------------------------------------------------------
     ViewObjectContact& ViewContactOfUnoControl::CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact )
     {
+        // print or print preview requires special handling
+        const OutputDevice* pDevice = _rObjectContact.TryToGetOutputDevice();
+        bool bPrintOrPreview = ( pDevice != NULL ) && ( pDevice->GetOutDevType() == OUTDEV_PRINTER );
+
         ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &_rObjectContact  );
-        if ( pPageViewContact )
-        {
-            // special classes for special devices:
-            // - PDF export
-            ::vcl::PDFExtOutDevData* pPDFExport = PTR_CAST( ::vcl::PDFExtOutDevData, pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetExtOutDevData() );
-            if ( pPDFExport != NULL )
-                return *new UnoControlPDFExportContact( *pPageViewContact, *this );
+        bPrintOrPreview |= ( pPageViewContact != NULL ) && pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview();
 
-            // - print preview
-            if ( pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview() )
-                return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this );
+        if ( bPrintOrPreview )
+            return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this );
 
-            OutDevType eDeviceType = pPageViewContact->GetPageWindow().GetPaintWindow().GetOutputDevice().GetOutDevType();
-            // - printing
-            if ( eDeviceType == OUTDEV_PRINTER )
-                return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this );
-
-            // - any other virtual device
-            if ( eDeviceType == OUTDEV_VIRDEV )
-                return *new UnoControlDefaultContact( *pPageViewContact, *this );
-
-            // - normal windows have special, design-mode dependent handling
-            if ( eDeviceType == OUTDEV_WINDOW )
-                return *new UnoControlWindowContact( *pPageViewContact, *this );
-        }
-
-        // if we're not working for a ObjectContactOfPageView, then we can't use a ViewObjectContactOfUnoControl, or any
-        // of its derivees. Fall back to a "normal" SdrObj's contact object.
-        return *new ViewObjectContactOfSdrObj( _rObjectContact, *this );
+        // all others are nowadays served by the same implementation
+        return *new ViewObjectContactOfUnoControl( _rObjectContact, *this );
     }
 
 	//--------------------------------------------------------------------
 			aTransform.set(0, 2, aRange.getMinX());
 			aTransform.set(1, 2, aRange.getMinY());
 
-			// create control primitive WITHOUT evtl. existing XControl; this would be done in
+			// create control primitive WITHOUT possibly existing XControl; this would be done in
 			// the VOC in createPrimitive2DSequence()
 			const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
 				aTransform, xControlModel));

svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx

     //= InvisibleControlViewAccess
     //====================================================================
     /** is a ->IPageViewAccess implementation which can be used to create an invisble control for
-        an arbitrary device
+        an arbitrary window
      */
     class InvisibleControlViewAccess : public IPageViewAccess
     {
     }
 
     //====================================================================
+    //= DummyPageViewAccess
+    //====================================================================
+    /** is a ->IPageViewAccess implementation which can be used to create a control for an arbitrary
+        non-Window device
+
+        The implementation will report the "PageView" as being in design mode, all layers to be visible,
+        and will not return any ControlContainer, so all control container related features (notifications etc)
+        are not available.
+     */
+    class DummyPageViewAccess : public IPageViewAccess
+    {
+    public:
+        DummyPageViewAccess()
+        {
+        }
+
+        virtual bool    isDesignMode() const;
+        virtual Reference< XControlContainer >
+                        getControlContainer( const OutputDevice& _rDevice ) const;
+        virtual bool    isLayerVisible( SdrLayerID _nLayerID ) const;
+    };
+
+    //--------------------------------------------------------------------
+    bool DummyPageViewAccess::isDesignMode() const
+    {
+        return true;
+    }
+    
+    //--------------------------------------------------------------------
+    Reference< XControlContainer > DummyPageViewAccess::getControlContainer( const OutputDevice& /*_rDevice*/ ) const
+    {
+        return NULL;
+    }
+    
+    //--------------------------------------------------------------------
+    bool DummyPageViewAccess::isLayerVisible( SdrLayerID /*_nLayerID*/ ) const
+    {
+        return true;
+    }
+
+    //====================================================================
     //= ViewObjectContactOfUnoControl_Impl
     //====================================================================
     typedef     ::cppu::WeakImplHelper4 <   XWindowListener
 
             This method cares for this, by retrieving the very original OutputDevice.
         */
-        static const OutputDevice& imp_getPageViewDevice_nothrow( const ObjectContactOfPageView& _rObjectContact );
-        const OutputDevice& imp_getPageViewDevice_nothrow() const;
+        static const OutputDevice& impl_getPageViewOutputDevice_nothrow( const ObjectContactOfPageView& _rObjectContact );
+
+        const OutputDevice& impl_getOutputDevice_throw() const;