[Libreoffice-commits] core.git: 8 commits - filter/Library_filterconfig.mk filter/source

Stephan Bergmann sbergman at redhat.com
Thu Jun 5 15:20:29 PDT 2014


 filter/Library_filterconfig.mk                  |    2 
 filter/source/config/cache/basecontainer.cxx    |    4 
 filter/source/config/cache/filtercache.cxx      |   47 --------
 filter/source/config/cache/filtercache.hxx      |   37 +------
 filter/source/config/cache/lateinitlistener.cxx |  126 ------------------------
 filter/source/config/cache/lateinitlistener.hxx |  111 ---------------------
 filter/source/config/cache/lateinitthread.cxx   |   49 ---------
 filter/source/config/cache/lateinitthread.hxx   |   53 ----------
 8 files changed, 7 insertions(+), 422 deletions(-)

New commits:
commit f7fac105102c6df21242dc30ee7174aee6507bb3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 22:15:23 2014 +0200

    ...which empirically shows that LateInitThread is useless
    
    Change-Id: Ic2946eef616eae39576d162ca534831753bd3c89

diff --git a/filter/Library_filterconfig.mk b/filter/Library_filterconfig.mk
index ce4475b..602d2b1 100644
--- a/filter/Library_filterconfig.mk
+++ b/filter/Library_filterconfig.mk
@@ -55,8 +55,6 @@ $(eval $(call gb_Library_add_exception_objects,filterconfig,\
 	filter/source/config/cache/filtercache \
 	filter/source/config/cache/filterfactory \
 	filter/source/config/cache/frameloaderfactory \
-	filter/source/config/cache/lateinitlistener \
-	filter/source/config/cache/lateinitthread \
 	filter/source/config/cache/querytokenizer \
 	filter/source/config/cache/registration \
 	filter/source/config/cache/typedetection \
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 92fced4..e9ac3ed 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -19,7 +19,6 @@
 
 
 #include "filtercache.hxx"
-#include "lateinitlistener.hxx"
 #include "macros.hxx"
 #include "constant.hxx"
 #include "cacheupdatelistener.hxx"
@@ -156,18 +155,12 @@ void FilterCache::takeOver(const FilterCache& rClone)
 
 
 
-void FilterCache::load(EFillState eRequired,
-    sal_Bool bByThread
-)
+void FilterCache::load(EFillState eRequired)
     throw(css::uno::Exception)
 {
     // SAFE -> ----------------------------------
     ::osl::ResettableMutexGuard aLock(m_aLock);
 
-    SAL_WARN_IF(
-        bByThread && (eRequired & ~m_eFillState) == 0, "filter.config",
-        "useless LateInitThread");
-
     // check if required fill state is already reached ...
     // There is nothing to do then.
     if ((m_eFillState & eRequired) == eRequired)
@@ -193,13 +186,6 @@ void FilterCache::load(EFillState eRequired,
 
         // Support the old configuration support. Read it only one times during office runtime!
         impl_readOldFormat();
-
-        // enable "loadOnDemand" feature ...
-        // Create uno listener, which waits for finishing the office startup
-        // and starts a thread, which calls loadAll() at this filter cache.
-        // Note: Its not a leak to create this listener with new here.
-        // It kills itself after working!
-        /* LateInitListener* pLateInit = */ new LateInitListener(comphelper::getProcessComponentContext());
     }
 
 
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index 2e82ccf..33efef1 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -314,32 +314,13 @@ class FilterCache : public BaseLock
                         This method must be called from every user of this cache
                         every time it needs a filled cache. Normally we load
                         only standard information into this cache on startup.
-                        After a few seconds we start a special thread, which
-                        may fill this cache completely. But if someone outside
-                        needs a filled cache before ... it can run into trouble,
-                        if this "load-on-demand" thread does not finished its work before.
-                        This method "load(xxx)" synchronize such load-on-demand requests.
-
-                        Of course it would be possible to supress this special load thread
-                        in general and start it manually inside this load() request.
-                        The outside code decide then, if and when this cache will be filled
-                        with all available information ...
-
-            @param      bByThread
-                        indicates using of this method by our global "load-on-demand-thread".
-                        Its an implementation detail! We use it to check, if this "load()"
-                        request was forced e.g. by one of our derived service container (which need
-                        it to full fill its own operations) or if it was forced by our own
-                        "load-on-demand-thread", which tries to optimize our startup performance
-                        and start this load() only in case the office startup was already finished!
 
             @throw      An exception if the cache could not be filled really
                         or seems to be invalid afterwards. But there is no reaction
                         at all if this method does nothing inside, because the cache
                         is already full filled!
          */
-        virtual void load(EFillState eRequired ,
-                          sal_Bool   bByThread = sal_False)
+        virtual void load(EFillState eRequired)
             throw(css::uno::Exception);
 
 
diff --git a/filter/source/config/cache/lateinitlistener.cxx b/filter/source/config/cache/lateinitlistener.cxx
deleted file mode 100644
index d05fb7d..0000000
--- a/filter/source/config/cache/lateinitlistener.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sal/config.h"
-
-#include "rtl/ref.hxx"
-#include "rtl/ustring.hxx"
-
-#include "lateinitlistener.hxx"
-#include "lateinitthread.hxx"
-
-#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
-
-
-namespace filter{
-    namespace config{
-
-LateInitListener::LateInitListener(const css::uno::Reference< css::uno::XComponentContext >& rxContext)
-    : BaseLock(     )
-{
-    // important to do so ...
-    // Otherwise the temp. reference to ourselves
-    // will kill us at releasing time!
-    osl_atomic_increment( &m_refCount );
-
-    m_xBroadcaster = css::uno::Reference< css::document::XEventBroadcaster >(
-        css::frame::theGlobalEventBroadcaster::get(rxContext),
-        css::uno::UNO_QUERY_THROW);
-
-    m_xBroadcaster->addEventListener(static_cast< css::document::XEventListener* >(this));
-
-    osl_atomic_decrement( &m_refCount );
-}
-
-
-
-LateInitListener::~LateInitListener()
-{
-}
-
-
-
-void SAL_CALL LateInitListener::notifyEvent(const css::document::EventObject& aEvent)
-    throw(css::uno::RuntimeException, std::exception)
-{
-    // wait for events which either
-    // a) indicate completed open of the first document in which case launch thread
-    // b) indicate close of application without any documents opened, in which case skip launching thread but drop references break cyclic dependencies in
-    // case of e.g. cancel from open/new database wizard or impress wizard
-    if ( aEvent.EventName == "OnNew" || aEvent.EventName == "OnLoad" || aEvent.EventName == "OnCloseApp" )
-    {
-        // this thread must be started one times only ...
-        // cancel listener connection before!
-
-        // SAFE ->
-        ::osl::ResettableMutexGuard aLock(m_aLock);
-
-        if ( !m_xBroadcaster.is() )
-            // the beauty of multi-threading ... OnLoad can be notified synchronously or asynchronously. In particular,
-            // SFX-based documents notify it synchronously, database documents do it asynchronously.
-            // Now if multiple documents are opened "at the same time", it is well possible that we get two events from
-            // different threads, where upon the first event, we already remove ourself from m_xBroadcaster, and start
-            // the thread, nonetheless there's also a second notification "in the queue", which will arrive short
-            // thereafter.
-            // In such a case, simply ignore this second event.
-            return;
-
-        m_xBroadcaster->removeEventListener(static_cast< css::document::XEventListener* >(this));
-        m_xBroadcaster.clear();
-
-        aLock.clear();
-        // <- SAFE
-
-        if ( aEvent.EventName != "OnCloseApp" )
-        {
-            rtl::Reference< LateInitThread >(new LateInitThread())->launch();
-                //TODO: a protocol is missing how to join with the launched
-                // thread before exit(3), to ensure the thread is no longer
-                // relying on any infrastructure while that infrastructure is
-                // being shut down in atexit handlers
-        }
-    }
-}
-
-
-
-void SAL_CALL LateInitListener::disposing(const css::lang::EventObject& /* aEvent */ )
-    throw(css::uno::RuntimeException, std::exception)
-{
-    // ???
-    // Normaly it should never be called. Because we cancel our listener connection
-    // if we got the event about finished open of the first office document.
-    // But if this method was reached, it indicates an office, which was started
-    // (might as remote script container for an external API client) but not really used.
-
-    // SAFE ->
-    ::osl::ResettableMutexGuard aLock(m_aLock);
-    if ( !m_xBroadcaster.is() )
-        return;
-
-    m_xBroadcaster->removeEventListener(static_cast< css::document::XEventListener* >(this));
-    m_xBroadcaster.clear();
-    aLock.clear();
-    // <- SAFE
-}
-
-    } // namespace config
-} // namespace filter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/config/cache/lateinitlistener.hxx b/filter/source/config/cache/lateinitlistener.hxx
deleted file mode 100644
index 79ac33f..0000000
--- a/filter/source/config/cache/lateinitlistener.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FILTER_SOURCE_CONFIG_CACHE_LATEINITLISTENER_HXX
-#define INCLUDED_FILTER_SOURCE_CONFIG_CACHE_LATEINITLISTENER_HXX
-
-#include "cacheitem.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/document/XEventListener.hpp>
-#include <com/sun/star/document/XEventBroadcaster.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace com { namespace sun { namespace star { namespace uno {
-    class XComponentContext;
-} } } }
-
-namespace filter{
-    namespace config{
-
-
-
-
-/** @short      implements a listener, which will update the
-                global filter cache of an office, after zje office
-                startup was finished.
-
-    @descr      To perform startup of an office, the filter cache starts
-                with a minimum set of properties only. After the first document
-                was loaded successfully a thread will be started to fill the
-                cache with all other proeprties, so it can work with the whole
-                filter configuration.
- */
-class LateInitListener : public BaseLock // must be the first one to guarantee right initialized mutex member!
-                       , public ::cppu::WeakImplHelper1< css::document::XEventListener >
-{
-
-    // member
-
-    private:
-
-        /** @short  reference to the global event broadcaster, which is usde to find
-                    out, when the first office document was opened successfully. */
-        css::uno::Reference< css::document::XEventBroadcaster > m_xBroadcaster;
-
-
-    // native interface
-
-    public:
-
-
-        // ctor/dtor
-
-        /** @short  initialize new instance of this class.
-
-            @descr  It set a reference to the global filter cache singleton,
-                    which should be updated here. Further it starts listening
-                    on the global event broadcaster to get the information, when
-                    loading of the first document was finished.
-
-            @param  rxContext
-                    reference to a component context, which can be used to create
-                    own needed uno services.
-         */
-        LateInitListener(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
-
-
-
-        /** @short  standard dtor.
-         */
-        virtual ~LateInitListener();
-
-
-    // uno interface
-
-    public:
-
-
-        // document.XEventListener
-
-        virtual void SAL_CALL notifyEvent(const css::document::EventObject& aEvent)
-            throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
-
-        // lang.XEventListener
-        virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
-            throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-};
-
-    } // namespace config
-} // namespace filter
-
-#endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_LATEINITLISTENER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/config/cache/lateinitthread.cxx b/filter/source/config/cache/lateinitthread.cxx
deleted file mode 100644
index 744ca5e..0000000
--- a/filter/source/config/cache/lateinitthread.cxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sal/config.h"
-
-#include "salhelper/singletonref.hxx"
-
-#include "filtercache.hxx"
-#include "lateinitthread.hxx"
-
-namespace filter { namespace config {
-
-LateInitThread::LateInitThread(): Thread("lateinitthread") {}
-
-LateInitThread::~LateInitThread() {}
-
-void LateInitThread::execute() {
-    // true => It indicates using of this method by this thread
-    // The filter cache use this information to show an assertion
-    // for "optimization failure" in case the first calli of loadAll()
-    // was not this thread ...
-
-    // Further please dont catch any exception here.
-    // May be they show the problem of a corrupted filter
-    // configuration, which is handled inside our event loop or desktop.main()!
-
-    salhelper::SingletonRef< FilterCache >()->load(
-        FilterCache::E_CONTAINS_ALL, true);
-}
-
-} }
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/config/cache/lateinitthread.hxx b/filter/source/config/cache/lateinitthread.hxx
deleted file mode 100644
index 4b560fa..0000000
--- a/filter/source/config/cache/lateinitthread.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_FILTER_SOURCE_CONFIG_CACHE_LATEINITTHREAD_HXX
-#define INCLUDED_FILTER_SOURCE_CONFIG_CACHE_LATEINITTHREAD_HXX
-
-#include "sal/config.h"
-
-#include "salhelper/thread.hxx"
-
-namespace filter{ namespace config {
-
-/** @short      implements a thread, which will update the
-                global filter cache of an office, after its
-                startup was finished.
-
-    @descr      Its started by a LateInitListener instance ...
-
-    @see        LateInitListener
-
-    @attention  The filter cache will be blocked during this thrad runs!
- */
-class LateInitThread: public salhelper::Thread {
-public:
-    LateInitThread();
-
-private:
-    virtual ~LateInitThread();
-
-    virtual void execute() SAL_OVERRIDE;
-};
-
-} }
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 416367380cbb0137f2463edc2773859a9d65a57b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 22:07:00 2014 +0200

    Make warning more useful
    
    Change-Id: I58226f74e644e2aa65dddf5bcb0832dc67c8a6e3

diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index ad25037..92fced4 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -164,16 +164,15 @@ void FilterCache::load(EFillState eRequired,
     // SAFE -> ----------------------------------
     ::osl::ResettableMutexGuard aLock(m_aLock);
 
+    SAL_WARN_IF(
+        bByThread && (eRequired & ~m_eFillState) == 0, "filter.config",
+        "useless LateInitThread");
+
     // check if required fill state is already reached ...
     // There is nothing to do then.
     if ((m_eFillState & eRequired) == eRequired)
         return;
 
-    SAL_WARN_IF(
-        !bByThread && ((eRequired & E_CONTAINS_ALL) == E_CONTAINS_ALL),
-        "filter.config",
-        "Who disturb our \"fill cache on demand\" feature and force loading of ALL data during office startup? Please optimize your code, so a full filled filter cache is not really needed here!");
-
     // Otherwise load the missing items.
 
 
commit b07438bda1f48465dca1df08af836106859040d5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 22:01:12 2014 +0200

    ...and so m_lDetectServices is never read
    
    Change-Id: I3ea0c037d2b614b010093692dc6451110d2b342c

diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index a2a0898..ad25037 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -85,7 +85,6 @@ FilterCache* FilterCache::clone() const
     // if they are needed.
 
     pClone->m_lTypes                     = m_lTypes;
-    pClone->m_lDetectServices            = m_lDetectServices;
     pClone->m_lFilters                   = m_lFilters;
     pClone->m_lFrameLoaders              = m_lFrameLoaders;
     pClone->m_lContentHandlers           = m_lContentHandlers;
@@ -1008,13 +1007,6 @@ void FilterCache::impl_validateAndOptimize()
         OUString sType = pIt->first;
         CacheItem       aType = pIt->second;
 
-        // create list of all known detect services / frame loader / content handler on demand
-        // Because these information are available as type properties!
-        OUString sDetectService;
-        aType[PROPNAME_DETECTSERVICE ] >>= sDetectService;
-        if (!sDetectService.isEmpty())
-            impl_resolveItem4TypeRegistration(&m_lDetectServices, sDetectService, sType);
-
         // get its registration for file Extensions AND(!) URLPattern ...
         // It doesn't matter if these items exists or if our
         // used index access create some default ones ...
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index eb99248..2e82ccf 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -188,10 +188,6 @@ class FilterCache : public BaseLock
         mutable CacheItemList m_lTypes;
 
 
-        /** @short  contains all well known detect service with its properties. */
-        mutable CacheItemList m_lDetectServices;
-
-
         /** @short  contains all loaded filters with its properties. */
         mutable CacheItemList m_lFilters;
 
commit 9f4576136521f183bac9cc1db38f2d1a0c02d928
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 21:59:15 2014 +0200

    impl_resolveItem4TypeRegistration can be static
    
    Change-Id: Ie2b83a472972194210c3b579a041a11a2ff76786

diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index 0e5e00e..eb99248 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -781,6 +781,7 @@ class FilterCache : public BaseLock
                         If registration failed by any reason.
                         That does not include double registrations!
          */
+        static
         void impl_resolveItem4TypeRegistration(      CacheItemList*   pList,
                                                const OUString& sItem,
                                                const OUString& sType)
commit a2f65879749e4a729cd51521b3962ae3c00bb9e1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 21:57:28 2014 +0200

    ...and so m_lChangedDetectServices is alway empty
    
    Change-Id: I9a4ef55eb243f5aabd0c909b0e4594c928e459cd

diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 653c6cd..a2a0898 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -98,7 +98,6 @@ FilterCache* FilterCache::clone() const
 
     pClone->m_lChangedTypes              = m_lChangedTypes;
     pClone->m_lChangedFilters            = m_lChangedFilters;
-    pClone->m_lChangedDetectServices     = m_lChangedDetectServices;
     pClone->m_lChangedFrameLoaders       = m_lChangedFrameLoaders;
     pClone->m_lChangedContentHandlers    = m_lChangedContentHandlers;
 
@@ -132,8 +131,6 @@ void FilterCache::takeOver(const FilterCache& rClone)
 
     if (rClone.m_lChangedTypes.size()>0)
         m_lTypes = rClone.m_lTypes;
-    if (rClone.m_lChangedDetectServices.size()>0)
-        m_lDetectServices = rClone.m_lDetectServices;
     if (rClone.m_lChangedFilters.size()>0)
         m_lFilters = rClone.m_lFilters;
     if (rClone.m_lChangedFrameLoaders.size()>0)
@@ -142,7 +139,6 @@ void FilterCache::takeOver(const FilterCache& rClone)
         m_lContentHandlers = rClone.m_lContentHandlers;
 
     m_lChangedTypes.clear();
-    m_lChangedDetectServices.clear();
     m_lChangedFilters.clear();
     m_lChangedFrameLoaders.clear();
     m_lChangedContentHandlers.clear();
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index d9b9011..0e5e00e 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -236,7 +236,6 @@ class FilterCache : public BaseLock
         /** TODO document me ... */
         OUStringList m_lChangedTypes;
         OUStringList m_lChangedFilters;
-        OUStringList m_lChangedDetectServices;
         OUStringList m_lChangedFrameLoaders;
         OUStringList m_lChangedContentHandlers;
 
commit db4d07e3a8e74e3da0ffaaa862c035dbc9d10ac6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 21:50:52 2014 +0200

    ...and E_DETECTSERVICE is just as unused
    
    Change-Id: I6f7c230e83a58f4889696b98fcd7bf24d0853ce0

diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index 2d849c8..439018c 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -104,9 +104,6 @@ void BaseContainer::impl_loadOnDemand()
             eRequiredState = FilterCache::E_CONTAINS_FILTERS;
             break;
 
-        case FilterCache::E_DETECTSERVICE :
-            break;
-
         case FilterCache::E_FRAMELOADER :
             eRequiredState = FilterCache::E_CONTAINS_FRAMELOADERS;
             break;
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 8517b71..653c6cd 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -743,7 +743,6 @@ const CacheItemList& FilterCache::impl_getItemList(EItemType eType) const
         case E_FILTER         : return m_lFilters        ;
         case E_FRAMELOADER    : return m_lFrameLoaders   ;
         case E_CONTENTHANDLER : return m_lContentHandlers;
-        case E_DETECTSERVICE  : return m_lDetectServices ;
 
     }
 
@@ -763,7 +762,6 @@ CacheItemList& FilterCache::impl_getItemList(EItemType eType)
         case E_FILTER         : return m_lFilters        ;
         case E_FRAMELOADER    : return m_lFrameLoaders   ;
         case E_CONTENTHANDLER : return m_lContentHandlers;
-        case E_DETECTSERVICE  : return m_lDetectServices ;
 
     }
 
@@ -1267,10 +1265,6 @@ void FilterCache::impl_addItem2FlushList(      EItemType        eType,
                 pList = &m_lChangedContentHandlers;
                 break;
 
-        case E_DETECTSERVICE :
-                pList = &m_lChangedDetectServices;
-                break;
-
         default : throw css::uno::Exception("unsupported item type", 0);
     }
 
@@ -1795,12 +1789,6 @@ CacheItemList::iterator FilterCache::impl_loadItemOnDemand(      EItemType
             sSet    = CFGSET_CONTENTHANDLERS;
         }
         break;
-
-        case E_DETECTSERVICE :
-        {
-            SAL_WARN( "filter.config", "Cant load detect services on demand. Who use this unsupported feature?");
-        }
-        break;
     }
 
     if (!pList)
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index c54f900..d9b9011 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -77,8 +77,7 @@ class FilterCache : public BaseLock
             E_TYPE          ,
             E_FILTER        ,
             E_FRAMELOADER   ,
-            E_CONTENTHANDLER,
-            E_DETECTSERVICE
+            E_CONTENTHANDLER
         };
 
 
commit 936f197887d56260db0442fb510071b4583c05a2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 21:39:58 2014 +0200

    E_CONTAINS_DETECTSERVICES does nothing
    
    ...ever since its inception in 16ac8733020a726c5b5b955f20709f9c2894c140 and
    9b79c1d48c0b562d1fc7d0427caf98f43590a837 "INTEGRATION: CWS filtercfg."
    
    Change-Id: I34422a1c5641802bfb15720f5bfa8ca16fb54aab

diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index 2a1c938..2d849c8 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -105,7 +105,6 @@ void BaseContainer::impl_loadOnDemand()
             break;
 
         case FilterCache::E_DETECTSERVICE :
-            eRequiredState = FilterCache::E_CONTAINS_DETECTSERVICES;
             break;
 
         case FilterCache::E_FRAMELOADER :
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index c7aa95ff..c54f900 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -102,10 +102,9 @@ class FilterCache : public BaseLock
             E_CONTAINS_STANDARD         = 1,
             E_CONTAINS_TYPES            = 2,
             E_CONTAINS_FILTERS          = 4,
-            E_CONTAINS_DETECTSERVICES   = 8,
-            E_CONTAINS_FRAMELOADERS     = 16,
-            E_CONTAINS_CONTENTHANDLERS  = 32,
-            E_CONTAINS_ALL              = 63 // must be a combination of all excepting E_CONTAINS_NOTHING! Please update if items will be added or removed ...
+            E_CONTAINS_FRAMELOADERS     = 8,
+            E_CONTAINS_CONTENTHANDLERS  = 16,
+            E_CONTAINS_ALL              = 31 // must be a combination of all excepting E_CONTAINS_NOTHING! Please update if items will be added or removed ...
         };
 
 
commit 570a719abf01e57d6f150c8f6fbe17d9110f9eb5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 5 21:37:37 2014 +0200

    Simplify SAL_WARN
    
    Change-Id: I76c03d5e846fae6cba87be522a10d20e45528e4c

diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 921baee..8517b71 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -162,11 +162,7 @@ void FilterCache::takeOver(const FilterCache& rClone)
 
 
 void FilterCache::load(EFillState eRequired,
-#if OSL_DEBUG_LEVEL > 1
     sal_Bool bByThread
-#else
-    sal_Bool
-#endif
 )
     throw(css::uno::Exception)
 {
@@ -178,12 +174,10 @@ void FilterCache::load(EFillState eRequired,
     if ((m_eFillState & eRequired) == eRequired)
         return;
 
-#if OSL_DEBUG_LEVEL > 1
-    if (!bByThread && ((eRequired & E_CONTAINS_ALL) == E_CONTAINS_ALL))
-    {
-        SAL_WARN( "filter.config", "Who disturb our \"fill cache on demand\" feature and force loading of ALL data during office startup? Please optimize your code, so a full filled filter cache is not really needed here!");
-    }
-#endif
+    SAL_WARN_IF(
+        !bByThread && ((eRequired & E_CONTAINS_ALL) == E_CONTAINS_ALL),
+        "filter.config",
+        "Who disturb our \"fill cache on demand\" feature and force loading of ALL data during office startup? Please optimize your code, so a full filled filter cache is not really needed here!");
 
     // Otherwise load the missing items.
 


More information about the Libreoffice-commits mailing list