1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include "mmgreetingspage.hxx"
21 #include <mailmergewizard.hxx>
22 #include <mmconfigitem.hxx>
23 #include "mmaddressblockpage.hxx"
24 #include <swtypes.hxx>
25 #include <dbui.hrc>
26 #include <com/sun/star/sdb/XColumn.hpp>
27 #include <com/sun/star/sdbc/SQLException.hpp>
28 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
29 #include <com/sun/star/container/XNameAccess.hpp>
30 #include <swmodule.hxx>
31 #include <view.hxx>
32 
33 using namespace svt;
34 using namespace ::com::sun::star;
35 using namespace ::com::sun::star::uno;
36 
lcl_FillGreetingsBox(weld::ComboBox & rBox,SwMailMergeConfigItem const & rConfig,SwMailMergeConfigItem::Gender eType)37 static void lcl_FillGreetingsBox(weld::ComboBox& rBox,
38                         SwMailMergeConfigItem const & rConfig,
39                         SwMailMergeConfigItem::Gender eType)
40 {
41     const Sequence< OUString> rEntries = rConfig.GetGreetings(eType);
42     for(const auto& rEntry : rEntries)
43         rBox.append_text(rEntry);
44     rBox.set_active(rConfig.GetCurrentGreeting(eType));
45 }
46 
lcl_StoreGreetingsBox(const weld::ComboBox & rBox,SwMailMergeConfigItem & rConfig,SwMailMergeConfigItem::Gender eType)47 static void lcl_StoreGreetingsBox(const weld::ComboBox& rBox,
48                         SwMailMergeConfigItem& rConfig,
49                         SwMailMergeConfigItem::Gender eType)
50 {
51     Sequence< OUString> aEntries(rBox.get_count());
52     OUString* pEntries = aEntries.getArray();
53     for(sal_Int32 nEntry = 0; nEntry < rBox.get_count(); ++nEntry)
54         pEntries[nEntry] = rBox.get_text(nEntry);
55     rConfig.SetGreetings(eType, aEntries);
56     rConfig.SetCurrentGreeting(eType, rBox.get_active());
57 }
58 
IMPL_LINK_NOARG(SwGreetingsHandler,IndividualHdl_Impl,weld::ToggleButton &,void)59 IMPL_LINK_NOARG(SwGreetingsHandler, IndividualHdl_Impl, weld::ToggleButton&, void)
60 {
61     bool bIndividual = m_xPersonalizedCB->get_sensitive() && m_xPersonalizedCB->get_active();
62     m_xFemaleFT->set_sensitive(bIndividual);
63     m_xFemaleLB->set_sensitive(bIndividual);
64     m_xFemalePB->set_sensitive(bIndividual);
65     m_xMaleFT->set_sensitive(bIndividual);
66     m_xMaleLB->set_sensitive(bIndividual);
67     m_xMalePB->set_sensitive(bIndividual);
68     m_xFemaleFI->set_sensitive(bIndividual);
69     m_xFemaleColumnFT->set_sensitive(bIndividual);
70     m_xFemaleColumnLB->set_sensitive(bIndividual);
71     m_xFemaleFieldFT->set_sensitive(bIndividual);
72     m_xFemaleFieldCB->set_sensitive(bIndividual);
73 
74     if( m_bIsTabPage )
75     {
76         m_rConfigItem.SetIndividualGreeting(bIndividual, false);
77         m_pWizard->UpdateRoadmap();
78         m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_LAYOUTPAGE));
79     }
80     UpdatePreview();
81 }
82 
IMPL_LINK(SwGreetingsHandler,GreetingHdl_Impl,weld::Button &,rButton,void)83 IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, weld::Button&, rButton, void)
84 {
85     std::unique_ptr<SwCustomizeAddressBlockDialog> xDlg(new SwCustomizeAddressBlockDialog(&rButton, m_rConfigItem,
86                         &rButton == m_xMalePB.get() ?
87                         SwCustomizeAddressBlockDialog::GREETING_MALE :
88                         SwCustomizeAddressBlockDialog::GREETING_FEMALE ));
89     if (RET_OK == xDlg->run())
90     {
91         weld::ComboBox* pToInsert = &rButton == m_xMalePB.get() ? m_xMaleLB.get() : m_xFemaleLB.get();
92         pToInsert->append_text(xDlg->GetAddress());
93         pToInsert->set_active(pToInsert->get_count() - 1);
94         if(m_bIsTabPage)
95         {
96             m_pWizard->UpdateRoadmap();
97             m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_LAYOUTPAGE));
98         }
99         UpdatePreview();
100     }
101 }
102 
UpdatePreview()103 void SwGreetingsHandler::UpdatePreview()
104 {
105     //the base class does nothing
106 }
107 
IMPL_LINK_NOARG(SwMailMergeGreetingsPage,AssignHdl_Impl,weld::Button &,void)108 IMPL_LINK_NOARG(SwMailMergeGreetingsPage, AssignHdl_Impl, weld::Button&, void)
109 {
110     const OUString sPreview(m_xFemaleLB->get_active_text() + "\n" + m_xMaleLB->get_active_text());
111     SwAssignFieldsDialog aDlg(m_pWizard->getDialog(), m_rConfigItem, sPreview, false);
112     if (RET_OK == aDlg.run())
113     {
114         UpdatePreview();
115         m_pWizard->UpdateRoadmap();
116         m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_LAYOUTPAGE));
117     }
118 }
119 
IMPL_LINK_NOARG(SwMailMergeGreetingsPage,GreetingSelectListBoxHdl_Impl,weld::ComboBox &,void)120 IMPL_LINK_NOARG(SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl, weld::ComboBox&, void)
121 {
122     UpdatePreview();
123 }
124 
IMPL_LINK_NOARG(SwMailMergeGreetingsPage,GreetingSelectComboBoxHdl_Impl,weld::ComboBox &,void)125 IMPL_LINK_NOARG(SwMailMergeGreetingsPage, GreetingSelectComboBoxHdl_Impl, weld::ComboBox&, void)
126 {
127     UpdatePreview();
128 }
129 
UpdatePreview()130 void SwMailMergeGreetingsPage::UpdatePreview()
131 {
132     //find out which type of greeting should be selected:
133     bool bFemale = false;
134     bool bNoValue = !m_xFemaleColumnLB->get_sensitive();
135     if( !bNoValue )
136     {
137         const OUString sFemaleValue = m_xFemaleFieldCB->get_active_text();
138         const OUString sFemaleColumn = m_xFemaleColumnLB->get_active_text();
139         Reference< sdbcx::XColumnsSupplier > xColsSupp( m_rConfigItem.GetResultSet(), UNO_QUERY);
140         Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr;
141         if(!sFemaleValue.isEmpty() && !sFemaleColumn.isEmpty() &&
142                 xColAccess.is() &&
143                 xColAccess->hasByName(sFemaleColumn))
144         {
145             //get the content and exchange it in the address string
146             Any aCol = xColAccess->getByName(sFemaleColumn);
147             Reference< sdb::XColumn > xColumn;
148             aCol >>= xColumn;
149             if(xColumn.is())
150             {
151                 try
152                 {
153                     bFemale = xColumn->getString() == sFemaleValue;
154 
155                     //no last name value marks the greeting also as neutral
156                     const OUString sLastNameColumn =
157                         m_rConfigItem.GetAssignedColumn(MM_PART_LASTNAME);
158                     if ( xColAccess->hasByName(sLastNameColumn) )
159                     {
160                         aCol = xColAccess->getByName(sLastNameColumn);
161                         aCol >>= xColumn;
162                         bNoValue = xColumn->getString().isEmpty();
163                     }
164                 }
165                 catch (const sdbc::SQLException&)
166                 {
167                     OSL_FAIL("SQLException caught");
168                 }
169             }
170         }
171     }
172 
173     OUString sPreview = bFemale ? m_xFemaleLB->get_active_text() :
174         bNoValue ? m_xNeutralCB->get_active_text() : m_xMaleLB->get_active_text();
175 
176     sPreview = SwAddressPreview::FillData(sPreview, m_rConfigItem);
177     m_xPreview->SetAddress(sPreview);
178 }
179 
Contains(bool bContainsGreeting)180 void SwGreetingsHandler::Contains(bool bContainsGreeting)
181 {
182     m_xPersonalizedCB->set_sensitive(bContainsGreeting);
183     bool bEnablePersonal = bContainsGreeting && m_xPersonalizedCB->get_active();
184     m_xFemaleFT->set_sensitive(bEnablePersonal);
185     m_xFemaleLB->set_sensitive(bEnablePersonal);
186     m_xFemalePB->set_sensitive(bEnablePersonal);
187     m_xMaleFT->set_sensitive(bEnablePersonal);
188     m_xMaleLB->set_sensitive(bEnablePersonal);
189     m_xMalePB->set_sensitive(bEnablePersonal);
190     m_xFemaleFI->set_sensitive(bEnablePersonal);
191     m_xFemaleColumnFT->set_sensitive(bEnablePersonal);
192     m_xFemaleColumnLB->set_sensitive(bEnablePersonal);
193     m_xFemaleFieldFT->set_sensitive(bEnablePersonal);
194     m_xFemaleFieldCB->set_sensitive(bEnablePersonal);
195     m_xNeutralFT->set_sensitive(bContainsGreeting);
196     m_xNeutralCB->set_sensitive(bContainsGreeting);
197 }
198 
SwMailMergeGreetingsPage(weld::Container * pPage,SwMailMergeWizard * pWizard)199 SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(weld::Container* pPage, SwMailMergeWizard* pWizard)
200     : vcl::OWizardPage(pPage, pWizard, "modules/swriter/ui/mmsalutationpage.ui", "MMSalutationPage")
201     , SwGreetingsHandler(pWizard->GetConfigItem(), *m_xBuilder)
202     , m_xPreview(new SwAddressPreview(m_xBuilder->weld_scrolled_window("previewwin")))
203     , m_xPreviewFI(m_xBuilder->weld_label("previewft"))
204     , m_xAssignPB(m_xBuilder->weld_button("assign"))
205     , m_xDocumentIndexFI(m_xBuilder->weld_label("documentindex"))
206     , m_xPrevSetIB(m_xBuilder->weld_button("prev"))
207     , m_xNextSetIB(m_xBuilder->weld_button("next"))
208     , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", *m_xPreview))
209 {
210     m_pWizard = pWizard;
211 
212     Size aSize(m_xPreview->GetDrawingArea()->get_ref_device().LogicToPixel(Size(186, 21), MapMode(MapUnit::MapAppFont)));
213     m_xPreviewWIN->set_size_request(aSize.Width(), aSize.Height());
214     m_sDocument = m_xDocumentIndexFI->get_label();
215 
216     m_bIsTabPage = true;
217 
218     m_xGreetingLineCB->connect_toggled(LINK(this, SwMailMergeGreetingsPage, ContainsHdl_Impl));
219     Link<weld::ToggleButton&,void> aIndividualLink = LINK(this, SwGreetingsHandler, IndividualHdl_Impl);
220     m_xPersonalizedCB->connect_toggled(aIndividualLink);
221     Link<weld::Button&,void> aGreetingLink = LINK(this, SwGreetingsHandler, GreetingHdl_Impl);
222     m_xFemalePB->connect_clicked(aGreetingLink);
223     m_xMalePB->connect_clicked(aGreetingLink);
224     m_xAssignPB->connect_clicked(LINK(this, SwMailMergeGreetingsPage, AssignHdl_Impl));
225     Link<weld::ComboBox&,void> aLBoxLink2 = LINK(this, SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl);
226     m_xFemaleLB->connect_changed(aLBoxLink2);
227     m_xMaleLB->connect_changed(aLBoxLink2);
228     m_xFemaleColumnLB->connect_changed(aLBoxLink2);
229     m_xFemaleFieldCB->connect_changed(LINK(this, SwMailMergeGreetingsPage, GreetingSelectComboBoxHdl_Impl));
230     m_xNeutralCB->connect_changed(LINK(this, SwMailMergeGreetingsPage, GreetingSelectComboBoxHdl_Impl));
231 
232     Link<weld::Button&,void> aDataLink = LINK(this, SwMailMergeGreetingsPage, InsertDataHdl_Impl);
233     m_xPrevSetIB->connect_clicked(aDataLink);
234     m_xNextSetIB->connect_clicked(aDataLink);
235 
236     m_xGreetingLineCB->set_active(m_rConfigItem.IsGreetingLine(false));
237     m_xPersonalizedCB->set_active(m_rConfigItem.IsIndividualGreeting(false));
238     ContainsHdl_Impl(*m_xGreetingLineCB);
239     aIndividualLink.Call(*m_xPersonalizedCB);
240 
241     lcl_FillGreetingsBox(*m_xFemaleLB, m_rConfigItem, SwMailMergeConfigItem::FEMALE);
242     lcl_FillGreetingsBox(*m_xMaleLB, m_rConfigItem, SwMailMergeConfigItem::MALE);
243     lcl_FillGreetingsBox(*m_xNeutralCB, m_rConfigItem, SwMailMergeConfigItem::NEUTRAL);
244 
245     m_xDocumentIndexFI->set_label(m_sDocument.replaceFirst("%1", "1"));
246 }
247 
~SwMailMergeGreetingsPage()248 SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
249 {
250     m_xPreviewWIN.reset();
251     m_xPreview.reset();
252 }
253 
Activate()254 void SwMailMergeGreetingsPage::Activate()
255 {
256     //try to find the gender setting
257     m_xFemaleColumnLB->clear();
258     Reference< sdbcx::XColumnsSupplier > xColsSupp = m_rConfigItem.GetColumnsSupplier();
259     if(xColsSupp.is())
260     {
261         Reference < container::XNameAccess> xColAccess = xColsSupp->getColumns();
262         const Sequence< OUString > aColumns = xColAccess->getElementNames();
263         for(const auto& rColumn : aColumns)
264             m_xFemaleColumnLB->append_text(rColumn);
265     }
266 
267     m_xFemaleColumnLB->set_active_text(m_rConfigItem.GetAssignedColumn(MM_PART_GENDER));
268     m_xFemaleColumnLB->save_value();
269 
270     m_xFemaleFieldCB->set_entry_text(m_rConfigItem.GetFemaleGenderValue());
271     m_xFemaleFieldCB->save_value();
272 
273     UpdatePreview();
274     m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_LAYOUTPAGE));
275 }
276 
commitPage(::vcl::WizardTypes::CommitPageReason)277 bool SwMailMergeGreetingsPage::commitPage( ::vcl::WizardTypes::CommitPageReason )
278 {
279     if (m_xFemaleColumnLB->get_value_changed_from_saved())
280     {
281         const SwDBData& rDBData = m_rConfigItem.GetCurrentDBData();
282         Sequence< OUString> aAssignment = m_rConfigItem.GetColumnAssignment( rDBData );
283         if(aAssignment.getLength() <= MM_PART_GENDER)
284             aAssignment.realloc(MM_PART_GENDER + 1);
285         aAssignment[MM_PART_GENDER] = m_xFemaleColumnLB->get_active_text();
286         m_rConfigItem.SetColumnAssignment( rDBData, aAssignment );
287     }
288     if (m_xFemaleFieldCB->get_value_changed_from_saved())
289         m_rConfigItem.SetFemaleGenderValue(m_xFemaleFieldCB->get_active_text());
290 
291     lcl_StoreGreetingsBox(*m_xFemaleLB, m_rConfigItem, SwMailMergeConfigItem::FEMALE);
292     lcl_StoreGreetingsBox(*m_xMaleLB, m_rConfigItem, SwMailMergeConfigItem::MALE);
293 
294     sal_Int32 nCurrentTextPos = m_xNeutralCB->find_text(m_xNeutralCB->get_active_text());
295     if (nCurrentTextPos == -1)
296     {
297         m_xNeutralCB->append_text(m_xNeutralCB->get_active_text());
298         m_xNeutralCB->set_active(m_xNeutralCB->get_count() - 1);
299     }
300     lcl_StoreGreetingsBox(*m_xNeutralCB, m_rConfigItem, SwMailMergeConfigItem::NEUTRAL);
301     m_rConfigItem.SetGreetingLine(m_xGreetingLineCB->get_active(), false);
302     m_rConfigItem.SetIndividualGreeting(m_xPersonalizedCB->get_active(), false);
303     return true;
304 }
305 
IMPL_LINK(SwMailMergeGreetingsPage,ContainsHdl_Impl,weld::ToggleButton &,rBox,void)306 IMPL_LINK(SwMailMergeGreetingsPage, ContainsHdl_Impl, weld::ToggleButton&, rBox, void)
307 {
308     bool bContainsGreeting = rBox.get_active();
309     SwGreetingsHandler::Contains(bContainsGreeting);
310     m_xPreviewFI->set_sensitive(bContainsGreeting);
311     m_xPreviewWIN->set_sensitive(bContainsGreeting);
312     m_xAssignPB->set_sensitive(bContainsGreeting);
313     m_xDocumentIndexFI->set_sensitive(bContainsGreeting);
314     m_xPrevSetIB->set_sensitive(bContainsGreeting);
315     m_xNextSetIB->set_sensitive(bContainsGreeting);
316     m_rConfigItem.SetGreetingLine(m_xGreetingLineCB->get_active(), false);
317     m_pWizard->UpdateRoadmap();
318     m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_LAYOUTPAGE));
319 }
320 
IMPL_LINK(SwMailMergeGreetingsPage,InsertDataHdl_Impl,weld::Button &,rButton,void)321 IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, weld::Button&, rButton, void)
322 {
323     bool bNext = &rButton == m_xNextSetIB.get();
324     sal_Int32 nPos = m_rConfigItem.GetResultSetPosition();
325     m_rConfigItem.MoveResultSet( bNext ? ++nPos : --nPos);
326     nPos = m_rConfigItem.GetResultSetPosition();
327     bool bEnable = true;
328     if(nPos < 1)
329     {
330         bEnable = false;
331         nPos = 1;
332     }
333     else
334         UpdatePreview();
335     m_xPrevSetIB->set_sensitive(bEnable);
336     m_xNextSetIB->set_sensitive(bEnable);
337     m_xDocumentIndexFI->set_sensitive(bEnable);
338     m_xDocumentIndexFI->set_label(m_sDocument.replaceFirst("%1", OUString::number(nPos)));
339 }
340 
SwMailBodyDialog(weld::Window * pParent)341 SwMailBodyDialog::SwMailBodyDialog(weld::Window* pParent)
342     : SfxDialogController(pParent, "modules/swriter/ui/mmmailbody.ui", "MailBodyDialog")
343     , SwGreetingsHandler(*GetActiveView()->GetMailMergeConfigItem(), *m_xBuilder)
344     , m_xBodyFT(m_xBuilder->weld_label("bodyft"))
345     , m_xBodyMLE(m_xBuilder->weld_text_view("bodymle"))
346     , m_xOK(m_xBuilder->weld_button("ok"))
347 {
348     m_bIsTabPage = false;
349     m_xBodyMLE->set_size_request(m_xBodyMLE->get_approximate_digit_width() * 45,
350                                  m_xBodyMLE->get_height_rows(6));
351     m_xGreetingLineCB->connect_toggled(LINK(this, SwMailBodyDialog, ContainsHdl_Impl));
352     Link<weld::ToggleButton&,void> aIndividualLink = LINK(this, SwGreetingsHandler, IndividualHdl_Impl);
353     m_xPersonalizedCB->connect_toggled(aIndividualLink);
354     Link<weld::Button&,void> aGreetingLink = LINK(this, SwGreetingsHandler, GreetingHdl_Impl);
355     m_xFemalePB->connect_clicked(aGreetingLink);
356     m_xMalePB->connect_clicked(aGreetingLink);
357     m_xOK->connect_clicked(LINK(this, SwMailBodyDialog, OKHdl));
358 
359     m_xGreetingLineCB->set_active(m_rConfigItem.IsGreetingLine(true));
360     m_xPersonalizedCB->set_active(m_rConfigItem.IsIndividualGreeting(true));
361     ContainsHdl_Impl(*m_xGreetingLineCB);
362     aIndividualLink.Call(*m_xPersonalizedCB);
363 
364     lcl_FillGreetingsBox(*m_xFemaleLB, m_rConfigItem, SwMailMergeConfigItem::FEMALE);
365     lcl_FillGreetingsBox(*m_xMaleLB, m_rConfigItem, SwMailMergeConfigItem::MALE);
366     lcl_FillGreetingsBox(*m_xNeutralCB, m_rConfigItem, SwMailMergeConfigItem::NEUTRAL);
367 
368     //try to find the gender setting
369     m_xFemaleColumnLB->clear();
370     Reference< sdbcx::XColumnsSupplier > xColsSupp = m_rConfigItem.GetColumnsSupplier();
371     if(xColsSupp.is())
372     {
373         Reference < container::XNameAccess> xColAccess = xColsSupp->getColumns();
374         const Sequence< OUString > aColumns = xColAccess->getElementNames();
375         for(const auto& rColumn : aColumns)
376             m_xFemaleColumnLB->append_text(rColumn);
377     }
378 
379     m_xFemaleColumnLB->set_active_text(m_rConfigItem.GetAssignedColumn(MM_PART_GENDER));
380     m_xFemaleColumnLB->save_value();
381 
382     m_xFemaleFieldCB->set_entry_text(m_rConfigItem.GetFemaleGenderValue());
383     m_xFemaleFieldCB->save_value();
384 }
385 
~SwMailBodyDialog()386 SwMailBodyDialog::~SwMailBodyDialog()
387 {
388 }
389 
IMPL_LINK(SwMailBodyDialog,ContainsHdl_Impl,weld::ToggleButton &,rBox,void)390 IMPL_LINK(SwMailBodyDialog, ContainsHdl_Impl, weld::ToggleButton&, rBox, void)
391 {
392     SwGreetingsHandler::Contains(rBox.get_active());
393     m_rConfigItem.SetGreetingLine(rBox.get_active(), true);
394 }
395 
IMPL_LINK_NOARG(SwMailBodyDialog,OKHdl,weld::Button &,void)396 IMPL_LINK_NOARG(SwMailBodyDialog, OKHdl, weld::Button&, void)
397 {
398     m_rConfigItem.SetGreetingLine(
399                 m_xGreetingLineCB->get_active(), false);
400     m_rConfigItem.SetIndividualGreeting(
401                 m_xPersonalizedCB->get_active(), false);
402 
403     if (m_xFemaleColumnLB->get_value_changed_from_saved())
404     {
405         const SwDBData& rDBData = m_rConfigItem.GetCurrentDBData();
406         Sequence< OUString> aAssignment = m_rConfigItem.GetColumnAssignment( rDBData );
407         sal_Int32 nPos = m_xFemaleColumnLB->get_active();
408         if(aAssignment.getLength() < MM_PART_GENDER)
409             aAssignment.realloc(MM_PART_GENDER);
410         if( nPos > 0 )
411             aAssignment[MM_PART_GENDER] = m_xFemaleColumnLB->get_active_text();
412         else
413             aAssignment[MM_PART_GENDER].clear();
414         m_rConfigItem.SetColumnAssignment( rDBData, aAssignment );
415     }
416     if (m_xFemaleFieldCB->get_value_changed_from_saved())
417         m_rConfigItem.SetFemaleGenderValue(m_xFemaleFieldCB->get_active_text());
418 
419     m_xDialog->response(RET_OK);
420 }
421 
422 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
423