summaryrefslogtreecommitdiff
path: root/vcl/source/window/NotebookBarAddonsMerger.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-21 09:13:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-21 12:52:36 +0200
commit09c757cbdd3f973c97151203d8ff522141102da7 (patch)
treed1424cd2d3698965f847dc161c282ce1d00f9a94 /vcl/source/window/NotebookBarAddonsMerger.cxx
parent22a4b7e621cbb6cab1d82d57c370e3cf33b4e74e (diff)
use for-range on Sequence in testtools..xmloff
Change-Id: I05b02a2f8b4b9091c7de0f7e98409d5b608ed250 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94610 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.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/vcl/source/window/NotebookBarAddonsMerger.cxx b/vcl/source/window/NotebookBarAddonsMerger.cxx
index 689f26dbaf6d..9d6bf3dd98ea 100644
--- a/vcl/source/window/NotebookBarAddonsMerger.cxx
+++ b/vcl/source/window/NotebookBarAddonsMerger.cxx
@@ -43,24 +43,24 @@ static const char MERGE_NOTEBOOKBAR_STYLE[] = "Style";
static void GetAddonNotebookBarItem(const css::uno::Sequence<css::beans::PropertyValue>& pExtension,
AddonNotebookBarItem& aAddonNotebookBarItem)
{
- for (int nIdx = 0; nIdx < pExtension.getLength(); nIdx++)
+ for (const auto& i : pExtension)
{
- if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_URL)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sCommandURL;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_TITLE)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sLabel;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_IMAGEID)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sImageIdentifier;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_CONTEXT)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sContext;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_TARGET)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sTarget;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_CONTROLTYPE)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sControlType;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_WIDTH)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.nWidth;
- else if (pExtension[nIdx].Name == MERGE_NOTEBOOKBAR_STYLE)
- pExtension[nIdx].Value >>= aAddonNotebookBarItem.sStyle;
+ if (i.Name == MERGE_NOTEBOOKBAR_URL)
+ i.Value >>= aAddonNotebookBarItem.sCommandURL;
+ else if (i.Name == MERGE_NOTEBOOKBAR_TITLE)
+ i.Value >>= aAddonNotebookBarItem.sLabel;
+ else if (i.Name == MERGE_NOTEBOOKBAR_IMAGEID)
+ i.Value >>= aAddonNotebookBarItem.sImageIdentifier;
+ else if (i.Name == MERGE_NOTEBOOKBAR_CONTEXT)
+ i.Value >>= aAddonNotebookBarItem.sContext;
+ else if (i.Name == MERGE_NOTEBOOKBAR_TARGET)
+ i.Value >>= aAddonNotebookBarItem.sTarget;
+ else if (i.Name == MERGE_NOTEBOOKBAR_CONTROLTYPE)
+ i.Value >>= aAddonNotebookBarItem.sControlType;
+ else if (i.Name == MERGE_NOTEBOOKBAR_WIDTH)
+ i.Value >>= aAddonNotebookBarItem.nWidth;
+ else if (i.Name == MERGE_NOTEBOOKBAR_STYLE)
+ i.Value >>= aAddonNotebookBarItem.sStyle;
}
}
@@ -124,7 +124,8 @@ void NotebookBarAddonsMerger::MergeNotebookBarAddons(
{
aExtension = aNotebookBarAddonsItem.aAddonValues[nIdx];
- for (int nSecIdx = 0; nSecIdx < aExtension.getLength(); nSecIdx++)
+ for (const css::uno::Sequence<css::beans::PropertyValue>& pExtension :
+ std::as_const(aExtension))
{
VclPtr<vcl::Window> pOptionalParent;
pOptionalParent = VclPtr<OptionalBox>::Create(pParent);
@@ -139,7 +140,6 @@ void NotebookBarAddonsMerger::MergeNotebookBarAddons(
pFunction(pNotebookbarToolBox, pOptionalParent, rMap);
AddonNotebookBarItem aAddonNotebookBarItem;
- const css::uno::Sequence<css::beans::PropertyValue> pExtension = aExtension[nSecIdx];
GetAddonNotebookBarItem(pExtension, aAddonNotebookBarItem);
CreateNotebookBarToolBox(pNotebookbarToolBox, m_xFrame, aAddonNotebookBarItem,