20#include <com/sun/star/sdbc/DataType.hpp>
21#include <com/sun/star/sdbc/XRow.hpp>
27#include <document.hxx>
34 mbSimpleText(true), mnStrLength(0)
39 const uno::Reference<sdbc::XRow>& xRow, sal_Int32 nRowPos,
45 bool bEmptyFlag =
false;
55 case sdbc::DataType::BIT:
56 case sdbc::DataType::BOOLEAN:
60 nVal = (xRow->getBoolean(nRowPos) ? 1 : 0);
61 bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull();
65 case sdbc::DataType::TINYINT:
66 case sdbc::DataType::SMALLINT:
67 case sdbc::DataType::INTEGER:
68 case sdbc::DataType::BIGINT:
69 case sdbc::DataType::FLOAT:
70 case sdbc::DataType::REAL:
71 case sdbc::DataType::DOUBLE:
72 case sdbc::DataType::NUMERIC:
73 case sdbc::DataType::DECIMAL:
75 nVal = xRow->getDouble(nRowPos);
76 bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull();
80 case sdbc::DataType::CHAR:
81 case sdbc::DataType::VARCHAR:
82 case sdbc::DataType::LONGVARCHAR:
83 aString = xRow->getString(nRowPos);
84 bEmptyFlag = ( aString.isEmpty() ) && xRow->wasNull();
89 util::Date aDate = xRow->getDate(nRowPos);
90 bEmptyFlag = xRow->wasNull();
104 case sdbc::DataType::TIME:
110 util::Time aTime = xRow->getTime(nRowPos);
115 bEmptyFlag = xRow->wasNull();
120 case sdbc::DataType::TIMESTAMP:
126 util::DateTime aStamp = xRow->getTimestamp(nRowPos);
127 if (aStamp.Year != 0)
129 nVal = (
Date( aStamp.Day, aStamp.Month, aStamp.Year ) -
135 bEmptyFlag = xRow->wasNull();
141 case sdbc::DataType::SQLNULL:
145 case sdbc::DataType::BINARY:
146 case sdbc::DataType::VARBINARY:
147 case sdbc::DataType::LONGVARBINARY:
152 catch ( uno::Exception& )
157 if ( bValue && bCurrency )
166 rDoc.
SetError( nCol, nRow, nTab, FormulaError::NotAvailable );
176 if (!aString.isEmpty())
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)
void SetEmptyCell(const ScAddress &rPos)
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
SC_DLLPUBLIC void SetNumberFormat(const ScAddress &rPos, sal_uInt32 nNumberFormat)
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
void SetError(SCCOL nCol, SCROW nRow, SCTAB nTab, const FormulaError nError)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
static SC_DLLPUBLIC LanguageType eLnge
static bool SC_DLLPUBLIC isMultiline(std::u16string_view rStr)
Detailed information on single string value.
Store parameters used in the ScDocument::SetString() method.
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is.