diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-16 13:43:31 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-10-16 19:02:18 +0200 |
commit | 62078c534f96e859d4e8c0ead6337a876344e4ab (patch) | |
tree | 96716a3f6cc9da439a6df9b2e19bc9ea250e6f72 /sfx2 | |
parent | 8ec8bbcd4b1af73527859255d84af9f5990426bb (diff) |
Simplify vector initialization in sfx2
Change-Id: Ibff7203a86b42c58738d8b4836a61bf1c5806962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123698
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/listview.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/autoredactdialog.cxx | 7 |
3 files changed, 9 insertions, 16 deletions
diff --git a/sfx2/source/control/listview.cxx b/sfx2/source/control/listview.cxx index 5b53ee5b67f9..0aa1781c8f13 100644 --- a/sfx2/source/control/listview.cxx +++ b/sfx2/source/control/listview.cxx @@ -49,12 +49,13 @@ ListView::ListView(std::unique_ptr<weld::TreeView> xTreeView) , mnSortColumn(-2) { auto nDigitWidth = mxTreeView->get_approximate_digit_width(); - std::vector<int> aWidths; - aWidths.push_back(static_cast<int>(nDigitWidth * 5)); /* Icon Column */ - aWidths.push_back(static_cast<int>(nDigitWidth * 24)); /* Name Column */ - aWidths.push_back(static_cast<int>(nDigitWidth * 22)); /* Category Column */ - aWidths.push_back(static_cast<int>(nDigitWidth * 15)); /* Application Column */ - aWidths.push_back(static_cast<int>(nDigitWidth * 18)); /* Modify Column */ + std::vector<int> aWidths{ + static_cast<int>(nDigitWidth * 5), /* Icon Column */ + static_cast<int>(nDigitWidth * 24), /* Name Column */ + static_cast<int>(nDigitWidth * 22), /* Category Column */ + static_cast<int>(nDigitWidth * 15), /* Application Column */ + static_cast<int>(nDigitWidth * 18) /* Modify Column */ + }; mxTreeView->set_column_fixed_widths(aWidths); mxTreeView->set_selection_mode(SelectionMode::Multiple); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 1c11e5fd422f..6de0d866c30b 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -140,10 +140,7 @@ namespace } } - std::vector<int> aWidths; - aWidths.push_back(nMax); - aWidths.push_back(nMaxAuthorWidth); - rVersionBox.set_column_fixed_widths(aWidths); + rVersionBox.set_column_fixed_widths({ nMax, nMaxAuthorWidth }); } } diff --git a/sfx2/source/doc/autoredactdialog.cxx b/sfx2/source/doc/autoredactdialog.cxx index 2e47a702d2f9..a951217fe665 100644 --- a/sfx2/source/doc/autoredactdialog.cxx +++ b/sfx2/source/doc/autoredactdialog.cxx @@ -43,12 +43,7 @@ TargetsTable::TargetsTable(std::unique_ptr<weld::TreeView> xControl) : m_xControl(std::move(xControl)) { m_xControl->set_size_request(555, 250); - std::vector<int> aWidths; - aWidths.push_back(100); - aWidths.push_back(50); - aWidths.push_back(200); - aWidths.push_back(105); - aWidths.push_back(105); + std::vector<int> aWidths{ 100, 50, 200, 105, 105 }; m_xControl->set_column_fixed_widths(aWidths); m_xControl->set_selection_mode(SelectionMode::Multiple); } |