diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/dbui/mailmergehelper.cxx | 123 | ||||
-rw-r--r-- | sw/source/uibase/inc/mailmergehelper.hxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/inc/swuiidxmrk.hxx | 1 |
4 files changed, 0 insertions, 140 deletions
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index b986228698fa..5da40144df6d 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1793,11 +1793,6 @@ void AuthorMarkPane::InitControls() m_xTitleFI->set_label(pEntry->GetAuthorField(AUTH_FIELD_TITLE)); } -void AuthorMarkPane::Activate() -{ - m_xActionBT->set_sensitive(!pSh->HasReadonlySel()); -} - namespace { const char* STR_AUTH_FIELD_ARY[] = diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index f249a8c04e2f..11f436cb9d63 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -259,21 +259,6 @@ void SwAddressPreview::Clear() UpdateScrollBar(); } -void SwAddressPreview::ReplaceSelectedAddress(const OUString& rNew) -{ - pImpl->aAddresses[pImpl->nSelectedAddress] = rNew; - Invalidate(); -} - -void SwAddressPreview::RemoveSelectedAddress() -{ - pImpl->aAddresses.erase(pImpl->aAddresses.begin() + pImpl->nSelectedAddress); - if(pImpl->nSelectedAddress) - --pImpl->nSelectedAddress; - UpdateScrollBar(); - Invalidate(); -} - void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns) { pImpl->nRows = nRows; @@ -281,11 +266,6 @@ void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns) UpdateScrollBar(); } -void SwAddressPreview::EnableScrollBar() -{ - pImpl->bEnableScrollBar = true; -} - void SwAddressPreview::UpdateScrollBar() { if(pImpl->nColumns) @@ -592,13 +572,6 @@ void AddressPreview::SelectAddress(sal_uInt16 nSelect) m_xVScrollBar->vadjustment_set_value(nSelectRow); } -void AddressPreview::Clear() -{ - pImpl->aAddresses.clear(); - pImpl->nSelectedAddress = 0; - UpdateScrollBar(); -} - void AddressPreview::ReplaceSelectedAddress(const OUString& rNew) { pImpl->aAddresses[pImpl->nSelectedAddress] = rNew; @@ -779,102 +752,6 @@ void AddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const OUS while (nPos >= 0); } -OUString AddressPreview::FillData( - const OUString& rAddress, - SwMailMergeConfigItem const & rConfigItem, - const Sequence< OUString>* pAssignments) -{ - //find the column names in the address string (with name assignment!) and - //exchange the placeholder (like <Firstname>) with the database content - //unassigned columns are expanded to <not assigned> - Reference< XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), UNO_QUERY); - Reference <XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; - Sequence< OUString> aAssignment = pAssignments ? - *pAssignments : - rConfigItem.GetColumnAssignment( - rConfigItem.GetCurrentDBData() ); - const OUString* pAssignment = aAssignment.getConstArray(); - const std::vector<std::pair<OUString, int>>& rDefHeaders = rConfigItem.GetDefaultAddressHeaders(); - OUString sNotAssigned = "<" + SwResId(STR_NOTASSIGNED) + ">"; - - bool bIncludeCountry = rConfigItem.IsIncludeCountry(); - const OUString rExcludeCountry = rConfigItem.GetExcludeCountry(); - bool bSpecialReplacementForCountry = (!bIncludeCountry || !rExcludeCountry.isEmpty()); - OUString sCountryColumn; - if( bSpecialReplacementForCountry ) - { - sCountryColumn = rDefHeaders[MM_PART_COUNTRY].first; - Sequence< OUString> aSpecialAssignment = - rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() ); - if(aSpecialAssignment.getLength() > MM_PART_COUNTRY && aSpecialAssignment[MM_PART_COUNTRY].getLength()) - sCountryColumn = aSpecialAssignment[MM_PART_COUNTRY]; - } - - SwAddressIterator aIter(rAddress); - OUStringBuffer sAddress; - while(aIter.HasMore()) - { - SwMergeAddressItem aItem = aIter.Next(); - if(aItem.bIsColumn) - { - //get the default column name - - //find the appropriate assignment - OUString sConvertedColumn = aItem.sText; - for(sal_uInt32 nColumn = 0; - nColumn < rDefHeaders.size() && nColumn < sal_uInt32(aAssignment.getLength()); - ++nColumn) - { - if (rDefHeaders[nColumn].first == aItem.sText && - !pAssignment[nColumn].isEmpty()) - { - sConvertedColumn = pAssignment[nColumn]; - break; - } - } - if(!sConvertedColumn.isEmpty() && - xColAccess.is() && - xColAccess->hasByName(sConvertedColumn)) - { - //get the content and exchange it in the address string - Any aCol = xColAccess->getByName(sConvertedColumn); - Reference< XColumn > xColumn; - aCol >>= xColumn; - if(xColumn.is()) - { - try - { - OUString sReplace = xColumn->getString(); - - if( bSpecialReplacementForCountry && sCountryColumn == sConvertedColumn ) - { - if( !rExcludeCountry.isEmpty() && sReplace != rExcludeCountry ) - aItem.sText = sReplace; - else - aItem.sText.clear(); - } - else - { - aItem.sText = sReplace; - } - } - catch (const sdbc::SQLException&) - { - OSL_FAIL("SQLException caught"); - } - } - } - else - { - aItem.sText = sNotAssigned; - } - - } - sAddress.append(aItem.sText); - } - return sAddress.makeStringAndClear(); -} - SwMergeAddressItem SwAddressIterator::Next() { //currently the string may either start with a '<' then it's a column diff --git a/sw/source/uibase/inc/mailmergehelper.hxx b/sw/source/uibase/inc/mailmergehelper.hxx index 575c4f679bc2..e2c4ad6b6093 100644 --- a/sw/source/uibase/inc/mailmergehelper.hxx +++ b/sw/source/uibase/inc/mailmergehelper.hxx @@ -99,12 +99,9 @@ public: // returns the selected address sal_uInt16 GetSelectedAddress() const; void SelectAddress(sal_uInt16 nSelect); - void ReplaceSelectedAddress(const OUString&); - void RemoveSelectedAddress(); // set the number of rows and columns of addresses void SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns); - void EnableScrollBar(); // fill the actual data into a string (address block or greeting) static OUString FillData(const OUString& rAddress, SwMailMergeConfigItem const & rConfigItem, @@ -143,8 +140,6 @@ public: void AddAddress(const OUString& rAddress); // for preview mode - replaces the currently used address by the given one void SetAddress(const OUString& rAddress); - // removes all addresses - void Clear(); // returns the selected address sal_uInt16 GetSelectedAddress() const; @@ -155,12 +150,6 @@ public: // set the number of rows and columns of addresses void SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns); void EnableScrollBar(); - - // fill the actual data into a string (address block or greeting) - static OUString FillData(const OUString& rAddress, SwMailMergeConfigItem const & rConfigItem, - const css::uno::Sequence<OUString>* pAssignments = nullptr); - - void SetSelectHdl (const Link<LinkParamNone*,void>& rLink) { m_aSelectHdl = rLink; } }; diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx index 3c8f63754998..f04c5eefe399 100644 --- a/sw/source/uibase/inc/swuiidxmrk.hxx +++ b/sw/source/uibase/inc/swuiidxmrk.hxx @@ -271,7 +271,6 @@ class AuthorMarkPane DECL_LINK(EditModifyHdl, weld::Entry&, void); void InitControls(); - void Activate(); public: AuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew); |