diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 00:04:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 01:41:02 +0200 |
commit | ce47b1a9c68a27fc37594148f6be2661f27120ea (patch) | |
tree | 4c9b5c3da29b76c7c8eb23cdbf85c496b0efd87e /vcl/source/window/NotebookBarAddonsMerger.cxx | |
parent | 6fc2a300ad8b1c6936b513eff94fd527ea74b469 (diff) |
loplugin:flatten in vcl/window
Change-Id: I94e69e988f038e85b1fb78985211d478bb5ed9b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100033
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/NotebookBarAddonsMerger.cxx')
-rw-r--r-- | vcl/source/window/NotebookBarAddonsMerger.cxx | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/vcl/source/window/NotebookBarAddonsMerger.cxx b/vcl/source/window/NotebookBarAddonsMerger.cxx index 1c042017a3fc..c8c3c4bd2288 100644 --- a/vcl/source/window/NotebookBarAddonsMerger.cxx +++ b/vcl/source/window/NotebookBarAddonsMerger.cxx @@ -72,39 +72,38 @@ static void CreateNotebookBarToolBox(vcl::Window* pNotebookbarToolBox, { sal_uInt16 nItemId = 0; ToolBox* pToolbox = dynamic_cast<ToolBox*>(pNotebookbarToolBox); - if (pToolbox) + if (!pToolbox) + return; + + pToolbox->InsertSeparator(); + pToolbox->Show(); + Size aSize(0, 0); + Image sImage; + pToolbox->InsertItem(aAddonNotebookBarItem.sCommandURL, m_xFrame, ToolBoxItemBits::NONE, aSize); + nItemId = pToolbox->GetItemId(aAddonNotebookBarItem.sCommandURL); + pToolbox->SetItemCommand(nItemId, aAddonNotebookBarItem.sCommandURL); + pToolbox->SetQuickHelpText(nItemId, aAddonNotebookBarItem.sLabel); + + if (nIter < aImageVec.size()) { - pToolbox->InsertSeparator(); - pToolbox->Show(); - Size aSize(0, 0); - Image sImage; - pToolbox->InsertItem(aAddonNotebookBarItem.sCommandURL, m_xFrame, ToolBoxItemBits::NONE, - aSize); - nItemId = pToolbox->GetItemId(aAddonNotebookBarItem.sCommandURL); - pToolbox->SetItemCommand(nItemId, aAddonNotebookBarItem.sCommandURL); - pToolbox->SetQuickHelpText(nItemId, aAddonNotebookBarItem.sLabel); - - if (nIter < aImageVec.size()) + sImage = aImageVec[nIter]; + if (!sImage) { - sImage = aImageVec[nIter]; - if (!sImage) - { - sImage = vcl::CommandInfoProvider::GetImageForCommand( - aAddonNotebookBarItem.sImageIdentifier, m_xFrame); - } + sImage = vcl::CommandInfoProvider::GetImageForCommand( + aAddonNotebookBarItem.sImageIdentifier, m_xFrame); } + } - if (aAddonNotebookBarItem.sStyle == STYLE_TEXT) - pToolbox->SetItemText(nItemId, aAddonNotebookBarItem.sLabel); - else if (aAddonNotebookBarItem.sStyle == STYLE_ICON) - pToolbox->SetItemImage(nItemId, sImage); - else - { - pToolbox->SetItemText(nItemId, aAddonNotebookBarItem.sLabel); - pToolbox->SetItemImage(nItemId, sImage); - } - pToolbox->Show(); + if (aAddonNotebookBarItem.sStyle == STYLE_TEXT) + pToolbox->SetItemText(nItemId, aAddonNotebookBarItem.sLabel); + else if (aAddonNotebookBarItem.sStyle == STYLE_ICON) + pToolbox->SetItemImage(nItemId, sImage); + else + { + pToolbox->SetItemText(nItemId, aAddonNotebookBarItem.sLabel); + pToolbox->SetItemImage(nItemId, sImage); } + pToolbox->Show(); } NotebookBarAddonsMerger::NotebookBarAddonsMerger() {} |