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

Mike Kaganski mike.kaganski at collabora.com
Sun May 27 17:20:10 UTC 2018


 filter/source/config/cache/contenthandlerfactory.cxx |   35 -------------------
 filter/source/config/cache/filterfactory.cxx         |   35 -------------------
 filter/source/config/cache/frameloaderfactory.cxx    |   35 -------------------
 filter/source/config/cache/versions.hxx              |   28 ---------------
 4 files changed, 3 insertions(+), 130 deletions(-)

New commits:
commit 04a2e5bf8933fb201f16de3eaf64c8efce596e8a
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sat May 19 05:25:26 2018 +0100

    Supposedly 14 years migration time is small enough
    
    Commit 28905832173cc312ceb1481ded7da34cfc043087 was merged in 2004
    
    Change-Id: Ie29b518d689208584fc22d4c261e0e7f139c2816
    Reviewed-on: https://gerrit.libreoffice.org/54559
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/filter/source/config/cache/contenthandlerfactory.cxx b/filter/source/config/cache/contenthandlerfactory.cxx
index 25313b36bee6..afedebfcd06f 100644
--- a/filter/source/config/cache/contenthandlerfactory.cxx
+++ b/filter/source/config/cache/contenthandlerfactory.cxx
@@ -21,7 +21,6 @@
 #include "contenthandlerfactory.hxx"
 #include "querytokenizer.hxx"
 #include "constant.hxx"
-#include "versions.hxx"
 
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/processfactory.hxx>
@@ -62,39 +61,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL ContentHandlerFactory::crea
 
     OUString sRealHandler = sHandler;
 
-    #ifdef FILTER_CONFIG_MIGRATION_Q_
-
-        /* -> TODO - HACK
-            check if the given handler name really exists ...
-            Because our old implementation worked with an internal
-            type name instead of a handler name. For a small migration time
-            we must simulate this old feature :-( */
-
-        auto & cache = TheFilterCache::get();
-
-        if (!cache.hasItem(FilterCache::E_CONTENTHANDLER, sHandler) && cache.hasItem(FilterCache::E_TYPE, sHandler))
-        {
-            css::uno::Sequence< OUString > lTypes { sHandler };
-
-            css::uno::Sequence< css::beans::NamedValue > lQuery { { PROPNAME_TYPES, css::uno::makeAny(lTypes) } };
-
-            css::uno::Reference< css::container::XEnumeration > xSet = BaseContainer::createSubSetEnumerationByProperties(lQuery);
-            while(xSet->hasMoreElements())
-            {
-                ::comphelper::SequenceAsHashMap lHandlerProps(xSet->nextElement());
-                if (!(lHandlerProps[PROPNAME_NAME] >>= sRealHandler))
-                    continue;
-            }
-
-            // prevent outside code against NoSuchElementException!
-            // But don't implement such defensive strategy for our new create handling :-)
-            if (!cache.hasItem(FilterCache::E_CONTENTHANDLER, sRealHandler))
-                return css::uno::Reference< css::uno::XInterface>();
-        }
-
-        /* <- HACK */
-
-    #endif // FILTER_CONFIG_MIGRATION_Q_
+    auto & cache = TheFilterCache::get();
 
     // search handler on cache
     CacheItem aHandler = cache.getItem(FilterCache::E_CONTENTHANDLER, sRealHandler);
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index a9564752334b..0e04d668a1d9 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -20,7 +20,6 @@
 
 #include "filterfactory.hxx"
 #include "constant.hxx"
-#include "versions.hxx"
 
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/processfactory.hxx>
@@ -79,39 +78,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FilterFactory::createInstan
 
     OUString sRealFilter = sFilter;
 
-    #ifdef FILTER_CONFIG_MIGRATION_Q_
-
-        /* -> TODO - HACK
-            check if the given filter name really exist ...
-            Because our old implementation worked with an internal
-            type name instead of a filter name. For a small migration time
-            we must simulate this old feature :-( */
-
-        auto & cache = TheFilterCache::get();
-
-        if (!cache.hasItem(FilterCache::E_FILTER, sFilter) && cache.hasItem(FilterCache::E_TYPE, sFilter))
-        {
-            OSL_FAIL("Who use this deprecated functionality?");
-
-            css::uno::Sequence< css::beans::NamedValue > lQuery { { PROPNAME_TYPE, css::uno::makeAny(sFilter) } };
-
-            css::uno::Reference< css::container::XEnumeration > xSet = createSubSetEnumerationByProperties(lQuery);
-            while(xSet->hasMoreElements())
-            {
-                ::comphelper::SequenceAsHashMap lHandlerProps(xSet->nextElement());
-                if (!(lHandlerProps[PROPNAME_NAME] >>= sRealFilter))
-                    continue;
-            }
-
-            // prevent outside code against NoSuchElementException!
-            // But don't implement such defensive strategy for our new create handling :-)
-            if (!cache.hasItem(FilterCache::E_FILTER, sRealFilter))
-                return css::uno::Reference< css::uno::XInterface>();
-        }
-
-        /* <- HACK */
-
-    #endif // FILTER_CONFIG_MIGRATION_Q_
+    auto & cache = TheFilterCache::get();
 
     // search filter on cache
     CacheItem aFilter = cache.getItem(FilterCache::E_FILTER, sRealFilter);
diff --git a/filter/source/config/cache/frameloaderfactory.cxx b/filter/source/config/cache/frameloaderfactory.cxx
index 5faf77c6e5d6..2bf7b9a5efd2 100644
--- a/filter/source/config/cache/frameloaderfactory.cxx
+++ b/filter/source/config/cache/frameloaderfactory.cxx
@@ -20,7 +20,6 @@
 
 #include "frameloaderfactory.hxx"
 #include "constant.hxx"
-#include "versions.hxx"
 
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/processfactory.hxx>
@@ -59,39 +58,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FrameLoaderFactory::createI
 
     OUString sRealLoader = sLoader;
 
-    #ifdef FILTER_CONFIG_MIGRATION_Q_
-
-        /* -> TODO - HACK
-            check if the given loader name really exist ...
-            Because our old implementation worked with an internal
-            type name instead of a loader name. For a small migration time
-            we must simulate this old feature :-( */
-
-        auto & cache = TheFilterCache::get();
-
-        if (!cache.hasItem(FilterCache::E_FRAMELOADER, sLoader) && cache.hasItem(FilterCache::E_TYPE, sLoader))
-        {
-            css::uno::Sequence< OUString > lTypes { sLoader };
-
-            css::uno::Sequence< css::beans::NamedValue > lQuery { { PROPNAME_TYPES, css::uno::makeAny(lTypes) } };
-
-            css::uno::Reference< css::container::XEnumeration > xSet = BaseContainer::createSubSetEnumerationByProperties(lQuery);
-            while(xSet->hasMoreElements())
-            {
-                ::comphelper::SequenceAsHashMap lLoaderProps(xSet->nextElement());
-                if (!(lLoaderProps[PROPNAME_NAME] >>= sRealLoader))
-                    continue;
-            }
-
-            // prevent outside code against NoSuchElementException!
-            // But don't implement such defensive strategy for our new create handling :-)
-            if (!cache.hasItem(FilterCache::E_FRAMELOADER, sRealLoader))
-                return css::uno::Reference< css::uno::XInterface>();
-        }
-
-        /* <- HACK */
-
-    #endif // FILTER_CONFIG_MIGRATION_Q_
+    auto & cache = TheFilterCache::get();
 
     // search loader on cache
     CacheItem aLoader = cache.getItem(m_eType, sRealLoader);
diff --git a/filter/source/config/cache/versions.hxx b/filter/source/config/cache/versions.hxx
deleted file mode 100644
index 6c3fe13ba890..000000000000
--- a/filter/source/config/cache/versions.hxx
+++ /dev/null
@@ -1,28 +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_VERSIONS_HXX
-#define INCLUDED_FILTER_SOURCE_CONFIG_CACHE_VERSIONS_HXX
-
-
-#define FILTER_CONFIG_MIGRATION_Q_     // useful for migration time, to support some old functionality temp. :-)
-
-#endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_VERSIONS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list