nss: upgrade to release 3.73
[LibreOffice.git] / svtools / source / control / indexentryres.cxx
blob9420a37b278f07987d3915804bdaa72080aae1c8
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/.
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 .
21 #include <svtools/svtresid.hxx>
22 #include <svtools/strings.hrc>
23 #include <svtools/indexentryres.hxx>
25 // implementation of the indexentry-algorithm-name translation
26 IndexEntryResource::IndexEntryResource()
28 m_aData.emplace_back("alphanumeric", SvtResId(STR_SVT_INDEXENTRY_ALPHANUMERIC));
29 m_aData.emplace_back("dict", SvtResId(STR_SVT_INDEXENTRY_DICTIONARY));
30 m_aData.emplace_back("pinyin", SvtResId(STR_SVT_INDEXENTRY_PINYIN));
31 m_aData.emplace_back("radical", SvtResId(STR_SVT_INDEXENTRY_RADICAL));
32 m_aData.emplace_back("stroke", SvtResId(STR_SVT_INDEXENTRY_STROKE));
33 m_aData.emplace_back("zhuyin", SvtResId(STR_SVT_INDEXENTRY_ZHUYIN));
34 m_aData.emplace_back("phonetic (alphanumeric first) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FS));
35 m_aData.emplace_back("phonetic (alphanumeric first) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FC));
36 m_aData.emplace_back("phonetic (alphanumeric last) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LS));
37 m_aData.emplace_back("phonetic (alphanumeric last) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LC));
40 const OUString& IndexEntryResource::GetTranslation(const OUString &r_Algorithm)
42 sal_Int32 nIndex = r_Algorithm.indexOf('.');
43 OUString aLocaleFreeAlgorithm;
45 if (nIndex == -1)
46 aLocaleFreeAlgorithm = r_Algorithm;
47 else {
48 nIndex += 1;
49 aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex);
52 for (size_t i = 0; i < m_aData.size(); ++i)
53 if (aLocaleFreeAlgorithm == m_aData[i].GetAlgorithm())
54 return m_aData[i].GetTranslation();
55 return r_Algorithm;
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */