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 <i18nutil/widthfolding.hxx>
22 #include <transliteration_OneToOne.hxx>
24 using namespace com::sun::star::uno
;
25 using namespace com::sun::star::lang
;
30 halfwidthToFullwidth::halfwidthToFullwidth()
33 table
= &i18nutil::widthfolding::gethalf2fullTable();
34 transliterationName
= "halfwidthToFullwidth";
35 implementationName
= "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH";
39 halfwidthToFullwidth::transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, Sequence
< sal_Int32
>& offset
)
41 bool _useOffset
= useOffset
;
44 const OUString
& newStr
= transliteration_OneToOne::transliterate( inStr
, startPos
, nCount
, offset
);
45 useOffset
= _useOffset
;
47 // Composition: KA + voice-mark --> GA
48 return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr
, 0, newStr
.getLength(), offset
, _useOffset
);
51 halfwidthKatakanaToFullwidthKatakana::halfwidthKatakanaToFullwidthKatakana()
54 table
= &i18nutil::widthfolding::gethalfKana2fullKanaTable();
55 transliterationName
= "halfwidthKatakanaToFullwidthKatakana";
56 implementationName
= "com.sun.star.i18n.Transliteration.HALFWIDTHKATAKANA_FULLWIDTHKATAKANA";
60 halfwidthKatakanaToFullwidthKatakana::transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, Sequence
< sal_Int32
>& offset
)
62 bool _useOffset
= useOffset
;
65 const OUString
& newStr
= transliteration_OneToOne::transliterate( inStr
, startPos
, nCount
, offset
);
66 useOffset
= _useOffset
;
68 // Composition: KA + voice-mark --> GA
69 return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr
, 0, newStr
.getLength(), offset
, _useOffset
);
72 halfwidthToFullwidthLikeJIS::halfwidthToFullwidthLikeJIS()
75 table
= &i18nutil::widthfolding::gethalf2fullTableForJIS();
76 transliterationName
= "halfwidthToFullwidthLikeJIS";
77 implementationName
= "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH_LIKE_JIS";
81 halfwidthToFullwidthLikeJIS::transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, Sequence
< sal_Int32
>& offset
)
83 bool _useOffset
= useOffset
;
86 const OUString
& newStr
= transliteration_OneToOne::transliterate( inStr
, startPos
, nCount
, offset
);
87 useOffset
= _useOffset
;
89 // Composition: KA + voice-mark --> GA
90 return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr
, 0, newStr
.getLength(), offset
, _useOffset
, WIDTHFOLDNIG_DONT_USE_COMBINED_VU
);
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */