summaryrefslogtreecommitdiff
path: root/winaccessibility/source/UAccCOM
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-10-03 12:44:07 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-10-03 16:30:36 +0200
commit532a4dcba6ec6fe1bd88f3c2db77f05868167886 (patch)
tree82857bab5b8914677e0d17a4b668dfcb97b0467e /winaccessibility/source/UAccCOM
parent372d2d78906aac32ddaf7eaa3c2037ea3d5af1ae (diff)
Replace more reinterpret_cast with SAL_W/SAL_U
Change-Id: Ia632e4083222ad9e7f17c2ad0d0825f189c700cc Reviewed-on: https://gerrit.libreoffice.org/43071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'winaccessibility/source/UAccCOM')
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.cxx5
-rw-r--r--winaccessibility/source/UAccCOM/AccImage.cxx2
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.cxx4
-rw-r--r--winaccessibility/source/UAccCOM/AccTextBase.cxx12
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx20
5 files changed, 17 insertions, 26 deletions
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index c873b44115c4..8feee0227c83 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -117,7 +117,7 @@ STDMETHODIMP CAccActionBase::get_description(long actionIndex,BSTR __RPC_FAR *de
// #CHECK#
SAFE_SYSFREESTRING(*description);
- *description = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *description = SysAllocString(SAL_W(ouStr.getStr()));
return S_OK;
@@ -176,8 +176,7 @@ STDMETHODIMP CAccActionBase::get_keyBinding(
{
auto const wString = GetkeyBindingStrByXkeyBinding( (binding.get())->getAccessibleKeyBinding(index) );
- (*keyBinding)[index] = SysAllocString(
- reinterpret_cast<wchar_t const *>(wString.getStr()));
+ (*keyBinding)[index] = SysAllocString(SAL_W(wString.getStr()));
}
*nBinding = nCount;
diff --git a/winaccessibility/source/UAccCOM/AccImage.cxx b/winaccessibility/source/UAccCOM/AccImage.cxx
index 4435841ed457..5b0e88fd47d1 100644
--- a/winaccessibility/source/UAccCOM/AccImage.cxx
+++ b/winaccessibility/source/UAccCOM/AccImage.cxx
@@ -56,7 +56,7 @@ STDMETHODIMP CAccImage::get_description(BSTR * description)
::rtl::OUString ouStr = GetXInterface()->getAccessibleImageDescription();
SAFE_SYSFREESTRING(*description);
- *description = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *description = SysAllocString(SAL_W(ouStr.getStr()));
return S_OK;
diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx
index f39fab74431d..6c6aebf32761 100644
--- a/winaccessibility/source/UAccCOM/AccTable.cxx
+++ b/winaccessibility/source/UAccCOM/AccTable.cxx
@@ -132,7 +132,7 @@ STDMETHODIMP CAccTable::get_columnDescription(long column, BSTR * description)
// #CHECK#
SAFE_SYSFREESTRING(*description);//??
- *description = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *description = SysAllocString(SAL_W(ouStr.getStr()));
if(description==nullptr)
return E_FAIL;
return S_OK;
@@ -351,7 +351,7 @@ STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * description)
// #CHECK#
SAFE_SYSFREESTRING(*description);
- *description = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *description = SysAllocString(SAL_W(ouStr.getStr()));
if(description==nullptr)
return E_FAIL;
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 0c7a58dbdade..651a1abe5347 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -183,9 +183,7 @@ STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long
// #CHECK#
if(*textAttributes)
SysFreeString(*textAttributes);
- *textAttributes = SysAllocString(
- reinterpret_cast<wchar_t const *>(
- strAttrs.makeStringAndClear().getStr()));
+ *textAttributes = SysAllocString(SAL_W(strAttrs.makeStringAndClear().getStr()));
if( offset < GetXInterface()->getCharacterCount() )
{
@@ -493,7 +491,7 @@ STDMETHODIMP CAccTextBase::get_text(long startOffset, long endOffset, BSTR * tex
}
SysFreeString(*text);
- *text = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *text = SysAllocString(SAL_W(ouStr.getStr()));
return S_OK;
LEAVE_PROTECTED_BLOCK
@@ -578,7 +576,7 @@ STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset, IA2TextBoundaryType
TextSegment segment = GetXInterface()->getTextBeforeIndex( offset, sal_Int16(lUnoBoundaryType));
::rtl::OUString ouStr = segment.SegmentText;
SysFreeString(*text);
- *text = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *text = SysAllocString(SAL_W(ouStr.getStr()));
*startOffset = segment.SegmentStart;
*endOffset = segment.SegmentEnd;
@@ -664,7 +662,7 @@ STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, IA2TextBoundaryType
TextSegment segment = GetXInterface()->getTextBehindIndex( offset, sal_Int16(lUnoBoundaryType));
::rtl::OUString ouStr = segment.SegmentText;
SysFreeString(*text);
- *text = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *text = SysAllocString(SAL_W(ouStr.getStr()));
*startOffset = segment.SegmentStart;
*endOffset = segment.SegmentEnd;
@@ -751,7 +749,7 @@ STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA2TextBoundaryType bou
TextSegment segment = GetXInterface()->getTextAtIndex( offset, sal_Int16(lUnoBoundaryType));
::rtl::OUString ouStr = segment.SegmentText;
SysFreeString(*text);
- *text = SysAllocString(reinterpret_cast<wchar_t const *>(ouStr.getStr()));
+ *text = SysAllocString(SAL_W(ouStr.getStr()));
*startOffset = segment.SegmentStart;
*endOffset = segment.SegmentEnd;
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index f0a72faa2d15..4a713760c21c 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -737,8 +737,7 @@ STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKe
}
SAFE_SYSFREESTRING(*pszKeyboardShortcut);
- *pszKeyboardShortcut = SysAllocString(
- reinterpret_cast<wchar_t const *>(wString.getStr()));
+ *pszKeyboardShortcut = SysAllocString(SAL_W(wString.getStr()));
return S_OK;
}
@@ -2959,8 +2958,7 @@ void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pv
pvData->vt = VT_BSTR;
::rtl::OUString val;
rAnyVal >>= val;
- pvData->bstrVal = SysAllocString(
- reinterpret_cast<wchar_t const *>(val.getStr()));
+ pvData->bstrVal = SysAllocString(SAL_W(val.getStr()));
break;
}
@@ -3013,7 +3011,7 @@ void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pv
case TypeClass::TypeClass_MAKE_FIXED_SIZE:
// Output the type string, if there is other uno value type.
pvData->vt = VT_BSTR;
- pvData->bstrVal = SysAllocString(reinterpret_cast<wchar_t const *>(rAnyVal.getValueTypeName().getStr()));
+ pvData->bstrVal = SysAllocString(SAL_W(rAnyVal.getValueTypeName().getStr()));
break;
default:
@@ -3127,12 +3125,9 @@ STDMETHODIMP CMAccessible:: get_locale( IA2Locale __RPC_FAR *locale )
return E_FAIL;
css::lang::Locale unoLoc = m_xContext.get()->getLocale();
- locale->language = SysAllocString(
- reinterpret_cast<wchar_t const *>(unoLoc.Language.getStr()));
- locale->country = SysAllocString(
- reinterpret_cast<wchar_t const *>(unoLoc.Country.getStr()));
- locale->variant = SysAllocString(
- reinterpret_cast<wchar_t const *>(unoLoc.Variant.getStr()));
+ locale->language = SysAllocString(SAL_W(unoLoc.Language.getStr()));
+ locale->country = SysAllocString(SAL_W(unoLoc.Country.getStr()));
+ locale->variant = SysAllocString(SAL_W(unoLoc.Variant.getStr()));
return S_OK;
@@ -3219,8 +3214,7 @@ STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
if(*pAttr)
SAFE_SYSFREESTRING(*pAttr);
- *pAttr = SysAllocString(
- reinterpret_cast<wchar_t const *>(val.getStr()));
+ *pAttr = SysAllocString(SAL_W(val.getStr()));
return S_OK;
}