/src/libreoffice/i18npool/source/transliteration/halfwidthToFullwidth.cxx
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <i18nutil/widthfolding.hxx> |
21 | | |
22 | | #include <transliteration_OneToOne.hxx> |
23 | | |
24 | | using namespace com::sun::star::uno; |
25 | | |
26 | | |
27 | | namespace i18npool { |
28 | | |
29 | | halfwidthToFullwidth::halfwidthToFullwidth() |
30 | 0 | { |
31 | 0 | func = nullptr; |
32 | 0 | table = &i18nutil::widthfolding::gethalf2fullTable(); |
33 | 0 | transliterationName = "halfwidthToFullwidth"; |
34 | 0 | implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH"; |
35 | 0 | } |
36 | | |
37 | | OUString |
38 | | halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset ) |
39 | 0 | { |
40 | | // One to One mapping |
41 | 0 | const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr); |
42 | | |
43 | | // Composition: KA + voice-mark --> GA |
44 | 0 | return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset ); |
45 | 0 | } |
46 | | |
47 | | HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::HALFWIDTHKATAKANA_FULLWIDTHKATAKANA() |
48 | 0 | { |
49 | 0 | func = nullptr; |
50 | 0 | table = &i18nutil::widthfolding::gethalfKana2fullKanaTable(); |
51 | 0 | transliterationName = "halfwidthKatakanaToFullwidthKatakana"; |
52 | 0 | implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTHKATAKANA_FULLWIDTHKATAKANA"; |
53 | 0 | } |
54 | | |
55 | | OUString |
56 | | HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset ) |
57 | 0 | { |
58 | | // One to One mapping |
59 | 0 | const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr); |
60 | | |
61 | | // Composition: KA + voice-mark --> GA |
62 | 0 | return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset ); |
63 | 0 | } |
64 | | |
65 | | HALFWIDTH_FULLWIDTH_LIKE_JIS::HALFWIDTH_FULLWIDTH_LIKE_JIS() |
66 | 0 | { |
67 | 0 | func = nullptr; |
68 | 0 | table = &i18nutil::widthfolding::gethalf2fullTableForJIS(); |
69 | 0 | transliterationName = "halfwidthToFullwidthLikeJIS"; |
70 | 0 | implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH_LIKE_JIS"; |
71 | 0 | } |
72 | | |
73 | | OUString |
74 | | HALFWIDTH_FULLWIDTH_LIKE_JIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset ) |
75 | 0 | { |
76 | | // One to One mapping |
77 | 0 | const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr); |
78 | | |
79 | | // Composition: KA + voice-mark --> GA |
80 | 0 | return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset, WIDTHFOLDING_DONT_USE_COMBINED_VU ); |
81 | 0 | } |
82 | | |
83 | | |
84 | | } |
85 | | |
86 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |