[Libreoffice-commits] core.git: 2 commits - basctl/source svx/Library_svxcore.mk svx/source
Caolán McNamara
caolanm at redhat.com
Wed Oct 12 14:04:28 UTC 2016
basctl/source/basicide/objdlg.cxx | 8 -
basctl/source/basicide/objdlg.hrc | 1
basctl/source/basicide/objdlg.src | 5 -
svx/Library_svxcore.mk | 1
svx/source/form/ParseContext.cxx | 15 +--
svx/source/form/fmstring.src | 137 +++++++--------------------------
svx/source/form/stringlistresource.cxx | 50 ------------
svx/source/form/tabwin.cxx | 10 +-
svx/source/inc/stringlistresource.hxx | 58 -------------
9 files changed, 46 insertions(+), 239 deletions(-)
New commits:
commit e510e9893d5ce99c8dfa9478d6972469fcc339d2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 14:56:53 2016 +0100
de-src silly RID_TLB_MACROS resource
Change-Id: I0b1bd13b1d8408c2b8d83411beb36615612ddadc
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 240b7e1..eb9a471 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -28,10 +28,10 @@
namespace basctl
{
-ObjectCatalog::ObjectCatalog (vcl::Window* pParent) :
- DockingWindow(pParent),
- aTitle(VclPtr<FixedText>::Create(this)),
- aTree(VclPtr<TreeListBox>::Create(this, IDEResId(RID_TLB_MACROS)))
+ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
+ : DockingWindow(pParent)
+ , aTitle(VclPtr<FixedText>::Create(this))
+ , aTree(VclPtr<TreeListBox>::Create(this, WB_TABSTOP))
{
SetHelpId("basctl:FloatingWindow:RID_BASICIDE_OBJCAT");
SetText(IDEResId(RID_BASICIDE_OBJCAT).toString());
diff --git a/basctl/source/basicide/objdlg.hrc b/basctl/source/basicide/objdlg.hrc
index abf33a1..8b8a969 100644
--- a/basctl/source/basicide/objdlg.hrc
+++ b/basctl/source/basicide/objdlg.hrc
@@ -23,7 +23,6 @@
#define RID_BASICIDE_OBJCAT ( RID_BASICIDE_START + 70 )
#define RID_STR_TLB_MACROS ( RID_BASICIDE_START + 71 )
-#define RID_TLB_MACROS ( RID_BASICIDE_START + 72 )
#endif // BASCTL_OBJDLG_HRR
diff --git a/basctl/source/basicide/objdlg.src b/basctl/source/basicide/objdlg.src
index 173f296..d66422c 100644
--- a/basctl/source/basicide/objdlg.src
+++ b/basctl/source/basicide/objdlg.src
@@ -19,11 +19,6 @@
#include <objdlg.hrc>
-Control RID_TLB_MACROS
-{
- TabStop = TRUE ;
-};
-
String RID_BASICIDE_OBJCAT
{
Text [en-US] = "Object Catalog";
commit 1b3f3b75743f00d9e2b62446fc527b04abe0ea3b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 14:50:34 2016 +0100
remove (yet another) StringListResource implementation
in favour of ResStringArray
Change-Id: I2d919bac0143d35f594ce2f4adad69b81d1bcb87
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 00ebc04..557c427 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 758412c..b02413e 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 b40cbf6..5ad484b 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 81c87f9..0000000
--- 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 27c9c5b..91e7e89 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 9e75dc0..0000000
--- 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: */
More information about the Libreoffice-commits
mailing list