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