[Libreoffice-commits] core.git: vcl/inc vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 21 17:25:16 UTC 2021


 vcl/inc/toolbox.h              |    3 ++-
 vcl/source/window/toolbox2.cxx |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 19654ca9de6ff221337e8ec82307611c311c4e57
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 21 13:36:49 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 21 19:24:38 2021 +0200

    flatten ImplToolBoxPrivateData
    
    Change-Id: Ia3c0d6624ccf2d3c6189064ab7c8b07dc0734c5b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119330
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/inc/toolbox.h b/vcl/inc/toolbox.h
index 8e00f48f4772..e5b1fe8b647a 100644
--- a/vcl/inc/toolbox.h
+++ b/vcl/inc/toolbox.h
@@ -23,6 +23,7 @@
 #include <vcl/toolbox.hxx>
 #include <vcl/toolkit/controllayout.hxx>
 
+#include <optional>
 #include <vector>
 
 #define TB_DROPDOWNARROWWIDTH   11
@@ -112,7 +113,7 @@ struct ToolBoxLayoutData : public ControlLayoutData
 
 struct ImplToolBoxPrivateData
 {
-    std::unique_ptr<vcl::ToolBoxLayoutData> m_pLayoutData;
+    std::optional<vcl::ToolBoxLayoutData> m_pLayoutData;
     ToolBox::ImplToolItems          m_aItems;
 
     ImplToolBoxPrivateData();
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index c7c1934270d5..52af143f293d 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1391,7 +1391,7 @@ void ToolBox::ImplUpdateInputEnable()
 
 void ToolBox::ImplFillLayoutData()
 {
-    mpData->m_pLayoutData.reset(new ToolBoxLayoutData);
+    mpData->m_pLayoutData.emplace();
 
     ImplToolItems::size_type nCount = mpData->m_aItems.size();
     for( ImplToolItems::size_type i = 0; i < nCount; i++ )


More information about the Libreoffice-commits mailing list