diff options
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 26 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableDesignView.cxx | 8 |
3 files changed, 25 insertions, 15 deletions
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 52fe090aa509..cced21daca36 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: oj $ $Date: 2001-10-18 12:04:10 $ + * last change: $Author: oj $ $Date: 2001-10-19 12:46:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -677,6 +677,8 @@ void setColumnUiProperties( const Reference< XPropertySet>& _rxColumn,const OFie _rxColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(_pFieldDesc->GetHorJustify()))); if(_rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(_pFieldDesc->GetDescription())); + if(_rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + _rxColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,makeAny(_pFieldDesc->GetDefaultValue())); } // ----------------------------------------------------------------------------- float ConvertFontWeight( ::FontWeight eWeight ) diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 7f3a920f809d..f6d64acb50fb 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableController.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.56 $ * - * last change: $Author: oj $ $Date: 2001-10-18 12:04:08 $ + * last change: $Author: oj $ $Date: 2001-10-19 12:46:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1029,7 +1029,7 @@ void OTableController::loadData() sal_Int32 nAlign = 0; sal_Bool bIsAutoIncrement,bIsCurrency; - ::rtl::OUString sName,sDefaultValue,sDescription,sTypeName; + ::rtl::OUString sName,sControlDefault,sDescription,sTypeName; // get the properties from the column xColumn->getPropertyValue(PROPERTY_NAME) >>= sName; @@ -1044,8 +1044,8 @@ void OTableController::loadData() if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription; - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DEFAULTVALUE)) - xColumn->getPropertyValue(PROPERTY_DEFAULTVALUE)>>= sDefaultValue; + if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT)>>= sControlDefault; if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY)) xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey; if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN)) @@ -1076,7 +1076,7 @@ void OTableController::loadData() ////////////////////////////////////////////////////////////////////// // Spezielle Daten pActFieldDescr->SetIsNullable(nNullable); - pActFieldDescr->SetDefaultValue(sDefaultValue); + pActFieldDescr->SetDefaultValue(sControlDefault); pActFieldDescr->SetPrecision(nPrecision); pActFieldDescr->SetScale(nScale); } @@ -1285,7 +1285,7 @@ void OTableController::alterColumns() sal_Int32 nType,nPrecision,nScale,nNullable,nFormatKey=0,nAlignment=0; sal_Bool bAutoIncrement; - ::rtl::OUString sDescription,sDefaultValue; + ::rtl::OUString sDescription,sControlDefault; xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision; @@ -1295,8 +1295,8 @@ void OTableController::alterColumns() // xColumn->getPropertyValue(PROPERTY_ISCURRENCY,::cppu::bool2any(pField->IsCurrency())); if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription; - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DEFAULTVALUE)) - xColumn->getPropertyValue(PROPERTY_DEFAULTVALUE) >>= sDefaultValue; + if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT) >>= sControlDefault; if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY)) xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey; if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN)) @@ -1307,8 +1307,7 @@ void OTableController::alterColumns() nPrecision != pField->GetPrecision() || nScale != pField->GetScale() || nNullable != pField->GetIsNullable() || - bAutoIncrement != pField->IsAutoIncrement() || - sDefaultValue != pField->GetDefaultValue()) && + bAutoIncrement != pField->IsAutoIncrement())&& xColumnFactory.is()) { Reference<XPropertySet> xNewColumn; @@ -1370,6 +1369,11 @@ void OTableController::alterColumns() if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription())); } + if(sControlDefault != pField->GetDefaultValue()) + { + if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,makeAny(pField->GetDefaultValue())); + } } else if(xColumnFactory.is() && xAlter.is() && nPos < nColumnCount) { // we can't find the column so we could try it with the index before we drop and append a new column diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 22fc13e0a99c..50f6bbd78f46 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableDesignView.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: oj $ $Date: 2001-09-27 06:25:13 $ + * last change: $Author: oj $ $Date: 2001-10-19 12:46:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -448,6 +448,10 @@ void OTableDesignView::setReadOnly(sal_Bool _bReadOnly) void OTableDesignView::reSync() { GetEditorCtrl()->DeactivateCell(); + OTableRow* pRow = (*GetEditorCtrl()->GetRowList())[GetEditorCtrl()->GetCurRow()]; + OFieldDescription* pFieldDescr = pRow ? pRow->GetActFieldDescr() : NULL; + if(pFieldDescr) + GetDescWin()->DisplayData(pFieldDescr); } // ----------------------------------------------------------------------------- |