20 #include <com/sun/star/sdbc/DataType.hpp>
21 #include <com/sun/star/sdbc/XRow.hpp>
26 #include <document.hxx>
33 mbSimpleText(true), mnStrLength(0)
38 const uno::Reference<sdbc::XRow>& xRow, sal_Int32 nRowPos,
44 bool bEmptyFlag =
false;
54 case sdbc::DataType::BIT:
55 case sdbc::DataType::BOOLEAN:
59 nVal = (xRow->getBoolean(nRowPos) ? 1 : 0);
60 bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull();
64 case sdbc::DataType::TINYINT:
65 case sdbc::DataType::SMALLINT:
66 case sdbc::DataType::INTEGER:
67 case sdbc::DataType::BIGINT:
68 case sdbc::DataType::FLOAT:
69 case sdbc::DataType::REAL:
70 case sdbc::DataType::DOUBLE:
71 case sdbc::DataType::NUMERIC:
72 case sdbc::DataType::DECIMAL:
74 nVal = xRow->getDouble(nRowPos);
75 bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull();
79 case sdbc::DataType::CHAR:
80 case sdbc::DataType::VARCHAR:
81 case sdbc::DataType::LONGVARCHAR:
82 aString = xRow->getString(nRowPos);
83 bEmptyFlag = ( aString.isEmpty() ) && xRow->wasNull();
88 util::Date aDate = xRow->getDate(nRowPos);
89 bEmptyFlag = xRow->wasNull();
103 case sdbc::DataType::TIME:
109 util::Time aTime = xRow->getTime(nRowPos);
114 bEmptyFlag = xRow->wasNull();
119 case sdbc::DataType::TIMESTAMP:
125 util::DateTime aStamp = xRow->getTimestamp(nRowPos);
126 if (aStamp.Year != 0)
128 nVal = (
Date( aStamp.Day, aStamp.Month, aStamp.Year ) -
134 bEmptyFlag = xRow->wasNull();
140 case sdbc::DataType::SQLNULL:
144 case sdbc::DataType::BINARY:
145 case sdbc::DataType::VARBINARY:
146 case sdbc::DataType::LONGVARBINARY:
151 catch ( uno::Exception& )
156 if ( bValue && bCurrency )
165 rDoc.
SetError( nCol, nRow, nTab, FormulaError::NotAvailable );
175 if (!aString.isEmpty())
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...
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
static bool SC_DLLPUBLIC isMultiline(const OUString &rStr)
void SetError(SCCOL nCol, SCROW nRow, SCTAB nTab, const FormulaError nError)
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 bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
static SC_DLLPUBLIC LanguageType eLnge
void SetNumberFormat(const ScAddress &rPos, sal_uInt32 nNumberFormat)
void SetEmptyCell(const ScAddress &rPos)
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)
Detailed information on single string value.