diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-09 14:36:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-09 14:37:53 +0100 |
commit | 7b355ad06e11bd81ce15f2a08044d6bbfae59131 (patch) | |
tree | a11ce08f3f09e7fbdb68b80341ba42c460dafcb5 /sw/source/ui/dbui | |
parent | 3011a704d9ff8ddd052165150a5cd91166fad69d (diff) |
Resolves: tdf#101382 turn SetMailMergeConfigItem into a shared_ptr
so if the SwView it nominally belongs to is deleted while a
mail merge wizard is open it still exists while the wizard
has a ref to it
Change-Id: I4f5acbcc1ea6404851cf6e0179fd3c795342f726
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/mailmergewizard.cxx | 44 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 116 |
2 files changed, 80 insertions, 80 deletions
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index d013c0779ec0..968c71e201ee 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -38,12 +38,12 @@ using namespace svt; using namespace ::com::sun::star; -SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem) : +SwMailMergeWizard::SwMailMergeWizard(SwView& rView, std::shared_ptr<SwMailMergeConfigItem>& rItem) : RoadmapWizard(&rView.GetViewFrame()->GetWindow(), WizardButtonFlags::NEXT|WizardButtonFlags::PREVIOUS|WizardButtonFlags::FINISH|WizardButtonFlags::CANCEL|WizardButtonFlags::HELP), m_pSwView(&rView), m_bDocumentLoad( false ), - m_rConfigItem(rItem), + m_xConfigItem(rItem), m_sStarting( SW_RES( ST_STARTING )), m_sDocumentType( SW_RES( ST_DOCUMENTTYPE )), m_sAddressBlock( SW_RES( ST_ADDRESSBLOCK )), @@ -61,7 +61,7 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem m_pPrevPage->SetHelpId(HID_MM_PREV_PAGE); //#i51949# no output type page visible if e-Mail is not supported - if(rItem.IsMailAvailable()) + if (m_xConfigItem->IsMailAvailable()) declarePath( 0, {MM_DOCUMENTSELECTPAGE, @@ -111,20 +111,20 @@ void SwMailMergeWizard::enterState( WizardState _nState ) of greeting and address block - if not yet done entering the merge or output page requires to create the output document */ - if(_nState > MM_LAYOUTPAGE && m_rConfigItem.GetSourceView() && - ((m_rConfigItem.IsAddressBlock() && !m_rConfigItem.IsAddressInserted()) || - (m_rConfigItem.IsGreetingLine(false) && !m_rConfigItem.IsGreetingInserted() ))) + if(_nState > MM_LAYOUTPAGE && m_xConfigItem->GetSourceView() && + ((m_xConfigItem->IsAddressBlock() && !m_xConfigItem->IsAddressInserted()) || + (m_xConfigItem->IsGreetingLine(false) && !m_xConfigItem->IsGreetingInserted() ))) { - SwMailMergeLayoutPage::InsertAddressAndGreeting(m_rConfigItem.GetSourceView(), - m_rConfigItem, Point(-1, -1), true); + SwMailMergeLayoutPage::InsertAddressAndGreeting(m_xConfigItem->GetSourceView(), + *m_xConfigItem, Point(-1, -1), true); } - if(m_rConfigItem.GetTargetView()) + if (m_xConfigItem->GetTargetView()) { //close the dialog, remove the target view, show the source view m_nRestartPage = _nState; //set ResultSet back to start - m_rConfigItem.MoveResultSet(1); + m_xConfigItem->MoveResultSet(1); EndDialog(RET_REMOVE_TARGET); return; } @@ -136,7 +136,7 @@ void SwMailMergeWizard::enterState( WizardState _nState ) bEnablePrev = false; // the first page break; case MM_ADDRESSBLOCKPAGE : - bEnableNext = m_rConfigItem.GetResultSet().is(); + bEnableNext = m_xConfigItem->GetResultSet().is(); break; case MM_LAYOUTPAGE: bEnableNext = false; // the last page @@ -157,7 +157,7 @@ OUString SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const case MM_OUTPUTTYPETPAGE: return m_sDocumentType; case MM_ADDRESSBLOCKPAGE: - return m_rConfigItem.IsOutputToLetter() ? + return m_xConfigItem->IsOutputToLetter() ? m_sAddressBlock : m_sAddressList; case MM_GREETINGSPAGE: return m_sGreetingsLine; @@ -185,12 +185,12 @@ void SwMailMergeWizard::UpdateRoadmap() TabPage* pCurPage = GetPage( nCurPage ); if(!pCurPage) return; - bool bAddressFieldsConfigured = !m_rConfigItem.IsOutputToLetter() || - !m_rConfigItem.IsAddressBlock() || - m_rConfigItem.IsAddressFieldsAssigned(); - bool bGreetingFieldsConfigured = !m_rConfigItem.IsGreetingLine(false) || - !m_rConfigItem.IsIndividualGreeting(false)|| - m_rConfigItem.IsGreetingFieldsAssigned(); + bool bAddressFieldsConfigured = !m_xConfigItem->IsOutputToLetter() || + !m_xConfigItem->IsAddressBlock() || + m_xConfigItem->IsAddressFieldsAssigned(); + bool bGreetingFieldsConfigured = !m_xConfigItem->IsGreetingLine(false) || + !m_xConfigItem->IsIndividualGreeting(false) || + m_xConfigItem->IsGreetingFieldsAssigned(); //#i97436# if a document has to be loaded then enable output type page only m_bDocumentLoad = false; @@ -199,7 +199,7 @@ void SwMailMergeWizard::UpdateRoadmap() // handle the Finish button bool bCanFinish = !m_bDocumentLoad && bEnableOutputTypePage && - m_rConfigItem.GetResultSet().is() && + m_xConfigItem->GetResultSet().is() && bAddressFieldsConfigured && bGreetingFieldsConfigured; enableButtons(WizardButtonFlags::FINISH, (nCurPage != MM_DOCUMENTSELECTPAGE) && bCanFinish); @@ -220,13 +220,13 @@ void SwMailMergeWizard::UpdateRoadmap() break; case MM_GREETINGSPAGE: bEnable = !m_bDocumentLoad && bEnableOutputTypePage && - m_rConfigItem.GetResultSet().is() && + m_xConfigItem->GetResultSet().is() && bAddressFieldsConfigured; break; case MM_LAYOUTPAGE: bEnable = bCanFinish && - ((m_rConfigItem.IsAddressBlock() && !m_rConfigItem.IsAddressInserted()) || - (m_rConfigItem.IsGreetingLine(false) && !m_rConfigItem.IsGreetingInserted() )); + ((m_xConfigItem->IsAddressBlock() && !m_xConfigItem->IsAddressInserted()) || + (m_xConfigItem->IsGreetingLine(false) && !m_xConfigItem->IsGreetingInserted() )); break; } enableState( nPage, bEnable ); diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 66bb81a65e80..2b66f5d1ff0b 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -237,9 +237,9 @@ SwMMResultSaveDialog::SwMMResultSaveDialog(vcl::Window* pParent) // m_pSaveAsOneRB is the default, so disable m_pFromNF and m_pToNF initially. aLink.Call(m_pSaveAsOneRB); SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); - sal_Int32 nCount = pConfigItem->GetMergedDocumentCount();; + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); + sal_Int32 nCount = xConfigItem->GetMergedDocumentCount();; m_pToNF->SetMax(nCount); m_pToNF->SetValue(nCount); @@ -381,7 +381,7 @@ void SwMMResultPrintDialog::FillInPrinterSettings() { //fill printer ListBox SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); const std::vector<OUString>& rPrinters = Printer::GetPrinterQueues(); unsigned int nCount = rPrinters.size(); bool bMergePrinterExists = false; @@ -390,13 +390,13 @@ void SwMMResultPrintDialog::FillInPrinterSettings() for( unsigned int i = 0; i < nCount; i++ ) { m_pPrinterLB->InsertEntry( rPrinters[i] ); - if( !bMergePrinterExists && rPrinters[i] == pConfigItem->GetSelectedPrinter() ) + if( !bMergePrinterExists && rPrinters[i] == xConfigItem->GetSelectedPrinter() ) bMergePrinterExists = true; } } - assert(pConfigItem); + assert(xConfigItem); if(!bMergePrinterExists) { SfxPrinter* pPrinter = pView->GetWrtShell().getIDocumentDeviceAccess().getPrinter( true ); @@ -404,23 +404,23 @@ void SwMMResultPrintDialog::FillInPrinterSettings() } else { - m_pPrinterLB->SelectEntry(pConfigItem->GetSelectedPrinter()); + m_pPrinterLB->SelectEntry(xConfigItem->GetSelectedPrinter()); } - sal_Int32 count = pConfigItem->GetMergedDocumentCount();; + sal_Int32 count = xConfigItem->GetMergedDocumentCount();; m_pToNF->SetValue(count); m_pToNF->SetMax(count); - m_pPrinterLB->SelectEntry(pConfigItem->GetSelectedPrinter()); + m_pPrinterLB->SelectEntry(xConfigItem->GetSelectedPrinter()); } void SwMMResultEmailDialog::FillInEmailSettings() { SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); - SwView* pSourceView = pConfigItem->GetSourceView(); + SwView* pSourceView = xConfigItem->GetSourceView(); OSL_ENSURE(pSourceView, "no source view exists"); if (pSourceView) { @@ -447,7 +447,7 @@ void SwMMResultEmailDialog::FillInEmailSettings() if (!m_pMailToLB->GetEntryCount()) { //select first column - uno::Reference< sdbcx::XColumnsSupplier > xColsSupp(pConfigItem->GetResultSet(), uno::UNO_QUERY); + uno::Reference< sdbcx::XColumnsSupplier > xColsSupp(xConfigItem->GetResultSet(), uno::UNO_QUERY); //get the name of the actual columns uno::Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; uno::Sequence< OUString > aFields; @@ -459,9 +459,9 @@ void SwMMResultEmailDialog::FillInEmailSettings() m_pMailToLB->SelectEntryPos(0); // then select the right one - may not be available - const ResStringArray& rHeaders = pConfigItem->GetDefaultAddressHeaders(); + const ResStringArray& rHeaders = xConfigItem->GetDefaultAddressHeaders(); OUString sEMailColumn = rHeaders.GetString( MM_PART_E_MAIL ); - Sequence< OUString> aAssignment = pConfigItem->GetColumnAssignment(pConfigItem->GetCurrentDBData()); + Sequence< OUString> aAssignment = xConfigItem->GetColumnAssignment(xConfigItem->GetCurrentDBData()); if (aAssignment.getLength() > MM_PART_E_MAIL && !aAssignment[MM_PART_E_MAIL].isEmpty()) sEMailColumn = aAssignment[MM_PART_E_MAIL]; m_pMailToLB->SelectEntry(sEMailColumn); @@ -571,12 +571,12 @@ void endDialog(Button* pButton) IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void) { SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); - if(!pConfigItem->GetTargetView()) + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); + if (!xConfigItem->GetTargetView()) SwDBManager::PerformMailMerge(pView); - SwView* pTargetView = pConfigItem->GetTargetView(); + SwView* pTargetView = xConfigItem->GetTargetView(); assert(pTargetView); if(m_pSaveAsOneRB->IsChecked()) @@ -617,7 +617,7 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void { sal_uInt32 nBegin = 0; sal_uInt32 nEnd = 0; - sal_uInt32 documentCount = pConfigItem->GetMergedDocumentCount(); + sal_uInt32 documentCount = xConfigItem->GetMergedDocumentCount(); if(m_pSaveIndividualRB->IsChecked()) { @@ -670,7 +670,7 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void ErrorHandler::HandleError( nErrorCode ); } - SwView* pSourceView = pConfigItem->GetSourceView(); + SwView* pSourceView = xConfigItem->GetSourceView(); ScopedVclPtrInstance< PrintMonitor > aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE); aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22)); aSaveMonitor->SetCancelHdl(LINK(this, SwMMResultSaveDialog, SaveCancelHdl_Impl)); @@ -710,7 +710,7 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void pTempView->GetDocShell()->GetDoc()->ReplaceDocumentProperties( *pTargetView->GetDocShell()->GetDoc(), true ); pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(), - documentStartPageNumber(pConfigItem, nDoc), documentEndPageNumber(pConfigItem, nDoc)); + documentStartPageNumber(xConfigItem.get(), nDoc), documentEndPageNumber(xConfigItem.get(), nDoc)); pTargetView->GetWrtShell().EndAction(); //then save it OUString sOutPath = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); @@ -763,8 +763,8 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, void) { SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); if (rBox.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) { const QueueInfo* pInfo = Printer::GetQueueInfo( rBox.GetSelectEntry(), false ); @@ -793,23 +793,23 @@ IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, vo else m_pPrinterSettingsPB->Disable(); - pConfigItem->SetSelectedPrinter(rBox.GetSelectEntry()); + xConfigItem->SetSelectedPrinter(rBox.GetSelectEntry()); } IMPL_LINK_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, pButton, void) { SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); - if(!pConfigItem->GetTargetView()) + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); + if(!xConfigItem->GetTargetView()) SwDBManager::PerformMailMerge(pView); - SwView* pTargetView = pConfigItem->GetTargetView(); + SwView* pTargetView = xConfigItem->GetTargetView(); assert(pTargetView); sal_uInt32 nBegin = 0; sal_uInt32 nEnd = 0; - sal_uInt32 documentCount = pConfigItem->GetMergedDocumentCount(); + sal_uInt32 documentCount = xConfigItem->GetMergedDocumentCount(); if(m_pPrintAllRB->IsChecked()) { @@ -823,13 +823,13 @@ IMPL_LINK_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, pButton, void) if(nEnd > documentCount) nEnd = documentCount; } - pConfigItem->SetPrintRange((sal_uInt16)nBegin, (sal_uInt16)nEnd); + xConfigItem->SetPrintRange((sal_uInt16)nBegin, (sal_uInt16)nEnd); - OUString sPages(OUString::number(documentStartPageNumber(pConfigItem, nBegin))); + OUString sPages(OUString::number(documentStartPageNumber(xConfigItem.get(), nBegin))); sPages += " - "; - sPages += OUString::number(documentEndPageNumber(pConfigItem, nEnd - 1)); + sPages += OUString::number(documentEndPageNumber(xConfigItem.get(), nEnd - 1)); - pTargetView->SetMailMergeConfigItem(pConfigItem, 0, false); + pTargetView->SetMailMergeConfigItem(xConfigItem, 0); if(m_pTempPrinter) { SfxPrinter *const pDocumentPrinter = pTargetView->GetWrtShell() @@ -902,17 +902,17 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendAsHdl_Impl, Button*, pButton, void) IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) { SwView* pView = ::GetActiveView(); - SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); - assert(pConfigItem); - if(!pConfigItem->GetTargetView()) + std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + assert(xConfigItem); + if (!xConfigItem->GetTargetView()) SwDBManager::PerformMailMerge(pView); //get the composed document - SwView* pTargetView = pConfigItem->GetTargetView(); + SwView* pTargetView = xConfigItem->GetTargetView(); assert(pTargetView); - if(pConfigItem->GetMailServer().isEmpty() || - !SwMailMergeHelper::CheckMailAddress(pConfigItem->GetMailAddress()) ) + if (xConfigItem->GetMailServer().isEmpty() || + !SwMailMergeHelper::CheckMailAddress(xConfigItem->GetMailAddress()) ) { ScopedVclPtrInstance< QueryBox > aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail); sal_uInt16 nRet = aQuery->Execute(); @@ -932,14 +932,14 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, if(m_pSendAllRB->IsChecked()) { nBegin = 0; - nEnd = pConfigItem->GetMergedDocumentCount(); + nEnd = xConfigItem->GetMergedDocumentCount(); } else { nBegin = static_cast< sal_Int32 >(m_pFromNF->GetValue() - 1); nEnd = static_cast< sal_Int32 >(m_pToNF->GetValue()); - if(nEnd > pConfigItem->GetMergedDocumentCount()) - nEnd = pConfigItem->GetMergedDocumentCount(); + if(nEnd > xConfigItem->GetMergedDocumentCount()) + nEnd = xConfigItem->GetMergedDocumentCount(); } bool bAsBody = false; rtl_TextEncoding eEncoding = ::osl_getThreadTextEncoding(); @@ -1047,7 +1047,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName() ); OUString sEMailColumn = m_pMailToLB->GetSelectEntry(); OSL_ENSURE( !sEMailColumn.isEmpty(), "No email column selected"); - Reference< sdbcx::XColumnsSupplier > xColsSupp( pConfigItem->GetResultSet(), UNO_QUERY); + Reference< sdbcx::XColumnsSupplier > xColsSupp( xConfigItem->GetResultSet(), UNO_QUERY); Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; if(sEMailColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn)) { @@ -1086,7 +1086,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, xStore->storeToURL( sTargetTempURL, aValues ); //create the send dialog - VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create(pButton, *pConfigItem); + VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create(pButton, *xConfigItem); pDlg->SetDocumentCount( nEnd ); pDlg->ShowDialog(); //help to force painting the dialog @@ -1096,7 +1096,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, Application::Reschedule(); for(sal_uInt32 nDoc = nBegin; nDoc < nEnd; ++nDoc) { - SwDocMergeInfo& rInfo = pConfigItem->GetDocumentMergeInfo(nDoc); + SwDocMergeInfo& rInfo = xConfigItem->GetDocumentMergeInfo(nDoc); //now extract a document from the target document // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here @@ -1117,7 +1117,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, pTempView->GetDocShell()->GetDoc()->ReplaceDefaults( *pTargetView->GetDocShell()->GetDoc()); pTempView->GetDocShell()->GetDoc()->ReplaceDocumentProperties( *pTargetView->GetDocShell()->GetDoc(), true ); pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(), - documentStartPageNumber(pConfigItem, nDoc), documentEndPageNumber(pConfigItem, nDoc)); + documentStartPageNumber(xConfigItem.get(), nDoc), documentEndPageNumber(xConfigItem.get(), nDoc)); pTargetView->GetWrtShell().EndAction(); //then save it @@ -1143,7 +1143,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, } xTempDocShell->DoClose(); - sal_Int32 nTarget = pConfigItem->MoveResultSet(rInfo.nDBRow); + sal_Int32 nTarget = xConfigItem->MoveResultSet(rInfo.nDBRow); OSL_ENSURE( nTarget == rInfo.nDBRow, "row of current document could not be selected"); (void)nTarget; OSL_ENSURE( !sEMailColumn.isEmpty(), "No email column selected"); @@ -1192,30 +1192,30 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, aDesc.sAttachmentName = sAttachment; aDesc.sMimeType = sMimeType; - if(pConfigItem->IsGreetingLine(true)) + if (xConfigItem->IsGreetingLine(true)) { - OUString sNameColumn = pConfigItem->GetAssignedColumn(MM_PART_LASTNAME); + OUString sNameColumn = xConfigItem->GetAssignedColumn(MM_PART_LASTNAME); OUString sName = lcl_GetColumnValueOf(sNameColumn, xColAccess); OUString sGreeting; - if(!sName.isEmpty() && pConfigItem->IsIndividualGreeting(true)) + if(!sName.isEmpty() && xConfigItem->IsIndividualGreeting(true)) { - OUString sGenderColumn = pConfigItem->GetAssignedColumn(MM_PART_GENDER); - const OUString& sFemaleValue = pConfigItem->GetFemaleGenderValue(); + OUString sGenderColumn = xConfigItem->GetAssignedColumn(MM_PART_GENDER); + const OUString& sFemaleValue = xConfigItem->GetFemaleGenderValue(); OUString sGenderValue = lcl_GetColumnValueOf(sGenderColumn, xColAccess); SwMailMergeConfigItem::Gender eGenderType = sGenderValue == sFemaleValue ? SwMailMergeConfigItem::FEMALE : SwMailMergeConfigItem::MALE; sGreeting = SwAddressPreview::FillData( - pConfigItem->GetGreetings(eGenderType) - [pConfigItem->GetCurrentGreeting(eGenderType)], - *pConfigItem); + xConfigItem->GetGreetings(eGenderType) + [xConfigItem->GetCurrentGreeting(eGenderType)], + *xConfigItem); } else { sGreeting = - pConfigItem->GetGreetings(SwMailMergeConfigItem::NEUTRAL) - [pConfigItem->GetCurrentGreeting(SwMailMergeConfigItem::NEUTRAL)]; + xConfigItem->GetGreetings(SwMailMergeConfigItem::NEUTRAL) + [xConfigItem->GetCurrentGreeting(SwMailMergeConfigItem::NEUTRAL)]; } sGreeting += "\n"; |