Tag: cws_src680_dba30 User: oj Date: 05/12/12 00:03:19 Modified: /dba/dbaccess/source/ui/inc/ FieldDescriptions.hxx, UITools.hxx /dba/dbaccess/source/ui/misc/ TableCopyHelper.cxx, UITools.cxx, WCopyTable.cxx /dba/dbaccess/source/ui/tabledesign/ FieldDescriptions.cxx, TableController.cxx
Log: #i18609# check type on target source File Changes: Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: FieldDescriptions.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/FieldDescriptions.hxx?r1=1.11&r2=1.11.14.1 Delta lines: +12 -4 -------------------- --- FieldDescriptions.hxx 8 Sep 2005 15:17:23 -0000 1.11 +++ FieldDescriptions.hxx 12 Dec 2005 08:03:12 -0000 1.11.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: FieldDescriptions.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.11.14.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 15:17:23 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:12 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -62,6 +62,8 @@ private: ::com::sun::star::uno::Any m_aDefaultValue; // the default value from the database ::com::sun::star::uno::Any m_aControlDefault; // the value which the control inserts as default + ::com::sun::star::uno::Any m_aWidth; // sal_Int32 or void + ::com::sun::star::uno::Any m_aRelativePosition; // sal_Int32 or void TOTypeInfoSP m_pType; @@ -82,6 +84,7 @@ sal_Bool m_bIsAutoIncrement; sal_Bool m_bIsPrimaryKey; sal_Bool m_bIsCurrency; + sal_Bool m_bHidden; public: OFieldDescription(); @@ -121,6 +124,11 @@ void SetAutoIncrement(sal_Bool _bAuto); void SetPrimaryKey(sal_Bool _bPKey); void SetCurrency(sal_Bool _bIsCurrency); + + /** copies the content of the field eescription into the column + @param _rxColumn the dest + */ + void copyColumnSettingsTo(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn); void FillFromTypeInfo(const TOTypeInfoSP& _pType,sal_Bool _bForce,sal_Bool _bReset); File [changed]: UITools.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/UITools.hxx?r1=1.28&r2=1.28.14.1 Delta lines: +3 -10 -------------------- --- UITools.hxx 8 Sep 2005 15:40:48 -0000 1.28 +++ UITools.hxx 12 Dec 2005 08:03:12 -0000 1.28.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: UITools.hxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.28.14.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 15:40:48 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:12 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -230,13 +230,6 @@ @return the corresponding SvxCellHorJustify */ SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment); - - /** fill a column with ui data of a field description - @param _rxColumn the column which should be filled - @param _pFieldDesc the source of the data - */ - void setColumnUiProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, - const OFieldDescription* _pFieldDesc); /** convert Font to ::com::sun::star::awt::FontDescriptor @param _rFont Font to be converted Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: TableCopyHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/TableCopyHelper.cxx?r1=1.4&r2=1.4.16.1 Delta lines: +5 -5 ------------------- --- TableCopyHelper.cxx 23 Sep 2005 12:37:33 -0000 1.4 +++ TableCopyHelper.cxx 12 Dec 2005 08:03:13 -0000 1.4.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: TableCopyHelper.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:37:33 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -311,10 +311,10 @@ case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: - FILL_PARAM( ::rtl::OUString, etString) - break; case DataType::DECIMAL: case DataType::NUMERIC: + FILL_PARAM( ::rtl::OUString, etString) + break; case DataType::DOUBLE: case DataType::REAL: FILL_PARAM( double, etDouble) File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.58&r2=1.58.16.1 Delta lines: +3 -15 -------------------- --- UITools.cxx 23 Sep 2005 12:38:33 -0000 1.58 +++ UITools.cxx 12 Dec 2005 08:03:14 -0000 1.58.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.58 $ + * $Revision: 1.58.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:38:33 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:14 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -991,18 +991,6 @@ OSL_ENSURE(0,"Invalid TextAlign!"); } return eJustify; -} -// ----------------------------------------------------------------------------- -void setColumnUiProperties( const Reference< XPropertySet>& _rxColumn,const OFieldDescription* _pFieldDesc) -{ - if ( _pFieldDesc->GetFormatKey() != NumberFormat::ALL && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY) ) - _rxColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(_pFieldDesc->GetFormatKey())); - if ( _pFieldDesc->GetHorJustify() != SVX_HOR_JUSTIFY_STANDARD && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN) ) - _rxColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(_pFieldDesc->GetHorJustify()))); - if ( _pFieldDesc->GetDescription().getLength() && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT) ) - _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(_pFieldDesc->GetDescription())); - if ( _pFieldDesc->GetControlDefault().hasValue() && _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT) ) - _rxColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,_pFieldDesc->GetControlDefault()); } // ----------------------------------------------------------------------------- float ConvertFontWeight( ::FontWeight eWeight ) File [changed]: WCopyTable.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WCopyTable.cxx?r1=1.41&r2=1.41.16.1 Delta lines: +5 -5 ------------------- --- WCopyTable.cxx 23 Sep 2005 12:38:55 -0000 1.41 +++ WCopyTable.cxx 12 Dec 2005 08:03:14 -0000 1.41.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: WCopyTable.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.41.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:38:55 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:14 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -709,7 +709,7 @@ if(xColumn.is()) { if(!_bKeyColumns) - ::dbaui::setColumnProperties(xColumn,pField); + dbaui::setColumnProperties(xColumn,pField); else xColumn->setPropertyValue(PROPERTY_NAME,makeAny(pField->GetName())); @@ -720,7 +720,7 @@ { xColumns->getByName(pField->GetName()) >>= xColumn; if(xColumn.is()) - dbaui::setColumnUiProperties(xColumn,pField); + pField->copyColumnSettingsTo(xColumn); } else { Directory: /dba/dbaccess/source/ui/tabledesign/ =============================================== File [changed]: FieldDescriptions.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx?r1=1.19&r2=1.19.14.1 Delta lines: +40 -3 -------------------- --- FieldDescriptions.cxx 8 Sep 2005 16:38:53 -0000 1.19 +++ FieldDescriptions.cxx 12 Dec 2005 08:03:15 -0000 1.19.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: FieldDescriptions.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.19.14.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 16:38:53 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -59,6 +59,9 @@ #ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" #endif +#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_ +#include <com/sun/star/util/NumberFormat.hpp> +#endif #define DEFAULT_VARCHAR_PRECSION 50 #define DEFAULT_OTHER_PRECSION 16 @@ -70,6 +73,7 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::util; //======================================================================== // class OFieldDescription @@ -87,6 +91,7 @@ ,m_nIsNullable(ColumnValue::NULLABLE) ,m_nType(DataType::VARCHAR) ,m_bIsCurrency(sal_False) + ,m_bHidden(sal_False) { DBG_CTOR(OFieldDescription,NULL); } @@ -108,6 +113,7 @@ ,m_bIsAutoIncrement(rDescr.m_bIsAutoIncrement) ,m_bIsPrimaryKey(rDescr.m_bIsPrimaryKey) ,m_nType(DataType::VARCHAR) + ,m_bHidden(rDescr.m_bHidden) { DBG_CTOR(OFieldDescription,NULL); } @@ -142,6 +148,7 @@ ,m_bIsAutoIncrement(_bIsAutoIncrement) ,m_bIsPrimaryKey(_bIsPrimaryKey) ,m_bIsCurrency(_bIsCurrency) +,m_bHidden(sal_False) { DBG_DTOR(OFieldDescription,NULL); } @@ -163,6 +170,7 @@ ,m_nIsNullable(ColumnValue::NULLABLE) ,m_nType(DataType::VARCHAR) ,m_bIsCurrency(sal_False) + ,m_bHidden(sal_False) { DBG_CTOR(OFieldDescription,NULL); OSL_ENSURE(xAffectedCol.is(),"PropetySet can notbe null!"); @@ -200,6 +208,12 @@ SetIsNullable(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_ISNULLABLE))); if(xPropSetInfo->hasPropertyByName(PROPERTY_FORMATKEY)) SetFormatKey(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY))); + if(xPropSetInfo->hasPropertyByName(PROPERTY_RELATIVEPOSITION)) + m_aRelativePosition = xAffectedCol->getPropertyValue(PROPERTY_RELATIVEPOSITION); + if(xPropSetInfo->hasPropertyByName(PROPERTY_WIDTH)) + m_aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH); + if(xPropSetInfo->hasPropertyByName(PROPERTY_HIDDEN)) + xAffectedCol->getPropertyValue(PROPERTY_HIDDEN) >>= m_bHidden; if(xPropSetInfo->hasPropertyByName(PROPERTY_ALIGN)) SetHorJustify( ::dbaui::mapTextJustify(::comphelper::getINT16(xAffectedCol->getPropertyValue(PROPERTY_ALIGN)))); if(xPropSetInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT)) @@ -621,4 +635,27 @@ } } // ----------------------------------------------------------------------------- +void OFieldDescription::copyColumnSettingsTo(const Reference< XPropertySet >& _rxColumn) +{ + if ( _rxColumn.is() ) + { + Reference<XPropertySetInfo> xInfo = _rxColumn->getPropertySetInfo(); + if ( GetFormatKey() != NumberFormat::ALL && xInfo->hasPropertyByName(PROPERTY_FORMATKEY) ) + _rxColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(GetFormatKey())); + if ( GetHorJustify() != SVX_HOR_JUSTIFY_STANDARD && xInfo->hasPropertyByName(PROPERTY_ALIGN) ) + _rxColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(GetHorJustify()))); + if ( GetDescription().getLength() && xInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) + _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(GetDescription())); + if ( GetControlDefault().hasValue() && xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT) ) + _rxColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,GetControlDefault()); + + if(xInfo->hasPropertyByName(PROPERTY_RELATIVEPOSITION)) + _rxColumn->setPropertyValue(PROPERTY_RELATIVEPOSITION,m_aRelativePosition); + if(xInfo->hasPropertyByName(PROPERTY_WIDTH)) + _rxColumn->setPropertyValue(PROPERTY_WIDTH,m_aWidth); + if(xInfo->hasPropertyByName(PROPERTY_HIDDEN)) + _rxColumn->setPropertyValue(PROPERTY_HIDDEN,makeAny(m_bHidden)); + } +} +// ----------------------------------------------------------------------------- File [changed]: TableController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TableController.cxx?r1=1.99&r2=1.99.16.1 Delta lines: +6 -6 ------------------- --- TableController.cxx 23 Sep 2005 12:45:53 -0000 1.99 +++ TableController.cxx 12 Dec 2005 08:03:16 -0000 1.99.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: TableController.cxx,v $ * - * $Revision: 1.99 $ + * $Revision: 1.99.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:45:53 $ + * last change: $Author: oj $ $Date: 2005/12/12 08:03:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -876,7 +876,7 @@ { xColumns->getByName(pField->GetName()) >>= xColumn; if(xColumn.is()) - dbaui::setColumnUiProperties(xColumn,pField); + pField->copyColumnSettingsTo(xColumn); } else { @@ -1335,7 +1335,7 @@ aColumns[pField->GetName()] = sal_True; xColumns->getByName(pField->GetName()) >>= xColumn; if(xColumn.is()) - dbaui::setColumnUiProperties(xColumn,pField); + pField->copyColumnSettingsTo(xColumn); } else { @@ -1408,7 +1408,7 @@ aColumns[pField->GetName()] = sal_True; xColumns->getByName(pField->GetName()) >>= xColumn; if(xColumn.is()) - dbaui::setColumnUiProperties(xColumn,pField); + pField->copyColumnSettingsTo(xColumn); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
