Supposedly 14 years migration time is small enough
Commit 2890583217
was merged in 2004
Change-Id: Ie29b518d689208584fc22d4c261e0e7f139c2816
Reviewed-on: https://gerrit.libreoffice.org/54559
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
#include "contenthandlerfactory.hxx"
|
#include "contenthandlerfactory.hxx"
|
||||||
#include "querytokenizer.hxx"
|
#include "querytokenizer.hxx"
|
||||||
#include "constant.hxx"
|
#include "constant.hxx"
|
||||||
#include "versions.hxx"
|
|
||||||
|
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
@@ -62,39 +61,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL ContentHandlerFactory::crea
|
|||||||
|
|
||||||
OUString sRealHandler = sHandler;
|
OUString sRealHandler = sHandler;
|
||||||
|
|
||||||
#ifdef FILTER_CONFIG_MIGRATION_Q_
|
auto & cache = TheFilterCache::get();
|
||||||
|
|
||||||
/* -> 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_
|
|
||||||
|
|
||||||
// search handler on cache
|
// search handler on cache
|
||||||
CacheItem aHandler = cache.getItem(FilterCache::E_CONTENTHANDLER, sRealHandler);
|
CacheItem aHandler = cache.getItem(FilterCache::E_CONTENTHANDLER, sRealHandler);
|
||||||
|
35
filter/source/config/cache/filterfactory.cxx
vendored
35
filter/source/config/cache/filterfactory.cxx
vendored
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "filterfactory.hxx"
|
#include "filterfactory.hxx"
|
||||||
#include "constant.hxx"
|
#include "constant.hxx"
|
||||||
#include "versions.hxx"
|
|
||||||
|
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
@@ -79,39 +78,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FilterFactory::createInstan
|
|||||||
|
|
||||||
OUString sRealFilter = sFilter;
|
OUString sRealFilter = sFilter;
|
||||||
|
|
||||||
#ifdef FILTER_CONFIG_MIGRATION_Q_
|
auto & cache = TheFilterCache::get();
|
||||||
|
|
||||||
/* -> 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_
|
|
||||||
|
|
||||||
// search filter on cache
|
// search filter on cache
|
||||||
CacheItem aFilter = cache.getItem(FilterCache::E_FILTER, sRealFilter);
|
CacheItem aFilter = cache.getItem(FilterCache::E_FILTER, sRealFilter);
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "frameloaderfactory.hxx"
|
#include "frameloaderfactory.hxx"
|
||||||
#include "constant.hxx"
|
#include "constant.hxx"
|
||||||
#include "versions.hxx"
|
|
||||||
|
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
@@ -59,39 +58,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FrameLoaderFactory::createI
|
|||||||
|
|
||||||
OUString sRealLoader = sLoader;
|
OUString sRealLoader = sLoader;
|
||||||
|
|
||||||
#ifdef FILTER_CONFIG_MIGRATION_Q_
|
auto & cache = TheFilterCache::get();
|
||||||
|
|
||||||
/* -> 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_
|
|
||||||
|
|
||||||
// search loader on cache
|
// search loader on cache
|
||||||
CacheItem aLoader = cache.getItem(m_eType, sRealLoader);
|
CacheItem aLoader = cache.getItem(m_eType, sRealLoader);
|
||||||
|
28
filter/source/config/cache/versions.hxx
vendored
28
filter/source/config/cache/versions.hxx
vendored
@@ -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: */
|
|
Reference in New Issue
Block a user