LibreOffice Module sw (master) 1
|
#include <dbmgr.hxx>
Classes | |
class | ConnectionDisposedListener_Impl |
class | MailDispatcherListener_Impl |
struct | SwDBManager_Impl |
Public Member Functions | |
SwDBManager (SwDoc *pDoc) | |
~SwDBManager () | |
const SwXMailMerge * | GetMailMergeEvtSrc () const |
MailMergeEvent source. More... | |
void | SetMailMergeEvtSrc (const SwXMailMerge *pSrc) |
bool | IsMergeSilent () const |
void | SetMergeSilent (bool bVal) |
bool | Merge (const SwMergeDescriptor &rMergeDesc) |
Merging of data records into fields. More... | |
void | MergeCancel () |
bool | IsMergeOk () const |
bool | IsMergeError () const |
bool | IsInitDBFields () const |
Initialize data fields that lack name of database. More... | |
void | SetInitDBFields (bool b) |
bool | GetTableNames (weld::ComboBox &rBox, const OUString &rDBName) |
Fill listbox with all table names of a database. More... | |
void | GetColumnNames (weld::ComboBox &rBox, const OUString &rDBName, const OUString &rTableName) |
Fill listbox with all column names of a database table. More... | |
sal_uLong | GetColumnFormat (const OUString &rDBName, const OUString &rTableName, const OUString &rColNm, SvNumberFormatter *pNFormatr, LanguageType nLanguage) |
sal_Int32 | GetColumnType (const OUString &rDBName, const OUString &rTableName, const OUString &rColNm) |
bool | IsInMerge () const |
void | ExecuteFormLetter (SwWrtShell &rSh, const css::uno::Sequence< css::beans::PropertyValue > &rProperties) |
bool | IsDataSourceOpen (const OUString &rDataSource, const OUString &rTableOrQuery, bool bMergeShell) |
check if a data source is open More... | |
bool | OpenDataSource (const OUString &rDataSource, const OUString &rTableOrQuery) |
open the source while fields are updated - for the calculator only! More... | |
sal_uInt32 | GetSelectedRecordId (const OUString &rDataSource, const OUString &rTableOrQuery, sal_Int32 nCommandType=-1) |
bool | GetColumnCnt (const OUString &rSourceName, const OUString &rTableName, const OUString &rColumnName, sal_uInt32 nAbsRecordId, LanguageType nLanguage, OUString &rResult, double *pNumber) |
css::uno::Reference< css::sdbc::XConnection > const & | RegisterConnection (OUString const &rSource) |
create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDBTreeList More... | |
void | CreateDSData (const SwDBData &rData) |
const SwDSParams_t & | GetDSParamArray () const |
void | CloseAll (bool bIncludingMerge=true) |
close all data sources - after fields were updated More... | |
bool | GetMergeColumnCnt (const OUString &rColumnName, LanguageType nLanguage, OUString &rResult, double *pNumber) |
bool | FillCalcWithMergeData (SvNumberFormatter *pDocFormatter, LanguageType nLanguage, SwCalc &aCalc) |
void | ToNextRecord (const OUString &rDataSource, const OUString &rTableOrQuery) |
sal_uInt32 | GetSelectedRecordId () |
bool | ToRecordId (sal_Int32 nSet) |
void | LoadAndRegisterEmbeddedDataSource (const SwDBData &rData, const SwDocShell &rDocShell) |
Load the embedded data source of the document and also register it. More... | |
void | setEmbeddedName (const OUString &rEmbeddedName, SwDocShell &rDocShell) |
const OUString & | getEmbeddedName () const |
SwDoc * | getDoc () const |
void | releaseRevokeListener () |
Stop reacting to removed database registrations. More... | |
void | RevokeLastRegistrations () |
Revoke not committed registrations in case of mail merge cancel. More... | |
void | CommitLastRegistrations () |
Accept not committed registrations. More... | |
void | RevokeNotUsedConnections () |
Remove not used connections. More... | |
Static Public Member Functions | |
static std::shared_ptr< SwMailMergeConfigItem > | PerformMailMerge (SwView const *pView) |
static void | GetColumnNames (weld::ComboBox &rBox, css::uno::Reference< css::sdbc::XConnection > const &xConnection, const OUString &rTableName) |
static sal_uLong | GetColumnFormat (css::uno::Reference< css::sdbc::XDataSource > const &xSource, css::uno::Reference< css::sdbc::XConnection > const &xConnection, css::uno::Reference< css::beans::XPropertySet > const &xColumn, SvNumberFormatter *pNFormatr, LanguageType nLanguage) |
static void | InsertText (SwWrtShell &rSh, const css::uno::Sequence< css::beans::PropertyValue > &rProperties) |
static const SwDBData & | GetAddressDBName () |
static OUString | GetDBField (css::uno::Reference< css::beans::XPropertySet > const &xColumnProp, const SwDBFormatData &rDBFormatData, double *pNumber=nullptr) |
static css::uno::Reference< css::sdbc::XConnection > | GetConnection (const OUString &rDataSource, css::uno::Reference< css::sdbc::XDataSource > &rxSource, const SwView *pView) |
static css::uno::Reference< css::sdbcx::XColumnsSupplier > | GetColumnSupplier (css::uno::Reference< css::sdbc::XConnection > const &xConnection, const OUString &rTableOrQuery, SwDBSelect eTableOrQuery=SwDBSelect::UNKNOWN) |
static css::uno::Sequence< OUString > | GetExistingDatabaseNames () |
static OUString | LoadAndRegisterDataSource (weld::Window *pParent, SwDocShell *pDocShell=nullptr) |
Loads a data source from file and registers it. More... | |
static OUString | LoadAndRegisterDataSource (std::u16string_view rURI, const OUString *pDestDir) |
Loads a data source from file and registers it. More... | |
static void | RevokeDataSource (const OUString &rName) |
Unregister a data source. More... | |
static css::uno::Reference< css::sdbc::XDataSource > | getDataSourceAsParent (const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const OUString &_sDataSourceName) |
try to get the data source from the given connection through the XChild interface. More... | |
static css::uno::Reference< css::sdbc::XResultSet > | createCursor (const OUString &_sDataSourceName, const OUString &_sCommand, sal_Int32 _nCommandType, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const SwView *pView) |
creates a RowSet, which must be disposed after use. More... | |
static void | StoreEmbeddedDataSource (const css::uno::Reference< css::frame::XStorable > &xStorable, const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rStreamRelPath, const OUString &rOwnURL, bool bCopyTo=false) |
Private Types | |
enum class | MergeStatus { Ok = 0 , Cancel , Error } |
Private Member Functions | |
void | SetAsUsed (const OUString &rName) |
Set connection as used. More... | |
SAL_DLLPRIVATE SwDSParam * | FindDSData (const SwDBData &rData, bool bCreate) |
SAL_DLLPRIVATE SwDSParam * | FindDSConnection (const OUString &rSource, bool bCreate) |
SAL_DLLPRIVATE void | ImportFromConnection (SwWrtShell *pSh) |
Insert data record as text into document. More... | |
SAL_DLLPRIVATE void | ImportDBEntry (SwWrtShell *pSh) |
Insert a single data record as text into document. More... | |
SAL_DLLPRIVATE bool | MergeMailFiles (SwWrtShell *pSh, const SwMergeDescriptor &rMergeDescriptor) |
Run the mail merge for defined modes, except DBMGR_MERGE. More... | |
SAL_DLLPRIVATE bool | ToNextMergeRecord () |
SAL_DLLPRIVATE bool | IsValidMergeRecord () const |
SAL_DLLPRIVATE void | ImplDestroy () |
SwDBManager (SwDBManager const &)=delete | |
SwDBManager & | operator= (SwDBManager const &)=delete |
Private Attributes | |
class SAL_DLLPRIVATE | ConnectionDisposedListener_Impl |
MergeStatus | m_aMergeStatus |
current / last merge status More... | |
bool | m_bInitDBFields: 1 |
bool | m_bInMerge: 1 |
merge process active More... | |
bool | m_bMergeSilent: 1 |
suppress display of dialogs/boxes (used when called over API) More... | |
SwDSParams_t | m_DataSourceParams |
std::unique_ptr< SwDBManager_Impl > | m_pImpl |
const SwXMailMerge * | m_pMergeEvtSrc |
!= 0 if mail merge events are to be send More... | |
OUString | m_sEmbeddedName |
Name of the embedded database that's included in the current document. More... | |
std::vector< OUString > | m_aNotUsedConnections |
Not used connections. More... | |
SwDoc * | m_pDoc |
The document that owns this manager. More... | |
Static Private Attributes | |
static std::vector< std::pair< SwDocShell *, OUString > > | s_aUncommittedRegistrations |
Store last registrations to revoke or commit. More... | |
|
strongprivate |
|
privatedelete |
SwDBManager::~SwDBManager | ( | ) |
Definition at line 749 of file dbmgr.cxx.
References ImplDestroy(), and suppress_fun_call_w_exception.
void SwDBManager::CloseAll | ( | bool | bIncludingMerge = true | ) |
close all data sources - after fields were updated
Definition at line 2423 of file dbmgr.cxx.
References m_bInMerge, m_DataSourceParams, and m_pImpl.
Referenced by sw::DocumentFieldsManager::FieldsToCalc(), SwEditShell::UpdateExpFields(), sw::DocumentFieldsManager::UpdateExpFieldsImpl(), and sw::DocumentFieldsManager::UpdateFields().
void SwDBManager::CommitLastRegistrations | ( | ) |
Accept not committed registrations.
Definition at line 3267 of file dbmgr.cxx.
References SwDoc::GetDocShell(), m_aNotUsedConnections, m_pDoc, and s_aUncommittedRegistrations.
Referenced by SwDoc::ChgDBData(), and SwFieldDBPage::FillItemSet().
|
static |
creates a RowSet, which must be disposed after use.
_sDataSourceName | The data source name |
_sCommand | The command. |
_nCommandType | The type of the command. |
_xConnection | The active connection which may be <NULL>. |
Definition at line 3110 of file dbmgr.cxx.
References comphelper::getComponentContext(), SfxViewShell::GetFrameWeld(), weld::Window::GetXWindow(), and TOOLS_WARN_EXCEPTION.
Referenced by SwInsertDBColAutoPilot::DataToDoc(), and SwTextShell::ExecDB().
|
inline |
Definition at line 366 of file dbmgr.hxx.
Referenced by SwDoc::AddUsedDBToList().
void SwDBManager::ExecuteFormLetter | ( | SwWrtShell & | rSh, |
const css::uno::Sequence< css::beans::PropertyValue > & | rProperties | ||
) |
Definition at line 2927 of file dbmgr.cxx.
References SwMergeDescriptor::bCreateSingleFile, SwMergeDescriptor::bPrefixIsFilename, svx::Command, svx::CommandType, svx::Connection, SwAbstractDialogFactory::Create(), SwAbstractDialogFactory::CreateMailMergeDlg(), svx::Cursor, FindDSConnection(), tools::SvRef< typename T >::get(), svx::ODataAccessDescriptor::getDataSource(), SfxViewFrame::GetFrameWeld(), SfxViewFrame::GetObjectShell(), SwWrtShell::GetView(), SfxViewShell::GetViewFrame(), svx::ODataAccessDescriptor::has(), m_DataSourceParams, m_pImpl, Merge(), RegisterConnection(), RET_OK, SwMergeDescriptor::sDBcolumn, SwMergeDescriptor::sDBPasswordColumn, svx::Selection, SwMergeDescriptor::sPrefix, SwMergeDescriptor::sSaveToFilter, STR_SW_EVENT_MAIL_MERGE, and STR_SW_EVENT_MAIL_MERGE_END.
Referenced by SwView::Execute(), and SwView::GenerateFormLetter().
bool SwDBManager::FillCalcWithMergeData | ( | SvNumberFormatter * | pDocFormatter, |
LanguageType | nLanguage, | ||
SwCalc & | aCalc | ||
) |
Definition at line 2126 of file dbmgr.cxx.
References aColNames, DatabaseSetNumber, SwDBField::FormatValue(), GetAppCharClass(), GetColumnFormat(), GetSelectedRecordId(), SwFieldType::GetTypeStr(), IsValidMergeRecord(), lcl_GetColumnCnt(), m_pImpl, SbxValue::PutDouble(), SbxValue::PutString(), SAL_INFO, SwSbxValue::SetDBvalue(), and SwCalc::VarChange().
Referenced by sw::DocumentFieldsManager::UpdateExpFieldsImpl().
|
private |
Definition at line 2492 of file dbmgr.cxx.
References SL::aData, m_DataSourceParams, m_pImpl, SetAsUsed(), and SwDSParam::xConnection.
Referenced by ExecuteFormLetter(), GetTableNames(), OpenDataSource(), and RegisterConnection().
Definition at line 2444 of file dbmgr.cxx.
References m_DataSourceParams, m_pImpl, SwDBData::nCommandType, nPos, SwDBData::sCommand, SwDBData::sDataSource, and SwDSParam::xConnection.
Referenced by GetColumnCnt(), GetColumnFormat(), GetColumnNames(), GetColumnType(), GetSelectedRecordId(), IsDataSourceOpen(), Merge(), OpenDataSource(), and ToNextRecord().
|
static |
bool SwDBManager::GetColumnCnt | ( | const OUString & | rSourceName, |
const OUString & | rTableName, | ||
const OUString & | rColumnName, | ||
sal_uInt32 | nAbsRecordId, | ||
LanguageType | nLanguage, | ||
OUString & | rResult, | ||
double * | pNumber | ||
) |
Definition at line 2046 of file dbmgr.cxx.
References SL::aData, SwDSParam::aSelection, FindDSData(), SwDSParam::HasValidRecord(), lcl_GetColumnCnt(), lcl_MoveAbsolute(), m_pImpl, and SwDSParam::xResultSet.
Referenced by SwCalc::VarLook().
sal_uLong SwDBManager::GetColumnFormat | ( | const OUString & | rDBName, |
const OUString & | rTableName, | ||
const OUString & | rColNm, | ||
SvNumberFormatter * | pNFormatr, | ||
LanguageType | nLanguage | ||
) |
Definition at line 1673 of file dbmgr.cxx.
References SL::aData, FindDSData(), GetColumnFormat(), GetColumnSupplier(), getDataSourceAsParent(), SvNumberFormatter::GetFormatIndex(), LANGUAGE_SYSTEM, m_pImpl, NF_NUMBER_STANDARD, RegisterConnection(), TOOLS_WARN_EXCEPTION, xColumn, SwDSParam::xConnection, and SwDSParam::xResultSet.
|
static |
Referenced by SwDBField::Evaluate(), FillCalcWithMergeData(), GetColumnFormat(), and SwFieldMgr::InsertField().
void SwDBManager::GetColumnNames | ( | weld::ComboBox & | rBox, |
const OUString & | rDBName, | ||
const OUString & | rTableName | ||
) |
Fill listbox with all column names of a database table.
Definition at line 674 of file dbmgr.cxx.
References SL::aData, FindDSData(), GetColumnNames(), RegisterConnection(), and SwDSParam::xConnection.
Referenced by GetColumnNames(), SwLabPage::InitDatabaseBox(), SwEnvPage::InitDatabaseBox(), and SwMailMergeDlg::SwMailMergeDlg().
|
static |
|
static |
Definition at line 1903 of file dbmgr.cxx.
References getDataSourceAsParent(), QUERY, TABLE, TOOLS_WARN_EXCEPTION, and UNKNOWN.
Referenced by SwAddressListDialog::DetectTablesAndQueries(), GetColumnFormat(), SwMailMergeConfigItem::GetColumnsSupplier(), GetColumnType(), and IMPL_LINK().
sal_Int32 SwDBManager::GetColumnType | ( | const OUString & | rDBName, |
const OUString & | rTableName, | ||
const OUString & | rColNm | ||
) |
Definition at line 1836 of file dbmgr.cxx.
References SL::aData, FindDSData(), GetColumnSupplier(), RegisterConnection(), SwDSParam::xConnection, and SwDSParam::xResultSet.
Referenced by SwDBField::Evaluate().
|
static |
Definition at line 1880 of file dbmgr.cxx.
References dbtools::getDataSource(), SfxViewShell::GetFrameWeld(), and weld::Window::GetXWindow().
Referenced by SwTextShell::ExecDB(), SwMailMergeConfigItem::GetResultSet(), IMPL_LINK(), and RegisterConnection().
|
static |
try to get the data source from the given connection through the XChild interface.
If this is not possible, the data source will be created through its name.
_xConnection | The connection which should support the XChild interface. (not a must) |
_sDataSourceName | The data source name will be used to create the data source when the connection can not be used for it. |
Definition at line 3092 of file dbmgr.cxx.
References dbtools::getDataSource(), and TOOLS_WARN_EXCEPTION.
Referenced by GetColumnFormat(), GetColumnSupplier(), IMPL_LINK(), SwDBTreeList::InitTreeList(), lcl_GetColumnCnt(), lcl_InitNumberFormatter(), and Merge().
|
static |
Definition at line 1951 of file dbmgr.cxx.
References SwDBFormatData::aLocale, SwDBFormatData::aNullDate, dbtools::DBTypeConversion::getFormattedValue(), TOOLS_WARN_EXCEPTION, xColumn, and SwDBFormatData::xFormatter.
Referenced by SwInsertDBColAutoPilot::DataToDoc(), ImportDBEntry(), lcl_GetColumnCnt(), and MergeMailFiles().
|
inline |
Definition at line 368 of file dbmgr.hxx.
Referenced by SwDoc::GetAllDBNames().
const OUString & SwDBManager::getEmbeddedName | ( | ) | const |
Definition at line 3171 of file dbmgr.cxx.
References m_sEmbeddedName.
Referenced by SwXDocumentSettings::_getSingleValue(), and SwDocShell::SaveAs().
|
static |
Definition at line 2535 of file dbmgr.cxx.
Referenced by SwLabPage::InitDatabaseBox(), and SwEnvPage::InitDatabaseBox().
|
inline |
MailMergeEvent source.
Definition at line 299 of file dbmgr.hxx.
Referenced by SwXMailMerge::execute(), and MergeMailFiles().
bool SwDBManager::GetMergeColumnCnt | ( | const OUString & | rColumnName, |
LanguageType | nLanguage, | ||
OUString & | rResult, | ||
double * | pNumber | ||
) |
Definition at line 2107 of file dbmgr.cxx.
References IsValidMergeRecord(), lcl_GetColumnCnt(), and m_pImpl.
Referenced by SwDBField::Evaluate(), and SwHiddenTextField::Evaluate().
sal_uInt32 SwDBManager::GetSelectedRecordId | ( | ) |
Definition at line 2279 of file dbmgr.cxx.
References m_pImpl.
Referenced by FillCalcWithMergeData(), and GetSelectedRecordId().
sal_uInt32 SwDBManager::GetSelectedRecordId | ( | const OUString & | rDataSource, |
const OUString & | rTableOrQuery, | ||
sal_Int32 | nCommandType = -1 |
||
) |
Definition at line 2378 of file dbmgr.cxx.
References SL::aData, SwDSParam::aSelection, FindDSData(), GetSelectedRecordId(), m_pImpl, SwDSParam::nSelectionIndex, and SwDSParam::xResultSet.
Referenced by SwDBSetNumberField::Evaluate(), sw::DocumentFieldsManager::UpdateDBNumFields(), sw::DocumentFieldsManager::UpdateExpFieldsImpl(), and SwCalc::VarLook().
bool SwDBManager::GetTableNames | ( | weld::ComboBox & | rBox, |
const OUString & | rDBName | ||
) |
Fill listbox with all table names of a database.
Definition at line 634 of file dbmgr.cxx.
References weld::ComboBox::append(), weld::ComboBox::clear(), FindDSConnection(), weld::ComboBox::get_active_text(), RegisterConnection(), weld::ComboBox::set_active_text(), and SwDSParam::xConnection.
Referenced by SwEnvPage::InitDatabaseBox().
|
private |
Definition at line 721 of file dbmgr.cxx.
References m_DataSourceParams, and RevokeLastRegistrations().
Referenced by ~SwDBManager().
|
private |
Insert a single data record as text into document.
Definition at line 609 of file dbmgr.cxx.
References aColNames, GetDBField(), i, m_pImpl, and nLength.
Referenced by ImportFromConnection().
|
private |
Insert data record as text into document.
Definition at line 578 of file dbmgr.cxx.
References SwWrtShell::DelRight(), SwEditShell::DoesGroupUndo(), SwEditShell::DoGroupUndo(), SwEditShell::EndAllAction(), SwEditShell::EndUndo(), SwView::GetDocShell(), SwWrtShell::GetView(), SwWrtShell::HasSelection(), i, ImportDBEntry(), m_pImpl, SwEditShell::StartAllAction(), SwEditShell::StartUndo(), and ToNextMergeRecord().
Referenced by Merge().
|
static |
Definition at line 3030 of file dbmgr.cxx.
References SwAbstractDialogFactory::Create(), SwAbstractDialogFactory::CreateSwInsertDBColAutoPilot(), dbtools::getDataSource(), SwWrtShell::GetView(), SwDBData::nCommandType, RET_OK, SwDBData::sCommand, SwDBData::sDataSource, and TOOLS_WARN_EXCEPTION.
Referenced by SwXDispatch::dispatch().
bool SwDBManager::IsDataSourceOpen | ( | const OUString & | rDataSource, |
const OUString & | rTableOrQuery, | ||
bool | bMergeShell | ||
) |
check if a data source is open
Definition at line 2023 of file dbmgr.cxx.
References SL::aData, FindDSData(), m_pImpl, and SwDSParam::xResultSet.
Referenced by SwDBField::Evaluate(), SwDBNextSetField::Evaluate(), SwDBNumSetField::Evaluate(), SwDBSetNumberField::Evaluate(), SwHiddenTextField::Evaluate(), and sw::DocumentFieldsManager::UpdateExpFieldsImpl().
|
inline |
|
inline |
Definition at line 343 of file dbmgr.hxx.
Referenced by SwDBNumSetField::Evaluate(), SwDBSetNumberField::Evaluate(), SwHiddenTextField::Evaluate(), and SwCalc::VarLook().
|
inline |
Definition at line 310 of file dbmgr.hxx.
Referenced by MergeMailFiles().
|
inline |
Definition at line 309 of file dbmgr.hxx.
Referenced by MergeMailFiles().
|
inline |
Definition at line 302 of file dbmgr.hxx.
Referenced by MergeMailFiles().
|
private |
Definition at line 2274 of file dbmgr.cxx.
References m_pImpl.
Referenced by FillCalcWithMergeData(), GetMergeColumnCnt(), and MergeMailFiles().
|
static |
|
static |
Loads a data source from file and registers it.
This function requires GUI interaction, as it loads the data source from the filename returned by a file picker and additional settings dialog. In case of success it returns the registered name, otherwise an empty string.
Definition at line 2788 of file dbmgr.cxx.
References aURL, ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), sw::GetDBunoType(), sfx2::FileDialogHelper::GetFilePicker(), name, s_aUncommittedRegistrations, sfx2::FileDialogHelper::SetContext(), SwResId(), type, and sfx2::FileDialogHelper::WriterRegisterDataSource.
Referenced by IMPL_LINK_NOARG().
void SwDBManager::LoadAndRegisterEmbeddedDataSource | ( | const SwDBData & | rData, |
const SwDocShell & | rDocShell | ||
) |
Load the embedded data source of the document and also register it.
Definition at line 2901 of file dbmgr.cxx.
References aURL, INetURLObject::GetMainURL(), SfxObjectShell::GetMedium(), comphelper::getProcessComponentContext(), SfxMedium::GetURLObject(), m_sEmbeddedName, INetURLObject::NONE, RevokeDataSource(), s_aUncommittedRegistrations, and SwDBData::sDataSource.
Referenced by setEmbeddedName().
bool SwDBManager::Merge | ( | const SwMergeDescriptor & | rMergeDesc | ) |
Merging of data records into fields.
Definition at line 431 of file dbmgr.cxx.
References SL::aData, SwEditShell::ChangeDBFields(), SwWrtShell::ChgDBData(), svx::Command, svx::CommandType, svx::Connection, svx::Cursor, DB_DELIM, DBMGR_MERGE, DBMGR_MERGE_EMAIL, DBMGR_MERGE_FILE, DBMGR_MERGE_PRINTER, DBMGR_MERGE_SHELL, SfxObjectShell::DoClose(), SwEditShell::EndAllAction(), FindDSData(), svx::ODataAccessDescriptor::getDataSource(), getDataSourceAsParent(), SwEditShell::GetDBData(), SwView::GetDocShell(), SwWrtShell::GetView(), svx::ODataAccessDescriptor::has(), ImportFromConnection(), SfxObjectShellLock::Is(), IsInitDBFields(), SfxObjectShell::IsModified(), lcl_CreateWorkingDocument(), lcl_InitNumberFormatter(), lcl_ToNextRecord(), m_bInMerge, m_DataSourceParams, m_pImpl, MergeMailFiles(), SwDBData::nCommandType, SwMergeDescriptor::nMergeType, SwMergeDescriptor::rDescriptor, SwMergeDescriptor::rSh, SwDBData::sCommand, SwDBData::sDataSource, svx::Selection, SetInitDBFields(), SwEditShell::SetModified(), and SwEditShell::StartAllAction().
Referenced by SwXDispatch::dispatch(), SwTextShell::ExecDB(), SwModule::ExecOther(), SwXMailMerge::execute(), ExecuteFormLetter(), and PerformMailMerge().
void SwDBManager::MergeCancel | ( | ) |
Definition at line 1665 of file dbmgr.cxx.
References Cancel, and m_aMergeStatus.
Referenced by SwXMailMerge::cancel(), and MergeMailFiles().
|
private |
Run the mail merge for defined modes, except DBMGR_MERGE.
Please have a look at the README in the same directory, before you make larger changes in this function!
Definition at line 1051 of file dbmgr.cxx.
References SwMailMergeConfigItem::AddMergedDocument(), SwDBFormatData::aNullDate, SwMergeDescriptor::aPrintOptions, SwMergeDescriptor::aSaveToFilterData, SwMergeDescriptor::bCreateSingleFile, SwMergeDescriptor::bPrefixIsFilename, SwMergeDescriptor::bSendAsAttachment, SwMergeDescriptor::bSendAsHTML, SwEditShell::CalcLayout(), SwMailMergeHelper::CheckMailAddress(), SwEditShell::ConvertFieldsToText(), DBMGR_MERGE_EMAIL, DBMGR_MERGE_FILE, DBMGR_MERGE_PRINTER, DBMGR_MERGE_SHELL, SfxObjectShell::DoClose(), ERRCODE_IO_NOTSUPPORTED, Error, SfxViewShell::ExecPrint(), Printer::FinishPrintJob(), tools::SvRef< typename T >::get(), SwDoc::GetAllLayouts(), INetURLObject::GetBase(), GetDBField(), SfxViewFrame::GetDispatcher(), SwViewShell::GetDoc(), SwView::GetDocShell(), SwView::GetEditWin(), SwIoSystem::GetFileFilter(), SfxFilterContainer::GetFilter4Extension(), SfxFilterContainer::GetFilter4FilterName(), SfxViewFrame::GetFirst(), vcl::Window::GetFrameWeld(), SwDoc::getIDocumentFieldsAccess(), GetMailMergeEvtSrc(), INetURLObject::GetMainURL(), SfxObjectShell::GetMedium(), SfxObjectShell::GetModel(), SfxViewFrame::GetNext(), SwCursorShell::GetPageCnt(), SfxViewShell::GetPrinterController(), IDocumentFieldsAccess::GetRecordsPerDocument(), SwEditShell::GetSectionFormatCount(), SwMailMergeConfigItem::GetTargetView(), SfxObjectShell::GetTitle(), SfxMedium::GetURLObject(), SwWrtShell::GetView(), SwViewShell::GetViewOptions(), SwFEShell::GetVirtPageNum(), SwView::GetWrtShell(), SwView::GetWrtShellPtr(), ErrorHandler::HandleError(), SfxObjectShellLock::Is(), tools::SvRef< typename T >::is(), SwEditShell::IsExpFieldsLocked(), SwEditShell::IsLabelDoc(), IsMergeError(), IsMergeOk(), IsMergeSilent(), Application::IsQuit(), IsValidMergeRecord(), lcl_CreateMailFromDoc(), lcl_CreateWorkingDocument(), lcl_getCountFromResultSet(), lcl_PreparePrinterOptions(), lcl_PrepareSaveFilterDataOptions(), lcl_RemoveSectionLinks(), lcl_SaveDebugDoc(), lcl_SaveDoc(), SfxDispatcher::Lock(), SwEditShell::LockExpFields(), m_aMergeStatus, m_pImpl, PrintMonitor::m_xPrinter, PrintMonitor::m_xPrintInfo, MergeCancel(), SwDocMergeInfo::nDBRow, SwMergeDescriptor::nMergeType, INetURLObject::NONE, Ok, SwMergeDescriptor::pMailMergeConfigItem, Scheduler::ProcessEventsToIdle(), INetURLObject::removeSegment(), Application::Reschedule(), RET_CANCEL, RET_OK, weld::DialogController::runAsync(), SAL_INFO, SwMergeDescriptor::sDBcolumn, SwMergeDescriptor::sDBPasswordColumn, SwViewOption::SetIdle(), SwEditShell::SetNumberingRestart(), SwMailMergeConfigItem::SetTargetView(), Timer::SetTimeout(), INetURLObject::SetURL(), sPrefix, SwMergeDescriptor::sPrefix, SwMergeDescriptor::sSaveToFilter, SwMergeDescriptor::sSaveToFilterOptions, Timer::Start(), SwDocMergeInfo::startPageInTarget, Task::Stop(), STR_SW_EVENT_FIELD_MERGE, STR_SW_EVENT_FIELD_MERGE_FINISHED, comphelper::string::stripStart(), SwCursorShell::SttEndDoc(), SW_MOD, SwResId(), toInt32(), ToNextMergeRecord(), SWUnoHelper::UCB_DeleteFile(), SwEditShell::UnlockExpFields(), IDocumentMarkAccess::UNO_BOOKMARK, SwDBFormatData::xFormatter, SwMergeDescriptor::xSmtpServer, and Application::Yield().
Referenced by Merge().
bool SwDBManager::OpenDataSource | ( | const OUString & | rDataSource, |
const OUString & | rTableOrQuery | ||
) |
open the source while fields are updated - for the calculator only!
Definition at line 2310 of file dbmgr.cxx.
References SL::aData, SwDSParam::bEndOfDB, SwDSParam::bScrollable, FindDSConnection(), FindDSData(), SwDSParam::nSelectionIndex, SwDSParam::xConnection, SwDSParam::xResultSet, and SwDSParam::xStatement.
Referenced by SwDocUpdateField::MakeFieldList_(), sw::DocumentFieldsManager::UpdateDBNumFields(), and SwCalc::VarLook().
|
privatedelete |
|
static |
Definition at line 3214 of file dbmgr.cxx.
References SwMergeDescriptor::bCreateSingleFile, svx::Command, svx::CommandType, svx::Connection, svx::Cursor, DBMGR_MERGE_SHELL, SwEditShell::GetDBManager(), SwView::GetMailMergeConfigItem(), SwView::GetWrtShell(), Merge(), SwMergeDescriptor::pMailMergeConfigItem, svx::Selection, and svx::ODataAccessDescriptor::setDataSource().
Referenced by SwModule::ExecOther(), and IMPL_LINK_NOARG().
uno::Reference< sdbc::XConnection > const & SwDBManager::RegisterConnection | ( | OUString const & | rSource | ) |
create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDBTreeList
Definition at line 2357 of file dbmgr.cxx.
References FindDSConnection(), GetConnection(), SwDoc::GetDocShell(), SwDocShell::GetView(), m_pDoc, m_pImpl, and SwDSParam::xConnection.
Referenced by ExecuteFormLetter(), GetColumnFormat(), GetColumnNames(), GetColumnType(), SwDBTreeList_Impl::GetConnection(), GetTableNames(), and SwFieldMgr::IsDBNumeric().
void SwDBManager::releaseRevokeListener | ( | ) |
|
static |
Unregister a data source.
Definition at line 2891 of file dbmgr.cxx.
References comphelper::getProcessComponentContext().
Referenced by IMPL_LINK_NOARG(), LoadAndRegisterEmbeddedDataSource(), RevokeLastRegistrations(), RevokeNotUsedConnections(), and SwDoc::~SwDoc().
void SwDBManager::RevokeLastRegistrations | ( | ) |
Revoke not committed registrations in case of mail merge cancel.
Definition at line 3239 of file dbmgr.cxx.
References SwDoc::GetDocShell(), SwView::GetMailMergeConfigItem(), SwDocShell::GetView(), m_pDoc, RevokeDataSource(), and s_aUncommittedRegistrations.
Referenced by ImplDestroy(), and SwFieldDBPage::~SwFieldDBPage().
void SwDBManager::RevokeNotUsedConnections | ( | ) |
Remove not used connections.
Definition at line 3288 of file dbmgr.cxx.
References m_aNotUsedConnections, and RevokeDataSource().
|
private |
Set connection as used.
Definition at line 3281 of file dbmgr.cxx.
References m_aNotUsedConnections.
Referenced by FindDSConnection().
void SwDBManager::setEmbeddedName | ( | const OUString & | rEmbeddedName, |
SwDocShell & | rDocShell | ||
) |
Definition at line 3150 of file dbmgr.cxx.
References SwDoc::GetDBData(), SwDocShell::GetDoc(), SfxObjectShell::GetStorage(), LoadAndRegisterEmbeddedDataSource(), m_pImpl, and m_sEmbeddedName.
Referenced by SwXDocumentSettings::_setSingleValue().
|
inline |
Definition at line 316 of file dbmgr.hxx.
Referenced by Merge(), and SwDoc::SetInitDBFields().
|
inline |
Definition at line 300 of file dbmgr.hxx.
Referenced by SwXMailMerge::execute().
|
inline |
Definition at line 303 of file dbmgr.hxx.
Referenced by SwXMailMerge::execute().
|
static |
Definition at line 2850 of file dbmgr.cxx.
References comphelper::InitPropertySequence().
Referenced by SwDocShell::SaveAs().
|
private |
Definition at line 2120 of file dbmgr.cxx.
References lcl_ToNextRecord(), and m_pImpl.
Referenced by ImportFromConnection(), and MergeMailFiles().
void SwDBManager::ToNextRecord | ( | const OUString & | rDataSource, |
const OUString & | rTableOrQuery | ||
) |
Definition at line 2190 of file dbmgr.cxx.
References SL::aData, FindDSData(), lcl_ToNextRecord(), and m_pImpl.
Referenced by SwDBNextSetField::Evaluate().
bool SwDBManager::ToRecordId | ( | sal_Int32 | nSet | ) |
Definition at line 2296 of file dbmgr.cxx.
References lcl_MoveAbsolute(), and m_pImpl.
Referenced by SwDBNumSetField::Evaluate().
|
private |
|
private |
current / last merge status
Definition at line 252 of file dbmgr.hxx.
Referenced by SwDBManager::MailDispatcherListener_Impl::mailDeliveryError(), MergeCancel(), and MergeMailFiles().
|
private |
Not used connections.
Definition at line 266 of file dbmgr.hxx.
Referenced by CommitLastRegistrations(), RevokeNotUsedConnections(), and SetAsUsed().
|
private |
merge process active
Definition at line 254 of file dbmgr.hxx.
Referenced by CloseAll(), and Merge().
|
private |
|
private |
Definition at line 256 of file dbmgr.hxx.
Referenced by CloseAll(), ExecuteFormLetter(), FindDSConnection(), FindDSData(), ImplDestroy(), and Merge().
|
private |
The document that owns this manager.
Definition at line 272 of file dbmgr.hxx.
Referenced by CommitLastRegistrations(), getDoc(), RegisterConnection(), and RevokeLastRegistrations().
|
private |
Definition at line 257 of file dbmgr.hxx.
Referenced by CloseAll(), ExecuteFormLetter(), FillCalcWithMergeData(), FindDSConnection(), FindDSData(), GetColumnCnt(), GetColumnFormat(), GetMergeColumnCnt(), GetSelectedRecordId(), ImportDBEntry(), ImportFromConnection(), IsDataSourceOpen(), IsValidMergeRecord(), SwDBManager::MailDispatcherListener_Impl::mailDelivered(), SwDBManager::MailDispatcherListener_Impl::mailDeliveryError(), Merge(), MergeMailFiles(), RegisterConnection(), releaseRevokeListener(), setEmbeddedName(), ToNextMergeRecord(), ToNextRecord(), and ToRecordId().
|
private |
|
private |
Name of the embedded database that's included in the current document.
Definition at line 260 of file dbmgr.hxx.
Referenced by getEmbeddedName(), LoadAndRegisterEmbeddedDataSource(), and setEmbeddedName().
|
staticprivate |
Store last registrations to revoke or commit.
Definition at line 263 of file dbmgr.hxx.
Referenced by CommitLastRegistrations(), LoadAndRegisterDataSource(), LoadAndRegisterEmbeddedDataSource(), and RevokeLastRegistrations().