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@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
bb27318a41
commit
04a2e5bf89
@ -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);
|
||||
|
35
filter/source/config/cache/filterfactory.cxx
vendored
35
filter/source/config/cache/filterfactory.cxx
vendored
@ -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);
|
||||
|
@ -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);
|
||||
|
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: */
|
Loading…
x
Reference in New Issue
Block a user