Commits

Anonymous committed b40134c Merge

CWS-TOOLING: integrate CWS fs34b_OOO340

  • Participants
  • Parent commits 28fa771, 225ed8f

Comments (0)

Files changed (35)

dbaccess/qa/complex/dbaccess/CopyTableWizard.java

 {
 
     private DatabaseApplication source;
+    private DbaseDatabase destinationDB = null;
     private DatabaseApplication dest;
 
     public CopyTableWizard()
     public void after()
     {
         dest.store();
+        if ( destinationDB != null )
+            destinationDB.close();
+        destinationDB = null;
         super.after();
     }
 
         try
         {
             createTestCase();
-            source = new DatabaseApplication(this.m_database.getDatabase());
-            dest = new DatabaseApplication(new DbaseDatabase(getMSF()));
+            source = new DatabaseApplication(m_database.getDatabase());
+            destinationDB = new DbaseDatabase( getMSF() );
+            dest = new DatabaseApplication( destinationDB );
         }
         catch (java.lang.Exception ex)
         {

dbaccess/source/ui/browser/unodatbr.cxx

 		{
 			if( !m_pTreeView->getListBox().GetEntryPosByName(*pIter,_pParent))
 			{
-                Reference<XNameAccess> xChild(_xNameAccess->getByName(*pIter),UNO_QUERY);
 				DBTreeListUserData* pEntryData = new DBTreeListUserData;
 				pEntryData->eType = _eEntryType;
-                if ( _eEntryType == etQuery && xChild.is() )
+                if ( _eEntryType == etQuery )
                 {
-                    pEntryData->eType = etQueryContainer;
+					Reference<XNameAccess> xChild(_xNameAccess->getByName(*pIter),UNO_QUERY);
+					if ( xChild.is() )
+						pEntryData->eType = etQueryContainer;
                 }
                 implAppendEntry( _pParent, *pIter, pEntryData, pEntryData->eType );
 			}

forms/qa/integration/forms/XMLFormSettings.java

         // create a simple structure in the DOM tree: an element with two attributes
         String[] modelNames = m_document.getXFormModelNames();
         m_defaultModel = m_document.getXFormModel( modelNames[0] );
-        Instance defaultInstance = m_defaultModel.getDefaultInstance();
+        final Instance defaultInstance = m_defaultModel.getDefaultInstance();
+        // remove the default root node
+        defaultInstance.removeNode( "instanceData" );
+        // create test structures
         XNode stringElement = defaultInstance.createElement( "stringElement" );
         XNode booleanAttrib = defaultInstance.createAttribute( stringElement, "booleanAttribute", "true" );
         XNode dateAttrib = defaultInstance.createAttribute( stringElement, "dateAttribute" );
 
-        // when it comes to saving and loading, only one child of the root element of the instance
-        // is handled (is this a bug? see xmloff/source/xforms/XFormsInstanceContext.cxx, method
-        // CreateChildContext).
-        // So, we remove the default node of the instance which it has all the time
-        defaultInstance.removeNode( "instanceData" );
-
         assure( "booleanAttrib's parent is wrong",
             UnoRuntime.areSame( stringElement, booleanAttrib.getParentNode() ) );
         assure( "dateAttrib's parent is wrong",

forms/qa/org/openoffice/xforms/Instance.java

 
     /** creates a new element in the instance
      * 
-     * The element will be inserted immediately below the root node of the instance.
-     * 
-     * @param _elementName
-     *      the name of the to-be-created element
-     * @param _initialNodeValue
-     *      the initial value to set at the node. Might be null, in this case no value is set.
-     * @return
-     *      the node of the newly created element
-     * @throws com.sun.star.xml.dom.DOMException
-     */
-    public XNode createElement( String _elementName, String _initialNodeValue ) throws DOMException
-    {
-        return createElement( m_domInstance, _elementName, _initialNodeValue );
-    }
-
-    /** creates a new element in the instance
-     * 
      * The element will be inserted immediately below a given XNode.
      * 
      * @param _parentElement

forms/source/xforms/submission/serialization_app_xml.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 #include "serialization.hxx"
 #include "serialization_app_xml.hxx"
 
-#include <unotools/processfactory.hxx>
+/** === begin UNO includes === **/
 #include <com/sun/star/xml/dom/XNode.hpp>
 #include <com/sun/star/xml/dom/XDocument.hpp>
 #include <com/sun/star/xml/dom/XNodeList.hpp>
 #include <com/sun/star/xml/dom/NodeType.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/xml/xpath/XPathObjectType.hpp>
+#include <com/sun/star/xml/sax/XSAXSerializable.hpp>
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
+/** === end UNO includes === **/
 
-#include <libxml/tree.h>
+#include <tools/diagnose_ex.h>
+#include <comphelper/processfactory.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <limits>
+
+/** === begin UNO using === **/
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
+using ::com::sun::star::xml::dom::XNode;
+using ::com::sun::star::xml::dom::XDocument;
+using ::com::sun::star::xml::sax::XSAXSerializable;
+using ::com::sun::star::beans::StringPair;
+using ::com::sun::star::io::XActiveDataSource;
+using ::com::sun::star::xml::dom::NodeType_DOCUMENT_NODE;
+using ::com::sun::star::xml::dom::NodeType_ELEMENT_NODE;
+using ::com::sun::star::xml::dom::XDocumentBuilder;
+using ::com::sun::star::xml::sax::XDocumentHandler;
+/** === end UNO using === **/
 
 CSerializationAppXML::CSerializationAppXML()
-    : m_aFactory(utl::getProcessServiceFactory())
-    , m_aPipe(CSS::uno::Reference< CSS::io::XOutputStream > (m_aFactory->createInstance( 
-        rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), CSS::uno::UNO_QUERY))
+    :m_aContext( ::comphelper::getProcessServiceFactory() )
 {
-    OSL_ENSURE(m_aPipe.is(), "cannot create Pipe");
+    m_aContext.createComponent( "com.sun.star.io.Pipe", m_xBuffer );
 }
 
-CSS::uno::Reference< CSS::io::XInputStream > 
+Reference< CSS::io::XInputStream >
 CSerializationAppXML::getInputStream()
 {
     // The pipes output is provided through it's
     // XOutputStream interface aspect
-    return CSS::uno::Reference< CSS::io::XInputStream >(m_aPipe, CSS::uno::UNO_QUERY);
+    return Reference< CSS::io::XInputStream >(m_xBuffer, UNO_QUERY);
 }
 
-void 
-CSerializationAppXML::serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& rNode)
+void
+CSerializationAppXML::serialize_node(const Reference< XNode >& rNode)
 {
-    CSS::uno::Reference< CSS::xml::dom::XNode > aNode = rNode;
-    if (aNode->getNodeType() == CSS::xml::dom::NodeType_DOCUMENT_NODE)
+    try
     {
-        CSS::uno::Reference< CSS::xml::dom::XDocument > aDoc(rNode, CSS::uno::UNO_QUERY_THROW);
-        aNode = CSS::uno::Reference< CSS::xml::dom::XNode >(aDoc->getDocumentElement(), CSS::uno::UNO_QUERY_THROW);
-    } 
-    if (aNode->getNodeType() != CSS::xml::dom::NodeType_ELEMENT_NODE)
-        return;
+        Reference< XSAXSerializable > xSerializer( rNode, UNO_QUERY );
+        if ( !xSerializer.is() )
+        {
+            // ensure we have a "real" node
+            Reference< XNode > xNode = rNode;
+            if ( xNode->getNodeType() == NodeType_DOCUMENT_NODE )
+            {
+                Reference< XDocument > const xDoc( xNode, UNO_QUERY_THROW );
+                xNode.set( xDoc->getDocumentElement(), UNO_QUERY_THROW );
+            }
+            ENSURE_OR_RETURN_VOID( xNode->getNodeType() == NodeType_ELEMENT_NODE,
+                "CSerializationAppXML::serialize_node: invalid node type!" );
 
-    // clone the node to a new document and serialize that document
-    CSS::uno::Reference< CSS::lang::XUnoTunnel > aTunnel(aNode, CSS::uno::UNO_QUERY);
-    if (aTunnel.is()) 
-    {
-        xmlNodePtr aNodePtr = reinterpret_cast< xmlNodePtr >( aTunnel->getSomething(CSS::uno::Sequence< sal_Int8 >()) );
-        xmlDocPtr aDocPtr = xmlNewDoc((xmlChar*)"1.0");
-        xmlNodePtr aDocNodePtr = xmlDocCopyNode(aNodePtr, aDocPtr, 1);
-        if (aDocNodePtr != NULL) {
-            xmlAddChild((xmlNodePtr)aDocPtr, aDocNodePtr);
-            xmlChar *buffer = NULL;
-            sal_Int32 size = 0;
-            xmlDocDumpMemory(aDocPtr, &buffer, (int*)&size);
-        
-            // write the xml into the pipe through it's XOutputStream interface
-            m_aPipe->writeBytes(CSS::uno::Sequence< sal_Int8 >((sal_Int8*)buffer, size));            
-            xmlFree(buffer);
+            // create a new document
+            Reference< XDocumentBuilder > const xDocBuilder(
+                m_aContext.createComponent( "com.sun.star.xml.dom.DocumentBuilder" ), UNO_QUERY_THROW );
+            Reference< XDocument > const xDocument( xDocBuilder->newDocument(), UNO_SET_THROW );
+
+            // copy the to-be-serialized node
+            Reference< XNode > const xImportedNode( xDocument->importNode( xNode, true ), UNO_SET_THROW );
+            xDocument->appendChild( xImportedNode );
+
+            // ask the doc for the serializer
+            xSerializer.set( xDocument, UNO_QUERY );
         }
 
-    } else {
-        // can't get tunnel to native backend
-        // logic for generic implementation could be implemented here...
-        OSL_ENSURE(sal_False, "unkown dom implementation, cannot serialize");
-        return;
+        ENSURE_OR_RETURN_VOID( xSerializer.is(),
+            "CSerializationAppXML::serialize_node: no serialization access to the node/document!" );
+
+        // create a SAXWriter to take the serialization events, and connect it to our pipe
+        Reference< XDocumentHandler > const xSaxWriter(
+            m_aContext.createComponent( "com.sun.star.xml.sax.Writer" ), UNO_QUERY_THROW );
+        Reference< XActiveDataSource > const xDataSource( xSaxWriter, UNO_QUERY_THROW );
+        xDataSource->setOutputStream( m_xBuffer );
+
+        // do the serialization
+        xSerializer->serialize( xSaxWriter, Sequence< StringPair >() );
+    }
+    catch( const Exception& )
+    {
+    	DBG_UNHANDLED_EXCEPTION();
     }
 }
 
-/*
-void
-CSerializationAppXML::serialize_nodeset()
-{
-    CSS::uno::Reference< CSS::xml::dom::XNodeList > aNodeList = m_aXPathObject->getNodeList();
-    for (sal_Int32 i=0; i<aNodeList->getLength(); i++)
-        serialize_node(aNodeList->item(i));
-    m_aPipe->closeOutput();
-}
-*/
-
 void
 CSerializationAppXML::serialize()
-{    
+{
     if (!m_aFragment.is()) return;
 
-    CSS::uno::Reference< CSS::xml::dom::XNode > cur = m_aFragment->getFirstChild();
+    Reference< XNode > cur = m_aFragment->getFirstChild();
     while (cur.is())
     {
         serialize_node(cur);
         cur = cur->getNextSibling();
     }
-    m_aPipe->closeOutput();
+    m_xBuffer->closeOutput();
 }

forms/source/xforms/submission/serialization_app_xml.hxx

 
 #include "serialization.hxx"
 
+#include <comphelper/componentcontext.hxx>
 
 class CSerializationAppXML : public CSerialization
 {
 private:
-    CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory;
-    CSS::uno::Reference< CSS::io::XOutputStream > m_aPipe;
+    ::comphelper::ComponentContext                  m_aContext;
+    CSS::uno::Reference< CSS::io::XOutputStream >   m_xBuffer;
 
     void serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& aNode);
     void serialize_nodeset();

forms/source/xforms/submission/submission_put.cxx

 #include "serialization_urlencoded.hxx"
 
 #include <osl/file.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/processfactory.hxx>
 #include <ucbhelper/content.hxx>
 
     CSS::uno::Reference< XCommandEnvironment > aEnvironment;
     auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment));
 
-    try {
+    try
+    {
         ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment);
 
         // insert serialized data to content -> PUT
         
         // no content as a result of put...
 
-    } catch (Exception&)
+    }
+    catch ( const Exception& )
     {
-        // XXX
-        OSL_ENSURE(sal_False, "Exception during UCB operatration.");
+        DBG_UNHANDLED_EXCEPTION();
         return UNKNOWN_ERROR;
     }
     

framework/source/fwe/helper/undomanagerhelper.cxx

         bool                                m_disposed;
         bool                                m_bAPIActionRunning;
         bool                                m_bProcessingEvents;
+        sal_Int32                           m_nLockCount;
         ::cppu::OInterfaceContainerHelper   m_aUndoListeners;
         ::cppu::OInterfaceContainerHelper   m_aModifyListeners;
         IUndoManagerImplementation&         m_rUndoManagerImplementation;
             ,m_disposed( false )
             ,m_bAPIActionRunning( false )
             ,m_bProcessingEvents( false )
+            ,m_nLockCount( 0 )
             ,m_aUndoListeners( m_aMutex )
             ,m_aModifyListeners( m_aMutex )
             ,m_rUndoManagerImplementation( i_undoManagerImpl )
         void clearRedo( IMutexGuard& i_instanceLock );
         void reset( IMutexGuard& i_instanceLock );
 
+        void lock();
+        void unlock();
+
         void addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener )
         {
             m_aUndoListeners.addInterface( i_listener );
     }
 
     //------------------------------------------------------------------------------------------------------------------
+    void UndoManagerHelper_Impl::lock()
+    {
+        // SYNCHRONIZED --->
+        ::osl::MutexGuard aGuard( getMutex() );
+
+        if ( ++m_nLockCount == 1 )
+        {
+            IUndoManager& rUndoManager = getUndoManager();
+            rUndoManager.EnableUndo( false );
+        }
+        // <--- SYNCHRONIZED
+    }
+
+    //------------------------------------------------------------------------------------------------------------------
+    void UndoManagerHelper_Impl::unlock()
+    {
+        // SYNCHRONIZED --->
+        ::osl::MutexGuard aGuard( getMutex() );
+
+        if ( m_nLockCount == 0 )
+            throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), getXUndoManager() );
+
+        if ( --m_nLockCount == 0 )
+        {
+            IUndoManager& rUndoManager = getUndoManager();
+            rUndoManager.EnableUndo( true );
+        }
+        // <--- SYNCHRONIZED
+    }
+
+    //------------------------------------------------------------------------------------------------------------------
     void UndoManagerHelper_Impl::impl_processRequest( ::boost::function0< void > const& i_request, IMutexGuard& i_instanceLock )
     {
         // create the request, and add it to our queue
     //------------------------------------------------------------------------------------------------------------------
     void UndoManagerHelper::lock()
     {
-        // SYNCHRONIZED --->
-        ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
-
-        IUndoManager& rUndoManager = m_pImpl->getUndoManager();
-        rUndoManager.EnableUndo( false );
-        // <--- SYNCHRONIZED
+        m_pImpl->lock();
     }
 
     //------------------------------------------------------------------------------------------------------------------
     void UndoManagerHelper::unlock()
     {
-        // SYNCHRONIZED --->
-        ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
-
-        IUndoManager& rUndoManager = m_pImpl->getUndoManager();
-        if ( rUndoManager.IsUndoEnabled() )
-            throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), m_pImpl->getXUndoManager() );
-        rUndoManager.EnableUndo( true );
-        // <--- SYNCHRONIZED
+        m_pImpl->unlock();
     }
 
     //------------------------------------------------------------------------------------------------------------------

sfx2/JunitTest_sfx2_complex.mk

 	sfx2/qa/complex/sfx2/DocumentInfo \
 	sfx2/qa/complex/sfx2/StandaloneDocumentInfo \
 	sfx2/qa/complex/sfx2/UndoManager \
+	sfx2/qa/complex/sfx2/JUnitBasedTest \
+	sfx2/qa/complex/sfx2/DocumentEvents \
 	sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest \
 	sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper \
 	sfx2/qa/complex/sfx2/standalonedocinfo/Test01 \
 	complex.sfx2.DocumentProperties \
 	complex.sfx2.DocumentMetadataAccess \
 	complex.sfx2.UndoManager \
+	complex.sfx2.DocumentEvents \
 ))
 # #i115674# fails currently: misses some OnUnfocus event
 #	complex.sfx2.GlobalEventBroadcaster \

sfx2/qa/complex/sfx2/DocumentEvents.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package complex.sfx2;
+
+import com.sun.star.document.DocumentEvent;
+import com.sun.star.document.XDocumentEventBroadcaster;
+import com.sun.star.document.XDocumentEventListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XEventListener;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.CloseVetoException;
+import com.sun.star.util.XCloseListener;
+import com.sun.star.util.XCloseable;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.openoffice.test.tools.OfficeDocument;
+
+/**
+ *
+ * @author frank.shoenheit@oracle.com
+ */
+public class DocumentEvents extends JUnitBasedTest
+{
+    @Before
+    public void beforeTest() throws Exception
+    {
+        m_document = OfficeDocument.blankTextDocument( this.getORB() );
+    }
+
+    @After
+    public void afterTest()
+    {
+        if ( m_document != null )
+        {
+            assertTrue( "closing the test document failed", m_document.close() );
+            m_document = null;
+        }
+    }
+
+    /**
+     * sets up the environment for a test which checks the behavior upon closing a doc
+     */
+    private void impl_setupDocCloseTest()
+    {
+        m_observedCloseEvents.clear();
+
+        final XDocumentEventBroadcaster docEventBroadcaster = UnoRuntime.queryInterface(
+            XDocumentEventBroadcaster.class, m_document.getDocument() );
+        docEventBroadcaster.addDocumentEventListener( new DocumentEventListener() );
+
+        final XCloseable docCloseable = UnoRuntime.queryInterface( XCloseable.class,
+                m_document.getDocument() );
+        docCloseable.addCloseListener( new CloseListener() );
+
+        m_document.getDocument().addEventListener( new DocDisposeListener() );
+    }
+
+    /**
+     * sets up the environment for a test which checks the behavior upon closing a doc
+     */
+    private void impl_tearDownDocCloseTest( final String i_docCloseMethod )
+    {
+        synchronized( m_document )
+        {
+            try
+            {
+                m_document.wait(10000);
+            }
+            catch (InterruptedException ex)
+            {
+                // don't continue the test if somebody interrupted us ...
+                return;
+            }
+        }
+
+        m_document = null;
+        synchronized( m_observedCloseEvents )
+        {
+            assertArrayEquals(
+                "wrong order of events when closing a doc " + i_docCloseMethod,
+                new CloseEventType[] { CloseEventType.OnUnload, CloseEventType.NotifyClosing, CloseEventType.Disposing },
+                m_observedCloseEvents.toArray( new CloseEventType[0] )
+            );
+        }
+    }
+
+    @Test
+    public void testCloseWinEvents() throws Exception
+    {
+        impl_setupDocCloseTest();
+        m_document.getCurrentView().dispatch( ".uno:CloseWin" );
+        impl_tearDownDocCloseTest( "via .uno:CloseWin" );
+    }
+
+    //@Test
+    public void testCloseDocEvents() throws Exception
+    {
+        impl_setupDocCloseTest();
+        m_document.getCurrentView().dispatch( ".uno:CloseDoc" );
+        impl_tearDownDocCloseTest( "via .uno:CloseDoc" );
+    }
+
+    //@Test
+    public void testCloseByAPI() throws Exception
+    {
+        impl_setupDocCloseTest();
+        // closing the doc by API is synchronous, so do this in a separate thread, else we will get a deadlock
+        // when the document tries to call back our listener (well, I admit I didn't understand *why* we get this
+        // deadlock ... :-\ )
+        (new DocCloser()).start();
+        impl_tearDownDocCloseTest( "by API" );
+    }
+
+    private class DocumentEventListener implements XDocumentEventListener
+    {
+
+        public void documentEventOccured( DocumentEvent i_documentEvent )
+        {
+            if ( i_documentEvent.EventName.equals( "OnUnload" ) )
+            {
+                synchronized( m_observedCloseEvents )
+                {
+                    m_observedCloseEvents.add( CloseEventType.OnUnload );
+                }
+            }
+        }
+
+        public void disposing(EventObject eo)
+        {
+            // not interested in
+        }
+    };
+
+    private class CloseListener implements XCloseListener
+    {
+
+        public void queryClosing(EventObject eo, boolean bln) throws CloseVetoException
+        {
+            // not interested in
+        }
+
+        public void notifyClosing(EventObject eo)
+        {
+            synchronized( m_observedCloseEvents )
+            {
+                m_observedCloseEvents.add( CloseEventType.NotifyClosing );
+            }
+        }
+
+        public void disposing(EventObject eo)
+        {
+            // not interested in
+        }
+    };
+
+    private class DocDisposeListener implements XEventListener
+    {
+        public void disposing(EventObject eo)
+        {
+            synchronized( m_observedCloseEvents )
+            {
+                m_observedCloseEvents.add( CloseEventType.Disposing );
+            }
+            synchronized ( m_document )
+            {
+                m_document.notifyAll();
+            }
+        }
+    };
+
+    private class DocCloser extends Thread
+    {
+        @Override
+        public void run()
+        {
+            try
+            {
+                final XCloseable docCloseable = UnoRuntime.queryInterface(XCloseable.class, m_document.getDocument());
+                docCloseable.close(true);
+            }
+            catch (CloseVetoException ex)
+            {
+                Logger.getLogger(DocumentEvents.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
+    };
+
+    private enum CloseEventType
+    {
+        OnUnload,
+        NotifyClosing,
+        Disposing
+    };
+
+    private OfficeDocument m_document = null;
+    final private Vector< CloseEventType > m_observedCloseEvents = new Vector<DocumentEvents.CloseEventType>();
+}

sfx2/qa/complex/sfx2/JUnitBasedTest.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package complex.sfx2;
+
+import org.openoffice.test.OfficeConnection;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XComponentContext;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ *
+ * @author Frank
+ */
+public class JUnitBasedTest
+{
+    // -----------------------------------------------------------------------------------------------------------------
+    protected XComponentContext getContext()
+    {
+        return m_connection.getComponentContext();
+    }
+
+    // -----------------------------------------------------------------------------------------------------------------
+    protected XMultiServiceFactory getORB()
+    {
+        final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(
+            XMultiServiceFactory.class, getContext().getServiceManager() );
+        return xMSF1;
+    }
+
+    // -----------------------------------------------------------------------------------------------------------------
+    @BeforeClass
+    public static void setUpConnection() throws Exception
+    {
+        System.out.println( "--------------------------------------------------------------------------------" );
+        System.out.println( "connecting ..." );
+        m_connection.setUp();
+    }
+
+    // -----------------------------------------------------------------------------------------------------------------
+    @AfterClass
+    public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception
+    {
+        System.out.println();
+        System.out.println( "tearing down connection" );
+        m_connection.tearDown();
+        System.out.println( "--------------------------------------------------------------------------------" );
+    }
+
+    private static final OfficeConnection   m_connection = new OfficeConnection();
+}

sfx2/qa/complex/sfx2/UndoManager.java

     }
 
     // -----------------------------------------------------------------------------------------------------------------
-//#i116813# disabled   @Test
+    @Test
     public void checkBrokenScripts() throws com.sun.star.uno.Exception, InterruptedException
     {
         System.out.println( "testing: broken scripts" );
         events.replaceByName( "OnViewCreated", scriptDescriptor );
 
         // The below doesn't work: event notification is broken in m96, see http://www.openoffice.org/issues/show_bug.cgi?id=116313
-/*        m_callbackCalled = false;
+        m_callbackCalled = false;
         m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" );
         assertTrue( "triggering an event did not work as expected - basic script not called", m_callbackCalled );
         // same as above: The script didn't close the context, but the OOo framework should have
         assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() );
- */
 
         // .............................................................................................................
         // scenario 4: let the script enter an Undo context, but not close it, as usual.

sfx2/source/dialog/filedlghelper.cxx

 			{
 				// respect the last "insert as link" state
 				sal_Bool bLink = (sal_Bool) aUserData.GetToken( 0, ' ' ).ToInt32();
-                if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ).hasValue() )
-                {
-				    aValue <<= bLink;
-				    xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue );
-                }
+				aValue <<= bLink;
+				xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue );
 
 				// respect the last "show preview" state
 				sal_Bool bShowPreview = (sal_Bool) aUserData.GetToken( 1, ' ' ).ToInt32();
-                if  ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ).hasValue() )
-                {
-				    aValue <<= bShowPreview;
-				    xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue );
-                }
+				aValue <<= bShowPreview;
+				xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue );
 
 				if ( !maPath.getLength() )
 					displayFolder( getInitPath( aUserData, 2 ) );

stoc/source/inspect/introspection.cxx

 #include <com/sun/star/container/XEnumerationAccess.hpp>
 
 #include <rtl/ustrbuf.hxx>
+#include <rtl/ref.hxx>
 #include <rtl/strbuf.hxx>
 #include <hash_map>
 
 using namespace com::sun::star::beans::MethodConcept;
 using namespace cppu;
 using namespace osl;
-using namespace rtl;
 
 #define IMPLEMENTATION_NAME "com.sun.star.comp.stoc.Introspection"
 #define SERVICE_NAME		"com.sun.star.beans.Introspection"
 // Hashtable fuer die Suche nach Namen
 struct hashName_Impl
 {
-	size_t operator()(const OUString Str) const
+	size_t operator()(const ::rtl::OUString Str) const
 	{
 		return (size_t)Str.hashCode();
 	}
 
 struct eqName_Impl
 {
-	sal_Bool operator()(const OUString Str1, const OUString Str2) const
+	sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const
 	{
 		return ( Str1 == Str2 );
 	}
 
 typedef std::hash_map
 <
-	OUString,
+    ::rtl::OUString,
 	sal_Int32,
 	hashName_Impl,
 	eqName_Impl
 // konvertierten Namen, dient zur Unterst�tzung von XExactName
 typedef std::hash_map
 <
-	OUString,
-	OUString,
+    ::rtl::OUString,
+    ::rtl::OUString,
 	hashName_Impl,
 	eqName_Impl
 >
 	{
 		delete[] mpOrgPropertyHandleArray;
 	}
-	sal_Int32 getPropertyIndex( const OUString& aPropertyName ) const;
-	sal_Int32 getMethodIndex( const OUString& aMethodName ) const;
+	sal_Int32 getPropertyIndex( const ::rtl::OUString& aPropertyName ) const;
+	sal_Int32 getMethodIndex( const ::rtl::OUString& aMethodName ) const;
 
 	void acquire() { nRefCount++; }
 	void release()
 	}
 
 	// Methoden von XIntrospectionAccess (ALT, jetzt nur Impl)
-	void setPropertyValue(const Any& obj, const OUString& aPropertyName, const Any& aValue) const;
-//	void setPropertyValue(Any& obj, const OUString& aPropertyName, const Any& aValue) const;
-	Any getPropertyValue(const Any& obj, const OUString& aPropertyName) const;
+	void setPropertyValue(const Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue) const;
+//	void setPropertyValue(Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue) const;
+	Any getPropertyValue(const Any& obj, const ::rtl::OUString& aPropertyName) const;
 	void setPropertyValueByIndex(const Any& obj, sal_Int32 nIndex, const Any& aValue) const;
 //	void setPropertyValueByIndex(Any& obj, sal_Int32 nIndex, const Any& aValue) const;
 	Any getPropertyValueByIndex(const Any& obj, sal_Int32 nIndex) const;
 // Von Hand refcounten !!!
 
 
-sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPropertyName ) const
+sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const ::rtl::OUString& aPropertyName ) const
 {
 	sal_Int32 iHashResult = -1;
 	IntrospectionAccessStatic_Impl* pThis = (IntrospectionAccessStatic_Impl*)this;
 	return iHashResult;
 }
 
-sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMethodName ) const
+sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const ::rtl::OUString& aMethodName ) const
 {
 	sal_Int32 iHashResult = -1;
 	IntrospectionAccessStatic_Impl* pThis = (IntrospectionAccessStatic_Impl*)this;
 			if( nFound == -1 )
 				break;
 
-			OUString aPureMethodName = aMethodName.copy( nFound + 1 );
+		    ::rtl::OUString aPureMethodName = aMethodName.copy( nFound + 1 );
 
 			aIt = pThis->maMethodNameMap.find( aPureMethodName );
 			if( !( aIt == pThis->maMethodNameMap.end() ) )
 			{
 				// Check if it can be a type?
 				// Problem: Does not work if package names contain _ ?!
-				OUString aStr = aMethodName.copy( 0, nFound );
-				OUString aTypeName = aStr.replace( '_', '.' );
+			    ::rtl::OUString aStr = aMethodName.copy( 0, nFound );
+			    ::rtl::OUString aTypeName = aStr.replace( '_', '.' );
 				Reference< XIdlClass > xClass = mxCoreReflection->forName( aTypeName );
 				if( xClass.is() )
 				{
 						{
 							const Reference<XIdlMethod> xMethod2 = pMethods[ i ];
 
-							OUString aTestClassName = xMethod2->getDeclaringClass()->getName();
-							OUString aTestMethodName = xMethod2->getName();
+						    ::rtl::OUString aTestClassName = xMethod2->getDeclaringClass()->getName();
+						    ::rtl::OUString aTestMethodName = xMethod2->getName();
 
 							if( xMethod2->getName() == aPureMethodName )
 							{
 	return iHashResult;
 }
 
-void IntrospectionAccessStatic_Impl::setPropertyValue( const Any& obj, const OUString& aPropertyName, const Any& aValue ) const
-//void IntrospectionAccessStatic_Impl::setPropertyValue( Any& obj, const OUString& aPropertyName, const Any& aValue ) const
+void IntrospectionAccessStatic_Impl::setPropertyValue( const Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue ) const
+//void IntrospectionAccessStatic_Impl::setPropertyValue( Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue ) const
 {
 	sal_Int32 i = getPropertyIndex( aPropertyName );
 	if( i != -1 )
 			if( eValType == TypeClass_INTERFACE )
 			{
 				Type aPropType = rProp.Type;
-				OUString aTypeName( aPropType.getTypeName() );
+			    ::rtl::OUString aTypeName( aPropType.getTypeName() );
 				Reference< XIdlClass > xPropClass = mxCoreReflection->forName( aTypeName );
 				//Reference<XIdlClass> xPropClass = rProp.Type;
 				if( xPropClass.is() && xPropClass->getTypeClass() == TypeClass_INTERFACE )
 	}
 }
 
-Any IntrospectionAccessStatic_Impl::getPropertyValue( const Any& obj, const OUString& aPropertyName ) const
+Any IntrospectionAccessStatic_Impl::getPropertyValue( const Any& obj, const ::rtl::OUString& aPropertyName ) const
 {
 	sal_Int32 i = getPropertyIndex( aPropertyName );
 	if( i != -1 )
 
 
 //*******************************
+//*** ImplIntrospectionAccess ***
+//*******************************
+
+// Neue Impl-Klasse im Rahmen der Introspection-Umstellung auf Instanz-gebundene
+// Introspection mit Property-Zugriff ueber XPropertySet. Die alte Klasse
+// ImplIntrospectionAccess lebt als IntrospectionAccessStatic_Impl
+class ImplIntrospectionAccess : public IntrospectionAccessHelper
+{
+	friend class ImplIntrospection;
+
+	// Untersuchtes Objekt
+	Any maInspectedObject;
+
+	// Als Interface
+	Reference<XInterface> mxIface;
+
+	// Statische Daten der Introspection
+	IntrospectionAccessStatic_Impl* mpStaticImpl;
+
+	// Adapter-Implementation
+    WeakReference< XInterface > maAdapter;
+
+	// Letzte Sequence, die bei getProperties geliefert wurde (Optimierung)
+    Sequence<Property> maLastPropertySeq;
+	sal_Int32 mnLastPropertyConcept;
+
+	// Letzte Sequence, die bei getMethods geliefert wurde (Optimierung)
+    Sequence<Reference<XIdlMethod> > maLastMethodSeq;
+	sal_Int32 mnLastMethodConcept;
+
+public:
+	ImplIntrospectionAccess( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ );
+	~ImplIntrospectionAccess();
+
+	// Methoden von XIntrospectionAccess
+    virtual sal_Int32 SAL_CALL getSuppliedMethodConcepts(void)
+		throw( RuntimeException );
+    virtual sal_Int32 SAL_CALL getSuppliedPropertyConcepts(void)
+		throw( RuntimeException );
+    virtual Property SAL_CALL getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts)
+		throw( NoSuchElementException, RuntimeException );
+    virtual sal_Bool SAL_CALL hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts)
+		throw( RuntimeException );
+    virtual Sequence< Property > SAL_CALL getProperties(sal_Int32 PropertyConcepts)
+	  	throw( RuntimeException );
+    virtual Reference<XIdlMethod> SAL_CALL getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts)
+	  	throw( NoSuchMethodException, RuntimeException );
+    virtual sal_Bool SAL_CALL hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts)
+	  	throw( RuntimeException );
+    virtual Sequence< Reference<XIdlMethod> > SAL_CALL getMethods(sal_Int32 MethodConcepts)
+	  	throw( RuntimeException );
+    virtual Sequence< Type > SAL_CALL getSupportedListeners(void)
+	  	throw( RuntimeException );
+    using OWeakObject::queryAdapter;
+    virtual Reference<XInterface> SAL_CALL queryAdapter( const Type& rType )
+	  	throw( IllegalTypeException, RuntimeException );
+
+	// Methoden von XMaterialHolder
+    virtual Any SAL_CALL getMaterial(void) throw(RuntimeException);
+
+	// Methoden von XExactName
+    virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException );
+};
+
+ImplIntrospectionAccess::ImplIntrospectionAccess
+	( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ )
+		: maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), maAdapter()
+{
+	mpStaticImpl->acquire();
+
+	// Objekt als Interface merken, wenn moeglich
+	TypeClass eType = maInspectedObject.getValueType().getTypeClass();
+	if( eType == TypeClass_INTERFACE )
+		mxIface = *(Reference<XInterface>*)maInspectedObject.getValue();
+
+	mnLastPropertyConcept = -1;
+	mnLastMethodConcept = -1;
+}
+
+ImplIntrospectionAccess::~ImplIntrospectionAccess()
+{
+	mpStaticImpl->release();
+}
+
+
+//*******************************
 //*** ImplIntrospectionAdapter ***
 //*******************************
 
 	public OWeakObject
 {
 	// Parent-Objekt
-	ImplIntrospectionAccess* mpAccess;
+    ::rtl::Reference< ImplIntrospectionAccess > mpAccess;
 
 	// Untersuchtes Objekt
 	const Any& mrInspectedObject;
 
 	// Methoden von XPropertySet
 	virtual Reference<XPropertySetInfo> SAL_CALL getPropertySetInfo() throw( RuntimeException );
-    virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const Any& aValue)
+    virtual void SAL_CALL setPropertyValue(const ::rtl::OUString& aPropertyName, const Any& aValue)
 		throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException );
-    virtual Any SAL_CALL getPropertyValue(const OUString& aPropertyName)
+    virtual Any SAL_CALL getPropertyValue(const ::rtl::OUString& aPropertyName)
 		throw( UnknownPropertyException, WrappedTargetException, RuntimeException );
-    virtual void SAL_CALL addPropertyChangeListener(const OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener) 
+    virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener) 
 		throw( UnknownPropertyException, WrappedTargetException, RuntimeException );
-    virtual void SAL_CALL removePropertyChangeListener(const OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener) 
+    virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener) 
 		throw( UnknownPropertyException, WrappedTargetException, RuntimeException );
-    virtual void SAL_CALL addVetoableChangeListener(const OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener) 
+    virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener) 
 		throw( UnknownPropertyException, WrappedTargetException, RuntimeException );
-    virtual void SAL_CALL removeVetoableChangeListener(const OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener) 
+    virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener) 
 		throw( UnknownPropertyException, WrappedTargetException, RuntimeException );
 
 	// Methoden von XFastPropertySet
 
 	// Methoden von XPropertySetInfo
 	virtual Sequence< Property > SAL_CALL getProperties(void) throw( RuntimeException );
-	virtual Property SAL_CALL getPropertyByName(const OUString& Name) throw( RuntimeException );
-	virtual sal_Bool SAL_CALL hasPropertyByName(const OUString& Name) throw( RuntimeException );
+	virtual Property SAL_CALL getPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException );
+	virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException );
 
 	// Methoden von XElementAccess
     virtual Type SAL_CALL getElementType(void) throw( RuntimeException );
     virtual sal_Bool SAL_CALL hasElements(void) throw( RuntimeException );
 
 	// Methoden von XNameAccess
-    virtual Any SAL_CALL getByName(const OUString& Name)
+    virtual Any SAL_CALL getByName(const ::rtl::OUString& Name)
 		throw( NoSuchElementException, WrappedTargetException, RuntimeException );
-    virtual Sequence<OUString> SAL_CALL getElementNames(void) throw( RuntimeException );
-    virtual sal_Bool SAL_CALL hasByName(const OUString& Name) throw( RuntimeException );
+    virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( RuntimeException );
+    virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( RuntimeException );
 
 	// Methoden von XNameContainer
-	virtual void SAL_CALL insertByName(const OUString& Name, const Any& Element)
+	virtual void SAL_CALL insertByName(const ::rtl::OUString& Name, const Any& Element)
 		throw( IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException );
-	virtual void SAL_CALL replaceByName(const OUString& Name, const Any& Element)
+	virtual void SAL_CALL replaceByName(const ::rtl::OUString& Name, const Any& Element)
 		throw( IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException );
-	virtual void SAL_CALL removeByName(const OUString& Name)
+	virtual void SAL_CALL removeByName(const ::rtl::OUString& Name)
 		throw( NoSuchElementException, WrappedTargetException, RuntimeException );
 
 	// Methoden von XIndexAccess
 }
 
 
-//*******************************
-//*** ImplIntrospectionAccess ***
-//*******************************
-
-// Neue Impl-Klasse im Rahmen der Introspection-Umstellung auf Instanz-gebundene
-// Introspection mit Property-Zugriff ueber XPropertySet. Die alte Klasse
-// ImplIntrospectionAccess lebt als IntrospectionAccessStatic_Impl
-class ImplIntrospectionAccess : IntrospectionAccessHelper
-{
-	friend class ImplIntrospection;
-
-	// Untersuchtes Objekt
-	Any maInspectedObject;
-
-	// Als Interface
-	Reference<XInterface> mxIface;
-
-	// Statische Daten der Introspection
-	IntrospectionAccessStatic_Impl* mpStaticImpl;
-
-	// Adapter-Implementation
-	ImplIntrospectionAdapter* mpAdapter;
-
-	// Letzte Sequence, die bei getProperties geliefert wurde (Optimierung)
-    Sequence<Property> maLastPropertySeq;
-	sal_Int32 mnLastPropertyConcept;
-
-	// Letzte Sequence, die bei getMethods geliefert wurde (Optimierung)
-    Sequence<Reference<XIdlMethod> > maLastMethodSeq;
-	sal_Int32 mnLastMethodConcept;
-
-public:
-	ImplIntrospectionAccess( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ );
-	~ImplIntrospectionAccess();
-
-	// Methoden von XIntrospectionAccess
-    virtual sal_Int32 SAL_CALL getSuppliedMethodConcepts(void)
-		throw( RuntimeException );
-    virtual sal_Int32 SAL_CALL getSuppliedPropertyConcepts(void)
-		throw( RuntimeException );
-    virtual Property SAL_CALL getProperty(const OUString& Name, sal_Int32 PropertyConcepts)
-		throw( NoSuchElementException, RuntimeException );
-    virtual sal_Bool SAL_CALL hasProperty(const OUString& Name, sal_Int32 PropertyConcepts)
-		throw( RuntimeException );
-    virtual Sequence< Property > SAL_CALL getProperties(sal_Int32 PropertyConcepts)
-	  	throw( RuntimeException );
-    virtual Reference<XIdlMethod> SAL_CALL getMethod(const OUString& Name, sal_Int32 MethodConcepts)
-	  	throw( NoSuchMethodException, RuntimeException );
-    virtual sal_Bool SAL_CALL hasMethod(const OUString& Name, sal_Int32 MethodConcepts)
-	  	throw( RuntimeException );
-    virtual Sequence< Reference<XIdlMethod> > SAL_CALL getMethods(sal_Int32 MethodConcepts)
-	  	throw( RuntimeException );
-    virtual Sequence< Type > SAL_CALL getSupportedListeners(void)
-	  	throw( RuntimeException );
-    using OWeakObject::queryAdapter;
-    virtual Reference<XInterface> SAL_CALL queryAdapter( const Type& rType )
-	  	throw( IllegalTypeException, RuntimeException );
-
-	// Methoden von XMaterialHolder
-    virtual Any SAL_CALL getMaterial(void) throw(RuntimeException);
-
-	// Methoden von XExactName
-    virtual OUString SAL_CALL getExactName( const OUString& rApproximateName ) throw( RuntimeException );
-};
-
-ImplIntrospectionAccess::ImplIntrospectionAccess
-	( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ )
-		: maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), mpAdapter( NULL )
-{
-	mpStaticImpl->acquire();
-
-	// Objekt als Interface merken, wenn moeglich
-	TypeClass eType = maInspectedObject.getValueType().getTypeClass();
-	if( eType == TypeClass_INTERFACE )
-		mxIface = *(Reference<XInterface>*)maInspectedObject.getValue();
-
-	mnLastPropertyConcept = -1;
-	mnLastMethodConcept = -1;
-}
-
-ImplIntrospectionAccess::~ImplIntrospectionAccess()
-{
-	mpStaticImpl->release();
-
-	// Eigene Referenz loslassen
-	if (mpAdapter)
-		mpAdapter->release();
-}
-
-
 //***************************************************
 //*** Implementation von ImplIntrospectionAdapter ***
 //***************************************************
 	return (XPropertySetInfo *)this;
 }
 
-void ImplIntrospectionAdapter::setPropertyValue(const OUString& aPropertyName, const Any& aValue)
+void ImplIntrospectionAdapter::setPropertyValue(const ::rtl::OUString& aPropertyName, const Any& aValue)
 	throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException )
 {
 	mpStaticImpl->setPropertyValue( mrInspectedObject, aPropertyName, aValue );
 }
 
-Any ImplIntrospectionAdapter::getPropertyValue(const OUString& aPropertyName)
+Any ImplIntrospectionAdapter::getPropertyValue(const ::rtl::OUString& aPropertyName)
 	throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
 	return mpStaticImpl->getPropertyValue( mrInspectedObject, aPropertyName );
 }
 
-void ImplIntrospectionAdapter::addPropertyChangeListener(const OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener)
+void ImplIntrospectionAdapter::addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener)
 	throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
 	if( mxIface.is() )
 	}
 }
 
-void ImplIntrospectionAdapter::removePropertyChangeListener(const OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener)
+void ImplIntrospectionAdapter::removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener)
 	throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
 	if( mxIface.is() )
 	}
 }
 
-void ImplIntrospectionAdapter::addVetoableChangeListener(const OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener)
+void ImplIntrospectionAdapter::addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener)
 	throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
 	if( mxIface.is() )
 	}
 }
 
-void ImplIntrospectionAdapter::removeVetoableChangeListener(const OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener)
+void ImplIntrospectionAdapter::removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference<XVetoableChangeListener>& aListener)
 	throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
 	if( mxIface.is() )
 	return mpStaticImpl->getProperties();
 }
 
-Property ImplIntrospectionAdapter::getPropertyByName(const OUString& Name)
+Property ImplIntrospectionAdapter::getPropertyByName(const ::rtl::OUString& Name)
 	throw( RuntimeException )
 {
 	return mpAccess->getProperty( Name, PropertyConcept::ALL );
 }
 
-sal_Bool ImplIntrospectionAdapter::hasPropertyByName(const OUString& Name)
+sal_Bool ImplIntrospectionAdapter::hasPropertyByName(const ::rtl::OUString& Name)
 	throw( RuntimeException )
 {
 	return mpAccess->hasProperty( Name, PropertyConcept::ALL );
 }
 
 // Methoden von XNameAccess
-Any ImplIntrospectionAdapter::getByName(const OUString& Name)
+Any ImplIntrospectionAdapter::getByName(const ::rtl::OUString& Name)
 	throw( NoSuchElementException, WrappedTargetException, RuntimeException )
 {
 	return mxObjNameAccess->getByName( Name );
 }
 
-Sequence< OUString > ImplIntrospectionAdapter::getElementNames(void)
+Sequence< ::rtl::OUString > ImplIntrospectionAdapter::getElementNames(void)
 	throw( RuntimeException )
 {
 	return mxObjNameAccess->getElementNames();
 }
 
-sal_Bool ImplIntrospectionAdapter::hasByName(const OUString& Name)
+sal_Bool ImplIntrospectionAdapter::hasByName(const ::rtl::OUString& Name)
 	throw( RuntimeException )
 {
 	return mxObjNameAccess->hasByName( Name );
 }
 
 // Methoden von XNameContainer
-void ImplIntrospectionAdapter::insertByName(const OUString& Name, const Any& Element)
+void ImplIntrospectionAdapter::insertByName(const ::rtl::OUString& Name, const Any& Element)
 	throw( IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException )
 {
 	mxObjNameContainer->insertByName( Name, Element );
 }
 
-void ImplIntrospectionAdapter::replaceByName(const OUString& Name, const Any& Element)
+void ImplIntrospectionAdapter::replaceByName(const ::rtl::OUString& Name, const Any& Element)
 	throw( IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException )
 {
 	mxObjNameContainer->replaceByName( Name, Element );
 }
 
-void ImplIntrospectionAdapter::removeByName(const OUString& Name)
+void ImplIntrospectionAdapter::removeByName(const ::rtl::OUString& Name)
 	throw( NoSuchElementException, WrappedTargetException, RuntimeException )
 {
 	mxObjNameContainer->removeByName( Name );
 			METHODS;
 }
 
-Property ImplIntrospectionAccess::getProperty(const OUString& Name, sal_Int32 PropertyConcepts)
+Property ImplIntrospectionAccess::getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts)
 	throw( NoSuchElementException, RuntimeException )
 {
 	Property aRet;
 	return aRet;
 }
 
-sal_Bool ImplIntrospectionAccess::hasProperty(const OUString& Name, sal_Int32 PropertyConcepts)
+sal_Bool ImplIntrospectionAccess::hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts)
 	throw( RuntimeException )
 {
 	sal_Int32 i = mpStaticImpl->getPropertyIndex( Name );
 
 		/*
 		// Property mit Concepts ausgeben
-		OUString aPropName = pSourceProps[ i ].Name;
+	    ::rtl::OUString aPropName = pSourceProps[ i ].Name;
 		String aNameStr = OOUStringToString(aPropName, CHARSET_SYSTEM);
 		String ConceptStr;
 		if( nConcept & PROPERTYSET )
 	return maLastPropertySeq;
 }
 
-Reference<XIdlMethod> ImplIntrospectionAccess::getMethod(const OUString& Name, sal_Int32 MethodConcepts)
+Reference<XIdlMethod> ImplIntrospectionAccess::getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts)
 	throw( NoSuchMethodException, RuntimeException )
 {
 	Reference<XIdlMethod> xRet;
 	return xRet;
 }
 
-sal_Bool ImplIntrospectionAccess::hasMethod(const OUString& Name, sal_Int32 MethodConcepts)
+sal_Bool ImplIntrospectionAccess::hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts)
 	throw( RuntimeException )
 {
 	sal_Int32 i = mpStaticImpl->getMethodIndex( Name );
 	throw( IllegalTypeException, RuntimeException )
 {
 	// Gibt es schon einen Adapter?
-	if( !mpAdapter )
+    Reference< XInterface > xAdapter( maAdapter );
+	if( !xAdapter.is() )
 	{
-		((ImplIntrospectionAccess*)this)->mpAdapter = 
-			new ImplIntrospectionAdapter( this, maInspectedObject, mpStaticImpl );
-
-		// Selbst eine Referenz halten
-		mpAdapter->acquire();
+        xAdapter = *( new ImplIntrospectionAdapter( this, maInspectedObject, mpStaticImpl ) );
+        maAdapter = xAdapter;
 	}
 
 	Reference<XInterface> xRet;
-	Any aIfaceAny( mpAdapter->queryInterface( rType ) );
-	if( aIfaceAny.hasValue() )
-		xRet = *(Reference<XInterface>*)aIfaceAny.getValue();
-
+	xAdapter->queryInterface( rType ) >>= xRet;
 	return xRet;
 }
 
 	return maInspectedObject;
 }
 
-// Hilfs-Funktion zur LowerCase-Wandlung eines OUString
-OUString toLower( OUString aUStr )
+// Hilfs-Funktion zur LowerCase-Wandlung eines ::rtl::OUString
+::rtl::OUString toLower( ::rtl::OUString aUStr )
 {
 	// Tabelle fuer XExactName pflegen
     ::rtl::OUString aOWStr( aUStr.getStr() );
 	::rtl::OUString aOWLowerStr = aOWStr.toAsciiLowerCase();
-	OUString aLowerUStr( aOWLowerStr.getStr() );
+    ::rtl::OUString aLowerUStr( aOWLowerStr.getStr() );
 	return aLowerUStr;
 }
 
 // Methoden von XExactName
-OUString ImplIntrospectionAccess::getExactName( const OUString& rApproximateName ) throw( RuntimeException )
+::rtl::OUString ImplIntrospectionAccess::getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException )
 {
-	OUString aRetStr;
+    ::rtl::OUString aRetStr;
 	LowerToExactNameMap::iterator aIt = 
 		mpStaticImpl->maLowerToExactNameMap.find( toLower( rApproximateName ) );
 	if( !( aIt == mpStaticImpl->maLowerToExactNameMap.end() ) )
     Sequence<sal_Int8>	SAL_CALL getImplementationId(  ) throw( RuntimeException );
 
 	// XServiceInfo
-	OUString 					SAL_CALL getImplementationName() throw();
-    sal_Bool					SAL_CALL supportsService(const OUString& ServiceName) throw();
-    Sequence< OUString > 		SAL_CALL getSupportedServiceNames(void) throw();
-    static OUString SAL_CALL	getImplementationName_Static(  );
-    static Sequence< OUString > SAL_CALL getSupportedServiceNames_Static(void) throw();
+    ::rtl::OUString 					SAL_CALL getImplementationName() throw();
+    sal_Bool					SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw();
+    Sequence< ::rtl::OUString > 		SAL_CALL getSupportedServiceNames(void) throw();
+    static ::rtl::OUString SAL_CALL	getImplementationName_Static(  );
+    static Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static(void) throw();
 
 	// Methoden von XIntrospection
     virtual Reference<XIntrospectionAccess> SAL_CALL inspect(const Any& aToInspectObj)
 #endif
 
 	// Spezielle Klassen holen
-// 	Reference< XInterface > xServiceIface = m_xSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) );
+// 	Reference< XInterface > xServiceIface = m_xSMgr->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) );
 // 	if( xServiceIface.is() )
 // 		mxCoreReflection = Reference< XIdlReflection >::query( xServiceIface );
     Reference< XPropertySet > xProps( rXSMgr, UNO_QUERY );
     {
         Reference< XComponentContext > xContext;
         xProps->getPropertyValue(
-            OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext;
+            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext;
         OSL_ASSERT( xContext.is() );
         if (xContext.is())
         {
             xContext->getValueByName(
-                OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection") ) ) >>= mxCoreReflection;
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection") ) ) >>= mxCoreReflection;
             OSL_ENSURE( mxCoreReflection.is(), "### CoreReflection singleton not accessible!?" );
         }
     }
     if (! mxCoreReflection.is())
     {
         throw DeploymentException(
-            OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection singleton not accessible") ),
+            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection singleton not accessible") ),
             Reference< XInterface >() );
     }
     
-	mxElementAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XElementAccess")) );
-	mxNameContainerClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameContainer")) );
-	mxNameAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess")) );
-	mxIndexContainerClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexContainer")) );
-	mxIndexAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexAccess")) );
-	mxEnumerationAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XEnumerationAccess")) );
-	mxInterfaceClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")) );
-	mxAggregationClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XAggregation")) );
+	mxElementAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XElementAccess")) );
+	mxNameContainerClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameContainer")) );
+	mxNameAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess")) );
+	mxIndexContainerClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexContainer")) );
+	mxIndexAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexAccess")) );
+	mxEnumerationAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XEnumerationAccess")) );
+	mxInterfaceClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")) );
+	mxAggregationClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XAggregation")) );
 	mbDisposed = sal_False;
 }
 
 
 
 // XServiceInfo
-OUString ImplIntrospection::getImplementationName() throw()
+::rtl::OUString ImplIntrospection::getImplementationName() throw()
 {
 	return getImplementationName_Static();	
 }
 
 // XServiceInfo
-sal_Bool ImplIntrospection::supportsService(const OUString& ServiceName) throw()
+sal_Bool ImplIntrospection::supportsService(const ::rtl::OUString& ServiceName) throw()
 {
-	Sequence< OUString > aSNL = getSupportedServiceNames();
-	const OUString * pArray = aSNL.getConstArray();
+	Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames();
+	const ::rtl::OUString * pArray = aSNL.getConstArray();
 	for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
 		if( pArray[i] == ServiceName )
 			return sal_True;
 }
 
 // XServiceInfo
-Sequence< OUString > ImplIntrospection::getSupportedServiceNames(void) throw()
+Sequence< ::rtl::OUString > ImplIntrospection::getSupportedServiceNames(void) throw()
 {
 	return getSupportedServiceNames_Static();
 }
 
 //*************************************************************************
 // Helper XServiceInfo
-OUString ImplIntrospection::getImplementationName_Static(  ) 
+::rtl::OUString ImplIntrospection::getImplementationName_Static(  ) 
 {
-	return OUString::createFromAscii( IMPLEMENTATION_NAME );
+	return ::rtl::OUString::createFromAscii( IMPLEMENTATION_NAME );
 }
 
 // ORegistryServiceManager_Static
-Sequence< OUString > ImplIntrospection::getSupportedServiceNames_Static(void) throw()
+Sequence< ::rtl::OUString > ImplIntrospection::getSupportedServiceNames_Static(void) throw()
 {
-	Sequence< OUString > aSNS( 1 );
-	aSNS.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
+	Sequence< ::rtl::OUString > aSNS( 1 );
+	aSNS.getArray()[0] = ::rtl::OUString::createFromAscii( SERVICE_NAME );
 	return aSNS;
 }
 
 	rType.getDescription( &pTD );
 	if( pTD )
 	{
-		OUString sOWName( pTD->pTypeName );
+	    ::rtl::OUString sOWName( pTD->pTypeName );
 		if( !xRefl.is() )
 		{
-			xRefl = Reference< XIdlReflection >( xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ), UNO_QUERY );
+			xRefl = Reference< XIdlReflection >( xMgr->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ), UNO_QUERY );
 			OSL_ENSURE( xRefl.is(), "### no corereflection!" );
 		}
 		xRetClass = xRefl->forName( sOWName );
 				pAccess->mnPropertySetPropCount++;
 
 				// Namen in Hashtable eintragen, wenn nicht schon bekannt
-				OUString aPropName = rProp.Name;
+			    ::rtl::OUString aPropName = rProp.Name;
 
 				// Haben wir den Namen schon?
 				IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName );
 				else
 				{
 					OSL_ENSURE( sal_False, 
-						OString( "Introspection: Property \"" ) + 
-						OUStringToOString( aPropName, RTL_TEXTENCODING_ASCII_US ) +
-						OString( "\" found more than once in PropertySet" ) );
+						::rtl::OString( "Introspection: Property \"" ) + 
+					    ::rtl::OUStringToOString( aPropName, RTL_TEXTENCODING_ASCII_US ) +
+                        ::rtl::OString( "\" found more than once in PropertySet" ) );
 				}
 
 				// Count pflegen
 
 							// In eigenes Property-Array eintragen
 							Property& rProp = pAllPropArray[ rPropCount ];
-							OUString aFieldName = xField->getName();
+						    ::rtl::OUString aFieldName = xField->getName();
 							rProp.Name = aFieldName;
 							rProp.Handle = rPropCount;
 							Type aFieldType( xPropType->getTypeClass(), xPropType->getName() );
 												? READONLY : 0;
 
 							// Namen in Hashtable eintragen
-							OUString aPropName = rProp.Name;
+						    ::rtl::OUString aPropName = rProp.Name;
 
 							// Haben wir den Namen schon?
 							IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName );
 							pLocalMethodConcepts[ i ] = 0;
 						}
 
-						OUString aMethName;
-						OUString aPropName;
-						OUString aStartStr;
+					    ::rtl::OUString aMethName;
+					    ::rtl::OUString aPropName;
+					    ::rtl::OUString aStartStr;
 						for( i = 0 ; i < nSourceMethodCount ; i++ )
 						{
 							// Methode ansprechen
 								}
 								else
 								{
-									if( aMethName != OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) )
+									if( aMethName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) )
 									{
 										rMethodConcept_i |= MethodConcept::DANGEROUS;
 										continue;
 							}
 							else if( rxMethod_i->getDeclaringClass()->equals( mxAggregationClass ) )
 							{
-								if( aMethName == OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) )
+								if( aMethName == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) )
 								{
 									rMethodConcept_i |= MethodConcept::DANGEROUS;
 									continue;
 
 							// Ist es eine get-Methode?
 							aStartStr = aMethName.copy( 0, 3 );
-							if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("get")) )
+							if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("get")) )
 							{
 								// Namen der potentiellen Property
 								aPropName = aMethName.copy( 3 );
 										continue;
 
 									// Name holen und auswerten
-									OUString aMethName2 = rxMethod_k->getName();
-									OUString aStartStr2 = aMethName2.copy( 0, 3 );
-									// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
-									if( !( aStartStr2 == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) )
+								    ::rtl::OUString aMethName2 = rxMethod_k->getName();
+								    ::rtl::OUString aStartStr2 = aMethName2.copy( 0, 3 );
+									// ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!!
+									if( !( aStartStr2 == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) )
 										continue;
 
 									// Ist es denn der gleiche Name?
-									OUString aPropName2 = aMethName2.copy( 3 );
-									// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
+								    ::rtl::OUString aPropName2 = aMethName2.copy( 3 );
+									// ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!!
 									if( !( aPropName == aPropName2 ) )
 										continue;
 
 							}
 
 							// Ist es eine addListener-Methode?
-							else if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("add")) )
+							else if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("add")) )
 							{
-								OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) );
+							    ::rtl::OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) );
 
 								// Namen der potentiellen Property
 								sal_Int32 nStrLen = aMethName.getLength();
                                 sal_Int32 nCopyLen = nStrLen - aListenerStr.getLength();
-                                OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 );
+                                ::rtl::OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 );
 
 								// Endet das Teil auf Listener?
-								// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
+								// ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!!
 								if( !( aEndStr == aListenerStr ) )
 									continue;
 
 								// Welcher Listener?
-								OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 );
+							    ::rtl::OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 );
 
 								// TODO: Hier koennten noch genauere Pruefungen vorgenommen werden
 								// - Rueckgabe-Typ
 										continue;
 
 									// Name holen und auswerten
-									OUString aMethName2 = rxMethod_k->getName();
+								    ::rtl::OUString aMethName2 = rxMethod_k->getName();
                                     sal_Int32 nNameLen = aMethName2.getLength();
                                     sal_Int32 nCopyLen2 = (nNameLen < 6) ? nNameLen : 6;
-									OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 );
-									OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) );
-									// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
+								    ::rtl::OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 );
+								    ::rtl::OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) );
+									// ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!!
 									if( !( aStartStr2 == aRemoveStr ) )
 										continue;
 
 									// Ist es denn der gleiche Listener?
 									if( aMethName2.getLength() - aRemoveStr.getLength() <= aListenerStr.getLength() )
 										continue;
-									OUString aListenerName2 = aMethName2.copy
+								    ::rtl::OUString aListenerName2 = aMethName2.copy
 										( 6, aMethName2.getLength() - aRemoveStr.getLength() - aListenerStr.getLength() );
-									// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
+									// ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!!
 									if( !( aListenerName == aListenerName2 ) )
 										continue;
 
 
 							// Ist es eine set-Methode ohne zugehoerige get-Methode?
 							aStartStr = aMethName.copy( 0, 3 );
-							if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) )
+							if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("set")) )
 							{
 								// Namen der potentiellen Property
 								aPropName = aMethName.copy( 3 );
 								const Reference<XIdlMethod>& rxMethod = pSourceMethods[i];
 
 								// Namen in Hashtable eintragen, wenn nicht schon bekannt
-								OUString aMethName2 = rxMethod->getName();
+							    ::rtl::OUString aMethName2 = rxMethod->getName();
 								IntrospectionNameMap::iterator aIt = rMethodNameMap.find( aMethName2 );
 								if( aIt == rMethodNameMap.end() )
 								{
 		{
 			Reference<XIdlField> xField = pFields[i];
 			Reference<XIdlClass> xPropType = xField->getType();
-			OUString aPropName = xField->getName();
+		    ::rtl::OUString aPropName = xField->getName();
 
 			// Ist die PropertySequence gross genug?
 			pAccess->checkPropertyArraysSize
 	{
 		Reference< XSingleServiceFactory > xFactory( createOneInstanceFactory(
 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
-			OUString::createFromAscii( pImplName ),
+		    ::rtl::OUString::createFromAscii( pImplName ),
 			stoc_inspect::ImplIntrospection_CreateInstance,
 			stoc_inspect::ImplIntrospection::getSupportedServiceNames_Static() ) );
 		

svl/inc/svl/undo.hxx

         /** clears the redo stack and removes the top undo action */
         virtual void            RemoveLastUndoAction() = 0;
 
-        // enables (true) or disables (false) recording of undo actions
-        // If undo actions are added while undo is disabled, they are deleted.
-        // Disabling undo does not clear the current undo buffer!
+        /** enables (true) or disables (false) recording of undo actions
+
+            If undo actions are added while undo is disabled, they are deleted.
+            Disabling undo does not clear the current undo buffer!
+
+            Multiple calls to <code>EnableUndo</code> are not cumulative. That is, calling <code>EnableUndo( false )</code>
+            twice, and then calling <code>EnableUndo( true )</code> means that Undo is enable afterwards.
+        */
         virtual void            EnableUndo( bool bEnable ) = 0;
 
         // returns true if undo is currently enabled

svl/source/undo/undo.cxx

 	SfxUndoArray*   pActUndoArray;
 	SfxUndoArray*   pFatherUndoArray;
 
-    sal_Int32       mnLockCount;
     sal_Int32       mnMarks;
     sal_Int32       mnEmptyMark;
+    bool            mbUndoEnabled;
     bool            mbDoing;
     bool            mbClearUntilTopLevel;
 
         :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) )
         ,pActUndoArray( NULL )
         ,pFatherUndoArray( NULL )
-        ,mnLockCount( 0 )
         ,mnMarks( 0 )
         ,mnEmptyMark(MARK_INVALID)
+        ,mbUndoEnabled( true )
         ,mbDoing( false )
         ,mbClearUntilTopLevel( false )
     {
 
 void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable )
 {
-    if ( !i_enable )
-        ++m_pData->mnLockCount;
-    else
-    {
-        OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" );
-        if ( m_pData->mnLockCount > 0 )
-            --m_pData->mnLockCount;
-    }
+    if ( m_pData->mbUndoEnabled == i_enable )
+        return;
+    m_pData->mbUndoEnabled = i_enable;
 }
 
 //------------------------------------------------------------------------
 
 bool SfxUndoManager::ImplIsUndoEnabled_Lock() const
 {
-	return m_pData->mnLockCount == 0;
+	return m_pData->mbUndoEnabled;
 }
 
 //------------------------------------------------------------------------

sw/source/core/undo/docundo.cxx

 
 void UndoManager::EnableUndo(bool bEnable)
 {
-    // UGLY: SfxUndoManager has a counter to match enable/disable calls
-    //       but the writer code expects that a single call switches
-    while (IsUndoEnabled() != bEnable)
-    {
-        SfxUndoManager::EnableUndo(bEnable);
-    }
+    // SfxUndoManager does not have a counter anymore, but reverted to the old behavior of
+    // having a simple boolean flag for locking. So, simply forward.
+    SfxUndoManager::EnableUndo(bEnable);
 }
 
 void UndoManager::AddUndoAction(SfxUndoAction *pAction, sal_Bool bTryMerge)

sw/source/ui/uno/unomod.cxx

 				aOpt.setBrowseMode( bVal );
 				pView->GetWrtShell().ApplyViewOptions( aOpt );
 				pView->RecheckBrowseMode();
+
+				// must be set in mpViewOption as this will overwrite settings in _post!
+				mpViewOption->setBrowseMode( bVal );
+
+				// disable multiple layout
+				pView->GetDocShell()->ToggleBrowserMode(bVal, pView );
             }
 		}
 		break;

testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc

     sleep(10)
 
     Kontext "DocumentWriter"
-    	DocumentWriter.TypeKeys "<MOD1 SHIFT I>" ,  true ' EDIT / SELECT TEXT
-    	DocumentWriter.TypeKeys "<DOWN>" ,  true
+    	DocumentWriter.TypeKeys "<MOD1 SHIFT I>" ,  true ' EDIT / SELECT TEXT    	
         DocumentWriter.TypeKeys "<SHIFT END>" , true
         DocumentWriter.TypeKeys "<MOD1 C>" , true
 
 
     ' select next line and check content
     Kontext "DocumentWriter"
-        DocumentWriter.TypeKeys "<DOWN>" ,  true
+        DocumentWriter.TypeKeys "<DOWN>", 2, true
         DocumentWriter.TypeKeys "<SHIFT HOME>" , true
         DocumentWriter.TypeKeys "<MOD1 C>" , true
 

testautomation/dbaccess/optional/includes/xf_Submission.inc

     dim sLine as String
     
     Line Input #1, sLine
-    if sLine <> "<?xml version=""1.0""?>" then
-        warnlog "the first line in the xml document should <?xml version=""1.0""?> but it is " + sLine
+    if sLine <> "<?xml version=""1.0"" encoding=""UTF-8""?>" then
+        warnlog "the first line in the xml document should <?xml version=""1.0"" encoding=""UTF-8""?> but it is " + sLine
     endif
     Line Input #1, sLine
     if sLine <> "<instanceData><element1/></instanceData>" then

testautomation/dbaccess/required/includes/ReportBuilder01.inc

 
  'edit menu        
         
-        '/// check if there are 11 items in the edit menu.
-        printlog "check if there are 11 items in the edit menu."
+        '/// check if there are 14 items in the edit menu.
+        printlog "check if there are 14 items in the edit menu."
         ReportDesign.UseMenu 
         hMenuSelectNr(2)        
         iCount = hMenuItemGetCount()
-        if (iCount <> 11) then
-            warnlog "There should 11 items in the edit menu but there are " + iCount + " items."
+        if (iCount <> 14) then
+            warnlog "There should 14 items in the edit menu but there are " + iCount + " items."
         end if
         call hMenuClose()
 
 
  'insert menu        
         
-        '/// check if there are 3 items in the insert menu.
-        printlog "check if there are 3 items in the insert menu."
+        '/// check if there are 5 items in the insert menu.
+        printlog "check if there are 5 items in the insert menu."
         ReportDesign.UseMenu 
         hMenuSelectNr(4)