diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-12 14:50:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-12 15:01:44 +0100 |
commit | 1b3f3b75743f00d9e2b62446fc527b04abe0ea3b (patch) | |
tree | 4f17338e1599540f4b181c5850c46eced8a7984a /svx | |
parent | a8030ce8be1c6d7dca9159374fc875c7165b6e41 (diff) |
remove (yet another) StringListResource implementation
in favour of ResStringArray
Change-Id: I2d919bac0143d35f594ce2f4adad69b81d1bcb87
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 1 | ||||
-rw-r--r-- | svx/source/form/ParseContext.cxx | 15 | ||||
-rw-r--r-- | svx/source/form/fmstring.src | 137 | ||||
-rw-r--r-- | svx/source/form/stringlistresource.cxx | 50 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 10 | ||||
-rw-r--r-- | svx/source/inc/stringlistresource.hxx | 58 |
6 files changed, 42 insertions, 229 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 00ebc04c7d8d..557c427c8a5a 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -471,7 +471,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/form/ParseContext \ svx/source/form/sdbdatacolumn \ svx/source/form/sqlparserclient \ - svx/source/form/stringlistresource \ svx/source/form/typemap \ svx/source/form/xfm_addcondition \ svx/source/uitest/sdrobject \ diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx index 758412c1db9a..b02413e1496c 100644 --- a/svx/source/form/ParseContext.cxx +++ b/svx/source/form/ParseContext.cxx @@ -20,38 +20,36 @@ #include <sal/macros.h> #include "svx/ParseContext.hxx" -#include "stringlistresource.hxx" #include "svx/fmresids.hrc" #include <svx/dialmgr.hxx> #include <unotools/syslocale.hxx> +#include <tools/resary.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> using namespace svxform; using namespace ::connectivity; -OSystemParseContext::OSystemParseContext() : IParseContext() +OSystemParseContext::OSystemParseContext() + : IParseContext() { SolarMutexGuard aGuard; - - svx::StringListResource aKeywords( SVX_RES( RID_RSC_SQL_INTERNATIONAL ) ); - aKeywords.get( m_aLocalizedKeywords ); + ResStringArray aLocalizedKeywords(SVX_RES(RID_RSC_SQL_INTERNATIONAL)); + for (sal_uInt32 i = 0; i < aLocalizedKeywords.Count(); ++i) + m_aLocalizedKeywords.push_back(aLocalizedKeywords.GetString(i)); } - OSystemParseContext::~OSystemParseContext() { } - css::lang::Locale OSystemParseContext::getPreferredLocale( ) const { return SvtSysLocale().GetLanguageTag().getLocale(); } - OUString OSystemParseContext::getErrorMessage(ErrorCode _eCode) const { OUString aMsg; @@ -75,7 +73,6 @@ OUString OSystemParseContext::getErrorMessage(ErrorCode _eCode) const return aMsg; } - OString OSystemParseContext::getIntlKeywordAscii(InternationalKeyCode _eKey) const { size_t nIndex = 0; diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src index b40cbf6ec700..5ad484b332b6 100644 --- a/svx/source/form/fmstring.src +++ b/svx/source/form/fmstring.src @@ -55,19 +55,13 @@ String RID_STR_FORM { Text [ en-US ] = "Form"; }; -Resource RID_RSC_TABWIN_PREFIX +StringArray RID_RSC_TABWIN_PREFIX { - String 1 + ItemList [ en-US ] = { - Text [ en-US ] = "Table"; - }; - String 2 - { - Text [ en-US ] = "Query"; - }; - String 3 - { - Text [ en-US ] = "SQL"; + < "Table"; >; + < "Query"; >; + < "SQL"; >; }; }; String RID_STR_STDFORMNAME @@ -297,103 +291,34 @@ String RID_STR_AUTOFIELD Text [ en-US ] = "<AutoField>"; }; -Resource RID_RSC_SQL_INTERNATIONAL +StringArray RID_RSC_SQL_INTERNATIONAL { - String 1 - { - Text [ en-US ] = "LIKE"; - }; - String 2 - { - Text [ en-US ] = "NOT"; - }; - String 3 - { - Text [ en-US ] = "EMPTY"; - }; - String 4 - { - Text [ en-US ] = "TRUE"; - }; - String 5 - { - Text [ en-US ] = "FALSE"; - }; - String 6 - { - Text [ en-US ] = "IS"; - }; - String 7 - { - Text [ en-US ] = "BETWEEN"; - }; - String 8 - { - Text [ en-US ] = "OR"; - }; - String 9 - { - Text [ en-US ] = "AND"; - }; - String 10 - { - Text [ en-US ] = "Average"; - }; - String 11 - { - Text [ en-US ] = "Count"; - }; - String 12 - { - Text [ en-US ] = "Maximum"; - }; - String 13 - { - Text [ en-US ] = "Minimum"; - }; - String 14 - { - Text [ en-US ] = "Sum"; - }; - String 15 - { - Text [ en-US ] = "Every"; - }; - String 16 - { - Text [ en-US ] = "Any"; - }; - String 17 - { - Text [ en-US ] = "Some"; - }; - String 18 - { - Text [ en-US ] = "STDDEV_POP"; - }; - String 19 - { - Text [ en-US ] = "STDDEV_SAMP"; - }; - String 20 - { - Text [ en-US ] = "VAR_SAMP"; - }; - String 21 - { - Text [ en-US ] = "VAR_POP"; - }; - String 22 - { - Text [ en-US ] = "Collect"; - }; - String 23 - { - Text [ en-US ] = "Fusion"; - }; - String 24 + ItemList [ en-US ] = { - Text [ en-US ] = "Intersection"; + < "LIKE"; >; + < "NOT"; >; + < "EMPTY"; >; + < "TRUE"; >; + < "FALSE"; >; + < "IS"; >; + < "BETWEEN"; >; + < "OR"; >; + < "AND"; >; + < "Average"; >; + < "Count"; >; + < "Maximum"; >; + < "Minimum"; >; + < "Sum"; >; + < "Every"; >; + < "Any"; >; + < "Some"; >; + < "STDDEV_POP"; >; + < "STDDEV_SAMP"; >; + < "VAR_SAMP"; >; + < "VAR_POP"; >; + < "Collect"; >; + < "Fusion"; >; + < "Intersection"; >; }; }; diff --git a/svx/source/form/stringlistresource.cxx b/svx/source/form/stringlistresource.cxx deleted file mode 100644 index 81c87f98e1be..000000000000 --- a/svx/source/form/stringlistresource.cxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "stringlistresource.hxx" - -#include <tools/rcid.h> - - -namespace svx -{ - - StringListResource::StringListResource( const ResId& _rResId ) - :Resource( _rResId ) - { - sal_uInt16 nLocalID = 1; - ResId aLocalID( nLocalID, *_rResId.GetResMgr() ); - while ( IsAvailableRes( aLocalID.SetRT( RSC_STRING ) ) ) - { - m_aStrings.push_back( aLocalID.toString() ); - aLocalID = ResId( ++nLocalID, *_rResId.GetResMgr() ); - } - } - - - StringListResource::~StringListResource() - { - FreeResource(); - } - - -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 27c9c5b4922c..91e7e89caa8e 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -21,7 +21,6 @@ #include "tabwin.hxx" #include "svx/fmtools.hxx" #include "fmservs.hxx" -#include "stringlistresource.hxx" #include <svx/svxids.hrc> #include <svx/dbaexchange.hxx> @@ -51,6 +50,7 @@ #include <sfx2/frame.hxx> #include <svx/dataaccessdescriptor.hxx> #include "svtools/treelistentry.hxx" +#include <tools/resary.hxx> #include <vcl/settings.hxx> const long STD_WIN_SIZE_X = 120; @@ -334,18 +334,18 @@ void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & x // set prefix OUString aPrefix; - StringListResource aPrefixes( SVX_RES( RID_RSC_TABWIN_PREFIX ) ); + ResStringArray aPrefixes(SVX_RES(RID_RSC_TABWIN_PREFIX)); switch (m_nObjectType) { case CommandType::TABLE: - aPrefix = aPrefixes[0]; + aPrefix = aPrefixes.GetString(0); break; case CommandType::QUERY: - aPrefix = aPrefixes[1]; + aPrefix = aPrefixes.GetString(1); break; default: - aPrefix = aPrefixes[2]; + aPrefix = aPrefixes.GetString(2); break; } diff --git a/svx/source/inc/stringlistresource.hxx b/svx/source/inc/stringlistresource.hxx deleted file mode 100644 index 9e75dc0e3f08..000000000000 --- a/svx/source/inc/stringlistresource.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVX_SOURCE_INC_STRINGLISTRESOURCE_HXX -#define INCLUDED_SVX_SOURCE_INC_STRINGLISTRESOURCE_HXX - -#include <tools/rc.hxx> -#include <svx/svxdllapi.h> - -#include <memory> - - -namespace svx -{ - - /** loads a list of strings from a resource, where the resource is of type RSC_RESOURCE, - and has sub resources of type string, numbered from 1 to n - */ - class StringListResource : public Resource - { - public: - SVX_DLLPUBLIC StringListResource( const ResId& _rResId ); - SVX_DLLPUBLIC ~StringListResource(); - - inline void get( ::std::vector< OUString >& _rStrings ) - { - _rStrings = m_aStrings; - } - - const OUString& operator[]( size_t _index ) const { return m_aStrings[ _index ]; } - - private: - ::std::vector< OUString > m_aStrings; - }; - - -} - - -#endif // INCLUDED_SVX_SOURCE_INC_STRINGLISTRESOURCE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |