summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx7
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx7
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx8
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx4
-rw-r--r--sw/source/ui/index/cnttab.cxx9
-rw-r--r--sw/source/ui/misc/bookmark.cxx7
-rw-r--r--sw/source/ui/misc/glosbib.cxx4
7 files changed, 24 insertions, 22 deletions
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index f94db2ebaee0..c0953f830ff5 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -19,6 +19,7 @@
#include <memory>
#include <cmdid.h>
+#include <o3tl/safeint.hxx>
#include <swmodule.hxx>
#include <view.hxx>
#include <wrtsh.hxx>
@@ -49,8 +50,10 @@ SwCondCollPage::SwCondCollPage(weld::Container* pPage, weld::DialogController* p
const auto nHeightRequest = m_xStyleLB->get_height_rows(12);
m_xStyleLB->set_size_request(-1, nHeightRequest);
m_xTbLinks->set_size_request(-1, nHeightRequest);
- std::vector<int> aWidths;
- aWidths.push_back(m_xTbLinks->get_approximate_digit_width() * 40);
+ std::vector<int> aWidths
+ {
+ o3tl::narrowing<int>(m_xTbLinks->get_approximate_digit_width() * 40)
+ };
m_xTbLinks->set_column_fixed_widths(aWidths);
const sal_Int32 nStrCount = m_xFilterLB->get_count();
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index aac1602f3968..2b5933096ac8 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/frame/XStorable.hpp>
+#include <o3tl/safeint.hxx>
#include <swunohelper.hxx>
#include <unotools/pathoptions.hxx>
#include <tools/diagnose_ex.h>
@@ -147,8 +148,10 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
m_xListLB->set_size_request(m_xListLB->get_approximate_digit_width() * 52,
m_xListLB->get_height_rows(9));
- std::vector<int> aWidths;
- aWidths.push_back(m_xListLB->get_approximate_digit_width() * 26);
+ std::vector<int> aWidths
+ {
+ o3tl::narrowing<int>(m_xListLB->get_approximate_digit_width() * 26)
+ };
m_xListLB->set_column_fixed_widths(aWidths);
m_xListLB->make_sorted();
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 27026e86830f..e8c8e35bc3dc 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -232,9 +232,11 @@ SwSendMailDialog::SwSendMailDialog(weld::Window *pParent, SwMailMergeConfigItem&
m_xStop->connect_clicked(LINK( this, SwSendMailDialog, StopHdl_Impl));
m_xCancel->connect_clicked(LINK( this, SwSendMailDialog, CancelHdl_Impl));
- std::vector<int> aWidths;
- aWidths.push_back(m_xStatus->get_checkbox_column_width());
- aWidths.push_back(aSize.Width()/3 * 2);
+ std::vector<int> aWidths
+ {
+ o3tl::narrowing<int>(m_xStatus->get_checkbox_column_width()),
+ o3tl::narrowing<int>(aSize.Width()/3 * 2)
+ };
m_xStatus->set_column_fixed_widths(aWidths);
m_xPaused->set_visible(false);
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index e49624e48273..3622a074193e 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <o3tl/safeint.hxx>
#include <swtypes.hxx>
#include "selectdbtabledialog.hxx"
#include "dbtablepreviewdialog.hxx"
@@ -48,8 +49,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(weld::Window* pParent,
m_xTable->set_size_request(m_xTable->get_approximate_digit_width() * 60,
m_xTable->get_height_rows(6));
- std::vector<int> aWidths;
- aWidths.push_back(m_xTable->get_approximate_digit_width() * 30);
+ std::vector<int> aWidths{ o3tl::narrowing<int>(m_xTable->get_approximate_digit_width() * 30) };
m_xTable->set_column_fixed_widths(aWidths);
m_xPreviewPB->connect_clicked(LINK(this, SwSelectDBTableDialog, PreviewHdl));
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index e58de4007613..dad3312e3d5a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -502,8 +502,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent,
m_xHeaderTree->enable_toggle_buttons(weld::ColumnToggleType::Radio);
m_xHeaderTree->connect_toggled(LINK(this, SwAddStylesDlg_Impl, RadioToggleOnHdl));
- std::vector<int> aWidths;
- aWidths.push_back(m_xHeaderTree->get_approximate_digit_width() * 30);
+ std::vector<int> aWidths
+ {
+ o3tl::narrowing<int>(m_xHeaderTree->get_approximate_digit_width() * 30)
+ };
int nPadding = m_xHeaderTree->get_approximate_digit_width() * 2;
OUString sTitle(m_xHeaderTree->get_column_title(1));
for (sal_uInt16 i = 0; i <= MAXLEVEL; ++i)
@@ -579,8 +581,7 @@ IMPL_LINK(SwAddStylesDlg_Impl, TreeSizeAllocHdl, const Size&, rSize, void)
{
auto nWidth = rSize.Width() - Application::GetSettings().GetStyleSettings().GetScrollBarSize();
- std::vector<int> aWidths;
- aWidths.push_back(0);
+ std::vector<int> aWidths { 0 };
int nPadding = m_xHeaderTree->get_approximate_digit_width() * 2;
for (sal_uInt16 i = 0; i <= MAXLEVEL; ++i)
{
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 54538bd502ff..77ff0b3bbd49 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -388,12 +388,7 @@ BookmarkTable::BookmarkTable(std::unique_ptr<weld::TreeView> xControl)
: m_xControl(std::move(xControl))
{
m_xControl->set_size_request(450, 250);
- std::vector<int> aWidths;
- aWidths.push_back(40);
- aWidths.push_back(110);
- aWidths.push_back(150);
- aWidths.push_back(60);
- m_xControl->set_column_fixed_widths(aWidths);
+ m_xControl->set_column_fixed_widths({ 40, 110, 150, 160 });
m_xControl->set_selection_mode(SelectionMode::Multiple);
}
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index c32605370b06..036ca954e680 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -57,9 +57,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(weld::Window * pParent,
//just has to be something small, real size will be available space
m_xGroupTLB->set_size_request(nWidth, m_xGroupTLB->get_height_rows(10));
- std::vector<int> aWidths;
- aWidths.push_back(nWidth);
- m_xGroupTLB->set_column_fixed_widths(aWidths);
+ m_xGroupTLB->set_column_fixed_widths( { nWidth } );
m_xGroupTLB->connect_changed(LINK(this, SwGlossaryGroupDlg, SelectHdl));
m_xNewPB->connect_clicked(LINK(this, SwGlossaryGroupDlg, NewHdl));