23#include <com/sun/star/sdbc/ColumnValue.hpp>
27#include <com/sun/star/util/NumberFormat.hpp>
29#define DEFAULT_VARCHAR_PRECISION 100
30#define DEFAULT_OTHER_PRECISION 16
31#define DEFAULT_NUMERIC_PRECISION 5
32#define DEFAULT_NUMERIC_SCALE 0
40OFieldDescription::OFieldDescription()
44 ,m_nIsNullable(ColumnValue::NULLABLE)
47 ,m_bIsAutoIncrement(false)
48 ,m_bIsPrimaryKey(false)
55 :m_aControlDefault(rDescr.m_aControlDefault)
56 ,m_aWidth(rDescr.m_aWidth)
57 ,m_aRelativePosition(rDescr.m_aRelativePosition)
58 ,m_pType(rDescr.m_pType)
60 ,m_xDestInfo(rDescr.m_xDestInfo)
62 ,m_sTypeName(rDescr.m_sTypeName)
64 ,m_sAutoIncrementValue(rDescr.m_sAutoIncrementValue)
65 ,m_nType(rDescr.m_nType)
66 ,m_nPrecision(rDescr.m_nPrecision)
67 ,m_nScale(rDescr.m_nScale)
68 ,m_nIsNullable(rDescr.m_nIsNullable)
69 ,m_nFormatKey(rDescr.m_nFormatKey)
70 ,m_eHorJustify(rDescr.m_eHorJustify)
71 ,m_bIsAutoIncrement(rDescr.m_bIsAutoIncrement)
72 ,m_bIsPrimaryKey(rDescr.m_bIsPrimaryKey)
73 ,m_bIsCurrency(rDescr.m_bIsCurrency)
74 ,m_bHidden(rDescr.m_bHidden)
86 ,m_nIsNullable(ColumnValue::NULLABLE)
89 ,m_bIsAutoIncrement(false)
90 ,m_bIsPrimaryKey(false)
94 OSL_ENSURE(xAffectedCol.is(),
"PropertySet can not be null!");
95 if ( !xAffectedCol.is() )
139 if ( aValue.hasValue() )
151 if ( aValue.hasValue() )
157 catch(
const Exception&)
167 if ( _pType == pOldType )
177 bool bForce = _bForce || !pOldType || pOldType->nType != _pType->nType;
178 switch ( _pType->nType )
181 case DataType::VARCHAR:
187 SetPrecision(std::min<sal_Int32>(nPrec,_pType->nPrecision));
190 case DataType::TIMESTAMP:
191 if ( bForce && _pType->nMaximumScale)
200 switch ( _pType->nType )
205 nPrec = _pType->nPrecision;
213 if ( _pType->nPrecision )
215 if ( _pType->nMaximumScale )
219 if ( _pType->aCreateParams.isEmpty() )
349 OSL_ENSURE(!
m_pType,
"Invalid call here!");
525 switch ( pTypeInfo->nType )
527 case DataType::TINYINT:
528 case DataType::SMALLINT:
529 case DataType::INTEGER:
530 case DataType::BIGINT:
532 nPrec = pTypeInfo->nPrecision;
575 TOTypeInfoSP pSpecialType = std::make_shared<OTypeInfo>();
578 pSpecialType->nMaximumScale =
static_cast<sal_Int16
>(
GetScale());
617 if ( !_rxColumn.is() )
#define DEFAULT_NUMERIC_SCALE
#define DEFAULT_VARCHAR_PRECISION
#define DEFAULT_NUMERIC_PRECISION
#define DEFAULT_OTHER_PRECISION
void SetTypeValue(sal_Int32 _nType)
OUString GetDescription() const
void SetHelpText(const OUString &_sHelptext)
void SetControlDefault(const css::uno::Any &_rControlDefault)
void SetTypeName(const OUString &_sTypeName)
void SetPrecision(sal_Int32 _rPrecision)
void SetIsNullable(sal_Int32 _rIsNullable)
const TOTypeInfoSP & getTypeInfo() const
void SetPrimaryKey(bool _bPKey)
void SetType(const TOTypeInfoSP &_pType)
sal_Int32 GetScale() const
css::uno::Any m_aRelativePosition
css::uno::Reference< css::beans::XPropertySet > m_xDest
css::uno::Any m_aControlDefault
OUString m_sAutoIncrementValue
void SetAutoIncrementValue(const OUString &_sAutoIncValue)
OUString GetHelpText() const
bool IsAutoIncrement() const
void SetAutoIncrement(bool _bAuto)
OUString GetTypeName() const
void SetName(const OUString &_rName)
sal_Int32 GetFormatKey() const
void SetDescription(const OUString &_rDescription)
OUString GetAutoIncrementValue() const
sal_Int32 GetType() const
void FillFromTypeInfo(const TOTypeInfoSP &_pType, bool _bForce, bool _bReset)
css::uno::Any GetControlDefault() const
SvxCellHorJustify GetHorJustify() const
sal_Int32 GetPrecision() const
void SetDefaultValue(const css::uno::Any &_rDefaultValue)
TOTypeInfoSP getSpecialTypeInfo() const
void SetCurrency(bool _bIsCurrency)
SvxCellHorJustify m_eHorJustify
sal_Int32 GetIsNullable() const
void SetScale(sal_Int32 _rScale)
void SetFormatKey(sal_Int32 _rFormatKey)
void copyColumnSettingsTo(const css::uno::Reference< css::beans::XPropertySet > &_rxColumn)
copies the content of the field description into the column
css::uno::Reference< css::beans::XPropertySetInfo > m_xDestInfo
void SetHorJustify(const SvxCellHorJustify &_rHorJustify)
const Reference< XParameters > m_xDest
#define DBG_UNHANDLED_EXCEPTION(...)
SvxCellHorJustify mapTextJustify(sal_Int32 _nAlignment)
maps css::awt::TextAlign to SvxCellHorJustify
std::shared_ptr< OTypeInfo > TOTypeInfoSP
sal_Int32 mapTextAlign(const SvxCellHorJustify &_eAlignment)
maps SvxCellHorJustify to css::awt::TextAlign
constexpr OUStringLiteral PROPERTY_WIDTH(u"Width")
constexpr OUStringLiteral PROPERTY_ISAUTOINCREMENT(u"IsAutoIncrement")
constexpr OUStringLiteral PROPERTY_CONTROLDEFAULT(u"ControlDefault")
constexpr OUStringLiteral PROPERTY_PRECISION(u"Precision")
constexpr OUStringLiteral PROPERTY_RELATIVEPOSITION(u"RelativePosition")
constexpr OUStringLiteral PROPERTY_TYPENAME(u"TypeName")
constexpr OUStringLiteral PROPERTY_ISNULLABLE(u"IsNullable")
constexpr OUStringLiteral PROPERTY_DESCRIPTION(u"Description")
constexpr OUStringLiteral PROPERTY_FORMATKEY(u"FormatKey")
constexpr OUStringLiteral PROPERTY_SCALE(u"Scale")
constexpr OUStringLiteral PROPERTY_DEFAULTVALUE(u"DefaultValue")
constexpr OUStringLiteral PROPERTY_HELPTEXT(u"HelpText")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_HIDDEN(u"Hidden")
constexpr OUStringLiteral PROPERTY_ALIGN(u"Align")
constexpr OUStringLiteral PROPERTY_AUTOINCREMENTCREATION(u"AutoIncrementCreation")