[Libreoffice-commits] core.git: cui/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 8 15:07:51 UTC 2021


 cui/source/customize/SvxNotebookbarConfigPage.cxx |    3 +--
 cui/source/customize/SvxToolbarConfigPage.cxx     |    9 ++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit b32520f3e6b4ec4868d6e94d6fc20abb283c8308
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Jun 8 12:44:41 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Tue Jun 8 17:07:06 2021 +0200

    Simplify Sequences initializations (cui)
    
    Change-Id: Iaf6a27f3a8dd156e91751a2fe242e8388f8d6b6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116829
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index 978055e1a1bc..16d555a9a2e7 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -516,8 +516,7 @@ void SvxNotebookbarEntriesListBox::ChangedVisibility(int nRow)
     else
         sVisible = "False";
     OUString sSetEntries = sUIItemId + ",visible," + sVisible;
-    Sequence<OUString> sSeqOfEntries(1);
-    sSeqOfEntries[0] = sSetEntries;
+    Sequence<OUString> sSeqOfEntries{ sSetEntries };
     EditRegistryFile(sUIItemId, sSetEntries, sNotebookbarInterface);
     CustomNotebookbarGenerator::modifyCustomizedUIFile(sSeqOfEntries);
     OUString sUIPath = "modules/s" + m_pPage->GetAppName().toAsciiLowerCase() + "/ui/";
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index 57f78dcd6161..99a85d82f96e 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -508,8 +508,6 @@ IMPL_LINK(SvxToolbarConfigPage, ModifyItemHdl, const OString&, rIdent, void)
 
             if (newgraphic.is())
             {
-                css::uno::Sequence<css::uno::Reference<css::graphic::XGraphic>> aGraphicSeq(1);
-
                 css::uno::Sequence<OUString> aURLSeq{ pEntry->GetCommand() };
 
                 if (!pEntry->GetBackupGraphic().is())
@@ -524,7 +522,9 @@ IMPL_LINK(SvxToolbarConfigPage, ModifyItemHdl, const OString&, rIdent, void)
                     }
                 }
 
-                aGraphicSeq[0] = newgraphic;
+                css::uno::Sequence<css::uno::Reference<css::graphic::XGraphic>> aGraphicSeq{
+                    newgraphic
+                };
                 try
                 {
                     GetSaveInData()->GetImageManager()->replaceImages(
@@ -558,8 +558,7 @@ IMPL_LINK(SvxToolbarConfigPage, ModifyItemHdl, const OString&, rIdent, void)
 
         css::uno::Reference<css::graphic::XGraphic> backup = pEntry->GetBackupGraphic();
 
-        css::uno::Sequence<css::uno::Reference<css::graphic::XGraphic>> aGraphicSeq(1);
-        aGraphicSeq[0] = backup;
+        css::uno::Sequence<css::uno::Reference<css::graphic::XGraphic>> aGraphicSeq{ backup };
 
         css::uno::Sequence<OUString> aURLSeq{ pEntry->GetCommand() };
 


More information about the Libreoffice-commits mailing list