Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 06/04/2012 05:12 PM, Stephan Bergmann wrote:
Will look at the other four patches later.

And now also pushed the other four. Again, they needed some trivial merge fixes, and I added a number of tweaks to patches 2, 3, and 5 (see attachments for reference).

Thanks again,
Stephan
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 28e4072..9608f7b 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -1268,7 +1268,7 @@ void LibPage::ExportAsPackage( const String& aLibName )
         xHandler = Reference< task::XInteractionHandler >( xMSF->createInstance
             ( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), UNO_QUERY );
 
-        xSFA = Reference< XSimpleFileAccess2 > ( 
SimpleFileAccess::create(comphelper::getProcessComponentContext()) );
+        xSFA = SimpleFileAccess::create(comphelper::getProcessComponentContext());
 
         Sequence <Any> aServiceType(1);
         aServiceType[0] <<= TemplateDescription::FILESAVE_SIMPLE;
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
index 1bb9509..e6b7885 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
@@ -38,7 +38,7 @@
 #include <osl/mutex.hxx>
 #include <osl/thread.h>
 #include <cppuhelper/factory.hxx>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/lang/XSingleComponentFactory.hpp>
 
 #include "filterdetect.hxx"
 
@@ -58,10 +58,10 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
     OUString implName = OUString::createFromAscii( pImplName );
     if ( pServiceManager && implName.equals(FilterDetect_getImplementationName()) )
     {
-        Reference< XSingleServiceFactory > xFactory( createSingleFactory(
-            reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
+        Reference< XSingleComponentFactory > xFactory( createSingleComponentFactory(
+            FilterDetect_createInstance,
             OUString::createFromAscii( pImplName ),
-            FilterDetect_createInstance, FilterDetect_getSupportedServiceNames() ) );
+            FilterDetect_getSupportedServiceNames() ) );
 
         if (xFactory.is())
         {
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
index 1c64c82..63c32c0 100644
--- 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
+++ 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
@@ -35,7 +35,6 @@
 
 #include "filterdetect.hxx"
 #include <osl/diagnose.h>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/io/XActiveDataSource.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
 #include <com/sun/star/io/XInputStream.hpp>
@@ -56,6 +55,7 @@
 #include <com/sun/star/beans/PropertyState.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 #include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 
 
@@ -98,7 +98,7 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
     if (!xInStream.is())
     {
         // open the stream if it was not suplied by the framework
-        Reference< XSimpleFileAccess2 > xSFI(SimpleFileAccess::create(mxMSF));
+        Reference< XSimpleFileAccess2 > xSFI(SimpleFileAccess::create(mxContext));
         if (sURL.getLength() > 0)
         {
             try
@@ -231,10 +231,10 @@ Sequence< OUString > SAL_CALL FilterDetect_getSupportedServiceNames(  )
 #undef SERVICE_NAME1
 #undef SERVICE_NAME2
 
-Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< 
XMultiServiceFactory > & rSMgr)
+Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XComponentContext > 
& rContext)
     throw( Exception )
 {
-    return (cppu::OWeakObject*) new FilterDetect( rSMgr );
+    return (cppu::OWeakObject*) new FilterDetect( rContext );
 }
 
 // XServiceInfo
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
index 210d59c..f3b0382 100644
--- 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
+++ 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
@@ -47,6 +47,10 @@
 
 #include <cppuhelper/implbase3.hxx>
 
+namespace com { namespace sun { namespace star { namespace uno {
+    class XComponentContext;
+} } } }
+
 enum FilterType
 {
     FILTER_IMPORT,
@@ -61,7 +65,7 @@ class FilterDetect : public cppu::WeakImplHelper3 <com::sun::star::document::XEx
                      com::sun::star::lang::XServiceInfo>
 {
 protected:
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
     ::rtl::OUString msFilterName;
     ::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
@@ -74,8 +78,8 @@ protected:
         throw (::com::sun::star::uno::RuntimeException);
 
 public:
-    FilterDetect( const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
-        : mxMSF( rxMSF ) {}
+    FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext 
&rxContext)
+        : mxContext( rxContext ) {}
 
     virtual ~FilterDetect() {}
 
@@ -110,7 +114,7 @@ sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceNa
     throw ( ::com::sun::star::uno::RuntimeException );
 
 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
-SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
+SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XComponentContext > & rContext)
     throw ( ::com::sun::star::uno::Exception );
 
 #endif
diff --git a/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx 
b/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
index c905dc4..42f7da8 100644
--- a/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
+++ b/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
@@ -252,7 +252,6 @@ sal_Int32 SAL_CALL XMLScanner::run( const uno::Sequence< rtl::OUString >& aArgum
     aUcbInitSequence[0] <<= rtl::OUString("Local");
     aUcbInitSequence[1] <<= rtl::OUString("Office");
     uno::Reference<lang::XMultiServiceFactory> xServiceFactory(xContext->getServiceManager(), 
uno::UNO_QUERY_THROW);
-    uno::Reference<lang::XMultiComponentFactory> xFactory(xContext->getServiceManager(), 
uno::UNO_QUERY_THROW );
     if (::ucbhelper::ContentBroker::initialize(xServiceFactory, aUcbInitSequence))
     {
             rtl::OUString arg=aArguments[0];
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 4e12f88..c61b412 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -40,7 +40,6 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 
 #include <comphelper/processfactory.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
 #include "com/sun/star/deployment/thePackageManagerFactory.hpp"
 #include <com/sun/star/util/XMacroExpander.hpp>
 #include <com/sun/star/uri/XUriReferenceFactory.hpp>
@@ -967,15 +966,7 @@ ExtensionIteratorBase::ExtensionIteratorBase( const rtl::OUString& aLanguage )
 
 void ExtensionIteratorBase::init()
 {
-    Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
-    Reference< XPropertySet > xProps( xFactory, UNO_QUERY );
-    OSL_ASSERT( xProps.is() );
-    if (xProps.is())
-    {
-        xProps->getPropertyValue(
-            ::rtl::OUString( "DefaultContext" ) ) >>= m_xContext;
-        OSL_ASSERT( m_xContext.is() );
-    }
+    m_xContext = ::comphelper::getProcessComponentContext();
     if( !m_xContext.is() )
     {
         throw RuntimeException(
@@ -983,8 +974,7 @@ void ExtensionIteratorBase::init()
             Reference< XInterface >() );
     }
 
-    Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-    m_xSFA = ucb::SimpleFileAccess::create(xContext);
+    m_xSFA = ucb::SimpleFileAccess::create(m_xContext);
 
     m_bUserPackagesLoaded = false;
     m_bSharedPackagesLoaded = false;
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index e4a5a31..938c09e 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -288,11 +288,6 @@ struct FactoryInfo
                 xSubstVars
                     = css::uno::Reference< css::util::XStringSubstitution >(
                         css::util::PathSubstitution::create(xContext) );
-                if ( !xSubstVars.is() )
-                    throw css::uno::RuntimeException(
-                        ::rtl::OUString( "Cannot instanciate service "
-                                "com.sun.star.util.PathSubstitution"  ),
-                        css::uno::Reference< css::uno::XInterface >() );
             }
             return xSubstVars;
         }
diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx 
b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
index 883ac8a..413bc6e 100644
--- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
@@ -146,7 +146,7 @@ namespace dbaccess
 
         try
         {
-             m_pData->xURLTransformer = URLTransformer::create(_rContext.getUNOContext());
+            m_pData->xURLTransformer = URLTransformer::create(_rContext.getUNOContext());
         }
         catch( const Exception& )
         {
diff --git a/sd/source/ui/framework/module/ReadOnlyModeObserver.cxx 
b/sd/source/ui/framework/module/ReadOnlyModeObserver.cxx
index d151bc4..423d503 100644
--- a/sd/source/ui/framework/module/ReadOnlyModeObserver.cxx
+++ b/sd/source/ui/framework/module/ReadOnlyModeObserver.cxx
@@ -68,6 +68,7 @@ ReadOnlyModeObserver::ReadOnlyModeObserver (
     // Create a URL object for the slot name.
     maSlotNameURL.Complete = ".uno:EditDoc";
     Reference<util::XURLTransformer> 
xTransformer(util::URLTransformer::create(::comphelper::getProcessComponentContext()));
+    xTransformer->parseStrict(maSlotNameURL);
 
     if ( ! ConnectToDispatch())
     {
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index c105204..541b3c9 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -346,27 +346,24 @@ ContextMenuHelper::dispatchCommand(
     }
 
     util::URL aTargetURL;
+    aTargetURL.Complete = aCommandURL;
+    m_xURLTransformer->parseStrict( aTargetURL );
+
     uno::Reference< frame::XDispatch > xDispatch;
-    if ( m_xURLTransformer.is() )
+    uno::Reference< frame::XDispatchProvider > xDispatchProvider(
+        rFrame, uno::UNO_QUERY );
+    if ( xDispatchProvider.is() )
     {
-        aTargetURL.Complete = aCommandURL;
-        m_xURLTransformer->parseStrict( aTargetURL );
-
-        uno::Reference< frame::XDispatchProvider > xDispatchProvider(
-            rFrame, uno::UNO_QUERY );
-        if ( xDispatchProvider.is() )
+        try
+        {
+            xDispatch = xDispatchProvider->queryDispatch( aTargetURL, m_aSelf, 0 );
+        }
+        catch ( uno::RuntimeException& )
+        {
+            throw;
+        }
+        catch ( uno::Exception& )
         {
-            try
-            {
-                xDispatch = xDispatchProvider->queryDispatch( aTargetURL, m_aSelf, 0 );
-            }
-            catch ( uno::RuntimeException& )
-            {
-                throw;
-            }
-            catch ( uno::Exception& )
-            {
-            }
         }
     }
 
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ad26b23..df7d15e 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10568,8 +10568,7 @@ sal_Int32 PDFWriterImpl::setLinkURL( sal_Int32 nLinkId, const OUString& 
rURL )
     util::URL aURL;
     aURL.Complete = rURL;
 
-    if (m_xTrans.is())
-        m_xTrans->parseStrict( aURL );
+    m_xTrans->parseStrict( aURL );
 
     m_aLinks[ nLinkId ].m_aURL  = aURL.Complete;
 

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.