[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - officecfg/registry sw/inc sw/source sw/uiconfig

Gülşah Köse (via logerrit) logerrit at kemper.freedesktop.org
Wed May 27 06:54:58 UTC 2020


 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   18 +++
 sw/inc/dbmgr.hxx                                           |    4 
 sw/inc/modcfg.hxx                                          |   13 ++
 sw/inc/swabstdlg.hxx                                       |    2 
 sw/source/ui/dialog/swdlgfact.cxx                          |   10 +
 sw/source/ui/dialog/swdlgfact.hxx                          |    2 
 sw/source/ui/envelp/mailmrge.cxx                           |   59 +++++++++++
 sw/source/uibase/config/modcfg.cxx                         |    7 +
 sw/source/uibase/dbui/dbmgr.cxx                            |   53 +++++++++-
 sw/source/uibase/inc/mailmrge.hxx                          |    7 +
 sw/uiconfig/swriter/ui/mailmerge.ui                        |   66 +++++++++++--
 11 files changed, 226 insertions(+), 15 deletions(-)

New commits:
commit 3edebd522fbe786eb41641f760cbdd20692ede8a
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Fri May 22 11:51:33 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 27 08:54:27 2020 +0200

    Add an option to create encyrpted PDF files with mailmerge.
    
    With that option user can create encyrpted pdf files with
    a password column in database via mailmerge.
    
    Change-Id: I081ef050bc269b1fec24fd01ecc812acd7b857ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94709
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.kose at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94830
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 40a48cd28e21..f4d3a3aa4182 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -6186,6 +6186,24 @@
             </info>
           </prop>
         </group>
+        <group oor:name="FilePassword">
+          <info>
+            <desc>Specifies how the file password is built.</desc>
+          </info>
+          <prop oor:name="Generation" oor:type="xs:boolean" oor:nillable="false" >
+            <!--UI hints: Form letter - File output - Generate file password from - Database field-->
+            <info>
+              <desc>Determines if the file password is generated from a database field.</desc>
+            </info>
+            <value>false</value>
+          </prop>
+          <prop oor:name="FromDatabaseField" oor:type="xs:string" oor:nillable="false">
+            <info>
+              <desc>Specifies the column name to be used as file password.</desc>
+            </info>
+            <value/>
+          </prop>
+        </group>
       </group>
     </group>
     <group oor:name="Misc">
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 8ca9302b1c17..82533b2cbe97 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -202,6 +202,10 @@ struct SwMergeDescriptor
      */
     OUString                                            sDBcolumn;
 
+    /** DB column to fetch password
+     */
+    OUString                                            sDBPasswordColumn;
+
     /** @} */
 
     /**
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index dd9c9ed40e15..c27f3be749be 100644
--- a/sw/inc/modcfg.hxx
+++ b/sw/inc/modcfg.hxx
@@ -180,9 +180,11 @@ class SwMiscConfig : public utl::ConfigItem
     bool        m_bNumAlignSize;              // Numbering/Graphic/KeepRatio
     bool        m_bSinglePrintJob;            // FormLetter/PrintOutput/SinglePrintJobs
     bool        m_bIsNameFromColumn;          // FormLetter/FileOutput/FileName/Generation
+    bool        m_bIsPasswordFromColumn;      // FormLetter/FileOutput/FilePassword/Generation
     bool        m_bAskForMailMergeInPrint;    // Ask if documents containing fields should be 'mailmerged'
     MailTextFormats m_nMailingFormats;            // FormLetter/MailingOutput/Formats
     OUString    m_sNameFromColumn;            // FormLetter/FileOutput/FileName/FromDatabaseField (string!)
+    OUString    m_sPasswordFromColumn;        // FormLetter/FileOutput/FilePassword/FromDatabaseField (string!)
     OUString    m_sMailingPath;               // FormLetter/FileOutput/Path
     OUString    m_sMailName;                  // FormLetter/FileOutput/FileName/FromManualSetting (string!)
 
@@ -330,6 +332,17 @@ public:
     void        SetNameFromColumn( const OUString& rSet )       { m_aMiscConfig.m_sNameFromColumn = rSet;
                                                                   m_aMiscConfig.SetModified();}
 
+    bool        IsFileEncyrptedFromColumn() const        { return m_aMiscConfig.m_bIsPasswordFromColumn;}
+    void        SetIsFileEncyrptedFromColumn( bool bSet )
+                        {
+                            m_aMiscConfig.SetModified();
+                            m_aMiscConfig.m_bIsPasswordFromColumn = bSet;
+                        }
+
+    const OUString& GetPasswordFromColumn() const       { return m_aMiscConfig.m_sPasswordFromColumn; }
+    void        SetPasswordFromColumn( const OUString& rSet )       { m_aMiscConfig.m_sPasswordFromColumn = rSet;
+                                                                      m_aMiscConfig.SetModified();}
+
     const OUString& GetMailingPath() const          { return m_aMiscConfig.m_sMailingPath; }
     void        SetMailingPath(const OUString& sPath) { m_aMiscConfig.m_sMailingPath = sPath;
                                                       m_aMiscConfig.SetModified();}
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 8e7020d37e87..3f261c47c344 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -152,7 +152,9 @@ public:
     virtual css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const = 0;
     virtual bool IsSaveSingleDoc() const = 0;
     virtual bool IsGenerateFromDataBase() const = 0;
+    virtual bool IsFileEncyrptedFromDataBase() const = 0;
     virtual OUString GetColumnName() const = 0;
+    virtual OUString GetPasswordColumnName() const = 0;
     virtual OUString GetTargetURL() const = 0;
 };
 
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 20097ec6c385..a715f6280c44 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -645,11 +645,21 @@ bool AbstractMailMergeDlg_Impl::IsGenerateFromDataBase() const
     return pDlg->IsGenerateFromDataBase();
 }
 
+bool AbstractMailMergeDlg_Impl::IsFileEncyrptedFromDataBase() const
+{
+    return pDlg->IsFileEncyrptedFromDataBase();
+}
+
 OUString AbstractMailMergeDlg_Impl::GetColumnName() const
 {
     return pDlg->GetColumnName();
 }
 
+OUString AbstractMailMergeDlg_Impl::GetPasswordColumnName() const
+{
+    return pDlg->GetPasswordColumnName();
+}
+
 OUString AbstractMailMergeDlg_Impl::GetTargetURL() const
 {
     return pDlg->GetTargetURL();
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 295b56f92348..3a7ecc581512 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -507,7 +507,9 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg
     virtual css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const override;
     virtual bool IsSaveSingleDoc() const override;
     virtual bool IsGenerateFromDataBase() const override;
+    virtual bool IsFileEncyrptedFromDataBase() const override;
     virtual OUString GetColumnName() const override;
+    virtual OUString GetPasswordColumnName() const override;
     virtual OUString GetTargetURL() const override;
 };
 
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index f9648fdd83fa..0eca50378902 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -170,6 +170,10 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
     get(m_pFormatRtfCB, "rtf");
     get(m_pFormatSwCB, "swriter");
 
+    get(m_pPasswordCB, "passwd-check");
+    get(m_pPasswordFT, "passwd-label");
+    get(m_pPasswordLB, "passwd-combobox");
+
     get(m_pOkBTN, "ok");
 
     m_pSingleJobsCB->Show(false); // not supported in since cws printerpullpages anymore
@@ -184,6 +188,9 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
     m_pAttachFT->Show(false);
     m_pAttachED->Show(false);
     m_pAttachPB->Show(false);
+    m_pPasswordCB->Show(false);
+    m_pPasswordFT->Show(false);
+    m_pPasswordLB->Show(false);
 
     Point aMailPos = m_pMailingRB->GetPosPixel();
     Point aFilePos = m_pFileRB->GetPosPixel();
@@ -276,13 +283,21 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
     m_pFromNF->SetMax(SAL_MAX_INT32);
     m_pToNF->SetMax(SAL_MAX_INT32);
 
+    Link<ListBox&,void> aLk3 = LINK(this, SwMailMergeDlg, FileFormatHdl);
+    m_pFilterLB->SetSelectHdl(aLk3);
+
     SwDBManager* pDBManager = rSh.GetDBManager();
+
     if(_xConnection.is())
         SwDBManager::GetColumnNames(m_pAddressFieldLB, _xConnection, rTableName);
     else
         pDBManager->GetColumnNames(m_pAddressFieldLB, rSourceName, rTableName);
+
     for(sal_Int32 nEntry = 0; nEntry < m_pAddressFieldLB->GetEntryCount(); ++nEntry)
+    {
         m_pColumnLB->InsertEntry(m_pAddressFieldLB->GetEntry(nEntry));
+        m_pPasswordLB->InsertEntry(m_pAddressFieldLB->GetEntry(nEntry));
+    }
 
     m_pAddressFieldLB->SelectEntry("EMAIL");
 
@@ -297,15 +312,23 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
     else
         m_pPathED->SetText(aURL.GetFull());
 
-    if (!bColumn ) {
+    if (!bColumn )
+    {
         m_pColumnLB->SelectEntry("NAME");
-    } else
+        m_pPasswordLB->SelectEntry("PASSWORD");
+    }
+    else
+    {
         m_pColumnLB->SelectEntry(pModOpt->GetNameFromColumn());
+        m_pPasswordLB->SelectEntry(pModOpt->GetPasswordFromColumn());
+    }
 
     if (m_pAddressFieldLB->GetSelectedEntryCount() == 0)
         m_pAddressFieldLB->SelectEntryPos(0);
     if (m_pColumnLB->GetSelectedEntryCount() == 0)
         m_pColumnLB->SelectEntryPos(0);
+    if (m_pPasswordLB->GetSelectedEntryCount() == 0)
+        m_pPasswordLB->SelectEntryPos(0);
 
     const bool bEnable = m_aSelection.getLength() != 0;
     m_pMarkedRB->Enable(bEnable);
@@ -437,6 +460,9 @@ IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, Button *, pBtn, void )
         m_pFilterFT->Enable(false);
         m_pFilterLB->Enable(false);
         m_pGenerateFromDataBaseCB->Enable(false);
+        m_pPasswordCB->Enable(false);
+        m_pPasswordFT->Enable(false);
+        m_pPasswordLB->Enable(false);
     }
 }
 
@@ -455,6 +481,9 @@ IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, Button*,  pBtn, void )
         m_pPathPB->Enable( false );
         m_pFilterFT->Enable( false );
         m_pFilterLB->Enable( false );
+        m_pPasswordCB->Enable(false);
+        m_pPasswordFT->Enable(false);
+        m_pPasswordLB->Enable(false);
     }
 }
 
@@ -468,6 +497,29 @@ IMPL_LINK( SwMailMergeDlg, FilenameHdl, Button*, pBox, void )
     m_pPathPB->Enable( bEnable );
     m_pFilterFT->Enable( bEnable );
     m_pFilterLB->Enable( bEnable );
+
+    if(m_pFilterLB->GetSelectedEntry() == "PDF - Portable Document Format")
+    {
+        m_pPasswordCB->Show(true);
+        m_pPasswordFT->Show(true);
+        m_pPasswordLB->Show(true);
+        m_pPasswordCB->Enable(true);
+        m_pPasswordFT->Enable(true);
+        m_pPasswordLB->Enable(true);
+    }
+}
+
+IMPL_LINK_NOARG( SwMailMergeDlg, FileFormatHdl, ListBox&, void )
+{
+    OUString sSelectedFilter = m_pFilterLB->GetSelectedEntry();
+    bool bEnable = sSelectedFilter == "PDF - Portable Document Format";
+
+    m_pPasswordCB->Show(bEnable);
+    m_pPasswordFT->Show(bEnable);
+    m_pPasswordLB->Show(bEnable);
+    m_pPasswordCB->Enable(bEnable);
+    m_pPasswordFT->Enable(bEnable);
+    m_pPasswordLB->Enable(bEnable);
 }
 
 IMPL_LINK_NOARG(SwMailMergeDlg, ModifyHdl, Edit&, void)
@@ -507,15 +559,18 @@ bool SwMailMergeDlg::ExecQryShell()
         nMergeType = DBMGR_MERGE_FILE;
         pModOpt->SetMailingPath( GetURLfromPath() );
         pModOpt->SetIsNameFromColumn(m_pGenerateFromDataBaseCB->IsChecked());
+        pModOpt->SetIsFileEncyrptedFromColumn(m_pPasswordCB->IsChecked());
 
         if (!AskUserFilename()) {
             pModOpt->SetNameFromColumn(m_pColumnLB->GetSelectedEntry());
+            pModOpt->SetPasswordFromColumn(m_pPasswordLB->GetSelectedEntry());
             if( m_pFilterLB->GetSelectedEntryPos() != LISTBOX_ENTRY_NOTFOUND)
                 m_sSaveFilter = *static_cast<const OUString*>(m_pFilterLB->GetSelectedEntryData());
             m_sFilename = OUString();
         } else {
             //#i97667# reset column name - otherwise it's remembered from the last run
             pModOpt->SetNameFromColumn(OUString());
+            pModOpt->SetPasswordFromColumn(OUString());
             //start save as dialog
             OUString sFilter;
             m_sFilename = SwMailMergeHelper::CallSaveAsDialog(GetFrameWeld(), sFilter);
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index fd8f9eeef127..3ce420932f4a 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1187,6 +1187,7 @@ SwMiscConfig::SwMiscConfig() :
     m_bNumAlignSize(true),
     m_bSinglePrintJob(false),
     m_bIsNameFromColumn(true),
+    m_bIsPasswordFromColumn(false),
     m_bAskForMailMergeInPrint(true),
     m_nMailingFormats(MailTextFormats::NONE)
 {
@@ -1218,6 +1219,8 @@ const Sequence<OUString>& SwMiscConfig::GetPropertyNames()
             "FormLetter/FileOutput/FileName/FromManualSetting",   // 9
             "FormLetter/FileOutput/FileName/Generation",//10
             "FormLetter/PrintOutput/AskForMerge"        //11
+            "FormLetter/FileOutput/FilePassword/FromDatabaseField",  // 12
+            "FormLetter/FileOutput/FilePassword/Generation",//13
         };
         OUString* pNames = aNames.getArray();
         for(int i = 0; i < nCount; i++)
@@ -1253,6 +1256,8 @@ void SwMiscConfig::ImplCommit()
             case 9 : pValues[nProp] <<= m_sMailName;        break;
             case 10: pValues[nProp] <<= m_bIsNameFromColumn; break;
             case 11: pValues[nProp] <<= m_bAskForMailMergeInPrint; break;
+            case 12: pValues[nProp] <<= m_sPasswordFromColumn; break;
+            case 13: pValues[nProp] <<= m_bIsPasswordFromColumn; break;
         }
     }
     PutProperties(aNames, aValues);
@@ -1285,6 +1290,8 @@ void SwMiscConfig::Load()
                 case 9 : pValues[nProp] >>= sTmp; m_sMailName = sTmp;     break;
                 case 10: m_bIsNameFromColumn = *o3tl::doAccess<bool>(pValues[nProp]); break;
                 case 11: pValues[nProp] >>= m_bAskForMailMergeInPrint; break;
+                case 12: m_bIsPasswordFromColumn = *o3tl::doAccess<bool>(pValues[nProp]); break;
+                case 13: pValues[nProp] >>= sTmp; m_sPasswordFromColumn = sTmp; break;
             }
         }
     }
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9c694a2bad4e..a3a443aec18a 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -990,6 +990,30 @@ static void lcl_PreparePrinterOptions(
     }
 }
 
+static void lcl_PrepareSaveFilterDataOptions(
+    const uno::Sequence< beans::PropertyValue >& rInSaveFilterDataptions,
+    uno::Sequence< beans::PropertyValue >& rOutSaveFilterDataOptions,
+    const OUString& sPassword)
+{
+    const sal_Int32 nOffset = 2;
+    rOutSaveFilterDataOptions.realloc( nOffset );
+    rOutSaveFilterDataOptions[ 0 ].Name = "EncryptFile";
+    rOutSaveFilterDataOptions[ 0 ].Value <<= true;
+    rOutSaveFilterDataOptions[ 1 ].Name = "DocumentOpenPassword";
+    rOutSaveFilterDataOptions[ 1 ].Value <<= sPassword;
+
+    // copy other options
+    sal_Int32 nIndex = nOffset;
+    for( const beans::PropertyValue& rOption : rInSaveFilterDataptions)
+    {
+         rOutSaveFilterDataOptions.realloc( nIndex + 1 );
+         rOutSaveFilterDataOptions[ nIndex ].Name = rOption.Name;
+         rOutSaveFilterDataOptions[ nIndex++ ].Value = rOption.Value ;
+    }
+
+}
+
+
 static SfxObjectShell* lcl_CreateWorkingDocument(
     // input
     const WorkingDocType aType, const SwWrtShell &rSourceWrtShell,
@@ -1189,10 +1213,13 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
     rtl_TextEncoding                    sMailEncoding = ::osl_getThreadTextEncoding();
 
     uno::Reference< beans::XPropertySet > xColumnProp;
+    uno::Reference< beans::XPropertySet > xPasswordColumnProp;
 
     // Check for (mandatory) email or (optional) filename column
     SwDBFormatData aColumnDBFormat;
     bool bColumnName = !rMergeDescriptor.sDBcolumn.isEmpty();
+    bool bPasswordColumnName = !rMergeDescriptor.sDBPasswordColumn.isEmpty();
+
     if( ! bColumnName )
     {
         if( bMT_EMAIL )
@@ -1207,6 +1234,12 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
         uno::Any aCol = xCols->getByName( rMergeDescriptor.sDBcolumn );
         aCol >>= xColumnProp;
 
+        if(bPasswordColumnName)
+        {
+            aCol = xCols->getByName( rMergeDescriptor.sDBPasswordColumn );
+            aCol >>= xPasswordColumnProp;
+        }
+
         aColumnDBFormat.xFormatter = pImpl->pMergeData->xFormatter;
         aColumnDBFormat.aNullDate  = pImpl->pMergeData->aNullDate;
 
@@ -1422,6 +1455,15 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
                 }
             }
 
+            OUString sPasswordColumnData;
+            uno::Sequence< beans::PropertyValue > aSaveToFilterDataOptions( rMergeDescriptor.aSaveToFilterData );
+
+            if( bMT_EMAIL || bPasswordColumnName )
+            {
+                sPasswordColumnData = GetDBField( xPasswordColumnProp, aColumnDBFormat );
+                lcl_PrepareSaveFilterDataOptions( rMergeDescriptor.aSaveToFilterData, aSaveToFilterDataOptions, sPasswordColumnData );
+            }
+
             if( IsMergeOk() )
             {
                 std::unique_ptr< INetURLObject > aTempFileURL;
@@ -1549,7 +1591,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
                     // save merged document
                     OUString sFileURL;
                     if( !lcl_SaveDoc( aTempFileURL.get(), pStoreToFilter, pStoreToFilterOptions,
-                                      &rMergeDescriptor.aSaveToFilterData, bIsPDFexport,
+                                      &aSaveToFilterDataOptions, bIsPDFexport,
                                       xWorkDocSh, *pWorkShell, &sFileURL ) )
                     {
                         m_aMergeStatus = MergeStatus::Error;
@@ -3083,9 +3125,14 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
         aMergeDesc.bCreateSingleFile = pImpl->pMergeDialog->IsSaveSingleDoc();
         aMergeDesc.bPrefixIsFilename = aMergeDesc.bCreateSingleFile;
         aMergeDesc.sPrefix = pImpl->pMergeDialog->GetTargetURL();
-        if( !aMergeDesc.bCreateSingleFile && pImpl->pMergeDialog->IsGenerateFromDataBase() )
+
+        if( !aMergeDesc.bCreateSingleFile )
         {
-            aMergeDesc.sDBcolumn = pImpl->pMergeDialog->GetColumnName();
+            if(pImpl->pMergeDialog->IsGenerateFromDataBase())
+                aMergeDesc.sDBcolumn = pImpl->pMergeDialog->GetColumnName();
+
+            if(pImpl->pMergeDialog->IsFileEncyrptedFromDataBase())
+                aMergeDesc.sDBPasswordColumn = pImpl->pMergeDialog->GetPasswordColumnName();
         }
 
         Merge( aMergeDesc );
diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx
index cbb9a9465936..d5730a80736c 100644
--- a/sw/source/uibase/inc/mailmrge.hxx
+++ b/sw/source/uibase/inc/mailmrge.hxx
@@ -90,6 +90,10 @@ class SwMailMergeDlg : public SvxStandardDialog
     VclPtr<CheckBox>        m_pFormatRtfCB;
     VclPtr<CheckBox>        m_pFormatSwCB;
 
+    VclPtr<CheckBox>        m_pPasswordCB;
+    VclPtr<FixedText>       m_pPasswordFT;
+    VclPtr<ListBox>         m_pPasswordLB;
+
     VclPtr<OKButton>        m_pOkBTN;
 
     std::unique_ptr<SwMailMergeDlg_Impl> pImpl;
@@ -110,6 +114,7 @@ class SwMailMergeDlg : public SvxStandardDialog
     DECL_LINK( FilenameHdl, Button*, void );
     DECL_LINK( ModifyHdl, Edit&, void );
     DECL_LINK( SaveTypeHdl, Button*, void );
+    DECL_LINK( FileFormatHdl, ListBox&, void );
 
     virtual void    Apply() override;
     bool            ExecQryShell();
@@ -130,7 +135,9 @@ public:
 
     bool IsSaveSingleDoc() const { return m_pSaveSingleDocRB->IsChecked(); }
     bool IsGenerateFromDataBase() const { return m_pGenerateFromDataBaseCB->IsChecked(); }
+    bool IsFileEncyrptedFromDataBase() const { return m_pPasswordCB->IsChecked(); }
     OUString GetColumnName() const { return m_pColumnLB->GetSelectedEntry(); }
+    OUString GetPasswordColumnName() const { return m_pPasswordLB->GetSelectedEntry(); }
     OUString GetTargetURL() const;
 
     const OUString& GetSaveFilter() const {return m_sSaveFilter;}
diff --git a/sw/uiconfig/swriter/ui/mailmerge.ui b/sw/uiconfig/swriter/ui/mailmerge.ui
index 623976f6d6e2..5e1b8348a627 100644
--- a/sw/uiconfig/swriter/ui/mailmerge.ui
+++ b/sw/uiconfig/swriter/ui/mailmerge.ui
@@ -505,7 +505,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">0</property>
-                                                    <property name="top_attach">5</property>
+                                                    <property name="top_attach">7</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -517,7 +517,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">5</property>
+                                                    <property name="top_attach">7</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -532,7 +532,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">0</property>
-                                                    <property name="top_attach">6</property>
+                                                    <property name="top_attach">8</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -544,7 +544,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">6</property>
+                                                    <property name="top_attach">8</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -558,7 +558,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">2</property>
-                                                    <property name="top_attach">6</property>
+                                                    <property name="top_attach">8</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -572,7 +572,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">0</property>
-                                                    <property name="top_attach">7</property>
+                                                    <property name="top_attach">9</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -583,7 +583,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">4</property>
+                                                    <property name="top_attach">6</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -599,7 +599,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">7</property>
+                                                    <property name="top_attach">9</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -615,7 +615,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">8</property>
+                                                    <property name="top_attach">10</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -631,9 +631,55 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">9</property>
+                                                    <property name="top_attach">11</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkCheckButton" id="passwd-check">
+                                                    <property name="label" translatable="yes" context="mailmerge|passwd-check">Save with password</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">False</property>
+                                                    <property name="halign">start</property>
+                                                    <property name="draw_indicator">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="left_attach">0</property>
+                                                    <property name="top_attach">4</property>
+                                                    <property name="width">2</property>
                                                   </packing>
                                                 </child>
+                                                <child>
+                                                  <object class="GtkLabel" id="passwd-label">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="halign">start</property>
+                                                    <property name="label" translatable="yes" context="mailmerge|passwd-label">Password field:</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="mnemonic_widget">passwd-combobox</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="left_attach">0</property>
+                                                    <property name="top_attach">5</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkComboBoxText" id="passwd-combobox">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="hexpand">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="left_attach">1</property>
+                                                    <property name="top_attach">5</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
                                                 <child>
                                                   <placeholder/>
                                                 </child>


More information about the Libreoffice-commits mailing list