summaryrefslogtreecommitdiff
path: root/reportdesign/source/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-17 14:00:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-17 14:03:26 +0100
commit5dcf536b69848b56f1199b81e4b7ed87a0a3864d (patch)
tree86f28d6db1963680549b6111ca99f95ca580f763 /reportdesign/source/inc
parentacd9cda35457f0a839bf9713c261022c39cd8269 (diff)
merge the 5 ConstAsciiString duplicate classes together
a) merge them together and move it into comphelper b) turn it into a POD rather than having vast amounts of destructors registered into the cxa_atexit chain Change-Id: I04d3b9d7804f8e233013c916df9d617a0f84f96a
Diffstat (limited to 'reportdesign/source/inc')
-rw-r--r--reportdesign/source/inc/constasciistring.hxx45
-rw-r--r--reportdesign/source/inc/corestrings.hrc4
-rw-r--r--reportdesign/source/inc/uistrings.hrc4
-rw-r--r--reportdesign/source/inc/xmlstrings.hrc4
4 files changed, 7 insertions, 50 deletions
diff --git a/reportdesign/source/inc/constasciistring.hxx b/reportdesign/source/inc/constasciistring.hxx
index 157923d36b5c..f4d38af3f5f4 100644
--- a/reportdesign/source/inc/constasciistring.hxx
+++ b/reportdesign/source/inc/constasciistring.hxx
@@ -9,55 +9,12 @@
// no namespaces. This file is included from several other files _within_ a namespace.
//============================================================
-//= a helper for static ascii pseudo-unicode strings
-//============================================================
-// string constants
-struct ConstAsciiString
-{
- const sal_Char* ascii;
- sal_Int32 length;
-
- inline operator const ::rtl::OUString& () const;
- inline operator const sal_Char* () const { return ascii; }
-
- inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength);
- inline ~ConstAsciiString();
-
-private:
- mutable ::rtl::OUString* ustring;
-};
-
-//------------------------------------------------------------
-inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength)
- :ascii(_pAsciiZeroTerminated)
- ,length(_nLength)
- ,ustring(NULL)
-{
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::~ConstAsciiString()
-{
- delete ustring;
- ustring = NULL;
-}
-
-//------------------------------------------------------------
-inline ConstAsciiString::operator const ::rtl::OUString& () const
-{
- if (!ustring)
- ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US);
- return *ustring;
-}
-
-//============================================================
#define DECLARE_CONSTASCII_USTRING( name ) \
extern const ConstAsciiString name
#define IMPLEMENT_CONSTASCII_USTRING( name, string ) \
- const ConstAsciiString name(string, sizeof(string)-1)
-
+ const ConstAsciiString name = {RTL_CONSTASCII_STRINGPARAM(string)}
#endif // _RPTSHARED_CONSTASCIISTRING_HXX_
diff --git a/reportdesign/source/inc/corestrings.hrc b/reportdesign/source/inc/corestrings.hrc
index 42f9dd829ad4..0fb95ea0b364 100644
--- a/reportdesign/source/inc/corestrings.hrc
+++ b/reportdesign/source/inc/corestrings.hrc
@@ -27,9 +27,9 @@
#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
#define REPORTDESIGN_SHARED_CORESTRINGS_HRC
-#ifndef _RTL_USTRING_HXX_
#include <rtl/ustring.hxx>
-#endif
+#include <comphelper/string.hxx>
+using comphelper::string::ConstAsciiString;
namespace reportdesign
{
diff --git a/reportdesign/source/inc/uistrings.hrc b/reportdesign/source/inc/uistrings.hrc
index 84807be6904e..b3543c37724e 100644
--- a/reportdesign/source/inc/uistrings.hrc
+++ b/reportdesign/source/inc/uistrings.hrc
@@ -27,9 +27,9 @@
#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
#define REPORTDESIGN_SHARED_UISTRINGS_HRC
-#ifndef _RTL_USTRING_HXX_
#include <rtl/ustring.hxx>
-#endif
+#include <comphelper/string.hxx>
+using comphelper::string::ConstAsciiString;
namespace rptui
{
diff --git a/reportdesign/source/inc/xmlstrings.hrc b/reportdesign/source/inc/xmlstrings.hrc
index 3f4a6f216174..8755a399c9f6 100644
--- a/reportdesign/source/inc/xmlstrings.hrc
+++ b/reportdesign/source/inc/xmlstrings.hrc
@@ -27,9 +27,9 @@
#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
#define REPORTDESIGN_SHARED_XMLSTRINGS_HRC
-#ifndef _RTL_USTRING_HXX_
#include <rtl/ustring.hxx>
-#endif
+#include <comphelper/string.hxx>
+using comphelper::string::ConstAsciiString;
namespace rptxml
{