diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-02-15 09:41:55 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-02-16 09:10:01 +0100 |
commit | 9572354fedf3d521c8fe123c402ccab20b824815 (patch) | |
tree | 508f22c16dac1731b99145629ed75520e95ff46b | |
parent | 9b3b747e164c4eab056f65bb29baa04ab1770bb2 (diff) |
a11y: Drop extra nesting level
These checks can all be done in a single if condition
rather than having two nested ones.
(Use `git show -w` to ignore whitespace change.)
Change-Id: Icbaaf45914f4dead9fc27d6e5e69d4cd03ee7393
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163426
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | accessibility/source/standard/vclxaccessiblebox.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index cbc68fb2d19a..84855ca096cf 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -70,26 +70,25 @@ void VCLXAccessibleBox::ProcessWindowChildEvent( const VclWindowEvent& rVclWindo if (m_aBoxType==COMBOBOX) { VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); - if ( ( pComboBox != nullptr ) && ( pChildWindow != nullptr ) ) - if (pChildWindow == pComboBox->GetSubEdit()) + if (pComboBox && pChildWindow && pChildWindow == pComboBox->GetSubEdit()) + { + if (rVclWindowEvent.GetId() == VclEventId::WindowShow) + { + // Instantiate text field. + getAccessibleChild (0); + aNewValue <<= m_xText; + } + else { - if (rVclWindowEvent.GetId() == VclEventId::WindowShow) - { - // Instantiate text field. - getAccessibleChild (0); - aNewValue <<= m_xText; - } - else - { - // Release text field. - aOldValue <<= m_xText; - m_xText = nullptr; - } - // Tell the listeners about the new/removed child. - NotifyAccessibleEvent ( - AccessibleEventId::CHILD, - aOldValue, aNewValue); + // Release text field. + aOldValue <<= m_xText; + m_xText = nullptr; } + // Tell the listeners about the new/removed child. + NotifyAccessibleEvent ( + AccessibleEventId::CHILD, + aOldValue, aNewValue); + } } } |