summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign/TableController.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-19 11:46:24 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-19 11:46:24 +0000
commit63d76fa222fef7a13451b814a3170683cbc4128d (patch)
tree30b5a1a7c1ff0020369cf5a2dfbfe52d6966c60d /dbaccess/source/ui/tabledesign/TableController.cxx
parente20a4a9c6b06c87c4f6c4d727628a7913f54a03e (diff)
#93489# impl new property for columnsettings
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx26
1 files changed, 15 insertions, 11 deletions
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