Line data Source code
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 :
21 : #include "propertyids.hxx"
22 :
23 : namespace dbtools
24 : {
25 102602 : const OUString& OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
26 : {
27 102602 : ::std::map<sal_Int32, OUString>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
28 102602 : if(aIter == m_aPropertyMap.end())
29 : {
30 408 : const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
31 408 : aIter = m_aPropertyMap.find(_nIndex);
32 : }
33 102602 : return aIter->second;
34 : }
35 :
36 408 : void OPropertyMap::fillValue(sal_Int32 _nIndex)
37 : {
38 408 : OUString pStr;
39 408 : switch(_nIndex)
40 : {
41 13 : case PROPERTY_ID_QUERYTIMEOUT: pStr = "QueryTimeOut"; break;
42 13 : case PROPERTY_ID_MAXFIELDSIZE: pStr = "MaxFieldSize"; break;
43 13 : case PROPERTY_ID_MAXROWS: pStr = "MaxRows"; break;
44 13 : case PROPERTY_ID_CURSORNAME: pStr = "CursorName"; break;
45 16 : case PROPERTY_ID_RESULTSETCONCURRENCY: pStr = "ResultSetConcurrency"; break;
46 :
47 16 : case PROPERTY_ID_RESULTSETTYPE: pStr = "ResultSetType"; break;
48 16 : case PROPERTY_ID_FETCHDIRECTION: pStr = "FetchDirection"; break;
49 16 : case PROPERTY_ID_FETCHSIZE: pStr = "FetchSize"; break;
50 13 : case PROPERTY_ID_ESCAPEPROCESSING: pStr = "EscapeProcessing"; break;
51 3 : case PROPERTY_ID_USEBOOKMARKS: pStr = "UseBookmarks"; break;
52 : // Column
53 10 : case PROPERTY_ID_NAME: pStr = "Name"; break;
54 10 : case PROPERTY_ID_TYPE: pStr = "Type"; break;
55 10 : case PROPERTY_ID_TYPENAME: pStr = "TypeName"; break;
56 10 : case PROPERTY_ID_PRECISION: pStr = "Precision"; break;
57 10 : case PROPERTY_ID_SCALE: pStr = "Scale"; break;
58 10 : case PROPERTY_ID_ISNULLABLE: pStr = "IsNullable"; break;
59 10 : case PROPERTY_ID_ISAUTOINCREMENT: pStr = "IsAutoIncrement"; break;
60 10 : case PROPERTY_ID_ISROWVERSION: pStr = "IsRowVersion"; break;
61 10 : case PROPERTY_ID_DESCRIPTION: pStr = "Description"; break;
62 10 : case PROPERTY_ID_DEFAULTVALUE: pStr = "DefaultValue"; break;
63 :
64 3 : case PROPERTY_ID_REFERENCEDTABLE: pStr = "ReferencedTable"; break;
65 3 : case PROPERTY_ID_UPDATERULE: pStr = "UpdateRule"; break;
66 3 : case PROPERTY_ID_DELETERULE: pStr = "DeleteRule"; break;
67 1 : case PROPERTY_ID_CATALOG: pStr = "Catalog"; break;
68 1 : case PROPERTY_ID_ISUNIQUE: pStr = "IsUnique"; break;
69 1 : case PROPERTY_ID_ISPRIMARYKEYINDEX: pStr = "IsPrimaryKeyIndex"; break;
70 1 : case PROPERTY_ID_ISCLUSTERED: pStr = "IsClustered"; break;
71 4 : case PROPERTY_ID_ISASCENDING: pStr = "IsAscending"; break;
72 10 : case PROPERTY_ID_SCHEMANAME: pStr = "SchemaName"; break;
73 10 : case PROPERTY_ID_CATALOGNAME: pStr = "CatalogName"; break;
74 :
75 0 : case PROPERTY_ID_COMMAND: pStr = "Command"; break;
76 0 : case PROPERTY_ID_CHECKOPTION: pStr = "CheckOption"; break;
77 4 : case PROPERTY_ID_PASSWORD: pStr = "Password"; break;
78 0 : case PROPERTY_ID_RELATEDCOLUMN: pStr = "RelatedColumn"; break;
79 :
80 10 : case PROPERTY_ID_FUNCTION: pStr = "Function"; break;
81 10 : case PROPERTY_ID_AGGREGATEFUNCTION: pStr = "AggregateFunction"; break;
82 10 : case PROPERTY_ID_TABLENAME: pStr = "TableName"; break;
83 10 : case PROPERTY_ID_REALNAME: pStr = "RealName"; break;
84 10 : case PROPERTY_ID_DBASEPRECISIONCHANGED: pStr = "DbasePrecisionChanged"; break;
85 10 : case PROPERTY_ID_ISCURRENCY: pStr = "IsCurrency"; break;
86 6 : case PROPERTY_ID_ISBOOKMARKABLE: pStr = "IsBookmarkable"; break;
87 0 : case PROPERTY_ID_HY010: pStr = "HY010"; break; // error messages
88 0 : case PROPERTY_ID_DELIMITER: pStr = "/"; break;
89 1 : case PROPERTY_ID_FORMATKEY: pStr = "FormatKey"; break;
90 0 : case PROPERTY_ID_LOCALE: pStr = "Locale"; break;
91 0 : case PROPERTY_ID_AUTOINCREMENTCREATION: pStr = "AutoIncrementCreation"; break;
92 3 : case PROPERTY_ID_PRIVILEGES: pStr = "Privileges"; break;
93 0 : case PROPERTY_ID_HAVINGCLAUSE: pStr = "HavingClause"; break;
94 0 : case PROPERTY_ID_ISSIGNED: pStr = "IsSigned"; break;
95 10 : case PROPERTY_ID_ISSEARCHABLE: pStr = "IsSearchable"; break;
96 10 : case PROPERTY_ID_LABEL: pStr = "Label"; break;
97 30 : case PROPERTY_ID_APPLYFILTER: pStr = "ApplyFilter"; break;
98 0 : case PROPERTY_ID_FILTER: pStr = "Filter"; break;
99 5 : case PROPERTY_ID_MASTERFIELDS: pStr = "MasterFields"; break;
100 5 : case PROPERTY_ID_DETAILFIELDS: pStr = "DetailFields"; break;
101 0 : case PROPERTY_ID_FIELDTYPE: pStr = "FieldType"; break;
102 0 : case PROPERTY_ID_VALUE: pStr = "Value"; break;
103 5 : case PROPERTY_ID_ACTIVE_CONNECTION: pStr = "ActiveConnection"; break;
104 : }
105 408 : m_aPropertyMap[_nIndex] = pStr;
106 408 : }
107 : }
108 :
109 :
110 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|