20#include <config_features.h>
33#include <rtl/character.hxx>
34#include <rtl/tencinfo.h>
36#include <osl/diagnose.h>
40#include <com/sun/star/sdb/CommandType.hpp>
41#include <com/sun/star/sdbc/DataType.hpp>
42#include <com/sun/star/sdbc/SQLException.hpp>
43#include <com/sun/star/sdbc/XConnection.hpp>
44#include <com/sun/star/sdbc/DriverManager.hpp>
45#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
46#include <com/sun/star/sdbc/XRow.hpp>
47#include <com/sun/star/sdbc/XRowSet.hpp>
48#include <com/sun/star/sdbc/XRowUpdate.hpp>
49#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
50#include <com/sun/star/sdbcx/XAppend.hpp>
51#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
52#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
53#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
54#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
55#include <com/sun/star/lang/XMultiServiceFactory.hpp>
56#include <com/sun/star/beans/XPropertySet.hpp>
57#include <com/sun/star/ucb/NameClash.hpp>
58#include <com/sun/star/ucb/TransferInfo.hpp>
59#include <com/sun/star/ucb/XCommandInfo.hpp>
63#include <progress.hxx>
79#include <unordered_set>
85#if HAVE_FEATURE_DBCONNECTIVITY
90constexpr OUStringLiteral SC_DBPROP_ACTIVECONNECTION =
u"ActiveConnection";
93constexpr OUStringLiteral SC_DBPROP_PROPCHANGE_NOTIFY =
u"PropertyChangeNotificationEnabled";
95constexpr OUStringLiteral SC_DBPROP_NAME =
u"Name";
96constexpr OUStringLiteral SC_DBPROP_TYPE =
u"Type";
97constexpr OUStringLiteral SC_DBPROP_PRECISION =
u"Precision";
98constexpr OUStringLiteral SC_DBPROP_SCALE =
u"Scale";
100constexpr OUStringLiteral SC_DBPROP_EXTENSION =
u"Extension";
101constexpr OUStringLiteral SC_DBPROP_CHARSET =
u"CharSet";
105 ErrCode lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr, uno::Reference<sdbc::XConnection>& _rConnection, OUString& _rTabName, std::u16string_view rFullFileName, rtl_TextEncoding eCharSet)
108 aURL.SetSmartProtocol( INetProtocol::File );
109 aURL.SetSmartURL( rFullFileName );
112 OUString aExtension =
aURL.getExtension();
113 aURL.removeSegment();
114 aURL.removeFinalSlash();
118 _rDrvMgr.set( sdbc::DriverManager::create( xContext ) );
122 const OUString aConnUrl{
"sdbc:dbase:" + aPath};
129 { SC_DBPROP_EXTENSION,
uno::Any(aExtension) },
130 { SC_DBPROP_CHARSET,
uno::Any(eCharSet) }
133 _rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps );
144 bool bMoveData =
true;
145 bool bRet =
true, bKillSource =
false;
159 uno::Reference< css::ucb::XCommandEnvironment >(),
161 uno::Reference< css::ucb::XCommandInfo > xInfo = aDestPath.
getCommands();
162 OUString aTransferName =
"transfer";
163 if ( xInfo->hasCommandByName( aTransferName ) )
167 css::ucb::NameClash::ERROR ) ) );
171 OSL_FAIL(
"transfer command not available" );
174 catch( uno::Exception& )
192 uno::Reference< css::ucb::XCommandEnvironment >(),
196 catch( uno::Exception& )
211 uno::Reference< css::ucb::XCommandEnvironment >(),
215 catch( uno::Exception& )
224#if HAVE_FEATURE_DBCONNECTIVITY
226static void lcl_setScalesToColumns(
ScDocument& rDoc,
const vector<tools::Long>& rScales)
232 SCCOL nColCount =
static_cast<SCCOL>(rScales.size());
233 for (
SCCOL i = 0;
i < nColCount; ++
i)
244 bool bThousand, bNegRed;
245 sal_uInt16 nPrecision, nLeading;
248 nPrecision =
static_cast<sal_uInt16
>(rScales[
i]);
249 OUString aNewPicture = pFormatter->
GenerateFormat(nOldFormat, eLang,
250 bThousand, bNegRed, nPrecision, nLeading);
252 sal_uInt32 nNewFormat = pFormatter->
GetEntryKey(aNewPicture, eLang);
253 if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
255 sal_Int32 nErrPos = 0;
258 aNewPicture, nErrPos, nNewType, nNewFormat, eLang);
276#if !HAVE_FEATURE_DBCONNECTIVITY
277 (void) rFullFileName;
279 (void) aColWidthParam;
280 (void) rRowHeightsRecalc;
290 sal_Int32 nColCount = 0;
292 uno::Reference<sdbc::XDriverManager2> xDrvMan;
293 uno::Reference<sdbc::XConnection> xConnection;
294 ErrCode nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
295 if ( !xConnection.is() || !xDrvMan.is() )
304 uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
305 OSL_ENSURE( xRowProp.is(),
"can't get RowSet" );
308 xRowProp->setPropertyValue( SC_DBPROP_ACTIVECONNECTION,
uno::Any(xConnection) );
314 xRowProp->setPropertyValue( SC_DBPROP_PROPCHANGE_NOTIFY,
uno::Any(
false) );
318 uno::Reference<sdbc::XResultSetMetaData> xMeta;
319 uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY );
320 if ( xMetaSupp.is() )
321 xMeta = xMetaSupp->getMetaData();
323 nColCount = xMeta->getColumnCount();
331 uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
332 OSL_ENSURE( xRow.is(),
"can't get Row" );
336 uno::Sequence<sal_Int32> aColTypes( nColCount );
337 sal_Int32* pTypeArr = aColTypes.getArray();
338 for (
i=0;
i<nColCount;
i++)
339 pTypeArr[
i] = xMeta->getColumnType(
i+1 );
346 vector<tools::Long> aScales(nColCount, -1);
347 for (
i=0;
i<nColCount;
i++)
349 OUString aHeader = xMeta->getColumnLabel(
i+1 );
351 switch ( pTypeArr[
i] )
353 case sdbc::DataType::BIT:
359 case sdbc::DataType::LONGVARCHAR:
362 case sdbc::DataType::VARCHAR:
363 aHeader +=
",C," + OUString::number( xMeta->getColumnDisplaySize(
i+1 ) );
365 case sdbc::DataType::DECIMAL:
374 OUString::number( nScale );
387 while ( !bEnd && xRowSet->next() )
389 if ( nRow <= m_pDocument->MaxRow() )
391 bool bSimpleRow =
true;
393 for (
i=0;
i<nColCount;
i++)
397 xRow,
i+1, pTypeArr[
i],
false,
400 if (aStrData.
mnStrLength > aColWidthParam[nCol].mnMaxTextLen)
402 aColWidthParam[nCol].mnMaxTextLen = aStrData.
mnStrLength;
403 aColWidthParam[nCol].mnMaxTextRow = nRow;
409 aColWidthParam[nCol].mbSimpleText =
false;
415 rRowHeightsRecalc.
setTrue(nRow, nRow);
425 catch ( sdbc::SQLException& )
429 catch ( uno::Exception& )
439#if HAVE_FEATURE_DBCONNECTIVITY
443void lcl_GetColumnTypes(
445 OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
446 sal_Int32* pColScales,
bool& bHasMemo, rtl_TextEncoding eCharSet )
457 typedef std::unordered_set<OUString> StrSetType;
461 SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
462 for (
SCCOL nCol = nFirstCol; nCol <= nLastCol; nCol++ )
464 bool bTypeDefined =
false;
465 bool bPrecDefined =
false;
466 sal_Int32 nFieldLen = 0;
467 sal_Int32 nPrecision = 0;
468 sal_Int32 nDbType = sdbc::DataType::SQLNULL;
473 if ( bHasFieldNames )
475 OUString aString {rDoc.
GetString(nCol, nFirstRow, nTab).toAsciiUpperCase()};
477 aFieldName = aString.getToken( 0,
',', nIdx);
480 aString = aString.replaceAll(
" ",
"");
484 nDbType = sdbc::DataType::BIT;
496 nDbType = sdbc::DataType::LONGVARCHAR;
503 nDbType = sdbc::DataType::VARCHAR;
508 nDbType = sdbc::DataType::DECIMAL;
512 if ( bTypeDefined && !nFieldLen && nIdx>0 )
515 if ( !bPrecDefined && nIdx>0 )
517 OUString aTmp( aString.getToken( 0,
',', nIdx ) );
520 nPrecision = aTmp.toInt32();
521 if (nPrecision && nFieldLen < nPrecision+1)
522 nFieldLen = nPrecision + 1;
535 if ( !rtl::isAsciiAlpha(aFieldName[0]) )
536 aFieldName =
"N" + aFieldName;
537 OUStringBuffer aTmpStr;
539 for (
const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ )
541 if ( rtl::isAsciiAlpha(c) || rtl::isAsciiDigit(c) || c ==
'_' )
546 aFieldName = aTmpStr.makeStringAndClear();
547 if ( aFieldName.getLength() > 10 )
548 aFieldName = aFieldName.copy(0, 10);
553 OUString aFixPart( aFieldName );
557 OUString aVarPart = OUString::number( nSub );
558 if ( aFixPart.getLength() + aVarPart.getLength() > 10 )
559 aFixPart = aFixPart.copy( 0, 10 - aVarPart.getLength() );
560 aFieldName = aFixPart + aVarPart;
566 aFieldName =
"N" + OUString::number(nCol+1);
572 if (aCell.isEmpty() || aCell.hasString())
573 nDbType = sdbc::DataType::VARCHAR;
576 sal_uInt32 nFormat = rDoc.
GetNumberFormat( nCol, nFirstDataRow, nTab );
577 switch ( pNumFmt->
GetType( nFormat ) )
579 case SvNumFormatType::LOGICAL :
580 nDbType = sdbc::DataType::BIT;
583 case SvNumFormatType::DATE :
587 case SvNumFormatType::TIME :
588 case SvNumFormatType::DATETIME :
589 nDbType = sdbc::DataType::VARCHAR;
592 nDbType = sdbc::DataType::DECIMAL;
597 if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen )
600 nLastRow, eCharSet );
601 if ( nFieldLen == 0 )
604 else if ( nDbType == sdbc::DataType::DECIMAL )
609 nFirstDataRow, nLastRow );
611 if ( nPrecision > 15 )
615 if ( bPrecDefined && nPrecision != nPrec )
617 if (nPrecision < nPrec)
628 SAL_WARN(
"sc",
"lcl_GetColumnTypes: conflicting dBase field precision for "
629 << aFieldName <<
" (" << nPrecision <<
"<" << nPrec <<
")");
634 if (nFieldLen - nPrecision > nLen - nPrec)
635 nLen = nFieldLen - (nPrecision ? nPrecision+1 : 0) + 1 + nPrec;
643 nLen = nLen + ( nPrecision - nPrec );
651 nLen = nLen + ( nPrecision - nPrec );
657 if (nFieldLen < nLen)
666 SAL_WARN(
"sc",
"lcl_GetColumnTypes: conflicting dBase field length for "
667 << aFieldName <<
" (" << nFieldLen <<
"<" << nLen <<
")");
673 if ( nFieldLen == 0 )
675 else if ( nFieldLen > 19 )
677 if ( nPrecision && nFieldLen < nPrecision + 2 )
678 nFieldLen = nPrecision + 2;
685 if ( nFieldLen > 254 )
687 if ( nDbType == sdbc::DataType::VARCHAR )
689 nDbType = sdbc::DataType::LONGVARCHAR;
697 pColNames[nField] = aFieldName;
698 pColTypes[nField] = nDbType;
699 pColLengths[nField] = nFieldLen;
700 pColScales[nField] = nPrecision;
706void lcl_getLongVarCharEditString( OUString& rString,
713 rString = rEditEngine.
GetText( LINEEND_CRLF );
716void lcl_getLongVarCharString(
731#if !HAVE_FEATURE_DBCONNECTIVITY
732 (void) rFullFileName;
739 INetURLObject aDeleteObj( rFullFileName, INetProtocol::File );
744 SCCOL nFirstCol, nLastCol;
745 SCROW nFirstRow, nLastRow;
747 m_pDocument->GetDataStart( nTab, nFirstCol, nFirstRow );
748 m_pDocument->GetCellArea( nTab, nLastCol, nLastRow );
749 if ( nFirstCol > nLastCol )
750 nFirstCol = nLastCol;
751 if ( nFirstRow > nLastRow )
752 nFirstRow = nLastRow;
754 nLastRow - nFirstRow,
true );
757 bool bHasFieldNames =
true;
758 for (
SCCOL nDocCol = nFirstCol; nDocCol <= nLastCol && bHasFieldNames; nDocCol++ )
760 if ( !
m_pDocument->HasStringData( nDocCol, nFirstRow, nTab ) )
761 bHasFieldNames =
false;
764 sal_Int32 nColCount = nLastCol - nFirstCol + 1;
765 uno::Sequence<OUString>
aColNames( nColCount );
766 uno::Sequence<sal_Int32> aColTypes( nColCount );
767 uno::Sequence<sal_Int32> aColLengths( nColCount );
768 uno::Sequence<sal_Int32> aColScales( nColCount );
770 ScRange aDataRange( nFirstCol, nFirstRow, nTab, nLastCol, nLastRow, nTab );
771 lcl_GetColumnTypes( *
this, aDataRange, bHasFieldNames,
772 aColNames.getArray(), aColTypes.getArray(),
773 aColLengths.getArray(), aColScales.getArray(),
774 bHasMemo, eCharSet );
782 uno::Reference<sdbc::XDriverManager2> xDrvMan;
783 uno::Reference<sdbc::XConnection> xConnection;
785 ErrCode nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
786 if ( !xConnection.is() || !xDrvMan.is() )
791 uno::Reference< sdbcx::XDataDefinitionSupplier > xDDSup( xDrvMan->getDriverByURL( xConnection->getMetaData()->getURL() ), uno::UNO_QUERY );
796 uno::Reference<sdbcx::XTablesSupplier> xTablesSupp =xDDSup->getDataDefinitionByConnection( xConnection );
797 OSL_ENSURE( xTablesSupp.is(),
"can't get Data Definition" );
800 uno::Reference<container::XNameAccess> xTables = xTablesSupp->getTables();
801 OSL_ENSURE( xTables.is(),
"can't get Tables" );
804 uno::Reference<sdbcx::XDataDescriptorFactory> xTablesFact( xTables, uno::UNO_QUERY );
805 OSL_ENSURE( xTablesFact.is(),
"can't get tables factory" );
808 uno::Reference<sdbcx::XAppend> xTablesAppend( xTables, uno::UNO_QUERY );
809 OSL_ENSURE( xTablesAppend.is(),
"can't get tables XAppend" );
812 uno::Reference<beans::XPropertySet> xTableDesc = xTablesFact->createDataDescriptor();
813 OSL_ENSURE( xTableDesc.is(),
"can't get table descriptor" );
816 xTableDesc->setPropertyValue( SC_DBPROP_NAME,
uno::Any(aTabName) );
820 uno::Reference<sdbcx::XColumnsSupplier> xColumnsSupp( xTableDesc, uno::UNO_QUERY );
821 OSL_ENSURE( xColumnsSupp.is(),
"can't get columns supplier" );
824 uno::Reference<container::XNameAccess> xColumns = xColumnsSupp->getColumns();
825 OSL_ENSURE( xColumns.is(),
"can't get columns" );
828 uno::Reference<sdbcx::XDataDescriptorFactory> xColumnsFact( xColumns, uno::UNO_QUERY );
829 OSL_ENSURE( xColumnsFact.is(),
"can't get columns factory" );
832 uno::Reference<sdbcx::XAppend> xColumnsAppend( xColumns, uno::UNO_QUERY );
833 OSL_ENSURE( xColumnsAppend.is(),
"can't get columns XAppend" );
836 const OUString* pColNames =
aColNames.getConstArray();
837 const sal_Int32* pColTypes = aColTypes.getConstArray();
838 const sal_Int32* pColLengths = aColLengths.getConstArray();
839 const sal_Int32* pColScales = aColScales.getConstArray();
842 for (nCol=0; nCol<nColCount; nCol++)
844 uno::Reference<beans::XPropertySet> xColumnDesc = xColumnsFact->createDataDescriptor();
845 OSL_ENSURE( xColumnDesc.is(),
"can't get column descriptor" );
848 xColumnDesc->setPropertyValue( SC_DBPROP_NAME,
uno::Any(pColNames[nCol]) );
850 xColumnDesc->setPropertyValue( SC_DBPROP_TYPE,
uno::Any(pColTypes[nCol]) );
852 xColumnDesc->setPropertyValue( SC_DBPROP_PRECISION,
uno::Any(pColLengths[nCol]) );
854 xColumnDesc->setPropertyValue( SC_DBPROP_SCALE,
uno::Any(pColScales[nCol]) );
856 xColumnsAppend->appendByDescriptor( xColumnDesc );
859 xTablesAppend->appendByDescriptor( xTableDesc );
866 uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
867 OSL_ENSURE( xRowProp.is(),
"can't get RowSet" );
870 xRowProp->setPropertyValue( SC_DBPROP_ACTIVECONNECTION,
uno::Any(xConnection) );
880 uno::Reference<sdbc::XResultSetUpdate> xResultUpdate( xRowSet, uno::UNO_QUERY );
881 OSL_ENSURE( xResultUpdate.is(),
"can't get XResultSetUpdate" );
884 uno::Reference<sdbc::XRowUpdate> xRowUpdate( xRowSet, uno::UNO_QUERY );
885 OSL_ENSURE( xRowUpdate.is(),
"can't get XRowUpdate" );
888 SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
891 for ( nDocRow = nFirstDataRow; nDocRow <= nLastRow; nDocRow++ )
893 xResultUpdate->moveToInsertRow();
895 for (nCol=0; nCol<nColCount; nCol++)
897 SCCOL nDocCol = sal::static_int_cast<SCCOL>( nFirstCol + nCol );
899 switch (pColTypes[nCol])
901 case sdbc::DataType::LONGVARCHAR:
908 lcl_getLongVarCharEditString(aString, aCell, aEditEngine);
912 lcl_getLongVarCharString(
913 aString, *
m_pDocument, nDocCol, nDocRow, nTab, *pNumFmt);
915 xRowUpdate->updateString( nCol+1, aString );
918 xRowUpdate->updateNull( nCol+1 );
922 case sdbc::DataType::VARCHAR:
923 aString =
m_pDocument->GetString(nDocCol, nDocRow, nTab);
924 xRowUpdate->updateString( nCol+1, aString );
925 if ( nErr ==
ERRCODE_NONE && pColLengths[nCol] < aString.getLength() )
931 fVal =
m_pDocument->GetValue( nDocCol, nDocRow, nTab );
933 bool bIsNull = (fVal == 0.0);
935 bIsNull = !
m_pDocument->HasValueData( nDocCol, nDocRow, nTab );
938 xRowUpdate->updateNull( nCol+1 );
940 m_pDocument->HasStringData( nDocCol, nDocRow, nTab ) )
947 xRowUpdate->updateDate( nCol+1, aDate.
GetUNODate() );
952 case sdbc::DataType::DECIMAL:
953 case sdbc::DataType::BIT:
954 fVal =
m_pDocument->GetValue( nDocCol, nDocRow, nTab );
956 m_pDocument->HasStringData( nDocCol, nDocRow, nTab ) )
958 if ( pColTypes[nCol] == sdbc::DataType::BIT )
959 xRowUpdate->updateBoolean( nCol+1, ( fVal != 0.0 ) );
961 xRowUpdate->updateDouble( nCol+1, fVal );
965 OSL_FAIL(
"ScDocShell::DBaseExport: unknown FieldType" );
968 fVal =
m_pDocument->GetValue( nDocCol, nDocRow, nTab );
969 xRowUpdate->updateDouble( nCol+1, fVal );
973 xResultUpdate->insertRow();
984 catch (
const sdbc::SQLException& aException )
986 sal_Int32 nError = aException.ErrorCode;
989 if (nError == 22018 || nError == 22001)
993 bool bEncErr = (nError == 22018);
994 bool bIsOctetTextEncoding = rtl_isOctetTextEncoding( eCharSet);
995 OSL_ENSURE( !bEncErr || bIsOctetTextEncoding,
"ScDocShell::DBaseExport: encoding error and not an octet textencoding");
996 SCCOL nDocCol = nFirstCol;
997 const sal_Int32* pColTypes = aColTypes.getConstArray();
998 const sal_Int32* pColLengths = aColLengths.getConstArray();
1000 nDocRow, nLastCol, nDocRow);
1007 SCCOL nCol = nDocCol - nFirstCol;
1008 switch (pColTypes[nCol])
1010 case sdbc::DataType::LONGVARCHAR:
1013 lcl_getLongVarCharEditString(aString, *pCell, aEditEngine);
1015 lcl_getLongVarCharString(
1016 aString, *
m_pDocument, nDocCol, nDocRow, nTab, *pNumFmt);
1020 case sdbc::DataType::VARCHAR:
1021 aString =
m_pDocument->GetString(nDocCol, nDocRow, nTab);
1034 if (bIsOctetTextEncoding)
1037 if (!aString.convertToString( &aOString, eCharSet,
1038 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
1039 RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
1044 nLen = aOString.getLength();
1046 SAL_WARN(
"sc",
"ScDocShell::DBaseExport encoding error, string with default replacements: ``" << aString <<
"''");
1051 pColTypes[nCol] != sdbc::DataType::LONGVARCHAR &&
1052 pColLengths[nCol] < nLen)
1055 SAL_INFO(
"sc",
"ScDocShell::DBaseExport: field width: " << pColLengths[nCol] <<
", encoded length: " << nLen);
1061 OUString sPosition(
ScAddress(nDocCol, nDocRow, nTab).GetColRowString());
1065 DialogMask::ButtonsOk | DialogMask::MessageError);
1067 else if ( !aException.Message.isEmpty() )
1072 catch ( uno::Exception& )
const char *const aFieldNames[]
static bool isAsciiNumeric(std::u16string_view rStr)
css::util::Date GetUNODate() const
void AddDays(sal_Int32 nAddDays)
OUString GetText(LineEnd eEnd=LINEEND_LF) const
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
INetProtocol GetProtocol() const
static void PutData(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const css::uno::Reference< css::sdbc::XRow > &xRow, sal_Int32 nRowPos, tools::Long nType, bool bCurrency, StrData *pStrData=nullptr)
static SAL_DLLPRIVATE bool KillFile(const INetURLObject &rURL)
SAL_DLLPRIVATE SCTAB GetSaveTab()
const ScDocument & GetDocument() const
std::shared_ptr< ScDocument > m_pDocument
static SAL_DLLPRIVATE bool MoveFile(const INetURLObject &rSource, const INetURLObject &rDest)
SAL_DLLPRIVATE ErrCode DBaseExport(const OUString &rFullFileName, rtl_TextEncoding eCharSet, bool &bHasMemo)
SAL_DLLPRIVATE ErrCode DBaseImport(const OUString &rFullFileName, rtl_TextEncoding eCharSet, std::map< SCCOL, ScColWidthParam > &aColWidthParam, ScFlatBoolRowSegments &rRowHeightsRecalc)
static SAL_DLLPRIVATE bool IsDocument(const INetURLObject &rURL)
sal_Int32 GetMaxNumberStringLen(sal_uInt16 &nPrecision, SCTAB nTab, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd) const
Maximum string length of numerical cells of a column, e.g.
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
SC_DLLPUBLIC SCROW MaxRow() const
sal_Int32 GetMaxStringLen(SCTAB nTab, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet) const
Maximum string length of a column, e.g.
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
bool setTrue(SCROW nRow1, SCROW nRow2)
ScRefCellValue * GetNext(SCCOL &rCol, SCROW &rRow)
void SetState(sal_uInt64 nVal, sal_uInt64 nNewRange=0)
void SetStateOnPercent(sal_uInt64 nVal)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SVL_DLLPUBLIC sal_Int32 ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale)
static SVL_DLLPUBLIC sal_Int32 ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale)
static OUString GetTextString(const rtl_TextEncoding nEnc)
css::uno::Any executeCommand(const OUString &rCommandName, const css::uno::Any &rCommandArgument)
css::uno::Reference< css::ucb::XCommandInfo > getCommands()
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral SC_DBPROP_COMMAND
constexpr OUStringLiteral SC_SERVICE_ROWSET
constexpr OUStringLiteral SC_DBPROP_COMMANDTYPE
#define ERRCODE_IO_GENERAL
Reference< XSingleServiceFactory > xFactory
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
void disposeComponent(css::uno::Reference< TYPE > &_rxComp)
Reference< XMultiServiceFactory > getProcessServiceFactory()
Reference< XComponentContext > getProcessComponentContext()
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const Color aColNames[SC_RANGECOLORS]
OUString ScResId(TranslateId aId)
#define SCERR_EXPORT_FIELDWIDTH
#define SCERR_EXPORT_ENCODING
#define SCWARN_IMPORT_RANGE_OVERFLOW
#define SCWARN_EXPORT_DATALOST
#define SCERR_EXPORT_DATA
#define SCWARN_IMPORT_COLUMN_OVERFLOW
#define SCERR_IMPORT_CONNECT
#define SCERR_EXPORT_SQLEXCEPTION
#define SCERR_EXPORT_CONNECT
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
Detailed information on single string value.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
const EditTextObject * getEditText() const