/src/libreoffice/svx/source/dialog/strarray.cxx
Line | Count | Source |
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 <svx/dialmgr.hxx> |
21 | | #include <svx/strarray.hxx> |
22 | | #include <tools/resary.hxx> |
23 | | #include <svx/svxitems.hrc> |
24 | | #include <fieldunit.hrc> |
25 | | #include <numberingtype.hrc> |
26 | | |
27 | 0 | sal_uInt32 SvxFieldUnitTable::Count() { return std::size(RID_SVXSTR_FIELDUNIT_TABLE); } |
28 | | |
29 | | OUString SvxFieldUnitTable::GetString(sal_uInt32 nPos) |
30 | 0 | { |
31 | 0 | if (RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count()) |
32 | 0 | return SvxResId(RID_SVXSTR_FIELDUNIT_TABLE[nPos].first); |
33 | 0 | return OUString(); |
34 | 0 | } |
35 | | |
36 | | FieldUnit SvxFieldUnitTable::GetValue(sal_uInt32 nPos) |
37 | 0 | { |
38 | 0 | if (RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count()) |
39 | 0 | return RID_SVXSTR_FIELDUNIT_TABLE[nPos].second; |
40 | 0 | return FieldUnit::NONE; |
41 | 0 | } |
42 | | |
43 | | OUString SvxAttrNameTable::GetString(sal_uInt32 nPos) |
44 | 0 | { |
45 | 0 | if (RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count()) |
46 | 0 | return SvxResId(RID_ATTR_NAMES[nPos].first); |
47 | 0 | return OUString(); |
48 | 0 | } |
49 | | |
50 | 0 | sal_uInt32 SvxAttrNameTable::Count() { return std::size(RID_ATTR_NAMES); } |
51 | | |
52 | | sal_uInt32 SvxAttrNameTable::FindIndex(int nValue) |
53 | 0 | { |
54 | 0 | for (size_t i = 0; i < std::size(RID_ATTR_NAMES); ++i) |
55 | 0 | { |
56 | 0 | if (nValue == RID_ATTR_NAMES[i].second) |
57 | 0 | return i; |
58 | 0 | } |
59 | 0 | return RESARRAY_INDEX_NOTFOUND; |
60 | 0 | } |
61 | | |
62 | | OUString SvxNumberingTypeTable::GetString(sal_uInt32 nPos) |
63 | 0 | { |
64 | 0 | if (RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count()) |
65 | 0 | return SvxResId(RID_SVXSTRARY_NUMBERINGTYPE[nPos].first); |
66 | 0 | return OUString(); |
67 | 0 | } |
68 | | |
69 | 0 | sal_uInt32 SvxNumberingTypeTable::Count() { return std::size(RID_SVXSTRARY_NUMBERINGTYPE); } |
70 | | |
71 | | int SvxNumberingTypeTable::GetValue(sal_uInt32 nPos) |
72 | 0 | { |
73 | 0 | if (RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count()) |
74 | 0 | return RID_SVXSTRARY_NUMBERINGTYPE[nPos].second; |
75 | 0 | return 0; |
76 | 0 | } |
77 | | |
78 | | sal_uInt32 SvxNumberingTypeTable::FindIndex(int nValue) |
79 | 0 | { |
80 | 0 | for (size_t i = 0; i < std::size(RID_SVXSTRARY_NUMBERINGTYPE); ++i) |
81 | 0 | { |
82 | 0 | if (nValue == RID_SVXSTRARY_NUMBERINGTYPE[i].second) |
83 | 0 | return i; |
84 | 0 | } |
85 | 0 | return RESARRAY_INDEX_NOTFOUND; |
86 | 0 | } |
87 | | |
88 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |