diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-08 09:06:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-11 15:37:05 +0100 |
commit | 3a42ee3284df7020ef111293a4d11148c1bf3a50 (patch) | |
tree | d12e7c85bb5e58c0ede3a500d56856e24a9ade0a /cui/source/customize/cfgutil.cxx | |
parent | 231c06c5c2320c0465df0cbeab4c754937a05a9b (diff) |
weld SvxConfigDialog
Change-Id: Ia6983fd658521cf8704ca1ed95ecff6590ddde09
Reviewed-on: https://gerrit.libreoffice.org/68906
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/customize/cfgutil.cxx')
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index f8de79671425..c7252ad9e498 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -249,23 +249,19 @@ std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const OUString& s OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent ) { - int nSelected = m_xTreeView->get_selected_index(); - if (nSelected != -1) + SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); + if (pData) { - SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64()); - if (pData) + if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT ) { - if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT ) - { - if (bConsiderParent) - return Application::GetHelp()->GetHelpText(pData->sCommand, m_xTreeView.get()); - else - return Application::GetHelp()->GetHelpText(pData->sCommand, static_cast<weld::Widget*>(nullptr)); - } - else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT ) - { - return pData->sHelpText; - } + if (bConsiderParent) + return Application::GetHelp()->GetHelpText(pData->sCommand, m_xTreeView.get()); + else + return Application::GetHelp()->GetHelpText(pData->sCommand, static_cast<weld::Widget*>(nullptr)); + } + else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT ) + { + return pData->sHelpText; } } return OUString(); @@ -273,22 +269,16 @@ OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent ) OUString CuiConfigFunctionListBox::GetCurCommand() { - int nSelected = m_xTreeView->get_selected_index(); - if (nSelected == -1) - return OUString(); - SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64()); - if (!pData) + SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); + if (pData) return OUString(); return pData->sCommand; } OUString CuiConfigFunctionListBox::GetCurLabel() { - int nSelected = m_xTreeView->get_selected_index(); - if (nSelected == -1) - return OUString(); - SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64()); - if (!pData) + SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); + if (pData) return OUString(); if (!pData->sLabel.isEmpty()) return pData->sLabel; @@ -341,13 +331,9 @@ void CuiConfigFunctionListBox::ClearAll() OUString CuiConfigFunctionListBox::GetSelectedScriptURI() { - int nSelected = m_xTreeView->get_selected_index(); - if (nSelected != -1) - { - SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(nSelected).toInt64()); - if (pData && pData->nKind == SfxCfgKind::FUNCTION_SCRIPT) - return *static_cast<OUString*>(pData->pObject); - } + SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); + if (pData && pData->nKind == SfxCfgKind::FUNCTION_SCRIPT) + return *static_cast<OUString*>(pData->pObject); return OUString(); } |