[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2023-11-13 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/service/AccObject.cxx |   36 ++
 1 file changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 552eb49c60562b67d2e8bc4b3813464b5d13be87
Author: Michael Weghorn 
AuthorDate: Mon Nov 13 13:28:49 2023 +
Commit: Michael Weghorn 
CommitDate: Tue Nov 14 08:08:37 2023 +0100

wina11y: Drop extra local var for role

Just use the `m_accRole` member directly.

Change-Id: I6a4eae9bc00422683e600fa1be300264d45fec46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159380
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index aeb220134843..51d04ec18dea 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -719,14 +719,11 @@ void  AccObject::DecreaseState( sal_Int64 xState )
 
 if( xState == FOCUSABLE)
 {
-short Role = m_accRole ;
-if(Role == MENU_ITEM
-|| Role == RADIO_MENU_ITEM
-|| Role == CHECK_MENU_ITEM)
+if (m_accRole == MENU_ITEM || m_accRole == RADIO_MENU_ITEM || 
m_accRole == CHECK_MENU_ITEM)
 return;
 else
 {
-if (Role == TOGGLE_BUTTON || Role == PUSH_BUTTON || 
BUTTON_DROPDOWN == Role)
+if (m_accRole == TOGGLE_BUTTON || m_accRole == PUSH_BUTTON || 
m_accRole == BUTTON_DROPDOWN)
 {
 if( ( m_pParentObj !=nullptr ) && (TOOL_BAR == 
m_pParentObj->m_accRole ) )
 return;
@@ -906,8 +903,6 @@ void AccObject::UpdateState()
 m_pIMAcc->IncreaseState( STATE_SYSTEM_INVISIBLE );
 }
 
-short Role = m_accRole;
-
 switch(m_accRole)
 {
 case LABEL:
@@ -949,19 +944,19 @@ void AccObject::UpdateState()
 if( isEnable )
 {
 
-if(!(Role == FILLER || Role == END_NOTE || Role == FOOTER || Role == 
FOOTNOTE || Role == GROUP_BOX || Role == RULER
-|| Role == HEADER || Role == ICON || Role == INTERNAL_FRAME || 
Role == LABEL || Role == LAYERED_PANE
-|| Role == SCROLL_BAR || Role == SCROLL_PANE || Role == 
SPLIT_PANE || Role == STATIC || Role == STATUS_BAR
-|| Role == TOOL_TIP || Role == NOTIFICATION))
+if (!(m_accRole == FILLER || m_accRole == END_NOTE || m_accRole == 
FOOTER || m_accRole == FOOTNOTE || m_accRole == GROUP_BOX || m_accRole == RULER
+|| m_accRole == HEADER || m_accRole == ICON || m_accRole == 
INTERNAL_FRAME || m_accRole == LABEL || m_accRole == LAYERED_PANE
+|| m_accRole == SCROLL_BAR || m_accRole == SCROLL_PANE || 
m_accRole == SPLIT_PANE || m_accRole == STATIC || m_accRole == STATUS_BAR
+|| m_accRole == TOOL_TIP || m_accRole == NOTIFICATION))
 {
-if( SEPARATOR == Role  )
+if (m_accRole == SEPARATOR)
 {
 if( ( m_pParentObj != nullptr ) && ( MENU == 
m_pParentObj->m_accRole  || POPUP_MENU == m_pParentObj->m_accRole ))
 IncreaseState( FOCUSABLE );
 }
 
-else if (TABLE_CELL == Role || TABLE == Role || PANEL == Role || 
OPTION_PANE == Role ||
- COLUMN_HEADER == Role)
+else if (m_accRole == TABLE_CELL || m_accRole == TABLE || 
m_accRole == PANEL || m_accRole == OPTION_PANE ||
+ m_accRole == COLUMN_HEADER)
 {
 if (isFocusable)
 IncreaseState( FOCUSABLE );
@@ -985,11 +980,11 @@ void AccObject::UpdateState()
 else
 {
 m_pIMAcc->IncreaseState( STATE_SYSTEM_UNAVAILABLE );
-if( !((Role == MENU_ITEM) ||
-(Role == RADIO_MENU_ITEM) ||
-(Role == CHECK_MENU_ITEM)) )
+if( !((m_accRole == MENU_ITEM) ||
+(m_accRole == RADIO_MENU_ITEM) ||
+(m_accRole == CHECK_MENU_ITEM)) )
 {
-if  ( Role == TOGGLE_BUTTON || Role == PUSH_BUTTON || 
BUTTON_DROPDOWN == Role)
+if  (m_accRole == TOGGLE_BUTTON || m_accRole == PUSH_BUTTON || 
m_accRole == BUTTON_DROPDOWN)
 {
 if(( m_pParentObj != nullptr )&& (TOOL_BAR ==  
m_pParentObj->m_accRole ) )
 IncreaseState( FOCUSABLE );
commit 9356c479a62e83f1e89be0dd455c60601c35ef86
Author: Michael Weghorn 
AuthorDate: Mon Nov 13 13:10:39 2023 +
Commit: Michael Weghorn 
CommitDate: Tue Nov 14 08:08:23 2023 +0100

wina11y: Drop unnecessary local var 'Role'

Just use `m_accRole` directly, as already
happens elsewhere in this method.

Change-Id: Ibd3358e9f85621ba7d9c99d5ed0812b6c692d473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159379
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 

[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2023-10-21 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   43 
 1 file changed, 22 insertions(+), 21 deletions(-)

New commits:
commit a8e75a8ac93c18a7e955e448bfd120d0ed9ef0b0
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 12:56:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:50 2023 +0200

wina11y: Just return empty attr string when none present

If the `XAccessibleExtendedAttributes` interface
isn't implemented, just return an empty string
for the attributes instead of an error code.

(This seems like a totally valid case to me,
no need to report an error.)

Change-Id: I986f030bc7a01da0fdd92a5aa2b4cf3c0d6a9200
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158258
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 98f15fdf230b..30e9b043b0fb 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2721,10 +2721,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 {
 return E_FAIL;
 }
+
+OUString sAttributes;
 Reference pRXI(pRContext,UNO_QUERY);
-if( !pRXI.is() )
-return E_FAIL;
-else
+if (pRXI.is())
 {
 
css::uno::Reference pRXAttr;
 pRXAttr = pRXI.get();
@@ -2732,13 +2732,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 
 OUString val;
 anyVal >>= val;
+sAttributes += val;
+}
 
-if(*pAttr)
-SysFreeString(*pAttr);
-*pAttr = SysAllocString(o3tl::toW(val.getStr()));
+if (*pAttr)
+SysFreeString(*pAttr);
+*pAttr = SysAllocString(o3tl::toW(sAttributes.getStr()));
 
-return S_OK;
-}
+return S_OK;
 } catch(...) { return E_FAIL; }
 }
 
commit eff3e9b8a576863c01f4244a5628cda64f48a363
Author: Michael Weghorn 
AuthorDate: Fri Oct 20 12:52:03 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sat Oct 21 13:48:42 2023 +0200

wina11y: Indent try block

Change-Id: I89a4ed514e1c24e683b081d04f72cd62ede80065
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158257
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index e8f29c8192d2..98f15fdf230b 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2711,34 +2711,34 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_attributes(/*[out]*/ BSTR *p
 SolarMutexGuard g;
 
 try {
-if (m_isDestroy) return S_FALSE;
+if (m_isDestroy) return S_FALSE;
 
-if (!m_xAccessible.is())
-return E_FAIL;
+if (!m_xAccessible.is())
+return E_FAIL;
 
-Reference pRContext = 
m_xAccessible->getAccessibleContext();
-if( !pRContext.is() )
-{
-return E_FAIL;
-}
-Reference pRXI(pRContext,UNO_QUERY);
-if( !pRXI.is() )
-return E_FAIL;
-else
-{
-css::uno::Reference 
pRXAttr;
-pRXAttr = pRXI.get();
-css::uno::Any  anyVal = pRXAttr->getExtendedAttributes();
+Reference pRContext = 
m_xAccessible->getAccessibleContext();
+if( !pRContext.is() )
+{
+return E_FAIL;
+}
+Reference pRXI(pRContext,UNO_QUERY);
+if( !pRXI.is() )
+return E_FAIL;
+else
+{
+
css::uno::Reference pRXAttr;
+pRXAttr = pRXI.get();
+css::uno::Any  anyVal = pRXAttr->getExtendedAttributes();
 
-OUString val;
-anyVal >>= val;
+OUString val;
+anyVal >>= val;
 
-if(*pAttr)
-SysFreeString(*pAttr);
-*pAttr = SysAllocString(o3tl::toW(val.getStr()));
+if(*pAttr)
+SysFreeString(*pAttr);
+*pAttr = SysAllocString(o3tl::toW(val.getStr()));
 
-return S_OK;
-}
+return S_OK;
+}
 } catch(...) { return E_FAIL; }
 }
 


[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2023-10-10 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccTextBase.cxx |   59 +++-
 winaccessibility/source/UAccCOM/AccTextBase.h   |2 
 2 files changed, 28 insertions(+), 33 deletions(-)

New commits:
commit 3b6366773389c55c127f097d5d82d27d5efaa69a
Author: Michael Weghorn 
AuthorDate: Tue Oct 10 12:52:49 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Oct 11 07:20:21 2023 +0200

wina11y: Drop CAccTextBase::GetXInterface

Just use the private `pRXText` member directly. The separate
getter doesn't really help regarding readability,
in particular since the typical usage pattern
involved first checking the member directly, then
using the getter, making it less obvious that this
was about the same object/reference e.g.

if(!pRXText.is())
{
return E_FAIL;
}

if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
return E_FAIL;

Change-Id: Iaf786220b94a37e79a46985f58e0586252846f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157766
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx 
b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 131d001b27df..37eb1d6fcf70 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -108,7 +108,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_addSelection(long startOffse
 }
 else
 {
-GetXInterface()->setSelection(startOffset, endOffset);
+pRXText->setSelection(startOffset, endOffset);
 return S_OK;
 }
 
@@ -137,12 +137,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_attributes(long offset, long
 return E_FAIL;
 }
 
-if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
+if (offset < 0 || offset > pRXText->getCharacterCount() )
 return E_FAIL;
 
 OUStringBuffer strAttrs("Version:1;");
 
-Sequence< css::beans::PropertyValue > pValues = 
GetXInterface()->getCharacterAttributes(offset, Sequence< OUString >());
+Sequence  pValues = 
pRXText->getCharacterAttributes(offset, Sequence());
 int nCount = pValues.getLength();
 
 sal_Int16 numberingLevel = 0;
@@ -220,9 +220,9 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_attributes(long offset, long
 SysFreeString(*textAttributes);
 *textAttributes = 
SysAllocString(o3tl::toW(strAttrs.makeStringAndClear().getStr()));
 
-if( offset < GetXInterface()->getCharacterCount() )
+if (offset < pRXText->getCharacterCount())
 {
-TextSegment textSeg = GetXInterface()->getTextAtIndex(offset, 
AccessibleTextType::ATTRIBUTE_RUN);
+TextSegment textSeg = pRXText->getTextAtIndex(offset, 
AccessibleTextType::ATTRIBUTE_RUN);
 *startOffset = textSeg.SegmentStart;
 *endOffset = textSeg.SegmentEnd;
 }
@@ -257,7 +257,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_caretOffset(long * offset)
 return S_OK;
 }
 
-*offset = GetXInterface()->getCaretPosition();
+*offset = pRXText->getCaretPosition();
 return S_OK;
 
 } catch(...) { return E_FAIL; }
@@ -283,7 +283,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterCount(long * nChara
 return S_OK;
 }
 
-*nCharacters = GetXInterface()->getCharacterCount();
+*nCharacters = pRXText->getCharacterCount();
 return S_OK;
 
 } catch(...) { return E_FAIL; }
@@ -310,11 +310,11 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterExtents(long offset
 if(!pRXText.is())
 return E_FAIL;
 
-if(offset < 0 || offset > GetXInterface()->getCharacterCount() )
+if (offset < 0 || offset > pRXText->getCharacterCount())
 return E_FAIL;
 
 css::awt::Rectangle rectangle;
-rectangle = GetXInterface()->getCharacterBounds(offset);
+rectangle = pRXText->getCharacterBounds(offset);
 
 //IA2Point aPoint;
 css::awt::Point aPoint;
@@ -346,10 +346,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_characterExtents(long offset
 *x = rectangle.X;
 *y = rectangle.Y;
 
-// GetXInterface()->getCharacterBounds() have different implement in 
different acc component
+// pRXText->getCharacterBounds() have different implement in different acc 
component
 // But we need return the width/height == 1 for every component when 
offset == text length.
-// So we ignore the return result of GetXInterface()->getCharacterBounds() 
when offset == text length.
-if( offset == GetXInterface()->getCharacterCount() )
+// So we ignore the return result of pRXText->getCharacterBounds() when 
offset == text length.
+if (offset == pRXText->getCharacterCount())
 {
 *width = 1;
 *height = 1;
@@ -395,7 +395,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccTextBase::get_nSelections(long * nSelectio
 return S_OK;
 }
 
-

[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2022-03-01 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   28 ++--
 winaccessibility/source/service/AccObjectWinManager.cxx |6 +--
 2 files changed, 13 insertions(+), 21 deletions(-)

New commits:
commit a427a46db0fa453acabe10389e106441031b317e
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:32:34 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:52:18 2022 +0100

wina11y: Use range-based for

Change-Id: Ie03126205d45ad2fcae14af53ab7a499f3c445f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130759
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx 
b/winaccessibility/source/service/AccObjectWinManager.cxx
index c405e6799d2b..bcde1ccf46a4 100644
--- a/winaccessibility/source/service/AccObjectWinManager.cxx
+++ b/winaccessibility/source/service/AccObjectWinManager.cxx
@@ -1057,11 +1057,9 @@ bool 
AccObjectWinManager::IsStateManageDescendant(XAccessible* pAccessible)
 if( !pRState.is() )
 return false;
 
-Sequence pStates = pRState->getStates();
-int count = pStates.getLength();
-for( int iIndex = 0;iIndex < count;iIndex++ )
+for (sal_Int16 nState : pRState->getStates())
 {
-if (pStates[iIndex] == 
AccessibleStateType::MANAGES_DESCENDANTS)
+if (nState == AccessibleStateType::MANAGES_DESCENDANTS)
 return true;
 }
 }
commit 45ae2fb7a7de4da4c3d6c7c359aaf92ccf0688a2
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:27:11 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:52:04 2022 +0100

wina11y: Use more range-based for

And use const reference to css::style::TabStop instead of
creating a copy.

Change-Id: I4092cbefcfbdaa6a6697974b7f40242e26cc6aad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130758
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index a24536c8f36f..56542b10028f 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2712,43 +2712,37 @@ OUString CMAccessible::get_StringFromAny(Any const & 
pAny)
 
 OUStringBuffer pString;
 
-int count = val.getLength();
+for (const OUString& rElem : val)
+pString.append(rElem);
 
-for( int iIndex = 0;iIndex < count;iIndex++ )
-{
-pString.append(val[iIndex]);
-}
 return pString.makeStringAndClear();
 }
 else if (pAny.getValueType() == cppu::UnoType>::get())
 {
 Sequence < css::style::TabStop > val;
 pAny >>= val;
-int count = val.getLength();
 
 OUStringBuffer buf;
-for( int iIndex = 0;iIndex < count;iIndex++ )
+for (const css::style::TabStop& rSingleVal : val)
 {
-css::style::TabStop sigleVal = val[iIndex];
-
 buf.append("Position=");
-buf.append(sigleVal.Position);
+buf.append(rSingleVal.Position);
 buf.append(",TabAlign=");
-buf.append(sal_Int32(sigleVal.Alignment));
+buf.append(sal_Int32(rSingleVal.Alignment));
 buf.append(",");
 
 buf.append("DecimalChar=");
-if(sigleVal.DecimalChar==';' || sigleVal.DecimalChar == 
':' || sigleVal.DecimalChar == ',' ||
-sigleVal.DecimalChar == '=' || sigleVal.DecimalChar == 
'\\')
+if (rSingleVal.DecimalChar==';' || rSingleVal.DecimalChar 
== ':' || rSingleVal.DecimalChar == ',' ||
+rSingleVal.DecimalChar == '=' || 
rSingleVal.DecimalChar == '\\')
 buf.append('\\');
-buf.append(sigleVal.DecimalChar);
+buf.append(rSingleVal.DecimalChar);
 buf.append(",");
 
 buf.append("FillChar=");
-if(sigleVal.FillChar==';' || sigleVal.FillChar == ':' || 
sigleVal.FillChar == ',' ||
-sigleVal.FillChar == '=' || sigleVal.FillChar == '\\')
+if (rSingleVal.FillChar==';' || rSingleVal.FillChar == ':' 
|| rSingleVal.FillChar == ',' ||
+rSingleVal.FillChar == '=' || rSingleVal.FillChar == 
'\\')
 buf.append('\\');
-buf.append(sigleVal.FillChar);
+buf.append(rSingleVal.FillChar);
 buf.append(",");
 }
 return buf.makeStringAndClear();


[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2022-01-06 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   36 
 winaccessibility/source/service/AccObject.cxx   |   19 +---
 2 files changed, 26 insertions(+), 29 deletions(-)

New commits:
commit d84c06577f3198d6c6bd05176429724897d918e6
Author: Michael Weghorn 
AuthorDate: Wed Jan 5 15:32:06 2022 +
Commit: Michael Weghorn 
CommitDate: Thu Jan 6 10:11:21 2022 +0100

wina11y: Don't use space in qualified name

While 'MyClass:: MyMethod' (with a space in it) is valid in C++,
it's unusual and may break a naive plain-text search for
a specific class member definition.

Change-Id: I8c9779865715a0b4f1a66d3e35b874f2cec19193
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128016
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index c905cc82b875..495f8b49f196 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -1802,7 +1802,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::role(long 
__RPC_FAR *role)
 }
 
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_nActions(long __RPC_FAR 
*nActions)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_nActions(long __RPC_FAR 
*nActions)
 {
 SolarMutexGuard g;
 
@@ -1833,12 +1833,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: 
get_nActions(long __RPC_FAR *nA
 }
 
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: scrollToPoint(enum 
IA2CoordinateType, long, long)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::scrollToPoint(enum 
IA2CoordinateType, long, long)
 {
 return E_NOTIMPL;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: scrollTo(enum IA2ScrollType)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::scrollTo(enum IA2ScrollType)
 {
 return E_NOTIMPL;
 }
@@ -1865,7 +1865,7 @@ static XAccessible* getTheParentOfMember(XAccessible* 
pXAcc)
 return nullptr;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_groupPosition(long 
__RPC_FAR *groupLevel,long __RPC_FAR *similarItemsInGroup,long __RPC_FAR 
*positionInGroup)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long 
__RPC_FAR *groupLevel,long __RPC_FAR *similarItemsInGroup,long __RPC_FAR 
*positionInGroup)
 {
 SolarMutexGuard g;
 
@@ -2041,13 +2041,13 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: 
get_groupPosition(long __RPC_FA
 LEAVE_PROTECTED_BLOCK
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_extendedStates( long, 
BSTR __RPC_FAR *__RPC_FAR *, long __RPC_FAR *)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_extendedStates(long, BSTR 
__RPC_FAR *__RPC_FAR *, long __RPC_FAR *)
 {
 return E_NOTIMPL;
 }
 
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_uniqueID(long __RPC_FAR 
*uniqueID)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_uniqueID(long __RPC_FAR 
*uniqueID)
 {
 SolarMutexGuard g;
 
@@ -2064,7 +2064,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: 
get_uniqueID(long __RPC_FAR *un
 LEAVE_PROTECTED_BLOCK
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_windowHandle(HWND 
__RPC_FAR *windowHandle)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_windowHandle(HWND 
__RPC_FAR *windowHandle)
 {
 SolarMutexGuard g;
 
@@ -3001,7 +3001,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::Get_XAccChildID(long* childID)
 return S_OK;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_states(AccessibleStates 
__RPC_FAR *states )
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_states(AccessibleStates 
__RPC_FAR *states)
 {
 SolarMutexGuard g;
 
@@ -3040,29 +3040,29 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: 
get_states(AccessibleStates __R
 }
 
 // return the UNO roles
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_extendedRole( BSTR 
__RPC_FAR *  )
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_extendedRole(BSTR 
__RPC_FAR *)
 {
 return E_NOTIMPL;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_localizedExtendedRole( 
BSTR __RPC_FAR *  )
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_localizedExtendedRole(BSTR 
__RPC_FAR *)
 {
 return E_NOTIMPL;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_nExtendedStates( long 
__RPC_FAR * )
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_nExtendedStates(long 
__RPC_FAR *)
 {
 return E_NOTIMPL;
 }
 
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_localizedExtendedStates( 
long, BSTR __RPC_FAR *__RPC_FAR *, long __RPC_FAR *)
+COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_localizedExtendedStates(long, BSTR __RPC_FAR *__RPC_FAR *, 
long __RPC_FAR *)
 {
 return E_NOTIMPL;
 }
 
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible:: get_indexInParent( long 
__RPC_FAR *accParentIndex)
+COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_indexInParent(long 
__RPC_FAR 

[Libreoffice-commits] core.git: 2 commits - winaccessibility/source xmloff/source

2018-10-20 Thread Libreoffice Gerrit user
 winaccessibility/source/UAccCOM/MAccessible.cxx |7 +--
 xmloff/source/style/numehelp.cxx|   14 --
 2 files changed, 9 insertions(+), 12 deletions(-)

New commits:
commit f90c2001eb8f6d41e90fa347bf5a707bbefb6f43
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 16:55:19 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 20 19:53:39 2018 +0200

pvs-studio: Expression '!bWasSetTypeAttribute' is always true.

Change-Id: I605bbc117426bba3dae9a8ec3ffc45967edbf7c4
Reviewed-on: https://gerrit.libreoffice.org/62060
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx
index b678d559a277..db9e1d8dac6e 100644
--- a/xmloff/source/style/numehelp.cxx
+++ b/xmloff/source/style/numehelp.cxx
@@ -105,11 +105,8 @@ void 
XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
 case util::NumberFormat::SCIENTIFIC:
 case util::NumberFormat::FRACTION:
 {
-if (!bWasSetTypeAttribute)
-{
-rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, 
XML_FLOAT);
-bWasSetTypeAttribute = true;
-}
+rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, 
XML_FLOAT);
+bWasSetTypeAttribute = true;
 SAL_FALLTHROUGH;
 }
 case util::NumberFormat::PERCENT:
@@ -374,11 +371,8 @@ void 
XMLNumberFormatAttributesExportHelper::WriteAttributes(
 case util::NumberFormat::SCIENTIFIC:
 case util::NumberFormat::FRACTION:
 {
-if (!bWasSetTypeAttribute)
-{
-pExport->AddAttribute(sAttrValType, XML_FLOAT);
-bWasSetTypeAttribute = true;
-}
+pExport->AddAttribute(sAttrValType, XML_FLOAT);
+bWasSetTypeAttribute = true;
 SAL_FALLTHROUGH;
 }
 case util::NumberFormat::PERCENT:
commit c2b33fec70f0f4c79584db119ecd565af3a5b28e
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 17:22:42 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 20 19:53:27 2018 +0200

pvs-studio: 'memcpy' function will lead to underflow of the buffer

Change-Id: I285d5ddcc8906d1e38c6b58c625dc7c894ad433a
Reviewed-on: https://gerrit.libreoffice.org/62064
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 0a75d9a4e5a8..1801cf61929e 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2898,10 +2898,13 @@ void CMAccessible::ConvertAnyToVariant(const 
css::uno::Any , VARIANT *pv
 break;
 
 case TypeClass_BOOLEAN:
+{
+bool bBoolean(false);
+rAnyVal >>= bBoolean;
 pvData->vt = VT_BOOL;
-memcpy(>boolVal, rAnyVal.getValue(), sizeof(sal_Bool));
+pvData->boolVal = bBoolean; // boolVal is a VARIANT_BOOL, a 16bit 
field
 break;
-
+}
 case TypeClass_BYTE:
 pvData->vt = VT_UI1;
 memcpy(>bVal, rAnyVal.getValue(), sizeof(sal_Int8));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2014-08-13 Thread Tor Lillqvist
 winaccessibility/source/UAccCOM/AccTable.cxx |1 -
 winaccessibility/source/service/AccTopWindowListener.cxx |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 5ba86251c08ea9a9297afd2c1d8f57adaecc3d03
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Aug 13 16:00:27 2014 +0300

WaE: C4189: 'isTRUE' : local variable is initialized but not referenced

Change-Id: I84859c105c5f91ec66f075dd96be865ddeb71e33

diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx 
b/winaccessibility/source/UAccCOM/AccTable.cxx
index c945ad7..472b968 100644
--- a/winaccessibility/source/UAccCOM/AccTable.cxx
+++ b/winaccessibility/source/UAccCOM/AccTable.cxx
@@ -539,7 +539,6 @@ STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
 ReferenceXAccessible pRAcc = GetXInterface()-getAccessibleSummary();
 
 IAccessible* pRet = NULL;
-BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible(pRAcc.get(), 
pRet);
 
 if(pRet)
 {
commit 450f6a177b93c3417fbc73a99f1de3f5c28376d2
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Aug 13 15:56:33 2014 +0300

WaE: C4245: 'argument' : conversion from 'int' to 'unsigned short'

Change-Id: I2631ff653377b58dde5ae135571fd669cfbf9d30

diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx 
b/winaccessibility/source/service/AccTopWindowListener.cxx
index 4f4bf54..a3df23b 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -78,7 +78,7 @@ void AccTopWindowListener::HandleWindowOpened( 
com::sun::star::accessibility::XA
 AddAllListeners(pAccessible,NULL,(HWND)systemdata-hWnd);
 
 if( window-GetStyle()  WB_MOVEABLE )
-accManagerAgent.IncreaseState( pAccessible, -1 /* U_MOVEBLE */ );
+accManagerAgent.IncreaseState( pAccessible, (unsigned short) -1 /* 
U_MOVEBLE */ );
 
 short role = pAccessibleContext-getAccessibleRole();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits