1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <cppuhelper/supportsservice.hxx>
21 #include <textconversion.hxx>
23 using namespace com::sun::star::uno
;
27 #ifndef DISABLE_DYNLOADING
29 extern "C" { static void thisModule() {} }
33 TextConversionService::TextConversionService(const char *pImplName
)
34 : implementationName(pImplName
)
36 #ifndef DISABLE_DYNLOADING
38 OUString
lib(SAL_DLLPREFIX
"textconv_dict" SAL_DLLEXTENSION
);
40 OUString
lib("textconv_dict" SAL_DLLEXTENSION
);
42 hModule
= osl_loadModuleRelative(
43 &thisModule
, lib
.pData
, SAL_LOADMODULE_DEFAULT
);
47 TextConversionService::~TextConversionService()
49 #ifndef DISABLE_DYNLOADING
50 if (hModule
) osl_unloadModule(hModule
);
54 #ifndef DISABLE_DYNLOADING
56 static void* nullFunc()
62 TextConversionService::getFunctionBySymbol(const char* func
)
65 return osl_getFunctionSymbol(hModule
, OUString::createFromAscii(func
).pData
);
67 return reinterpret_cast< oslGenericFunction
>(nullFunc
);
73 TextConversionService::getImplementationName()
75 return OUString::createFromAscii(implementationName
);
79 TextConversionService::supportsService(const OUString
& rServiceName
)
81 return cppu::supportsService(this, rServiceName
);
84 Sequence
< OUString
> SAL_CALL
85 TextConversionService::getSupportedServiceNames()
87 Sequence
< OUString
> aRet
{ OUString::createFromAscii(implementationName
) };
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */