[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source sw/uiconfig

2021-04-21 Thread Gülşah Köse (via logerrit)
 sw/source/ui/dbui/mmdocselectpage.cxx  |   30 ++--
 sw/source/ui/dbui/mmdocselectpage.hxx  |2 +
 sw/uiconfig/swriter/ui/mmselectpage.ui |   35 -
 3 files changed, 56 insertions(+), 11 deletions(-)

New commits:
commit efc99a06894ab7cd8a16fced93aaafc5fdb5133f
Author: Gülşah Köse 
AuthorDate: Tue Apr 13 08:48:32 2021 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Apr 21 08:40:09 2021 +0200

tdf#139906  Add an option to change data source from mail merge wizard 
dialog.

Change-Id: I52dfd9be82813a1b01c725eab97a7534ae9a05d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114079
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114373
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx 
b/sw/source/ui/dbui/mmdocselectpage.cxx
index 58151d969acf..7d99f8274976 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -30,9 +30,8 @@
 #include 
 #include 
 #include 
-
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -54,6 +53,7 @@ 
SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
 , m_xBrowseTemplatePB(m_xBuilder->weld_button("browsetemplate"))
 , m_xRecentDocLB(m_xBuilder->weld_combo_box("recentdoclb"))
 , m_xDataSourceWarningFT(m_xBuilder->weld_label("datasourcewarning"))
+, m_xExchangeDatabasePB(m_xBuilder->weld_button("exchangedatabase"))
 {
 m_xCurrentDocRB->set_active(true);
 DocSelectHdl(*m_xNewDocRB);
@@ -69,6 +69,9 @@ 
SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
 m_xBrowseDocPB->connect_clicked(aFileSelectHdl);
 m_xBrowseTemplatePB->connect_clicked(aFileSelectHdl);
 
+Link aExchangeDatabaseHdl = LINK(this, 
SwMailMergeDocSelectPage, ExchangeDatabaseHdl);
+m_xExchangeDatabasePB->connect_clicked(aExchangeDatabaseHdl);
+
 const uno::Sequence< OUString >& rDocs =
 m_pWizard->GetConfigItem().GetSavedDocuments();
 for(const auto& rDoc : rDocs)
@@ -105,6 +108,11 @@ IMPL_LINK_NOARG(SwMailMergeDocSelectPage, DocSelectHdl, 
weld::ToggleButton&, voi
 m_xDataSourceWarningFT->hide();
 m_pWizard->enableButtons(WizardButtonFlags::NEXT, 
m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
 }
+
+if(m_xCurrentDocRB->get_active())
+m_xExchangeDatabasePB->set_sensitive(true);
+else
+m_xExchangeDatabasePB->set_sensitive(false);
 }
 
 IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, weld::Button&, rButton, 
void)
@@ -160,6 +168,24 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, 
weld::Button&, rButton, void)
 m_pWizard->enableButtons(WizardButtonFlags::NEXT, 
m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
 }
 
+IMPL_LINK_NOARG(SwMailMergeDocSelectPage, ExchangeDatabaseHdl, weld::Button&, 
void)
+{
+
+SwAbstractDialogFactory& rFact = ::swui::GetFactory();
+ScopedVclPtr 
pDlg(rFact.CreateSwChangeDBDlg(*m_pWizard->GetSwView()));
+pDlg->Execute();
+
+OUString sDataSourceName = m_pWizard->GetSwView()->GetDataSourceName();
+
+if(m_xCurrentDocRB->get_active() &&
+   !sDataSourceName.isEmpty() &&
+   SwView::IsDataSourceAvailable(sDataSourceName))
+{
+m_xDataSourceWarningFT->hide();
+m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
+}
+}
+
 bool SwMailMergeDocSelectPage::commitPage( 
::vcl::WizardTypes::CommitPageReason _eReason )
 {
 bool bReturn = false;
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx 
b/sw/source/ui/dbui/mmdocselectpage.hxx
index eccb3ffdda15..8a2a86a6e400 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -40,9 +40,11 @@ class SwMailMergeDocSelectPage : public vcl::OWizardPage
 std::unique_ptr m_xBrowseTemplatePB;
 std::unique_ptr m_xRecentDocLB;
 std::unique_ptr m_xDataSourceWarningFT;
+std::unique_ptr m_xExchangeDatabasePB;
 
 DECL_LINK(DocSelectHdl, weld::ToggleButton&, void);
 DECL_LINK(FileSelectHdl, weld::Button&, void);
+DECL_LINK(ExchangeDatabaseHdl, weld::Button&, void);
 
 virtual boolcommitPage( ::vcl::WizardTypes::CommitPageReason _eReason 
) override;
 
diff --git a/sw/uiconfig/swriter/ui/mmselectpage.ui 
b/sw/uiconfig/swriter/ui/mmselectpage.ui
index 4f5da744c05c..323af20266fd 100644
--- a/sw/uiconfig/swriter/ui/mmselectpage.ui
+++ b/sw/uiconfig/swriter/ui/mmselectpage.ui
@@ -55,7 +55,7 @@
   
   
 0
-1
+3
   
 
 
@@ -72,7 +72,7 @@
   
   
 0
-2
+4
   
 
 
@@ -89,7 +89,7 @@
   
   

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source sw/uiconfig

2020-05-22 Thread Szymon Kłos (via logerrit)
 sw/source/ui/table/instable.cxx   |5 +
 sw/source/uibase/inc/instable.hxx |1 +
 sw/uiconfig/swriter/ui/inserttable.ui |2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0fe4f3590e641ebd3049bdfe72cc32fbc74603ee
Author: Szymon Kłos 
AuthorDate: Thu May 21 16:33:32 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 22 09:41:33 2020 +0200

Don't show styles frame in insert table in online

Change-Id: I2ee2daef028b49a409920c0fe83190575e7a82c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94639
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 4d1225af9a27..5401b92c0bda 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define ROW_COL_PROD 16384
 
@@ -76,7 +77,11 @@ SwInsTableDlg::SwInsTableDlg(SwView& rView)
 , m_xInsertBtn(m_xBuilder->weld_button("ok"))
 , m_xLbFormat(m_xBuilder->weld_tree_view("formatlbinstable"))
 , m_xWndPreview(new weld::CustomWeld(*m_xBuilder, "previewinstable", 
m_aWndPreview))
+, m_xStyleFrame(m_xBuilder->weld_frame("stylesframe"))
 {
+if (comphelper::LibreOfficeKit::isActive())
+m_xStyleFrame->hide();
+
 const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32;
 const int nHeight = m_xLbFormat->get_height_rows(8);
 m_xLbFormat->set_size_request(nWidth, nHeight);
diff --git a/sw/source/uibase/inc/instable.hxx 
b/sw/source/uibase/inc/instable.hxx
index 3145227e84a1..aa36dc655c00 100644
--- a/sw/source/uibase/inc/instable.hxx
+++ b/sw/source/uibase/inc/instable.hxx
@@ -58,6 +58,7 @@ class SwInsTableDlg : public SfxDialogController
 std::unique_ptr m_xInsertBtn;
 std::unique_ptr m_xLbFormat;
 std::unique_ptr m_xWndPreview;
+std::unique_ptr m_xStyleFrame;
 
 // Returns 255 if mapping is not possible.
 // This means there cannot be more than 255 autotable style.
diff --git a/sw/uiconfig/swriter/ui/inserttable.ui 
b/sw/uiconfig/swriter/ui/inserttable.ui
index 03a2eb096a91..64cfab916932 100644
--- a/sw/uiconfig/swriter/ui/inserttable.ui
+++ b/sw/uiconfig/swriter/ui/inserttable.ui
@@ -366,7 +366,7 @@
   
 
 
-  
+  
 True
 False
 True
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits