LibreOffice Module dbaccess (master) 1
|
#include <DExport.hxx>
Public Types | |
typedef std::map< OUString, OFieldDescription *, ::comphelper::UStringMixLess > | TColumns |
typedef std::vector< TColumns::const_iterator > | TColumnVector |
typedef std::vector< std::pair< sal_Int32, sal_Int32 > > | TPositions |
Public Member Functions | |
ODatabaseExport (const SharedConnection &_rxConnection, const css::uno::Reference< css::util::XNumberFormatter > &_rxNumberF, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, SvStream &_rInputStream) | |
ODatabaseExport (sal_Int32 nRows, TPositions &&_rColumnPositions, const css::uno::Reference< css::util::XNumberFormatter > &_rxNumberF, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const TColumnVector *rList, const OTypeInfoMap *_pInfoMap, bool _bAutoIncrementEnabled, SvStream &_rInputStream) | |
void | SetColumnTypes (const TColumnVector *rList, const OTypeInfoMap *_pInfoMap) |
void | SetTableName (const OUString &_sTableName) |
void | enableCheckOnly () |
bool | isCheckEnabled () const |
Static Public Member Functions | |
static css::uno::Reference< css::sdbc::XPreparedStatement > | createPreparedStatement (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData, const css::uno::Reference< css::beans::XPropertySet > &_xDestTable, const TPositions &_rvColumnPositions) |
Protected Member Functions | |
virtual TypeSelectionPageFactory | getTypeSelectionPageFactory ()=0 |
void | CreateDefaultColumn (const OUString &_rColumnName) |
sal_Int16 | CheckString (const OUString &aToken, sal_Int16 _nOldNumberFormat) |
void | adjustFormat () |
void | eraseTokens () |
void | insertValueIntoColumn () |
void | createRowSet () |
void | showErrorDialog (const css::sdbc::SQLException &e) |
void | ensureFormatter () |
bool | executeWizard (const OUString &_sTableName, const css::uno::Any &_aTextColor, const css::awt::FontDescriptor &_rFont) |
executeWizard calls a wizard to create/append data More... | |
virtual | ~ODatabaseExport () |
Protected Attributes | |
TPositions | m_vColumnPositions |
columns to be used More... | |
std::vector< sal_Int32 > | m_vColumnTypes |
ColumnTypes for faster access. More... | |
std::vector< sal_Int32 > | m_vColumnSize |
std::vector< sal_Int16 > | m_vNumberFormat |
css::lang::Locale | m_aLocale |
TColumns | m_aDestColumns |
container for new created columns More... | |
TColumnVector | m_vDestVector |
css::uno::Reference< css::beans::XPropertySet > | m_xTable |
dest table More... | |
css::uno::Reference< css::container::XNameAccess > | m_xTables |
container More... | |
SharedConnection | m_xConnection |
dest conn More... | |
std::shared_ptr< IUpdateHelper > | m_pUpdateHelper |
css::uno::Reference< css::util::XNumberFormatter > | m_xFormatter |
a number formatter working with the connection's NumberFormatsSupplier More... | |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
css::util::Date | m_aNullDate |
SvNumberFormatter * | m_pFormatter |
SvStream & | m_rInputStream |
OUString | m_sDefaultTableName |
for saving the selected tablename More... | |
OUString | m_sTextToken |
cell content More... | |
OUString | m_sNumToken |
SDNUM value. More... | |
TOTypeInfoSP | m_pTypeInfo |
contains the default type More... | |
const TColumnVector * | m_pColumnList |
const OTypeInfoMap * | m_pInfoMap |
sal_Int32 | m_nColumnPos |
current column position More... | |
sal_Int32 | m_nRows |
number of rows to be searched More... | |
sal_Int32 | m_nRowCount |
current count of rows More... | |
bool | m_bError |
error and termination code More... | |
bool | m_bInTbl |
true, if parser is in RTF table More... | |
bool | m_bHead |
true, if the header hasn't been read yet More... | |
bool | m_bDontAskAgain |
if there is an error when pasting, don't show it again More... | |
bool | m_bIsAutoIncrement |
if PKey is set by user More... | |
bool | m_bFoundTable |
set to true when a table was found More... | |
bool | m_bCheckOnly |
bool | m_bAppendFirstLine |
Definition at line 54 of file DExport.hxx.
typedef std::map<OUString, OFieldDescription*, ::comphelper::UStringMixLess> dbaui::ODatabaseExport::TColumns |
Definition at line 57 of file DExport.hxx.
typedef std::vector<TColumns::const_iterator> dbaui::ODatabaseExport::TColumnVector |
Definition at line 58 of file DExport.hxx.
typedef std::vector< std::pair<sal_Int32,sal_Int32> > dbaui::ODatabaseExport::TPositions |
Definition at line 59 of file DExport.hxx.
|
protectedvirtual |
Definition at line 263 of file DExport.cxx.
References m_aDestColumns, m_pFormatter, and m_vDestVector.
dbaui::ODatabaseExport::ODatabaseExport | ( | const SharedConnection & | _rxConnection, |
const css::uno::Reference< css::util::XNumberFormatter > & | _rxNumberF, | ||
const css::uno::Reference< css::uno::XComponentContext > & | _rxContext, | ||
SvStream & | _rInputStream | ||
) |
dbaui::ODatabaseExport::ODatabaseExport | ( | sal_Int32 | nRows, |
TPositions && | _rColumnPositions, | ||
const css::uno::Reference< css::util::XNumberFormatter > & | _rxNumberF, | ||
const css::uno::Reference< css::uno::XComponentContext > & | _rxContext, | ||
const TColumnVector * | rList, | ||
const OTypeInfoMap * | _pInfoMap, | ||
bool | _bAutoIncrementEnabled, | ||
SvStream & | _rInputStream | ||
) |
|
protected |
Definition at line 741 of file DExport.cxx.
References CheckString(), COLUMN_POSITION_NOT_FOUND, eraseTokens(), m_bIsAutoIncrement, m_nColumnPos, m_sTextToken, m_vColumnPositions, m_vColumnSize, and m_vNumberFormat.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
Definition at line 385 of file DExport.cxx.
References ensureFormatter(), Exception, SvNumberFormatter::GetFormatForLanguageIfBuiltIn(), SfxHTMLParser::GetTableDataOptionsValNum(), SvNumberFormatter::IsNumberFormat(), LANGUAGE_NONE, m_aLocale, m_pFormatter, m_sNumToken, m_sTextToken, m_xFormatter, nType, PROPERTY_TYPE(), and SAL_WARN.
Referenced by adjustFormat().
|
protected |
Definition at line 605 of file DExport.cxx.
References dbaui::isSQL92CheckEnabled(), m_aDestColumns, m_pTypeInfo, m_vDestVector, m_xConnection, nCount, nPos, dbaui::OFieldDescription::SetAutoIncrement(), dbaui::OFieldDescription::SetCurrency(), dbaui::OFieldDescription::SetIsNullable(), dbaui::OFieldDescription::SetName(), dbaui::OFieldDescription::SetPrecision(), dbaui::OFieldDescription::SetPrimaryKey(), dbaui::OFieldDescription::SetScale(), dbaui::OFieldDescription::SetType(), and sName.
Referenced by dbaui::OHTMLReader::CreateTable(), and dbaui::ORTFReader::CreateTable().
|
static |
Definition at line 781 of file DExport.cxx.
References COLUMN_POSITION_NOT_FOUND.
Referenced by createRowSet().
|
protected |
Definition at line 656 of file DExport.cxx.
References createPreparedStatement(), m_pUpdateHelper, m_vColumnPositions, m_xConnection, and m_xTable.
Referenced by executeWizard().
|
inline |
Definition at line 153 of file DExport.hxx.
References m_bCheckOnly.
|
protected |
Definition at line 769 of file DExport.cxx.
References m_aNullDate, m_pFormatter, and m_xFormatter.
Referenced by CheckString(), and insertValueIntoColumn().
|
protected |
Definition at line 763 of file DExport.cxx.
References m_sNumToken, and m_sTextToken.
Referenced by adjustFormat(), insertValueIntoColumn(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
executeWizard calls a wizard to create/append data
_sTableName | the tablename |
_aTextColor | the text color of the new created table |
_rFont | the font of the new table |
Definition at line 661 of file DExport.cxx.
References Any, createRowSet(), DBG_UNHANDLED_EXCEPTION, Exception, dbaui::OCopyTableWizard::GetColumnPositions(), dbaui::OCopyTableWizard::GetColumnTypes(), weld::AssistantController::getDialog(), dbaui::OCopyTableWizard::getOperation(), getTypeSelectionPageFactory(), weld::Window::GetXWindow(), m_aDestColumns, m_bAppendFirstLine, m_bIsAutoIncrement, m_rInputStream, m_sDefaultTableName, m_vColumnPositions, m_vColumnTypes, m_vDestVector, m_xConnection, m_xContext, m_xFormatter, m_xTable, PROPERTY_FONT(), PROPERTY_TEXTCOLOR(), dbaui::OCopyTableWizard::returnTable(), weld::DialogController::run(), dbaui::OCopyTableWizard::shouldCreatePrimaryKey(), and dbaui::OCopyTableWizard::UseHeaderLine().
Referenced by dbaui::OHTMLReader::CreateTable(), and dbaui::ORTFReader::CreateTable().
|
protectedpure virtual |
Implemented in dbaui::OHTMLReader, and dbaui::ORTFReader.
Referenced by executeWizard().
|
protected |
Definition at line 272 of file DExport.cxx.
References COLUMN_POSITION_NOT_FOUND, ensureFormatter(), eraseTokens(), Exception, SvNumberFormatter::GetFormatForLanguageIfBuiltIn(), SfxHTMLParser::GetTableDataOptionsValNum(), dbaui::OFieldDescription::GetType(), dbaui::OFieldDescription::IsNullable(), SvNumberFormatter::IsNumberFormat(), LANGUAGE_NONE, m_aLocale, m_aNullDate, m_bIsAutoIncrement, m_nColumnPos, m_pFormatter, m_pUpdateHelper, m_sNumToken, m_sTextToken, m_vColumnPositions, m_vColumnTypes, m_vDestVector, m_xFormatter, nPos, nType, PROPERTY_TYPE(), and SAL_INFO.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
inline |
Definition at line 154 of file DExport.hxx.
References m_bCheckOnly.
Referenced by dbaui::OHTMLReader::CreateTable(), and dbaui::ORTFReader::CreateTable().
void ODatabaseExport::SetColumnTypes | ( | const TColumnVector * | rList, |
const OTypeInfoMap * | _pInfoMap | ||
) |
Definition at line 530 of file DExport.cxx.
References i, m_aLocale, m_vColumnSize, m_vNumberFormat, m_xFormatter, nDataType, nLength, and nType.
Referenced by dbaui::OHTMLReader::CallParser(), and dbaui::ORTFReader::CallParser().
|
inline |
Definition at line 151 of file DExport.hxx.
References m_sDefaultTableName.
|
protected |
Definition at line 725 of file DExport.cxx.
References DBA_RES, dbaui::DefaultNo, m_bDontAskAgain, m_bError, RET_YES, weld::DialogController::run(), and dbaui::YesNo.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
container for new created columns
Definition at line 68 of file DExport.hxx.
Referenced by CreateDefaultColumn(), executeWizard(), and ~ODatabaseExport().
|
protected |
Definition at line 66 of file DExport.hxx.
Referenced by CheckString(), insertValueIntoColumn(), and SetColumnTypes().
|
protected |
Definition at line 78 of file DExport.hxx.
Referenced by ensureFormatter(), and insertValueIntoColumn().
|
protected |
Definition at line 100 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CreateTable(), dbaui::ORTFReader::CreateTable(), executeWizard(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
Definition at line 99 of file DExport.hxx.
Referenced by enableCheckOnly(), and isCheckEnabled().
|
protected |
if there is an error when pasting, don't show it again
Definition at line 96 of file DExport.hxx.
Referenced by showErrorDialog().
|
protected |
error and termination code
Definition at line 93 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::NextToken(), dbaui::ORTFReader::NextToken(), and showErrorDialog().
|
protected |
set to true when a table was found
Definition at line 98 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CallParser(), dbaui::ORTFReader::CallParser(), dbaui::OHTMLReader::CreateTable(), and dbaui::ORTFReader::CreateTable().
|
protected |
true, if the header hasn't been read yet
Definition at line 95 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
true, if parser is in RTF table
Definition at line 94 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CreateTable(), dbaui::ORTFReader::CreateTable(), dbaui::OHTMLReader::fetchOptions(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
if PKey is set by user
Definition at line 97 of file DExport.hxx.
Referenced by adjustFormat(), executeWizard(), insertValueIntoColumn(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
current column position
Definition at line 90 of file DExport.hxx.
Referenced by adjustFormat(), insertValueIntoColumn(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
current count of rows
Definition at line 92 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
number of rows to be searched
Definition at line 91 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
Definition at line 88 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CallParser(), and dbaui::ORTFReader::CallParser().
|
protected |
Definition at line 80 of file DExport.hxx.
Referenced by CheckString(), ensureFormatter(), insertValueIntoColumn(), and ~ODatabaseExport().
|
protected |
Definition at line 89 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CallParser(), and dbaui::ORTFReader::CallParser().
|
protected |
contains the default type
Definition at line 87 of file DExport.hxx.
Referenced by CreateDefaultColumn().
|
protected |
Definition at line 75 of file DExport.hxx.
Referenced by createRowSet(), insertValueIntoColumn(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
Definition at line 81 of file DExport.hxx.
Referenced by executeWizard().
|
protected |
for saving the selected tablename
Definition at line 83 of file DExport.hxx.
Referenced by executeWizard(), and SetTableName().
|
protected |
SDNUM value.
Definition at line 86 of file DExport.hxx.
Referenced by CheckString(), eraseTokens(), dbaui::OHTMLReader::fetchOptions(), and insertValueIntoColumn().
|
protected |
cell content
Definition at line 85 of file DExport.hxx.
Referenced by adjustFormat(), CheckString(), dbaui::OHTMLReader::CreateTable(), eraseTokens(), insertValueIntoColumn(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
columns to be used
Definition at line 62 of file DExport.hxx.
Referenced by adjustFormat(), createRowSet(), executeWizard(), and insertValueIntoColumn().
|
protected |
Definition at line 64 of file DExport.hxx.
Referenced by adjustFormat(), and SetColumnTypes().
|
protected |
ColumnTypes for faster access.
Definition at line 63 of file DExport.hxx.
Referenced by executeWizard(), and insertValueIntoColumn().
|
protected |
Definition at line 69 of file DExport.hxx.
Referenced by CreateDefaultColumn(), dbaui::OHTMLReader::CreateTable(), dbaui::ORTFReader::CreateTable(), executeWizard(), insertValueIntoColumn(), and ~ODatabaseExport().
|
protected |
Definition at line 65 of file DExport.hxx.
Referenced by adjustFormat(), and SetColumnTypes().
|
protected |
dest conn
Definition at line 73 of file DExport.hxx.
Referenced by CreateDefaultColumn(), createRowSet(), executeWizard(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
Definition at line 77 of file DExport.hxx.
Referenced by executeWizard().
|
protected |
a number formatter working with the connection's NumberFormatsSupplier
Definition at line 76 of file DExport.hxx.
Referenced by CheckString(), ensureFormatter(), executeWizard(), insertValueIntoColumn(), and SetColumnTypes().
|
protected |
dest table
Definition at line 71 of file DExport.hxx.
Referenced by createRowSet(), dbaui::OHTMLReader::CreateTable(), dbaui::ORTFReader::CreateTable(), executeWizard(), dbaui::OHTMLReader::NextToken(), and dbaui::ORTFReader::NextToken().
|
protected |
container
Definition at line 72 of file DExport.hxx.
Referenced by dbaui::OHTMLReader::CreateTable(), and dbaui::ORTFReader::CreateTable().