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 () COVERITY_NOEXCEPT_FALSE
 
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 ()
 
bool IsMergeError ()
 
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 (ListBox *pListBox, const OUString &rDBName, const OUString &rTableName)
 Fill listbox with all column names of a database table. More...
 
void GetColumnNames (weld::ComboBox &rBox, const OUString &rDBName, const OUString &rTableName)
 
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 (ListBox *pListBox, css::uno::Reference< css::sdbc::XConnection > const &xConnection, const OUString &rTableName)
 
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 (const OUString &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  MergeStatus {
  MergeStatus::Ok = 0,
  MergeStatus::Cancel,
  MergeStatus::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
 
 SwDBManager (SwDBManager const &)=delete
 
SwDBManageroperator= (SwDBManager const &)=delete
 

Private Attributes

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 > > m_aUncommittedRegistrations
 Store last registrations to revoke or commit. More...
 

Detailed Description

Definition at line 235 of file dbmgr.hxx.

Member Enumeration Documentation

enum SwDBManager::MergeStatus
strongprivate
Enumerator
Ok 
Cancel 
Error 

Definition at line 241 of file dbmgr.hxx.

Constructor & Destructor Documentation

SwDBManager::SwDBManager ( SwDBManager const &  )
privatedelete
SwDBManager::SwDBManager ( SwDoc pDoc)

Definition at line 824 of file dbmgr.cxx.

References Ok.

SwDBManager::~SwDBManager ( )

Definition at line 835 of file dbmgr.cxx.

References m_DataSourceParams, and RevokeLastRegistrations().

Member Function Documentation

void SwDBManager::CloseAll ( bool  bIncludingMerge = true)
void SwDBManager::CommitLastRegistrations ( )

Accept not committed registrations.

Definition at line 3348 of file dbmgr.cxx.

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

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

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

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

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

void SwDBManager::CreateDSData ( const SwDBData rData)
inline

Definition at line 364 of file dbmgr.hxx.

Referenced by SwDoc::AddUsedDBToList().

void SwDBManager::ExecuteFormLetter ( SwWrtShell rSh,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
bool SwDBManager::FillCalcWithMergeData ( SvNumberFormatter pDocFormatter,
LanguageType  nLanguage,
SwCalc aCalc 
)
SwDSParam * SwDBManager::FindDSConnection ( const OUString &  rSource,
bool  bCreate 
)
private
SwDSParam * SwDBManager::FindDSData ( const SwDBData rData,
bool  bCreate 
)
private
const SwDBData & SwDBManager::GetAddressDBName ( )
static

Definition at line 2600 of file dbmgr.cxx.

References SW_MOD.

Referenced by SwDoc::GetDBDesc().

bool SwDBManager::GetColumnCnt ( const OUString &  rSourceName,
const OUString &  rTableName,
const OUString &  rColumnName,
sal_uInt32  nAbsRecordId,
LanguageType  nLanguage,
OUString &  rResult,
double *  pNumber 
)
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
sal_uLong SwDBManager::GetColumnFormat ( const OUString &  rDBName,
const OUString &  rTableName,
const OUString &  rColNm,
SvNumberFormatter pNFormatr,
LanguageType  nLanguage 
)
void SwDBManager::GetColumnNames ( ListBox pListBox,
const OUString &  rDBName,
const OUString &  rTableName 
)
void SwDBManager::GetColumnNames ( weld::ComboBox rBox,
const OUString &  rDBName,
const OUString &  rTableName 
)
static void SwDBManager::GetColumnNames ( ListBox pListBox,
css::uno::Reference< css::sdbc::XConnection > const &  xConnection,
const OUString &  rTableName 
)
static
static void SwDBManager::GetColumnNames ( weld::ComboBox rBox,
css::uno::Reference< css::sdbc::XConnection > const &  xConnection,
const OUString &  rTableName 
)
static
uno::Reference< sdbcx::XColumnsSupplier > SwDBManager::GetColumnSupplier ( css::uno::Reference< css::sdbc::XConnection > const &  xConnection,
const OUString &  rTableOrQuery,
SwDBSelect  eTableOrQuery = SwDBSelect::UNKNOWN 
)
static
sal_Int32 SwDBManager::GetColumnType ( const OUString &  rDBName,
const OUString &  rTableName,
const OUString &  rColNm 
)
uno::Reference< sdbc::XConnection > SwDBManager::GetConnection ( const OUString &  rDataSource,
css::uno::Reference< css::sdbc::XDataSource > &  rxSource,
const SwView pView 
)
static
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 3173 of file dbmgr.cxx.

References dbtools::getDataSource(), comphelper::getProcessComponentContext(), and TOOLS_WARN_EXCEPTION.

Referenced by GetColumnFormat(), GetColumnSupplier(), IMPL_LINK(), lcl_GetColumnCnt(), lcl_InitNumberFormatter(), and Merge().

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

Definition at line 3257 of file dbmgr.cxx.

References m_pDoc.

Referenced by SwDataSourceRemovedListener::revokedDatabaseLocation().

const SwDSParams_t& SwDBManager::GetDSParamArray ( ) const
inline

Definition at line 366 of file dbmgr.hxx.

Referenced by SwDoc::GetAllDBNames().

const OUString & SwDBManager::getEmbeddedName ( ) const
uno::Sequence< OUString > SwDBManager::GetExistingDatabaseNames ( )
static
const SwXMailMerge* SwDBManager::GetMailMergeEvtSrc ( ) const
inline

MailMergeEvent source.

Definition at line 292 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 2173 of file dbmgr.cxx.

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

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

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

Definition at line 2345 of file dbmgr.cxx.

References m_pImpl.

Referenced by FillCalcWithMergeData(), and GetSelectedRecordId().

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

Fill listbox with all table names of a database.

Definition at line 712 of file dbmgr.cxx.

References weld::ComboBox::clear(), FindDSConnection(), weld::ComboBox::get_active_text(), if(), RegisterConnection(), and SwDSParam::xConnection.

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

void SwDBManager::ImportDBEntry ( SwWrtShell pSh)
private

Insert a single data record as text into document.

Definition at line 643 of file dbmgr.cxx.

References DB_SEP_NEWLINE, DB_SEP_RETURN, DB_SEP_SPACE, DB_SEP_TAB, GetDBField(), i, SwWrtShell::Insert(), SwWrtShell::InsertLineBreak(), lcl_FindColumn(), m_pImpl, nLength, and SwWrtShell::SplitNode().

Referenced by ImportFromConnection().

void SwDBManager::ImportFromConnection ( SwWrtShell pSh)
private
void SwDBManager::InsertText ( SwWrtShell rSh,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
static
bool SwDBManager::IsDataSourceOpen ( const OUString &  rDataSource,
const OUString &  rTableOrQuery,
bool  bMergeShell 
)
bool SwDBManager::IsInitDBFields ( ) const
inline

Initialize data fields that lack name of database.

Definition at line 308 of file dbmgr.hxx.

Referenced by Merge().

bool SwDBManager::IsInMerge ( ) const
inline
bool SwDBManager::IsMergeError ( )
inline

Definition at line 303 of file dbmgr.hxx.

Referenced by MergeMailFiles().

bool SwDBManager::IsMergeOk ( )
inline

Definition at line 302 of file dbmgr.hxx.

Referenced by MergeMailFiles().

bool SwDBManager::IsMergeSilent ( ) const
inline

Definition at line 295 of file dbmgr.hxx.

Referenced by MergeMailFiles().

bool SwDBManager::IsValidMergeRecord ( ) const
private

Definition at line 2340 of file dbmgr.cxx.

References m_pImpl.

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

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

References ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), sw::GetDBunoType(), sfx2::FileDialogHelper::GetFilePicker(), comphelper::getProcessComponentContext(), m_aUncommittedRegistrations, sfx2::FileDialogHelper::SetDisplayDirectory(), and SwResId().

Referenced by IMPL_LINK_NOARG().

OUString SwDBManager::LoadAndRegisterDataSource ( const OUString &  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 2956 of file dbmgr.cxx.

void SwDBManager::LoadAndRegisterEmbeddedDataSource ( const SwDBData rData,
const SwDocShell rDocShell 
)
bool SwDBManager::Merge ( const SwMergeDescriptor rMergeDesc)
void SwDBManager::MergeCancel ( )

Definition at line 1730 of file dbmgr.cxx.

References Cancel, and m_aMergeStatus.

Referenced by SwXMailMerge::cancel(), and 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 1138 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(), COPY, DBMGR_MERGE_EMAIL, DBMGR_MERGE_FILE, DBMGR_MERGE_PRINTER, DBMGR_MERGE_SHELL, SfxObjectShell::DoClose(), IDocumentUndoRedo::DoUndo(), ERRCODE_IO_NOTSUPPORTED, Error, SfxViewShell::ExecPrint(), Printer::FinishPrintJob(), SvxHtmlOptions::Get(), tools::SvRef< T >::get(), SwDoc::GetAllLayouts(), INetURLObject::GetBase(), GetDBField(), SfxViewFrame::GetDispatcher(), SwViewShell::GetDoc(), SwView::GetDocShell(), SwView::GetEditWin(), SwIoSystem::GetFileFilter(), SfxViewFrame::GetFirst(), vcl::Window::GetFrameWeld(), SwViewShell::getIDocumentDeviceAccess(), SwDoc::getIDocumentDeviceAccess(), SwDoc::getIDocumentFieldsAccess(), SwDoc::getIDocumentMarkAccess(), SwDoc::GetIDocumentUndoRedo(), GetMailMergeEvtSrc(), INetURLObject::GetMainURL(), SfxObjectShell::GetMedium(), SfxObjectShell::GetModel(), SfxViewFrame::GetNext(), SwCursorShell::GetPageCnt(), IDocumentDeviceAccess::getPrintData(), SfxViewShell::GetPrinterController(), IDocumentFieldsAccess::GetRecordsPerDocument(), SwEditShell::GetSectionFormatCount(), SwMailMergeConfigItem::GetTargetView(), SvxHtmlOptions::GetTextEncoding(), SfxObjectShell::GetTitle(), SfxMedium::GetURLObject(), SwWrtShell::GetView(), SwViewShell::GetViewOptions(), SwFEShell::GetVirtPageNum(), SwView::GetWrtShell(), SwView::GetWrtShellPtr(), ErrorHandler::HandleError(), SfxObjectShellLock::Is(), tools::SvRef< T >::is(), SwEditShell::IsExpFieldsLocked(), SwEditShell::IsLabelDoc(), IsMergeError(), IsMergeOk(), IsMergeSilent(), IsValidMergeRecord(), SwXMailMerge::LaunchMailMergeEvent(), lcl_CreateMailFromDoc(), lcl_CreateWorkingDocument(), lcl_getCountFromResultSet(), lcl_PreparePrinterOptions(), 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, sw::mark::New, SwMergeDescriptor::nMergeType, INetURLObject::NONE, Ok, SwMergeDescriptor::pMailMergeConfigItem, SwDoc::RemoveInvisibleContent(), INetURLObject::removeSegment(), Application::Reschedule(), RET_CANCEL, RET_OK, weld::DialogController::runAsync(), SAL_INFO, SwMergeDescriptor::sDBcolumn, SwDoc::SetAllUniqueFlyNames(), SwDoc::SetDBManager(), Task::SetDebugName(), SwViewOption::SetIdle(), SwDoc::SetInMailMerge(), SwEditShell::SetNumberingRestart(), IDocumentDeviceAccess::setPrintData(), SwMailMergeConfigItem::SetTargetView(), Timer::SetTimeout(), INetURLObject::SetURL(), 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(), TARGET, 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 
)
SwDBManager& SwDBManager::operator= ( SwDBManager const &  )
privatedelete
std::shared_ptr< SwMailMergeConfigItem > SwDBManager::PerformMailMerge ( SwView const *  pView)
static
uno::Reference< sdbc::XConnection > const & SwDBManager::RegisterConnection ( OUString const &  rSource)
void SwDBManager::releaseRevokeListener ( )

Stop reacting to removed database registrations.

Definition at line 3262 of file dbmgr.cxx.

References m_pImpl.

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

Revoke not committed registrations in case of mail merge cancel.

Definition at line 3320 of file dbmgr.cxx.

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

Referenced by SwFieldDBPage::dispose(), and ~SwDBManager().

void SwDBManager::RevokeNotUsedConnections ( )

Remove not used connections.

Definition at line 3369 of file dbmgr.cxx.

References m_aNotUsedConnections, and RevokeDataSource().

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

Set connection as used.

Definition at line 3362 of file dbmgr.cxx.

References m_aNotUsedConnections.

Referenced by FindDSConnection().

void SwDBManager::setEmbeddedName ( const OUString &  rEmbeddedName,
SwDocShell rDocShell 
)
void SwDBManager::SetInitDBFields ( bool  b)
inline

Definition at line 309 of file dbmgr.hxx.

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

void SwDBManager::SetMailMergeEvtSrc ( const SwXMailMerge pSrc)
inline

Definition at line 293 of file dbmgr.hxx.

Referenced by SwXMailMerge::execute().

void SwDBManager::SetMergeSilent ( bool  bVal)
inline

Definition at line 296 of file dbmgr.hxx.

Referenced by SwXMailMerge::execute().

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

References comphelper::InitPropertySequence().

Referenced by SwDocShell::SaveAs().

bool SwDBManager::ToNextMergeRecord ( )
private

Definition at line 2186 of file dbmgr.cxx.

References lcl_ToNextRecord(), and m_pImpl.

Referenced by ImportFromConnection(), and MergeMailFiles().

void SwDBManager::ToNextRecord ( const OUString &  rDataSource,
const OUString &  rTableOrQuery 
)
bool SwDBManager::ToRecordId ( sal_Int32  nSet)

Definition at line 2362 of file dbmgr.cxx.

References lcl_MoveAbsolute(), and m_pImpl.

Referenced by SwDBNumSetField::Evaluate().

Member Data Documentation

MergeStatus SwDBManager::m_aMergeStatus
private

current / last merge status

Definition at line 246 of file dbmgr.hxx.

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

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

Not used connections.

Definition at line 260 of file dbmgr.hxx.

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

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

Store last registrations to revoke or commit.

Definition at line 257 of file dbmgr.hxx.

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

bool SwDBManager::m_bInitDBFields
private

Definition at line 247 of file dbmgr.hxx.

bool SwDBManager::m_bInMerge
private

merge process active

Definition at line 248 of file dbmgr.hxx.

Referenced by CloseAll(), and Merge().

bool SwDBManager::m_bMergeSilent
private

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

Definition at line 249 of file dbmgr.hxx.

SwDSParams_t SwDBManager::m_DataSourceParams
private
SwDoc* SwDBManager::m_pDoc
private

The document that owns this manager.

Definition at line 266 of file dbmgr.hxx.

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

std::unique_ptr<SwDBManager_Impl> SwDBManager::m_pImpl
private
const SwXMailMerge* SwDBManager::m_pMergeEvtSrc
private

!= 0 if mail merge events are to be send

Definition at line 252 of file dbmgr.hxx.

OUString SwDBManager::m_sEmbeddedName
private

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

Definition at line 254 of file dbmgr.hxx.

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


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