Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / editeng / source / misc / SvXMLAutoCorrectTokenHandler.cxx
blobae17446150736e5cb325baebeda34adb4d63f4e9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include "SvXMLAutoCorrectTokenHandler.hxx"
11 #include <xmloff/xmltoken.hxx>
12 #if defined __clang__
13 #if __has_warning("-Wdeprecated-register")
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wdeprecated-register"
16 #endif
17 #endif
18 #include <tokens.cxx>
19 #if defined __clang__
20 #if __has_warning("-Wdeprecated-register")
21 #pragma GCC diagnostic pop
22 #endif
23 #endif
25 using namespace css::uno;
26 using namespace ::xmloff::token;
28 SvXMLAutoCorrectTokenHandler::SvXMLAutoCorrectTokenHandler()
32 SvXMLAutoCorrectTokenHandler::~SvXMLAutoCorrectTokenHandler()
36 sal_Int32 SAL_CALL SvXMLAutoCorrectTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& Identifier )
38 return getTokenDirect( std::string_view(reinterpret_cast< const char* >( Identifier.getConstArray() ), Identifier.getLength()) );
41 Sequence< sal_Int8 > SAL_CALL SvXMLAutoCorrectTokenHandler::getUTF8Identifier( sal_Int32 )
43 return Sequence< sal_Int8 >();
46 sal_Int32 SvXMLAutoCorrectTokenHandler::getTokenDirect(std::string_view token) const
48 const struct xmltoken* pToken = Perfect_Hash::in_word_set(token.data(), token.size());
49 return pToken ? pToken->nToken : XML_TOKEN_INVALID;
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */