summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-12-20 14:23:33 +0200
committerNoel Grandin <noel@peralex.com>2014-01-07 09:43:37 +0200
commit82625bb98e256b83351328d3bf2a14e3dd244eef (patch)
tree9b661850ae5df9ea27fcac063cfe61862046c8d1 /stoc
parent347af397cafa97cfa7d5027f83fff784ca04a397 (diff)
remove unnecessary sal_Unicode casts in OUStringBuffer::append calls
Convert code like: buf.append( static_cast<sal_Unicode>('!') ); to: buf.append( '!' ); Change-Id: Iacb03a61de65a895540940953b49620677b3d051
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/implementationregistration/implreg.cxx2
-rw-r--r--stoc/source/security/permissions.cxx10
-rw-r--r--stoc/source/uriproc/UriReference.cxx6
-rw-r--r--stoc/source/uriproc/UriReferenceFactory.cxx32
-rw-r--r--stoc/test/uriproc/test_uriproc.cxx6
5 files changed, 28 insertions, 28 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 3490320f9aa8..bceef4b026ea 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -972,7 +972,7 @@ static void insert_singletons(
OUStringBuffer buf( 64 );
buf.append( "existing singleton service (" );
buf.append( singleton_name );
- buf.append( (sal_Unicode)'=' );
+ buf.append( '=' );
buf.append( existing_name );
buf.append( ") does not support given one: " );
buf.append( service_name );
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 448db7ea9f75..03b6fd437b37 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -92,7 +92,7 @@ static inline OUString makeStrings(
{
buf.appendAscii( *strings );
if (mask << 1) // more items following
- buf.append( (sal_Unicode)',' );
+ buf.append( ',' );
}
mask = (mask << 1);
++strings;
@@ -247,19 +247,19 @@ OUString SocketPermission::toString() const SAL_THROW(())
buf.append( m_host );
if (m_resolvedHost)
{
- buf.append( (sal_Unicode)'[' );
+ buf.append( '[' );
buf.append( m_ip );
- buf.append( (sal_Unicode)']' );
+ buf.append( ']' );
}
// port
if (0 != m_lowerPort || 65535 != m_upperPort)
{
- buf.append( (sal_Unicode)':' );
+ buf.append( ':' );
if (m_lowerPort > 0)
buf.append( m_lowerPort );
if (m_upperPort > m_lowerPort)
{
- buf.append( (sal_Unicode)'-' );
+ buf.append( '-' );
if (m_upperPort < 65535)
buf.append( m_upperPort );
}
diff --git a/stoc/source/uriproc/UriReference.cxx b/stoc/source/uriproc/UriReference.cxx
index 3544b60e2c96..a671aee07de3 100644
--- a/stoc/source/uriproc/UriReference.cxx
+++ b/stoc/source/uriproc/UriReference.cxx
@@ -57,11 +57,11 @@ OUString UriReference::getUriReference() throw (css::uno::RuntimeException)
OUStringBuffer buf;
if (!m_scheme.isEmpty()) {
buf.append(m_scheme);
- buf.append(static_cast< sal_Unicode >(':'));
+ buf.append(':');
}
appendSchemeSpecificPart(buf);
if (m_hasFragment) {
- buf.append(static_cast< sal_Unicode >('#'));
+ buf.append('#');
buf.append(m_fragment);
}
return buf.makeStringAndClear();
@@ -189,7 +189,7 @@ void UriReference::appendSchemeSpecificPart(OUStringBuffer & buffer) const
}
buffer.append(m_path);
if (m_hasQuery) {
- buffer.append(static_cast< sal_Unicode >('?'));
+ buffer.append('?');
buffer.append(m_query);
}
}
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 121c761d5a88..a6edbc135551 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -421,7 +421,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
return abs;
} else {
OUStringBuffer abs(baseUriReference->getScheme());
- abs.append(static_cast< sal_Unicode >(':'));
+ abs.append(':');
if (uriReference->hasAuthority()) {
abs.append("//");
abs.append(uriReference->getAuthority());
@@ -442,7 +442,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
// these rules for consistent results.
bool slash = !baseUriReference->getPath().isEmpty();
if (slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
for (Segments::iterator i(segments.begin()); i != segments.end();
++i)
@@ -452,24 +452,24 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
baseUriReference->getPathSegment(-(*i + 2)));
if (!segment.isEmpty() || segments.size() > 1) {
if (!slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
abs.append(segment);
slash = true;
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
} else if (*i > 1) {
OUString segment(uriReference->getPathSegment(*i - 2));
if (!segment.isEmpty() || segments.size() > 1) {
if (!slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
abs.append(segment);
slash = false;
}
} else if (*i == 0) {
if (segments.size() > 1 && !slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
} else {
switch (excessParentSegments) {
@@ -478,12 +478,12 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
case css::uri::RelativeUriExcessParentSegments_RETAIN:
if (!slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
abs.append("..");
slash = *i < 0;
if (slash) {
- abs.append(static_cast< sal_Unicode >('/'));
+ abs.append('/');
}
break;
@@ -500,11 +500,11 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute(
abs.append(uriReference->getPath());
}
if (uriReference->hasQuery()) {
- abs.append(static_cast< sal_Unicode >('?'));
+ abs.append('?');
abs.append(uriReference->getQuery());
}
if (uriReference->hasFragment()) {
- abs.append(static_cast< sal_Unicode >('#'));
+ abs.append('#');
abs.append(uriReference->getFragment());
}
return parse(abs.makeStringAndClear());
@@ -570,7 +570,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
|| uriReference->getPath().getLength() > 1)
{
if (uriReference->getPath().isEmpty()) {
- rel.append(static_cast< sal_Unicode >('/'));
+ rel.append('/');
} else {
assert(uriReference->getPath()[0] == '/');
if (uriReference->getPath().startsWith("//")) {
@@ -585,7 +585,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
bool segments = false;
for (sal_Int32 j = i; j < count1 - 1; ++j) {
if (segments) {
- rel.append(static_cast< sal_Unicode >('/'));
+ rel.append('/');
}
rel.append("..");
segments = true;
@@ -598,12 +598,12 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
|| (parseScheme(uriReference->getPathSegment(i))
>= 0)))
{
- rel.append(static_cast< sal_Unicode >('.'));
+ rel.append('.');
segments = true;
}
for (; i < count2; ++i) {
if (segments) {
- rel.append(static_cast< sal_Unicode >('/'));
+ rel.append('/');
}
OUString s(uriReference->getPathSegment(i));
if (encodeRetainedSpecialSegments && s == ".") {
@@ -619,11 +619,11 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
}
}
if (!omitQuery && uriReference->hasQuery()) {
- rel.append(static_cast< sal_Unicode >('?'));
+ rel.append('?');
rel.append(uriReference->getQuery());
}
if (uriReference->hasFragment()) {
- rel.append(static_cast< sal_Unicode >('#'));
+ rel.append('#');
rel.append(uriReference->getFragment());
}
return parse(rel.makeStringAndClear());
diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx
index a7be7da9bc2f..9f0977776f05 100644
--- a/stoc/test/uriproc/test_uriproc.cxx
+++ b/stoc/test/uriproc/test_uriproc.cxx
@@ -85,9 +85,9 @@ OString createTestAssertEqualMessage(
{
OUStringBuffer buf;
buf.appendAscii(token1);
- buf.append(static_cast< sal_Unicode >('|'));
+ buf.append('|');
append(buf, token2);
- buf.append(static_cast< sal_Unicode >('|'));
+ buf.append('|');
append(buf, token3);
buf.append(": TEST_ASSERT_EQUAL(");
buf.appendAscii(expectedExpr);
@@ -97,7 +97,7 @@ OString createTestAssertEqualMessage(
append(buf, expected);
buf.append("> != <");
append(buf, actual);
- buf.append(static_cast< sal_Unicode >('>'));
+ buf.append('>');
return OUStringToOString(
buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
}