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

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 4 17:48:15 UTC 2020


 include/vcl/builder.hxx                |    6 +++---
 svtools/source/control/toolbarmenu.cxx |    2 +-
 vcl/source/app/salvtables.cxx          |   12 ++++++------
 vcl/source/window/builder.cxx          |   20 ++++++++++----------
 4 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 7520e2b2126c05aadb738256313d2f250b9ded62
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Mar 4 13:15:51 2020 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Mar 4 18:47:36 2020 +0100

    We have had C++11 for some time now
    
    Change-Id: I3946aba66a49518fb6c3fe6e1767babecddc956b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89962
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 3e22639569b8..d9bf965b043d 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -82,7 +82,7 @@ public:
     template <typename T> T* get(VclPtr<T>& ret, const OString& sID);
 
     //sID may not exist, but must be of type T if it does
-    template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString& sID);
+    template <typename T = vcl::Window> T* get(const OString& sID);
 
     vcl::Window*    get_widget_root();
 
@@ -435,7 +435,7 @@ inline T* VclBuilder::get(VclPtr<T>& ret, const OString& sID)
 }
 
 //sID may not exist, but must be of type T if it does
-template <typename T /*= vcl::Window if we had c++11*/>
+template <typename T>
 inline T* VclBuilder::get(const OString& sID)
 {
     vcl::Window *w = get_by_name(sID);
@@ -474,7 +474,7 @@ public:
     {
         return m_pUIBuilder->get<T>(ret, sID);
     }
-    template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString & sID)
+    template <typename T = vcl::Window> T* get(const OString & sID)
     {
         return m_pUIBuilder->get<T>(sID);
     }
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index d82ddc5f18ad..b72546e39a08 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -230,7 +230,7 @@ IMPL_LINK_NOARG(ToolbarPopupContainer, FocusHdl, weld::Widget&, void)
 InterimToolbarPopup::InterimToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame, vcl::Window* pParent,
                                          std::unique_ptr<WeldToolbarPopup> xPopup)
     : ToolbarPopup(rFrame, pParent, "InterimDockParent", "svx/ui/interimdockparent.ui")
-    , m_xBox(get<vcl::Window>("box"))
+    , m_xBox(get("box"))
     , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), "svx/ui/interimparent.ui"))
     , m_xContainer(m_xBuilder->weld_container("container"))
     , m_xPopup(std::move(xPopup))
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 55a7d221968b..fb688c2570fe 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6197,21 +6197,21 @@ std::unique_ptr<weld::Window> SalInstanceBuilder::weld_window(const OString& id,
 std::unique_ptr<weld::Widget> SalInstanceBuilder::weld_widget(const OString& id,
                                                               bool bTakeOwnership)
 {
-    vcl::Window* pWidget = m_xBuilder->get<vcl::Window>(id);
+    vcl::Window* pWidget = m_xBuilder->get(id);
     return pWidget ? std::make_unique<SalInstanceWidget>(pWidget, this, bTakeOwnership) : nullptr;
 }
 
 std::unique_ptr<weld::Container> SalInstanceBuilder::weld_container(const OString& id,
                                                                     bool bTakeOwnership)
 {
-    vcl::Window* pContainer = m_xBuilder->get<vcl::Window>(id);
+    vcl::Window* pContainer = m_xBuilder->get(id);
     return pContainer ? std::make_unique<SalInstanceContainer>(pContainer, this, bTakeOwnership)
                       : nullptr;
 }
 
 std::unique_ptr<weld::Box> SalInstanceBuilder::weld_box(const OString& id, bool bTakeOwnership)
 {
-    vcl::Window* pContainer = m_xBuilder->get<vcl::Window>(id);
+    vcl::Window* pContainer = m_xBuilder->get(id);
     return pContainer ? std::make_unique<SalInstanceBox>(pContainer, this, bTakeOwnership)
                       : nullptr;
 }
@@ -6241,7 +6241,7 @@ std::unique_ptr<weld::ScrolledWindow> SalInstanceBuilder::weld_scrolled_window(c
 std::unique_ptr<weld::Notebook> SalInstanceBuilder::weld_notebook(const OString& id,
                                                                   bool bTakeOwnership)
 {
-    vcl::Window* pNotebook = m_xBuilder->get<vcl::Window>(id);
+    vcl::Window* pNotebook = m_xBuilder->get(id);
     if (!pNotebook)
         return nullptr;
     if (pNotebook->GetType() == WindowType::TABCONTROL)
@@ -6388,7 +6388,7 @@ SalInstanceBuilder::weld_time_spin_button(const OString& id, TimeFieldFormat eFo
 std::unique_ptr<weld::ComboBox> SalInstanceBuilder::weld_combo_box(const OString& id,
                                                                    bool bTakeOwnership)
 {
-    vcl::Window* pWidget = m_xBuilder->get<vcl::Window>(id);
+    vcl::Window* pWidget = m_xBuilder->get(id);
     ::ComboBox* pComboBox = dynamic_cast<::ComboBox*>(pWidget);
     if (pComboBox)
         return std::make_unique<SalInstanceComboBoxWithEdit>(pComboBox, this, bTakeOwnership);
@@ -6402,7 +6402,7 @@ std::unique_ptr<weld::EntryTreeView>
 SalInstanceBuilder::weld_entry_tree_view(const OString& containerid, const OString& entryid,
                                          const OString& treeviewid, bool bTakeOwnership)
 {
-    vcl::Window* pContainer = m_xBuilder->get<vcl::Window>(containerid);
+    vcl::Window* pContainer = m_xBuilder->get(containerid);
     return pContainer ? std::make_unique<SalInstanceEntryTreeView>(
                             pContainer, this, bTakeOwnership, weld_entry(entryid, bTakeOwnership),
                             weld_tree_view(treeviewid, bTakeOwnership))
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 4abd075b5d58..c32e59ab2b37 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -468,7 +468,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
     for (auto const& mnemonicWidget : m_pParserState->m_aMnemonicWidgetMaps)
     {
         FixedText *pOne = get<FixedText>(mnemonicWidget.m_sID);
-        vcl::Window *pOther = get<vcl::Window>(mnemonicWidget.m_sValue.toUtf8());
+        vcl::Window *pOther = get(mnemonicWidget.m_sValue.toUtf8());
         SAL_WARN_IF(!pOne || !pOther, "vcl", "missing either source " << mnemonicWidget.m_sID
             << " or target " << mnemonicWidget.m_sValue << " member of Mnemonic Widget Mapping");
         if (pOne && pOther)
@@ -493,7 +493,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
             }
             else
             {
-                vcl::Window *pTarget = get<vcl::Window>(rParam.toUtf8());
+                vcl::Window *pTarget = get(rParam.toUtf8());
                 SAL_WARN_IF(!pTarget, "vcl", "missing parameter of a11y relation: " << rParam);
                 if (!pTarget)
                     continue;
@@ -532,7 +532,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
     //Set ComboBox models when everything has been imported
     for (auto const& elem : m_pParserState->m_aModelMaps)
     {
-        vcl::Window* pTarget = get<vcl::Window>(elem.m_sID);
+        vcl::Window* pTarget = get(elem.m_sID);
         ListBox *pListBoxTarget = dynamic_cast<ListBox*>(pTarget);
         ComboBox *pComboBoxTarget = dynamic_cast<ComboBox*>(pTarget);
         SvTabListBox *pTreeBoxTarget = dynamic_cast<SvTabListBox*>(pTarget);
@@ -560,7 +560,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
     //Set SpinButton adjustments when everything has been imported
     for (auto const& elem : m_pParserState->m_aNumericFormatterAdjustmentMaps)
     {
-        NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get<vcl::Window>(elem.m_sID));
+        NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get(elem.m_sID));
         const Adjustment *pAdjustment = get_adjustment_by_name(elem.m_sValue.toUtf8());
         SAL_WARN_IF(!pTarget, "vcl", "missing NumericFormatter element of spinbutton/adjustment");
         SAL_WARN_IF(!pAdjustment, "vcl", "missing Adjustment element of spinbutton/adjustment");
@@ -570,7 +570,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
 
     for (auto const& elem : m_pParserState->m_aFormattedFormatterAdjustmentMaps)
     {
-        FormattedField *pTarget = dynamic_cast<FormattedField*>(get<vcl::Window>(elem.m_sID));
+        FormattedField *pTarget = dynamic_cast<FormattedField*>(get(elem.m_sID));
         const Adjustment *pAdjustment = get_adjustment_by_name(elem.m_sValue.toUtf8());
         SAL_WARN_IF(!pTarget, "vcl", "missing FormattedField element of spinbutton/adjustment");
         SAL_WARN_IF(!pAdjustment, "vcl", "missing Adjustment element of spinbutton/adjustment");
@@ -580,7 +580,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
 
     for (auto const& elem : m_pParserState->m_aTimeFormatterAdjustmentMaps)
     {
-        TimeField *pTarget = dynamic_cast<TimeField*>(get<vcl::Window>(elem.m_sID));
+        TimeField *pTarget = dynamic_cast<TimeField*>(get(elem.m_sID));
         const Adjustment *pAdjustment = get_adjustment_by_name(elem.m_sValue.toUtf8());
         SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment");
         if (pTarget && pAdjustment)
@@ -589,7 +589,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
 
     for (auto const& elem : m_pParserState->m_aDateFormatterAdjustmentMaps)
     {
-        DateField *pTarget = dynamic_cast<DateField*>(get<vcl::Window>(elem.m_sID));
+        DateField *pTarget = dynamic_cast<DateField*>(get(elem.m_sID));
         const Adjustment *pAdjustment = get_adjustment_by_name(elem.m_sValue.toUtf8());
         SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment");
         if (pTarget && pAdjustment)
@@ -609,7 +609,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
     //Set Scale(Slider) adjustments
     for (auto const& elem : m_pParserState->m_aSliderAdjustmentMaps)
     {
-        Slider* pTarget = dynamic_cast<Slider*>(get<vcl::Window>(elem.m_sID));
+        Slider* pTarget = dynamic_cast<Slider*>(get(elem.m_sID));
         const Adjustment* pAdjustment = get_adjustment_by_name(elem.m_sValue.toUtf8());
         SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of scale(slider)/adjustment");
         if (pTarget && pAdjustment)
@@ -632,7 +632,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
 
         for (auto const& elem : sizeGroup.m_aWidgets)
         {
-            vcl::Window* pWindow = get<vcl::Window>(elem.getStr());
+            vcl::Window* pWindow = get(elem.getStr());
             pWindow->add_to_size_group(xGroup);
         }
     }
@@ -827,7 +827,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
         officecfg::Office::Common::Help::HelpRootURL::get().isEmpty();
     if (bHideHelp)
     {
-        if (vcl::Window *pHelpButton = get<vcl::Window>("help"))
+        if (vcl::Window *pHelpButton = get("help"))
             pHelpButton->Hide();
     }
 }


More information about the Libreoffice-commits mailing list