summaryrefslogtreecommitdiff
path: root/forms/source/xforms
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-17 18:46:13 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-20 09:06:47 +0100
commit3ad6e328a76569660c8441cc8e546cb6f22cdeb7 (patch)
tree125b64600e0dba5bc680b68f2aa39d3d8a00eda8 /forms/source/xforms
parent6194c26e1eaf7ff3534202fcd9e734645010a30d (diff)
Some more loplugin:cstylecast: forms
Change-Id: I39325fccdadcc57df32fe5821eef0d8477018b59
Diffstat (limited to 'forms/source/xforms')
-rw-r--r--forms/source/xforms/submission/serialization_urlencoded.cxx2
-rw-r--r--forms/source/xforms/submission/submission_get.cxx2
-rw-r--r--forms/source/xforms/xpathlib/xpathlib.cxx22
3 files changed, 13 insertions, 13 deletions
diff --git a/forms/source/xforms/submission/serialization_urlencoded.cxx b/forms/source/xforms/submission/serialization_urlencoded.cxx
index 8bd3807dd1ab..c688b6eb7fc0 100644
--- a/forms/source/xforms/submission/serialization_urlencoded.cxx
+++ b/forms/source/xforms/submission/serialization_urlencoded.cxx
@@ -142,7 +142,7 @@ void CSerializationURLEncoded::serialize_node(const Reference< XNode >& aNode)
aEncodedBuffer.append("=");
encode_and_append(aUnencValue, aEncodedBuffer);
aEncodedBuffer.append("&");
- sal_Int8 *pData = (sal_Int8*)aEncodedBuffer.getStr();
+ sal_Int8 const *pData = reinterpret_cast<sal_Int8 const *>(aEncodedBuffer.getStr());
Sequence< sal_Int8 > sData(pData, aEncodedBuffer.getLength());
m_aPipe->writeBytes(sData);
}
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx
index 3c497e5e86ff..de7caa654f74 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -79,7 +79,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference<
sal_Int32 n = 0;
Sequence< sal_Int8 > aByteBuffer(size);
while ((n = aInStream->readSomeBytes(aByteBuffer, size-1)) != 0)
- aQueryString.append((sal_Char*)aByteBuffer.getArray(), n);
+ aQueryString.append(reinterpret_cast<char const *>(aByteBuffer.getConstArray()), n);
if (!aQueryString.isEmpty() && m_aURLObj.GetProtocol() != INET_PROT_FILE)
{
aUTF8QueryURL.append('?');
diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx
index e8183c3c0246..609b6faa3575 100644
--- a/forms/source/xforms/xpathlib/xpathlib.cxx
+++ b/forms/source/xforms/xpathlib/xpathlib.cxx
@@ -51,7 +51,7 @@ using namespace com::sun::star::lang;
xmlXPathFunction xforms_lookupFunc(void *, const xmlChar *xname, const xmlChar *)
{
- const char *name = (char *)xname;
+ const char *name = reinterpret_cast<char const *>(xname);
if (strcmp("boolean-from-string", name)==0)
return xforms_booleanFromStringFunction;
else if ((strcmp("if", name))==0)
@@ -92,7 +92,7 @@ void xforms_booleanFromStringFunction(xmlXPathParserContextPtr ctxt, int nargs)
if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY);
xmlChar *pString = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE);
- OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8);
+ OUString aString(reinterpret_cast<char*>(pString), strlen(reinterpret_cast<char*>(pString)), RTL_TEXTENCODING_UTF8);
if (aString.equalsIgnoreAsciiCase("true") ||
aString.equalsIgnoreAsciiCase("1"))
xmlXPathReturnTrue(ctxt);
@@ -221,11 +221,11 @@ void xforms_propertyFunction(xmlXPathParserContextPtr ctxt, int nargs)
if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY);
xmlChar* pString = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE);
- OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8);
+ OUString aString(reinterpret_cast<char*>(pString), strlen(reinterpret_cast<char*>(pString)), RTL_TEXTENCODING_UTF8);
if (aString.equalsIgnoreAsciiCase("version"))
- xmlXPathReturnString(ctxt, (xmlChar*)_version);
+ xmlXPathReturnString(ctxt, reinterpret_cast<xmlChar *>(const_cast<char *>(_version)));
else if (aString.equalsIgnoreAsciiCase("conformance-level"))
- xmlXPathReturnString(ctxt, (xmlChar*)_conformance);
+ xmlXPathReturnString(ctxt, reinterpret_cast<xmlChar *>(const_cast<char *>(_conformance)));
else
xmlXPathReturnEmptyString(ctxt);
}
@@ -280,7 +280,7 @@ void xforms_nowFunction(xmlXPathParserContextPtr ctxt, int /*nargs*/)
DateTime aDateTime( DateTime::SYSTEM );
OString aDateTimeString = makeDateTimeString(aDateTime);
xmlChar *pString = static_cast<xmlChar*>(xmlMalloc(aDateTimeString.getLength()+1));
- strncpy((char*)pString, (char*)aDateTimeString.getStr(), aDateTimeString.getLength());
+ strncpy(reinterpret_cast<char*>(pString), (char*)aDateTimeString.getStr(), aDateTimeString.getLength());
pString[aDateTimeString.getLength()] = 0;
xmlXPathReturnString(ctxt, pString);
}
@@ -332,7 +332,7 @@ void xforms_daysFromDateFunction(xmlXPathParserContextPtr ctxt, int nargs)
if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY);
xmlChar* pString = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE);
- OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8);
+ OUString aString(reinterpret_cast<char*>(pString), strlen(reinterpret_cast<char*>(pString)), RTL_TEXTENCODING_UTF8);
DateTime aDateTime( DateTime::EMPTY );
if (parseDateTime(aString, aDateTime))
@@ -355,7 +355,7 @@ void xforms_secondsFromDateTimeFunction(xmlXPathParserContextPtr ctxt, int nargs
if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY);
xmlChar* pString = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE);
- OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8);
+ OUString aString(reinterpret_cast<char*>(pString), strlen(reinterpret_cast<char*>(pString)), RTL_TEXTENCODING_UTF8);
DateTime aDateTime( DateTime::EMPTY );
@@ -378,10 +378,10 @@ static bool parseDuration(const xmlChar* aString, bool& bNegative, sal_Int32& nY
sal_Int32& nHours, sal_Int32& nMinutes, sal_Int32& nSeconds)
{
bool bTime = false; // in part after T
- sal_Int32 nLength = strlen((char*)aString)+1;
+ sal_Int32 nLength = strlen(reinterpret_cast<char const *>(aString))+1;
char *pString = (char*)rtl_allocateMemory(nLength);
char *pString0 = pString;
- strncpy(pString, (char*)aString, nLength);
+ strncpy(pString, reinterpret_cast<char const *>(aString), nLength);
if (pString[0] == '-') {
bNegative = true;
@@ -504,7 +504,7 @@ void xforms_instanceFuction(xmlXPathParserContextPtr ctxt, int nargs)
if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY);
xmlChar *pString = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE);
- OUString aString((char*)pString, strlen((char*)pString), RTL_TEXTENCODING_UTF8);
+ OUString aString(reinterpret_cast<char*>(pString), strlen(reinterpret_cast<char*>(pString)), RTL_TEXTENCODING_UTF8);
Reference< XModel > aModel = ((CLibxml2XFormsExtension*)ctxt->context->funcLookupData)->getModel();
if (aModel.is())