From 6b32bda33bee7b56d43f34adb23bcd60d8a1b1b9 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 5 Jan 2022 12:05:50 +0000 Subject: wina11y: Use separate local variable for action description Use a separate local variable for the accessible *action* description here, which is independent of the accessible description handled above. While at it, use '!OUString::isEmpty' instead of 'OUString::getLength() > 0'. Change-Id: I146d8603ed3decde68f8ce716ac13c04b0263040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128004 Tested-by: Jenkins Reviewed-by: Michael Weghorn Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128251 --- winaccessibility/source/service/AccObject.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx index 9b6609666ee6..b69507486e25 100644 --- a/winaccessibility/source/service/AccObject.cxx +++ b/winaccessibility/source/service/AccObject.cxx @@ -771,10 +771,10 @@ void AccObject::UpdateActionDesc() if (!(Role == SPIN_BOX || Role == COMBO_BOX || Role == DATE_EDITOR || Role == EDIT_BAR || Role == PASSWORD_TEXT || Role == TEXT)) { - pXString = m_xAccActionRef->getAccessibleActionDescription( 0 ); - //Solution: if string length is more than zero, action is set. - if( pXString.getLength() > 0) - m_pIMAcc->Put_ActionDescription( o3tl::toW(pXString.getStr()) ); + const OUString sActionDesc = m_xAccActionRef->getAccessibleActionDescription(0); + // if string is non-empty, action is set. + if (!sActionDesc.isEmpty()) + m_pIMAcc->Put_ActionDescription(o3tl::toW(sActionDesc.getStr())); } } } -- cgit