LibreOffice Module sw (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SwDBManager Class Reference

#include <dbmgr.hxx>

Collaboration diagram for SwDBManager:
[legend]

Classes

class  ConnectionDisposedListener_Impl
 
class  MailDispatcherListener_Impl
 
struct  SwDBManager_Impl
 

Public Member Functions

 SwDBManager (SwDoc *pDoc)
 
 ~SwDBManager ()
 
const SwXMailMergeGetMailMergeEvtSrc () 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_tGetDSParamArray () 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
 
SwDocgetDoc () 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< SwMailMergeConfigItemPerformMailMerge (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 SwDBDataGetAddressDBName ()
 
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 SwDSParamFindDSData (const SwDBData &rData, bool bCreate)
 
SAL_DLLPRIVATE SwDSParamFindDSConnection (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
 
SwDBManageroperator= (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_Implm_pImpl
 
const SwXMailMergem_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...
 
SwDocm_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...
 

Detailed Description

Definition at line 240 of file dbmgr.hxx.

Member Enumeration Documentation

◆ MergeStatus

enum class SwDBManager::MergeStatus
strongprivate
Enumerator
Ok 
Cancel 
Error 

Definition at line 246 of file dbmgr.hxx.

Constructor & Destructor Documentation

◆ SwDBManager() [1/2]

SwDBManager::SwDBManager ( SwDBManager const &  )
privatedelete

◆ SwDBManager() [2/2]

SwDBManager::SwDBManager ( SwDoc pDoc)

Definition at line 696 of file dbmgr.cxx.

References Ok.

◆ ~SwDBManager()

SwDBManager::~SwDBManager ( )

Definition at line 735 of file dbmgr.cxx.

References ImplDestroy(), and suppress_fun_call_w_exception.

Member Function Documentation

◆ CloseAll()

void SwDBManager::CloseAll ( bool  bIncludingMerge = true)

◆ CommitLastRegistrations()

void SwDBManager::CommitLastRegistrations ( )

Accept not committed registrations.

Definition at line 3254 of file dbmgr.cxx.

References SwDoc::GetDocShell(), m_aNotUsedConnections, m_pDoc, and s_aUncommittedRegistrations.

Referenced by SwDoc::ChgDBData(), and SwFieldDBPage::FillItemSet().

◆ createCursor()

uno::Reference< sdbc::XResultSet > SwDBManager::createCursor ( const OUString &  _sDataSourceName,
const OUString &  _sCommand,
sal_Int32  _nCommandType,
const css::uno::Reference< css::sdbc::XConnection > &  _xConnection,
const SwView pView 
)
static

creates a RowSet, which must be disposed after use.

Parameters
_sDataSourceNameThe data source name
_sCommandThe command.
_nCommandTypeThe type of the command.
_xConnectionThe active connection which may be <NULL>.
Returns
The new created RowSet.

Definition at line 3097 of file dbmgr.cxx.

References comphelper::getComponentContext(), SfxViewShell::GetFrameWeld(), weld::Window::GetXWindow(), and TOOLS_WARN_EXCEPTION.

Referenced by SwInsertDBColAutoPilot::DataToDoc(), and SwTextShell::ExecDB().

◆ CreateDSData()

void SwDBManager::CreateDSData ( const SwDBData rData)
inline

Definition at line 365 of file dbmgr.hxx.

References rData.

Referenced by SwDoc::AddUsedDBToList().

◆ ExecuteFormLetter()

void SwDBManager::ExecuteFormLetter ( SwWrtShell rSh,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)

◆ FillCalcWithMergeData()

bool SwDBManager::FillCalcWithMergeData ( SvNumberFormatter pDocFormatter,
LanguageType  nLanguage,
SwCalc aCalc 
)

◆ FindDSConnection()

SwDSParam * SwDBManager::FindDSConnection ( const OUString &  rSource,
bool  bCreate 
)
private

◆ FindDSData()

SwDSParam * SwDBManager::FindDSData ( const SwDBData rData,
bool  bCreate 
)
private

◆ GetAddressDBName()

const SwDBData & SwDBManager::GetAddressDBName ( )
static

Definition at line 2504 of file dbmgr.cxx.

References SW_MOD.

Referenced by SwDoc::GetDBData().

◆ GetColumnCnt()

bool SwDBManager::GetColumnCnt ( const OUString &  rSourceName,
const OUString &  rTableName,
const OUString &  rColumnName,
sal_uInt32  nAbsRecordId,
LanguageType  nLanguage,
OUString &  rResult,
double *  pNumber 
)

◆ GetColumnFormat() [1/2]

sal_uLong SwDBManager::GetColumnFormat ( const OUString &  rDBName,
const OUString &  rTableName,
const OUString &  rColNm,
SvNumberFormatter pNFormatr,
LanguageType  nLanguage 
)

◆ GetColumnFormat() [2/2]

static sal_uLong SwDBManager::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

◆ GetColumnNames() [1/2]

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 660 of file dbmgr.cxx.

References SL::aData, FindDSData(), GetColumnNames(), RegisterConnection(), and SwDSParam::xConnection.

Referenced by GetColumnNames(), SwLabPage::InitDatabaseBox(), SwEnvPage::InitDatabaseBox(), and SwMailMergeDlg::SwMailMergeDlg().

◆ GetColumnNames() [2/2]

static void SwDBManager::GetColumnNames ( weld::ComboBox rBox,
css::uno::Reference< css::sdbc::XConnection > const &  xConnection,
const OUString &  rTableName 
)
static

◆ GetColumnSupplier()

uno::Reference< sdbcx::XColumnsSupplier > SwDBManager::GetColumnSupplier ( css::uno::Reference< css::sdbc::XConnection > const &  xConnection,
const OUString &  rTableOrQuery,
SwDBSelect  eTableOrQuery = SwDBSelect::UNKNOWN 
)
static

◆ GetColumnType()

sal_Int32 SwDBManager::GetColumnType ( const OUString &  rDBName,
const OUString &  rTableName,
const OUString &  rColNm 
)

◆ GetConnection()

uno::Reference< sdbc::XConnection > SwDBManager::GetConnection ( const OUString &  rDataSource,
css::uno::Reference< css::sdbc::XDataSource > &  rxSource,
const SwView pView 
)
static

◆ getDataSourceAsParent()

uno::Reference< sdbc::XDataSource > SwDBManager::getDataSourceAsParent ( const css::uno::Reference< css::sdbc::XConnection > &  _xConnection,
const OUString &  _sDataSourceName 
)
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.

Parameters
_xConnectionThe connection which should support the XChild interface. (not a must)
_sDataSourceNameThe data source name will be used to create the data source when the connection can not be used for it.
Returns
The data source.

Definition at line 3079 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().

◆ GetDBField()

OUString SwDBManager::GetDBField ( css::uno::Reference< css::beans::XPropertySet > const &  xColumnProp,
const SwDBFormatData rDBFormatData,
double *  pNumber = nullptr 
)
static

◆ getDoc()

SwDoc * SwDBManager::getDoc ( ) const

Definition at line 3163 of file dbmgr.cxx.

References m_pDoc.

◆ GetDSParamArray()

const SwDSParams_t & SwDBManager::GetDSParamArray ( ) const
inline

Definition at line 367 of file dbmgr.hxx.

Referenced by SwDoc::GetAllDBNames().

◆ getEmbeddedName()

const OUString & SwDBManager::getEmbeddedName ( ) const

Definition at line 3158 of file dbmgr.cxx.

References m_sEmbeddedName.

Referenced by SwXDocumentSettings::_getSingleValue(), and SwDocShell::SaveAs().

◆ GetExistingDatabaseNames()

uno::Sequence< OUString > SwDBManager::GetExistingDatabaseNames ( )
static

Definition at line 2509 of file dbmgr.cxx.

Referenced by SwLabPage::InitDatabaseBox(), and SwEnvPage::InitDatabaseBox().

◆ GetMailMergeEvtSrc()

const SwXMailMerge * SwDBManager::GetMailMergeEvtSrc ( ) const
inline

MailMergeEvent source.

Definition at line 298 of file dbmgr.hxx.

Referenced by SwXMailMerge::execute(), and MergeMailFiles().

◆ GetMergeColumnCnt()

bool SwDBManager::GetMergeColumnCnt ( const OUString &  rColumnName,
LanguageType  nLanguage,
OUString &  rResult,
double *  pNumber 
)

Definition at line 2081 of file dbmgr.cxx.

References IsValidMergeRecord(), lcl_GetColumnCnt(), and m_pImpl.

Referenced by SwDBField::Evaluate(), and SwHiddenTextField::Evaluate().

◆ GetSelectedRecordId() [1/2]

sal_uInt32 SwDBManager::GetSelectedRecordId ( )

Definition at line 2253 of file dbmgr.cxx.

References m_pImpl.

Referenced by FillCalcWithMergeData(), and GetSelectedRecordId().

◆ GetSelectedRecordId() [2/2]

sal_uInt32 SwDBManager::GetSelectedRecordId ( const OUString &  rDataSource,
const OUString &  rTableOrQuery,
sal_Int32  nCommandType = -1 
)

◆ GetTableNames()

bool SwDBManager::GetTableNames ( weld::ComboBox rBox,
const OUString &  rDBName 
)

◆ ImplDestroy()

void SwDBManager::ImplDestroy ( )
private

Definition at line 707 of file dbmgr.cxx.

References m_DataSourceParams, and RevokeLastRegistrations().

Referenced by ~SwDBManager().

◆ ImportDBEntry()

void SwDBManager::ImportDBEntry ( SwWrtShell pSh)
private

Insert a single data record as text into document.

Definition at line 595 of file dbmgr.cxx.

References aColNames, GetDBField(), i, m_pImpl, and nLength.

Referenced by ImportFromConnection().

◆ ImportFromConnection()

void SwDBManager::ImportFromConnection ( SwWrtShell pSh)
private

◆ InsertText()

void SwDBManager::InsertText ( SwWrtShell rSh,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
static

◆ IsDataSourceOpen()

bool SwDBManager::IsDataSourceOpen ( const OUString &  rDataSource,
const OUString &  rTableOrQuery,
bool  bMergeShell 
)

◆ IsInitDBFields()

bool SwDBManager::IsInitDBFields ( ) const
inline

Initialize data fields that lack name of database.

Definition at line 314 of file dbmgr.hxx.

Referenced by Merge().

◆ IsInMerge()

bool SwDBManager::IsInMerge ( ) const
inline

◆ IsMergeError()

bool SwDBManager::IsMergeError ( ) const
inline

Definition at line 309 of file dbmgr.hxx.

Referenced by MergeMailFiles().

◆ IsMergeOk()

bool SwDBManager::IsMergeOk ( ) const
inline

Definition at line 308 of file dbmgr.hxx.

Referenced by MergeMailFiles().

◆ IsMergeSilent()

bool SwDBManager::IsMergeSilent ( ) const
inline

Definition at line 301 of file dbmgr.hxx.

Referenced by MergeMailFiles().

◆ IsValidMergeRecord()

bool SwDBManager::IsValidMergeRecord ( ) const
private

Definition at line 2248 of file dbmgr.cxx.

References m_pImpl.

Referenced by FillCalcWithMergeData(), GetMergeColumnCnt(), and MergeMailFiles().

◆ LoadAndRegisterDataSource() [1/2]

OUString SwDBManager::LoadAndRegisterDataSource ( std::u16string_view  rURI,
const OUString *  pDestDir 
)
static

Loads a data source from file and registers it.

Convenience function, which calls GetDBunoURI and has just one mandatory parameter. In case of success it returns the registered name, otherwise an empty string.

Definition at line 2857 of file dbmgr.cxx.

◆ LoadAndRegisterDataSource() [2/2]

OUString SwDBManager::LoadAndRegisterDataSource ( weld::Window pParent,
SwDocShell pDocShell = nullptr 
)
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 2779 of file dbmgr.cxx.

References aURL, ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), sw::GetDBunoType(), sfx2::FileDialogHelper::GetFilePicker(), s_aUncommittedRegistrations, sfx2::FileDialogHelper::SetContext(), SwResId(), type, and sfx2::FileDialogHelper::WriterRegisterDataSource.

Referenced by IMPL_LINK_NOARG().

◆ LoadAndRegisterEmbeddedDataSource()

void SwDBManager::LoadAndRegisterEmbeddedDataSource ( const SwDBData rData,
const SwDocShell rDocShell 
)

◆ Merge()

bool SwDBManager::Merge ( const SwMergeDescriptor rMergeDesc)

◆ MergeCancel()

void SwDBManager::MergeCancel ( )

Definition at line 1639 of file dbmgr.cxx.

References Cancel, and m_aMergeStatus.

Referenced by SwXMailMerge::cancel(), and MergeMailFiles().

◆ MergeMailFiles()

bool SwDBManager::MergeMailFiles ( SwWrtShell pSh,
const SwMergeDescriptor rMergeDescriptor 
)
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 1039 of file dbmgr.cxx.

References SwMailMergeConfigItem::AddMergedDocument(), SwDBFormatData::aNullDate, SwDoc::AppendDoc(), 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(), IDocumentUndoRedo::DoUndo(), 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(), SwDoc::getIDocumentMarkAccess(), SwDoc::GetIDocumentUndoRedo(), 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, IDocumentMarkAccess::makeMark(), MergeCancel(), SwDocMergeInfo::nDBRow, SwMergeDescriptor::nMergeType, INetURLObject::NONE, Ok, SwMergeDescriptor::pMailMergeConfigItem, Scheduler::ProcessEventsToIdle(), SwDoc::RemoveInvisibleContent(), INetURLObject::removeSegment(), Application::Reschedule(), RET_CANCEL, RET_OK, weld::DialogController::runAsync(), SAL_INFO, SwMergeDescriptor::sDBcolumn, SwMergeDescriptor::sDBPasswordColumn, SwDoc::SetAllUniqueFlyNames(), SwDoc::SetDBManager(), SwViewOption::SetIdle(), SwDoc::SetInMailMerge(), 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().

◆ OpenDataSource()

bool SwDBManager::OpenDataSource ( const OUString &  rDataSource,
const OUString &  rTableOrQuery 
)

◆ operator=()

SwDBManager & SwDBManager::operator= ( SwDBManager const &  )
privatedelete

◆ PerformMailMerge()

std::shared_ptr< SwMailMergeConfigItem > SwDBManager::PerformMailMerge ( SwView const *  pView)
static

◆ RegisterConnection()

uno::Reference< sdbc::XConnection > const & SwDBManager::RegisterConnection ( OUString const &  rSource)

◆ releaseRevokeListener()

void SwDBManager::releaseRevokeListener ( )

Stop reacting to removed database registrations.

Definition at line 3168 of file dbmgr.cxx.

References m_pImpl.

◆ RevokeDataSource()

void SwDBManager::RevokeDataSource ( const OUString &  rName)
static

◆ RevokeLastRegistrations()

void SwDBManager::RevokeLastRegistrations ( )

Revoke not committed registrations in case of mail merge cancel.

Definition at line 3226 of file dbmgr.cxx.

References SwDoc::GetDocShell(), SwView::GetMailMergeConfigItem(), SwDocShell::GetView(), m_pDoc, RevokeDataSource(), and s_aUncommittedRegistrations.

Referenced by ImplDestroy(), and SwFieldDBPage::~SwFieldDBPage().

◆ RevokeNotUsedConnections()

void SwDBManager::RevokeNotUsedConnections ( )

Remove not used connections.

Definition at line 3275 of file dbmgr.cxx.

References m_aNotUsedConnections, and RevokeDataSource().

◆ SetAsUsed()

void SwDBManager::SetAsUsed ( const OUString &  rName)
private

Set connection as used.

Definition at line 3268 of file dbmgr.cxx.

References m_aNotUsedConnections.

Referenced by FindDSConnection().

◆ setEmbeddedName()

void SwDBManager::setEmbeddedName ( const OUString &  rEmbeddedName,
SwDocShell rDocShell 
)

◆ SetInitDBFields()

void SwDBManager::SetInitDBFields ( bool  b)
inline

Definition at line 315 of file dbmgr.hxx.

Referenced by Merge(), and SwDoc::SetInitDBFields().

◆ SetMailMergeEvtSrc()

void SwDBManager::SetMailMergeEvtSrc ( const SwXMailMerge pSrc)
inline

Definition at line 299 of file dbmgr.hxx.

Referenced by SwXMailMerge::execute().

◆ SetMergeSilent()

void SwDBManager::SetMergeSilent ( bool  bVal)
inline

Definition at line 302 of file dbmgr.hxx.

Referenced by SwXMailMerge::execute().

◆ StoreEmbeddedDataSource()

void SwDBManager::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 
)
static

Definition at line 2837 of file dbmgr.cxx.

References comphelper::InitPropertySequence().

Referenced by SwDocShell::SaveAs().

◆ ToNextMergeRecord()

bool SwDBManager::ToNextMergeRecord ( )
private

Definition at line 2094 of file dbmgr.cxx.

References lcl_ToNextRecord(), and m_pImpl.

Referenced by ImportFromConnection(), and MergeMailFiles().

◆ ToNextRecord()

void SwDBManager::ToNextRecord ( const OUString &  rDataSource,
const OUString &  rTableOrQuery 
)

Definition at line 2164 of file dbmgr.cxx.

References SL::aData, FindDSData(), lcl_ToNextRecord(), and m_pImpl.

Referenced by SwDBNextSetField::Evaluate().

◆ ToRecordId()

bool SwDBManager::ToRecordId ( sal_Int32  nSet)

Definition at line 2270 of file dbmgr.cxx.

References lcl_MoveAbsolute(), and m_pImpl.

Referenced by SwDBNumSetField::Evaluate().

Member Data Documentation

◆ ConnectionDisposedListener_Impl

class SAL_DLLPRIVATE SwDBManager::ConnectionDisposedListener_Impl
private

Definition at line 243 of file dbmgr.hxx.

◆ m_aMergeStatus

MergeStatus SwDBManager::m_aMergeStatus
private

current / last merge status

Definition at line 251 of file dbmgr.hxx.

Referenced by SwDBManager::MailDispatcherListener_Impl::mailDeliveryError(), MergeCancel(), and MergeMailFiles().

◆ m_aNotUsedConnections

std::vector<OUString> SwDBManager::m_aNotUsedConnections
private

Not used connections.

Definition at line 265 of file dbmgr.hxx.

Referenced by CommitLastRegistrations(), RevokeNotUsedConnections(), and SetAsUsed().

◆ m_bInitDBFields

bool SwDBManager::m_bInitDBFields
private

Definition at line 252 of file dbmgr.hxx.

◆ m_bInMerge

bool SwDBManager::m_bInMerge
private

merge process active

Definition at line 253 of file dbmgr.hxx.

Referenced by CloseAll(), and Merge().

◆ m_bMergeSilent

bool SwDBManager::m_bMergeSilent
private

suppress display of dialogs/boxes (used when called over API)

Definition at line 254 of file dbmgr.hxx.

◆ m_DataSourceParams

SwDSParams_t SwDBManager::m_DataSourceParams
private

Definition at line 255 of file dbmgr.hxx.

Referenced by CloseAll(), ExecuteFormLetter(), FindDSConnection(), FindDSData(), ImplDestroy(), and Merge().

◆ m_pDoc

SwDoc* SwDBManager::m_pDoc
private

The document that owns this manager.

Definition at line 271 of file dbmgr.hxx.

Referenced by CommitLastRegistrations(), getDoc(), RegisterConnection(), and RevokeLastRegistrations().

◆ m_pImpl

std::unique_ptr<SwDBManager_Impl> SwDBManager::m_pImpl
private

◆ m_pMergeEvtSrc

const SwXMailMerge* SwDBManager::m_pMergeEvtSrc
private

!= 0 if mail merge events are to be send

Definition at line 257 of file dbmgr.hxx.

◆ m_sEmbeddedName

OUString SwDBManager::m_sEmbeddedName
private

Name of the embedded database that's included in the current document.

Definition at line 259 of file dbmgr.hxx.

Referenced by getEmbeddedName(), LoadAndRegisterEmbeddedDataSource(), and setEmbeddedName().

◆ s_aUncommittedRegistrations

std::vector< std::pair< SwDocShell *, OUString > > SwDBManager::s_aUncommittedRegistrations
staticprivate

Store last registrations to revoke or commit.

Definition at line 262 of file dbmgr.hxx.

Referenced by CommitLastRegistrations(), LoadAndRegisterDataSource(), LoadAndRegisterEmbeddedDataSource(), and RevokeLastRegistrations().


The documentation for this class was generated from the following files: