diff options
Diffstat (limited to 'dbaccess/source/ui/tabledesign/FieldDescriptions.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/FieldDescriptions.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 0f7ef63d5d94..f4cf44643ac7 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,10 @@ #include "UITools.hxx" #include <com/sun/star/util/NumberFormat.hpp> -#define DEFAULT_VARCHAR_PRECSION 50 -#define DEFAULT_OTHER_PRECSION 16 -#define DEFAULT_NUMERIC_PRECSION 5 -#define DEFAULT_NUMERIC_SCALE 0 +#define DEFAULT_VARCHAR_PRECSION 50 +#define DEFAULT_OTHER_PRECSION 16 +#define DEFAULT_NUMERIC_PRECSION 5 +#define DEFAULT_NUMERIC_SCALE 0 using namespace dbaui; @@ -235,7 +235,7 @@ void OFieldDescription::FillFromTypeInfo(const TOTypeInfoSP& _pType,sal_Bool _bF nPrec = GetPrecision(); break; } - + if ( _pType->nPrecision ) SetPrecision(::std::min<sal_Int32>(nPrec ? nPrec : DEFAULT_NUMERIC_PRECSION,_pType->nPrecision)); if ( _pType->nMaximumScale ) @@ -487,7 +487,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) } // ----------------------------------------------------------------------------- -::rtl::OUString OFieldDescription::GetName() const +::rtl::OUString OFieldDescription::GetName() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_NAME) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_NAME)); @@ -495,7 +495,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_sName; } // ----------------------------------------------------------------------------- -::rtl::OUString OFieldDescription::GetDescription() const +::rtl::OUString OFieldDescription::GetDescription() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_DESCRIPTION) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_DESCRIPTION)); @@ -503,7 +503,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_sDescription; } // ----------------------------------------------------------------------------- -::rtl::OUString OFieldDescription::GetHelpText() const +::rtl::OUString OFieldDescription::GetHelpText() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_HELPTEXT)); @@ -511,7 +511,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_sHelpText; } // ----------------------------------------------------------------------------- -::com::sun::star::uno::Any OFieldDescription::GetControlDefault() const +::com::sun::star::uno::Any OFieldDescription::GetControlDefault() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT) ) return m_xDest->getPropertyValue(PROPERTY_CONTROLDEFAULT); @@ -519,7 +519,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_aControlDefault; } // ----------------------------------------------------------------------------- -::rtl::OUString OFieldDescription::GetAutoIncrementValue() const +::rtl::OUString OFieldDescription::GetAutoIncrementValue() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_AUTOINCREMENTCREATION) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_AUTOINCREMENTCREATION)); @@ -527,7 +527,7 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_sAutoIncrementValue; } // ----------------------------------------------------------------------------- -sal_Int32 OFieldDescription::GetType() const +sal_Int32 OFieldDescription::GetType() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPE) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_TYPE)); @@ -535,7 +535,7 @@ sal_Int32 OFieldDescription::GetType() const return m_pType.get() ? m_pType->nType : m_nType; } // ----------------------------------------------------------------------------- -::rtl::OUString OFieldDescription::GetTypeName() const +::rtl::OUString OFieldDescription::GetTypeName() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPENAME) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_TYPENAME)); @@ -543,7 +543,7 @@ sal_Int32 OFieldDescription::GetType() const return m_pType.get() ? m_pType->aTypeName : m_sTypeName; } // ----------------------------------------------------------------------------- -sal_Int32 OFieldDescription::GetPrecision() const +sal_Int32 OFieldDescription::GetPrecision() const { sal_Int32 nPrec = m_nPrecision; if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_PRECISION) ) @@ -563,11 +563,11 @@ sal_Int32 OFieldDescription::GetPrecision() const break; } // switch ( pTypeInfo->nType ) } - + return nPrec; } // ----------------------------------------------------------------------------- -sal_Int32 OFieldDescription::GetScale() const +sal_Int32 OFieldDescription::GetScale() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_SCALE) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_SCALE)); @@ -575,7 +575,7 @@ sal_Int32 OFieldDescription::GetScale() const return m_nScale; } // ----------------------------------------------------------------------------- -sal_Int32 OFieldDescription::GetIsNullable() const +sal_Int32 OFieldDescription::GetIsNullable() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISNULLABLE) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_ISNULLABLE)); @@ -583,7 +583,7 @@ sal_Int32 OFieldDescription::GetIsNullable() const return m_nIsNullable; } // ----------------------------------------------------------------------------- -sal_Int32 OFieldDescription::GetFormatKey() const +sal_Int32 OFieldDescription::GetFormatKey() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_FORMATKEY) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_FORMATKEY)); @@ -591,7 +591,7 @@ sal_Int32 OFieldDescription::GetFormatKey() const return m_nFormatKey; } // ----------------------------------------------------------------------------- -SvxCellHorJustify OFieldDescription::GetHorJustify() const +SvxCellHorJustify OFieldDescription::GetHorJustify() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ALIGN) ) return ::dbaui::mapTextJustify(::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_ALIGN))); @@ -599,12 +599,12 @@ SvxCellHorJustify OFieldDescription::GetHorJustify() const return m_eHorJustify; } // ----------------------------------------------------------------------------- -TOTypeInfoSP OFieldDescription::getTypeInfo() const +TOTypeInfoSP OFieldDescription::getTypeInfo() const { return m_pType; } // ----------------------------------------------------------------------------- -TOTypeInfoSP OFieldDescription::getSpecialTypeInfo() const +TOTypeInfoSP OFieldDescription::getSpecialTypeInfo() const { TOTypeInfoSP pSpecialType( new OTypeInfo() ); *pSpecialType = *m_pType; @@ -613,7 +613,7 @@ TOTypeInfoSP OFieldDescription::getSpecialTypeInfo() const return pSpecialType; } // ----------------------------------------------------------------------------- -sal_Bool OFieldDescription::IsAutoIncrement() const +sal_Bool OFieldDescription::IsAutoIncrement() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT) ) return ::cppu::any2bool(m_xDest->getPropertyValue(PROPERTY_ISAUTOINCREMENT)); @@ -621,17 +621,17 @@ sal_Bool OFieldDescription::IsAutoIncrement() const return m_bIsAutoIncrement; } // ----------------------------------------------------------------------------- -sal_Bool OFieldDescription::IsPrimaryKey() const +sal_Bool OFieldDescription::IsPrimaryKey() const { return m_bIsPrimaryKey; } // ----------------------------------------------------------------------------- -sal_Bool OFieldDescription::IsCurrency() const +sal_Bool OFieldDescription::IsCurrency() const { return m_bIsCurrency; } // ----------------------------------------------------------------------------- -sal_Bool OFieldDescription::IsNullable() const +sal_Bool OFieldDescription::IsNullable() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISNULLABLE) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_ISNULLABLE)) == ::com::sun::star::sdbc::ColumnValue::NULLABLE; |