[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source sw/uiconfig

2021-09-17 Thread Balazs Varga (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx|   56 +--
 sw/source/ui/inc/mmresultdialogs.hxx |2 
 sw/uiconfig/swriter/ui/mmresultsavedialog.ui |3 -
 3 files changed, 39 insertions(+), 22 deletions(-)

New commits:
commit d8e5a8c7c3ff747023e7b4b501b7eaef86c40592
Author: Balazs Varga 
AuthorDate: Fri Sep 10 08:46:23 2021 +0200
Commit: László Németh 
CommitDate: Fri Sep 17 09:50:54 2021 +0200

tdf#144427 tdf#144483 sw mailmerge: fix merge all document

Not all records were merged if we selected the “From 'X' To 'Y' of the
“Save Merged Documents” or “Print Merged Documents” or "Send to Email"
dialog windows and write some value into them and then we switched back
on to Save/Print/Send All record (opened via the Mail merge toolbar).

Regression from commit: ec44f87d5b99a3299322d0b79abc4c6808877865
(tdf#117212 sw mailmerge: merge only the selected range)

(cherry picked from commit f3993912ec4b526aa57cb4bfb4745d7298a4da82)

tdf#144483 sw mail merge: save ranges in a single document

In the Save mail merged document dialog, it wasn't possible
to save mail ranges in a single document, because of the bad
UI of the dialog window: grouping range selector as a radio
button with the single document/individual documents radio
buttons. Moreover, commit f3993912ec4b526aa57cb4bfb4745d7298a4da82
"tdf#144427 sw mailmerge: fix merge all document" removed
the hidden workaround: setting range at the third radio button,
and selecting the first radio button. Using checkbox for the
third option solved the problem as proposed.

(cherry picked from commit 45c4caff685b15a0f1b87ef05436a7e6aca96851)

Fix broken ui file

...after 45c4caff685b15a0f1b87ef05436a7e6aca96851 "tdf#144483 sw mail merge:
save ranges in a single document", causing CppunitTest_sw_dialogs_test to 
fail
with

> warn:vcl.gtk:2759211:2759211:vcl/unx/gtk3/gtkinst.cxx:21611: 
GtkInstanceBuilder: error when calling gtk_builder_add_from_file: 
~/lo/core/instdir/share/config/soffice.cfg/modules/swriter/ui/mmresultsavedialog.ui:165:49
 Invalid property: GtkCheckButton.group

(cherry picked from commit 7b37af5af6afe75ad952538c145a4f4e61de9a96)

Change-Id: I01fc664fe76f74cefe4faa81b324088ec37b9881
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121982
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index 6e081c68a9a1..fe39b8ed90d9 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -251,7 +251,7 @@ SwMMResultSaveDialog::SwMMResultSaveDialog(weld::Window* 
pParent)
 , m_bCancelSaving(false)
 , m_xSaveAsOneRB(m_xBuilder->weld_radio_button("singlerb"))
 , m_xSaveIndividualRB(m_xBuilder->weld_radio_button("individualrb"))
-, m_xFromRB(m_xBuilder->weld_radio_button("fromrb"))
+, m_xFromRB(m_xBuilder->weld_check_button("fromrb"))
 , m_xFromNF(m_xBuilder->weld_spin_button("from"))
 , m_xToFT(m_xBuilder->weld_label("toft"))
 , m_xToNF(m_xBuilder->weld_spin_button("to"))
@@ -552,11 +552,17 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, 
weld::Button&, void)
 std::shared_ptr xConfigItem = 
pView->GetMailMergeConfigItem();
 assert(xConfigItem);
 
-sal_uInt32 nBegin = static_cast(m_xFromNF->get_value() - 1);
-sal_uInt32 nEnd = static_cast(m_xToNF->get_value());
-sal_uInt32 nMax = static_cast(m_xToNF->get_max());
-if (nEnd > nMax)
-nEnd = nMax;
+const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
+sal_uInt32 nBegin = 0;
+sal_uInt32 nEnd = nDocumentCount;
+
+if (m_xFromRB->get_active())
+{
+nBegin = static_cast(m_xFromNF->get_value() - 1);
+nEnd = static_cast(m_xToNF->get_value());
+if (nEnd > nDocumentCount)
+nEnd = nDocumentCount;
+}
 
 xConfigItem->SetBeginEnd(nBegin, nEnd);
 
@@ -773,11 +779,17 @@ IMPL_LINK_NOARG(SwMMResultPrintDialog, PrintHdl_Impl, 
weld::Button&, void)
 std::shared_ptr xConfigItem = 
pView->GetMailMergeConfigItem();
 assert(xConfigItem);
 
-sal_uInt32 nBegin = static_cast(m_xFromNF->get_value() - 1);
-sal_uInt32 nEnd = static_cast(m_xToNF->get_value());
-sal_uInt32 nMax = static_cast(m_xToNF->get_max());
-if (nEnd > nMax)
-nEnd = nMax;
+const sal_uInt32 nDocumentCount = xConfigItem->GetMergedDocumentCount();
+sal_uInt32 nBegin = 0;
+sal_uInt32 nEnd = nDocumentCount;
+
+if (m_xFromRB->get_active())
+{
+nBegin = static_cast(m_xFromNF->get_value() - 1);
+nEnd = static_cast(m_xToNF->get_value());
+if (nEnd > nDocumentCount)
+nEnd = nDocumentCount;
+}
 
 xConfigItem->SetBeginEnd(nBegin, nEnd);
 
@@ -791,8 +803,8 @@ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source sw/uiconfig

2021-08-06 Thread Caolán McNamara (via logerrit)
 sw/source/ui/index/cnttab.cxx|5 +++--
 sw/uiconfig/swriter/ui/assignstylesdialog.ui |1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9cf27e924aaea4d45c059edec07be1429cbb16d4
Author: Caolán McNamara 
AuthorDate: Thu Aug 5 11:18:45 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Aug 7 01:34:35 2021 +0200

Resolves: tdf#143720 treeview not resizing to fill available space

Change-Id: I041c3a743b8624f49bfe57e8a4469535e334e5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119987
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 30c9407064d3..c23a3b7adc9d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -513,7 +513,8 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* 
pParent,
 aWidths.push_back(m_xHeaderTree->get_pixel_size(sTitle).Width() + 
nPadding);
 }
 m_xHeaderTree->set_column_fixed_widths(aWidths);
-auto nWidth = std::accumulate(aWidths.begin(), aWidths.end(), 0);
+auto nWidth = std::accumulate(aWidths.begin(), aWidths.end(),
+  
Application::GetSettings().GetStyleSettings().GetScrollBarSize());
 m_xHeaderTree->set_size_request(nWidth, 
m_xHeaderTree->get_height_rows(15));
 
 int nRow(0);
@@ -576,7 +577,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* 
pParent,
 
 IMPL_LINK(SwAddStylesDlg_Impl, TreeSizeAllocHdl, const Size&, rSize, void)
 {
-auto nWidth = rSize.Width();
+auto nWidth = rSize.Width() - 
Application::GetSettings().GetStyleSettings().GetScrollBarSize();
 
 std::vector aWidths;
 aWidths.push_back(0);
diff --git a/sw/uiconfig/swriter/ui/assignstylesdialog.ui 
b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
index 81f8444b56da..83d150e5bd09 100644
--- a/sw/uiconfig/swriter/ui/assignstylesdialog.ui
+++ b/sw/uiconfig/swriter/ui/assignstylesdialog.ui
@@ -180,6 +180,7 @@
 True
 False
 start
+True
 12