Kaydet (Commit) 0375504f authored tarafından Noel Grandin's avatar Noel Grandin

fdo#38835 strip out OString globals

Change-Id: Id2eb27132fd6c1734e50c02617ce1bbb75e294a0
üst 77162432
......@@ -261,7 +261,7 @@ void handleFilesOfDir(
}
bool includeProject(const OString& rProject) {
static const OString projects[] = {
static const char *projects[] = {
"accessibility",
"avmedia",
"basctl",
......
......@@ -439,7 +439,7 @@ void MergeDataFile::InsertEntry(
OString MergeDataFile::CreateKey(const OString& rTYP, const OString& rGID,
const OString& rLID, const OString& rFilename, bool bCaseSensitive)
{
static const OString sStroke('-');
static const char sStroke[] = "-";
OString sKey( rTYP );
sKey += sStroke;
sKey += rGID;
......
......@@ -396,12 +396,12 @@ OString PoEntry::genKeyId(const OString& rGenerator)
aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength());
sal_uInt32 nCRC = aCRC32.checksum();
// Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
static const OString sSymbols =
static const char sSymbols[] =
"ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
char sKeyId[6];
for( short nKeyInd = 0; nKeyInd < 5; ++nKeyInd )
{
sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % sSymbols.getLength()];
sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % strlen(sSymbols)];
nCRC >>= 6;
}
sKeyId[5] = '\0';
......
......@@ -677,14 +677,14 @@ void Parser::readFont()
uno::Sequence<beans::PropertyValue> Parser::readImageImpl()
{
static const OString aJpegMarker( "JPEG" );
static const OString aPbmMarker( "PBM" );
static const OString aPpmMarker( "PPM" );
static const OString aPngMarker( "PNG" );
static const char aJpegFile[] = "DUMMY.JPEG";
static const char aPbmFile[] = "DUMMY.PBM";
static const char aPpmFile[] = "DUMMY.PPM";
static const char aPngFile[] = "DUMMY.PNG";
static const char aJpegMarker[] = "JPEG";
static const char aPbmMarker[] = "PBM";
static const char aPpmMarker[] = "PPM";
static const char aPngMarker[] = "PNG";
static const char aJpegFile[] = "DUMMY.JPEG";
static const char aPbmFile[] = "DUMMY.PBM";
static const char aPpmFile[] = "DUMMY.PPM";
static const char aPngFile[] = "DUMMY.PNG";
OString aToken = readNextToken();
const sal_Int32 nImageSize( readInt32() );
......
......@@ -143,40 +143,25 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
return rStrm;
}
namespace
{
struct ImplINetRFC822MessageHeaderDataImpl
{
const OString* operator()()
{
static const OString _ImplINetRFC822MessageHeaderData[] =
{
OString("BCC"),
OString("CC"),
OString("Comments"),
OString("Date"),
OString("From"),
OString("In-Reply-To"),
OString("Keywords"),
OString("Message-ID"),
OString("References"),
OString("Reply-To"),
OString("Return-Path"),
OString("Subject"),
OString("Sender"),
OString("To"),
OString("X-Mailer"),
OString("Return-Receipt-To")
};
return &_ImplINetRFC822MessageHeaderData[0];
}
};
struct ImplINetRFC822MessageHeaderData
: public rtl::StaticAggregate< const OString, ImplINetRFC822MessageHeaderDataImpl > {};
}
#define HDR(n) ImplINetRFC822MessageHeaderData::get()[(n)]
static const char * ImplINetRFC822MessageHeaderData[] =
{
"BCC",
"CC",
"Comments",
"Date",
"From",
"In-Reply-To",
"Keywords",
"Message-ID",
"References",
"Reply-To",
"Return-Path",
"Subject",
"Sender",
"To",
"X-Mailer",
"Return-Receipt-To"
};
enum _ImplINetRFC822MessageHeaderState
{
......@@ -592,7 +577,7 @@ sal_uIntPtr INetRFC822Message::SetHeaderField (
case INETMSG_RFC822_OK:
pData = pStop;
SetHeaderField_Impl (
INetMessageHeader (HDR(nIdx), rHeader.GetValue()),
INetMessageHeader( ImplINetRFC822MessageHeaderData[nIdx], rHeader.GetValue() ),
m_nIndex[nIdx]);
nNewIndex = m_nIndex[nIdx];
break;
......@@ -630,30 +615,15 @@ SvStream& INetRFC822Message::operator>> (SvStream& rStrm)
return rStrm;
}
namespace
static const char* ImplINetMIMEMessageHeaderData[] =
{
struct ImplINetMIMEMessageHeaderDataImpl
{
const OString* operator()()
{
static const OString _ImplINetMIMEMessageHeaderData[] =
{
OString("MIME-Version"),
OString("Content-Description"),
OString("Content-Disposition"),
OString("Content-ID"),
OString("Content-Type"),
OString("Content-Transfer-Encoding")
};
return &_ImplINetMIMEMessageHeaderData[0];
}
};
struct ImplINetMIMEMessageHeaderData
: public rtl::StaticAggregate< const OString, ImplINetMIMEMessageHeaderDataImpl > {};
}
#define MIMEHDR(n) ImplINetMIMEMessageHeaderData::get()[(n)]
"MIME-Version",
"Content-Description",
"Content-Disposition",
"Content-ID",
"Content-Type",
"Content-Transfer-Encoding"
};
enum _ImplINetMIMEMessageHeaderState
{
......@@ -871,7 +841,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
case INETMSG_MIME_OK:
pData = pStop;
SetHeaderField_Impl (
INetMessageHeader (MIMEHDR(nIdx), rHeader.GetValue()),
INetMessageHeader( ImplINetMIMEMessageHeaderData[nIdx], rHeader.GetValue()),
m_nIndex[nIdx]);
nNewIndex = m_nIndex[nIdx];
break;
......@@ -890,7 +860,7 @@ void INetMIMEMessage::SetMIMEVersion (const OUString& rVersion)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
MIMEHDR(INETMSG_MIME_VERSION), rVersion,
ImplINetMIMEMessageHeaderData[INETMSG_MIME_VERSION], rVersion,
m_nIndex[INETMSG_MIME_VERSION]);
}
......@@ -898,7 +868,7 @@ void INetMIMEMessage::SetContentDisposition (const OUString& rDisposition)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
MIMEHDR(INETMSG_MIME_CONTENT_DISPOSITION), rDisposition,
ImplINetMIMEMessageHeaderData[INETMSG_MIME_CONTENT_DISPOSITION], rDisposition,
m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
}
......@@ -906,7 +876,7 @@ void INetMIMEMessage::SetContentType (const OUString& rType)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
MIMEHDR(INETMSG_MIME_CONTENT_TYPE), rType,
ImplINetMIMEMessageHeaderData[INETMSG_MIME_CONTENT_TYPE], rType,
m_nIndex[INETMSG_MIME_CONTENT_TYPE]);
}
......@@ -915,7 +885,7 @@ void INetMIMEMessage::SetContentTransferEncoding (
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
MIMEHDR(INETMSG_MIME_CONTENT_TRANSFER_ENCODING), rEncoding,
ImplINetMIMEMessageHeaderData[INETMSG_MIME_CONTENT_TRANSFER_ENCODING], rEncoding,
m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
}
......
......@@ -213,8 +213,6 @@ class SalGtkFilePicker : public SalGtkPicker, public SalGtkFilePicker_Base
bool mbToggleVisibility[TOGGLE_LAST];
bool mbToggleChecked[TOGGLE_LAST];
static const OString m_ToggleLabels[TOGGLE_LAST];
enum {
PLAY,
BUTTON_LAST };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment