summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-09-24 08:19:07 +0000
committerOcke Janssen <oj@openoffice.org>2002-09-24 08:19:07 +0000
commit3000faccaf963e614ee49e63a206a1c229d456e5 (patch)
treef39a52bcdd564dd0a6cf6cc7def409ab66c1a144 /dbaccess/source/ui/tabledesign
parente6aac5e97de7d1b87ff8154190c0ac25dfa1d750 (diff)
#103049# change handling of controlDefault, allow string and doubles
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx6
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescriptions.cxx19
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx100
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx20
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldControl.cxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldControl.hxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx6
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx45
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.cxx10
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.hxx13
11 files changed, 154 insertions, 89 deletions
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
index b2d4fae7cf0c..04e2b20db907 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FieldDescGenWin.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-07-16 07:55:35 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,6 +109,8 @@ namespace dbaui
void cut();
void copy();
void paste();
+
+ inline OTableFieldControl* getFieldControl() const { m_pFieldControl; }
};
}
#endif // DBAUI_TABLEFIELDDESCGENPAGE_HXX
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
index c8b3fd6615a3..57392e1c6098 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FieldDescriptions.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2002-08-19 07:45:22 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -114,7 +114,8 @@ OFieldDescription::OFieldDescription( const OFieldDescription& rDescr ) :
m_sName(rDescr.m_sName)
,m_sTypeName(rDescr.m_sTypeName)
,m_sDescription(rDescr.m_sDescription)
- ,m_sDefaultValue(rDescr.m_sDefaultValue)
+ ,m_aDefaultValue(rDescr.m_aDefaultValue)
+ ,m_aControlDefault(rDescr.m_aControlDefault)
,m_sAutoIncrementValue(rDescr.m_sAutoIncrementValue)
,m_pType(rDescr.m_pType)
,m_nPrecision(rDescr.m_nPrecision)
@@ -132,7 +133,8 @@ OFieldDescription::OFieldDescription( const OFieldDescription& rDescr ) :
OFieldDescription::OFieldDescription( const ::rtl::OUString& _sName,
const ::rtl::OUString& _sTypeName,
const ::rtl::OUString& _sDescription,
- const ::rtl::OUString& _sDefaultValue,
+ const ::com::sun::star::uno::Any& _aDefaultValue,
+ const ::com::sun::star::uno::Any& _aControlDefault,
const ::rtl::OUString& _sAutoIncrementValue,
const OTypeInfo* _pType,
sal_Int32 _nPrecision,
@@ -146,7 +148,8 @@ OFieldDescription::OFieldDescription( const ::rtl::OUString& _sName,
m_sName(_sName)
,m_sTypeName(_sTypeName)
,m_sDescription(_sDescription)
-,m_sDefaultValue(_sDefaultValue)
+,m_aDefaultValue(_aDefaultValue)
+,m_aControlDefault(_aControlDefault)
,m_sAutoIncrementValue(_sAutoIncrementValue)
,m_pType(_pType)
,m_nPrecision(_nPrecision)
@@ -189,7 +192,11 @@ OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedC
if(xPropSetInfo->hasPropertyByName(PROPERTY_DESCRIPTION))
SetDescription(::comphelper::getString(xAffectedCol->getPropertyValue(PROPERTY_DESCRIPTION)));
if(xPropSetInfo->hasPropertyByName(PROPERTY_DEFAULTVALUE))
- SetDefaultValue(::comphelper::getString(xAffectedCol->getPropertyValue(PROPERTY_DEFAULTVALUE)));
+ SetDefaultValue( xAffectedCol->getPropertyValue(PROPERTY_DEFAULTVALUE) );
+
+ if(xPropSetInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
+ SetControlDefault( xAffectedCol->getPropertyValue(PROPERTY_CONTROLDEFAULT) );
+
if(xPropSetInfo->hasPropertyByName(PROPERTY_AUTOINCREMENTCREATION))
SetAutoIncrementValue(::comphelper::getString(xAffectedCol->getPropertyValue(PROPERTY_AUTOINCREMENTCREATION)));
if(xPropSetInfo->hasPropertyByName(PROPERTY_TYPE))
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index f2f928d0d9e2..2d1ca25b56ad 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TEditControl.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: oj $ $Date: 2002-08-21 06:28:00 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,6 +133,12 @@
#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
#endif
+#ifndef DBAUI_FIELDDESCRIPTIONCONTROL_HXX
+#include "FieldDescControl.hxx"
+#endif
+#ifndef DBAUI_TABLEFIELDCONTROL_HXX
+#include "TableFieldControl.hxx"
+#endif
using namespace ::dbaui;
using namespace ::comphelper;
@@ -1131,7 +1137,7 @@ void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const OTypeInfo* _
SetControlText(nRow,nColId,_pTypeInfo ? _pTypeInfo->aUIName : ::rtl::OUString());
}
//------------------------------------------------------------------------------
-void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const String& _rNewData )
+void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData )
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
//////////////////////////////////////////////////////////////////////
@@ -1141,23 +1147,15 @@ void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const String& _rNe
OFieldDescription* pFieldDescr = GetFieldDescr( nRow );
if( !pFieldDescr && nColId != FIELD_TYPE)
return;
-// {
-// OTypeInfoMap::const_iterator aTypeIter = GetView()->getController()->getTypeInfo()->find(DataType::VARCHAR);
-// if(aTypeIter == GetView()->getController()->getTypeInfo()->end())
-// aTypeIter = GetView()->getController()->getTypeInfo()->begin();
-//
-// OTableRow* pRow = (*m_pRowList)[nRow];
-// pRow->SetFieldType( aTypeIter->second );
-// pFieldDescr = pRow->GetActFieldDescr();
-// }
-
+ String sValue;
//////////////////////////////////////////////////////////////////////
// Einzelne Felder setzen
switch( nColId )
{
case FIELD_NAME:
- pFieldDescr->SetName( _rNewData );
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetName( sValue );
break;
case FIELD_TYPE:
@@ -1165,20 +1163,27 @@ void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const String& _rNe
break;
case FIELD_DESCR:
- pFieldDescr->SetDescription( _rNewData );
+ pFieldDescr->SetDescription( sValue = ::comphelper::getString(_rNewData) );
break;
case FIELD_PROPERTY_DEFAULT:
- pFieldDescr->SetDefaultValue( _rNewData );
+ pFieldDescr->SetControlDefault( _rNewData );
+ sValue = GetView()->GetDescWin()->getGenPage()->getFieldControl()->getControlDefault(pFieldDescr);
break;
case FIELD_PROPERTY_REQUIRED:
- pFieldDescr->SetIsNullable( _rNewData.ToInt32() );
+ {
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetIsNullable( sValue.ToInt32() );
+ }
break;
case FIELD_PROPERTY_TEXTLEN:
case FIELD_PROPERTY_LENGTH:
- pFieldDescr->SetPrecision( _rNewData.ToInt32() );
+ {
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetPrecision( sValue.ToInt32() );
+ }
break;
case FIELD_PROPERTY_NUMTYPE:
@@ -1189,33 +1194,40 @@ void OTableEditorCtrl::SetData( long nRow, sal_uInt16 nColId, const String& _rNe
case FIELD_PROPERTY_AUTOINC:
{
String strYes(ModuleRes(STR_VALUE_YES));
- // String strNo(ModuleRes(STR_VALUE_NO));
- pFieldDescr->SetAutoIncrement(_rNewData.Equals(strYes));
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetAutoIncrement(sValue.Equals(strYes));
}
break;
case FIELD_PROPERTY_SCALE:
- pFieldDescr->SetScale(_rNewData.ToInt32());
+ {
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetScale(sValue.ToInt32());
+ }
break;
case FIELD_PROPERTY_BOOL_DEFAULT:
- pFieldDescr->SetDefaultValue(GetView()->GetDescWin()->BoolStringPersistent(_rNewData));
+ sValue = GetView()->GetDescWin()->BoolStringPersistent(::comphelper::getString(_rNewData));
+ pFieldDescr->SetControlDefault(makeAny(::rtl::OUString(sValue)));
break;
case FIELD_PROPERTY_FORMAT:
- pFieldDescr->SetFormatKey(_rNewData.ToInt32());
+ {
+ sValue = ::comphelper::getString(_rNewData);
+ pFieldDescr->SetFormatKey(sValue.ToInt32());
+ }
break;
}
- SetControlText(nRow,nColId,_rNewData);
+ SetControlText(nRow,nColId,sValue);
}
//------------------------------------------------------------------------------
-String OTableEditorCtrl::GetData( long nRow, sal_uInt16 nColId )
+Any OTableEditorCtrl::GetData( long nRow, sal_uInt16 nColId )
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
OFieldDescription* pFieldDescr = GetFieldDescr( nRow );
if( !pFieldDescr )
- return String();
+ return Any();
//////////////////////////////////////////////////////////////////////
// Aktuellen Datenzeiger umsetzen
@@ -1225,47 +1237,57 @@ String OTableEditorCtrl::GetData( long nRow, sal_uInt16 nColId )
static const String strYes(ModuleRes(STR_VALUE_YES));
static const String strNo(ModuleRes(STR_VALUE_NO));
+ ::rtl::OUString sValue;
//////////////////////////////////////////////////////////////////////
// Einzelne Felder auslesen
switch( nColId )
{
case FIELD_NAME:
- return pFieldDescr->GetName();
+ sValue = pFieldDescr->GetName();
+ break;
case FIELD_TYPE:
- return pFieldDescr->getTypeInfo()->aUIName;
+ sValue = pFieldDescr->getTypeInfo()->aUIName;
+ break;
case FIELD_DESCR:
- return pFieldDescr->GetDescription();
+ sValue = pFieldDescr->GetDescription();
+ break;
case FIELD_PROPERTY_DEFAULT:
- return pFieldDescr->GetDefaultValue();
+ return pFieldDescr->GetControlDefault();
case FIELD_PROPERTY_REQUIRED:
- return pFieldDescr->GetIsNullable() == ColumnValue::NULLABLE ? strYes : strNo;
+ sValue = pFieldDescr->GetIsNullable() == ColumnValue::NULLABLE ? strYes : strNo;
+ break;
case FIELD_PROPERTY_TEXTLEN:
case FIELD_PROPERTY_LENGTH:
- return String::CreateFromInt32(pFieldDescr->GetPrecision());
+ sValue = String::CreateFromInt32(pFieldDescr->GetPrecision());
+ break;
case FIELD_PROPERTY_NUMTYPE:
OSL_ENSURE(sal_False, "OTableEditorCtrl::GetData: invalid column!");
// return pFieldDescr->GetNumType();
case FIELD_PROPERTY_AUTOINC:
- return pFieldDescr->IsAutoIncrement() ? strYes : strNo;
+ sValue = pFieldDescr->IsAutoIncrement() ? strYes : strNo;
+ break;
case FIELD_PROPERTY_SCALE:
- return String::CreateFromInt32(pFieldDescr->GetScale());
+ sValue = String::CreateFromInt32(pFieldDescr->GetScale());
+ break;
case FIELD_PROPERTY_BOOL_DEFAULT:
- return GetView()->GetDescWin()->BoolStringUI(pFieldDescr->GetDefaultValue());
+ sValue = GetView()->GetDescWin()->BoolStringUI(::comphelper::getString(pFieldDescr->GetControlDefault()));
+ break;
case FIELD_PROPERTY_FORMAT:
- return String::CreateFromInt32(pFieldDescr->GetFormatKey());
+ sValue = String::CreateFromInt32(pFieldDescr->GetFormatKey());
+ break;
}
- return String();
+ return makeAny(sValue);
}
//------------------------------------------------------------------------------
@@ -1274,7 +1296,7 @@ String OTableEditorCtrl::GetCellText( long nRow, sal_uInt16 nColId ) const
DBG_CHKTHIS(OTableEditorCtrl,NULL);
//////////////////////////////////////////////////////////////////////
// Text aus Dokumentdaten holen
- return const_cast<OTableEditorCtrl*>(this)->GetData( nRow, nColId );
+ return ::comphelper::getString(const_cast<OTableEditorCtrl*>(this)->GetData( nRow, nColId ));
}
//------------------------------------------------------------------------------
@@ -1712,7 +1734,7 @@ void OTableEditorCtrl::AdjustFieldDescription(OFieldDescription* _pFieldDesc,
if(!_bSet && _pFieldDesc->getTypeInfo()->bNullable)
{
_pFieldDesc->SetIsNullable(ColumnValue::NO_NULLS);
- _pFieldDesc->SetDefaultValue(String());
+ _pFieldDesc->SetControlDefault(Any());
}
//////////////////////////////////////////////////////////////////////
// update field description
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index 3e95200a95b4..12deeee1b499 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TEditControl.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: oj $ $Date: 2002-07-09 12:38:20 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -191,8 +191,8 @@ namespace dbaui
// erzwingt das Anzeigen der genannten Zeile (selbst wenn es eigentlich schon die aktuelle ist)
virtual void SetData( long nRow, USHORT nColId, const OTypeInfo* _pTypeInfo );
- virtual void SetData( long nRow, USHORT nColId, const String& _rSaveData );
- virtual String GetData( long nRow, USHORT nColId );
+ virtual void SetData( long nRow, USHORT nColId, const ::com::sun::star::uno::Any& _rSaveData );
+ virtual ::com::sun::star::uno::Any GetData( long nRow, USHORT nColId );
virtual void SetControlText( long nRow, USHORT nColId, const String& rText );
virtual String GetControlText( long nRow, USHORT nColId );
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 8a20269d6350..d459fa26dbdc 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.80 $
+ * $Revision: 1.81 $
*
- * last change: $Author: oj $ $Date: 2002-09-20 11:05:39 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1027,7 +1027,8 @@ void OTableController::loadData()
sal_Int32 nAlign = 0;
sal_Bool bIsAutoIncrement,bIsCurrency;
- ::rtl::OUString sName,sControlDefault,sDescription,sTypeName;
+ ::rtl::OUString sName,sDescription,sTypeName;
+ Any aControlDefault;
// get the properties from the column
xColumn->getPropertyValue(PROPERTY_NAME) >>= sName;
@@ -1043,7 +1044,7 @@ void OTableController::loadData()
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT))
xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription;
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
- xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT)>>= sControlDefault;
+ aControlDefault = xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT);
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY))
xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey;
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN))
@@ -1073,7 +1074,7 @@ void OTableController::loadData()
//////////////////////////////////////////////////////////////////////
// Spezielle Daten
pActFieldDescr->SetIsNullable(nNullable);
- pActFieldDescr->SetDefaultValue(sControlDefault);
+ pActFieldDescr->SetControlDefault(aControlDefault);
pActFieldDescr->SetPrecision(nPrecision);
pActFieldDescr->SetScale(nScale);
}
@@ -1299,7 +1300,8 @@ void OTableController::alterColumns()
sal_Int32 nType,nPrecision,nScale,nNullable,nFormatKey=0,nAlignment=0;
sal_Bool bAutoIncrement;
- ::rtl::OUString sDescription,sControlDefault;
+ ::rtl::OUString sDescription;
+ Any aControlDefault;
xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType;
xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision;
@@ -1310,7 +1312,7 @@ void OTableController::alterColumns()
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT))
xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription;
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
- xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT) >>= sControlDefault;
+ aControlDefault = xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT);
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY))
xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey;
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN))
@@ -1385,10 +1387,10 @@ void OTableController::alterColumns()
if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT))
xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription()));
}
- if(sControlDefault != pField->GetDefaultValue())
+ if ( aControlDefault != pField->GetControlDefault())
{
if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
- xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,makeAny(pField->GetDefaultValue()));
+ xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault());
}
}
else if(xColumnFactory.is() && xAlter.is() && nPos < nColumnCount)
diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
index 7d8639f881ce..898cdf452531 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableFieldControl.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: oj $ $Date: 2002-07-26 09:35:15 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,7 +99,7 @@ void OTableFieldControl::CellModified(long nRow, sal_uInt16 nColId )
GetCtrl()->CellModified(nRow,nColId);
}
//------------------------------------------------------------------
-OTableEditorCtrl* OTableFieldControl::GetCtrl()
+OTableEditorCtrl* OTableFieldControl::GetCtrl() const
{
OTableDesignView* pDesignWin = static_cast<OTableDesignView*>(GetParent()->GetParent()->GetParent()->GetParent());
OSL_ENSURE(pDesignWin,"no view!");
@@ -167,7 +167,7 @@ void OTableFieldControl::SetModified(BOOL bModified)
return xCon->getMetaData();
}
// -----------------------------------------------------------------------------
-Reference< XNumberFormatter > OTableFieldControl::GetFormatter()
+Reference< XNumberFormatter > OTableFieldControl::GetFormatter() const
{
return GetCtrl()->GetView()->getController()->getNumberFormatter();
}
diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
index 1f6da3e3de21..fea7bf81c8c2 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableFieldControl.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2002-07-26 09:35:15 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,7 +74,7 @@ namespace dbaui
//==================================================================
class OTableFieldControl : public OFieldDescControl
{
- OTableEditorCtrl* GetCtrl();
+ OTableEditorCtrl* GetCtrl() const;
protected:
virtual void ActivateAggregate( EControlType eType );
virtual void DeactivateAggregate( EControlType eType );
@@ -82,7 +82,7 @@ namespace dbaui
virtual void CellModified(long nRow, USHORT nColId );
virtual BOOL IsReadOnly();
virtual void SetModified(BOOL bModified);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const;
virtual ::com::sun::star::lang::Locale GetLocale() const;
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
index e3e005e7aa36..b8ca3180fd78 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableFieldDescWin.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2002-07-05 13:22:55 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -120,6 +120,8 @@ namespace dbaui
void copy();
void paste();
+ inline OFieldDescGenWin* getGenPage() const { return m_pGenPage; }
+
};
}
#endif // DBAUI_TABLEFIELDDESCRIPTION_HXX
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 922e17034925..23e133887c36 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableRow.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: oj $ $Date: 2002-07-11 06:57:45 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,7 @@
#include "FieldDescriptions.hxx"
#endif
#include <algorithm>
+#include <comphelper/types.hxx>
using namespace dbaui;
using namespace ::com::sun::star::sdbc;
@@ -156,7 +157,7 @@ void OTableRow::SetFieldType( const OTypeInfo* _pType, sal_Bool _bForce )
{
// reset type depending information
m_pActFieldDescr->SetFormatKey(0);
- m_pActFieldDescr->SetDefaultValue(::rtl::OUString());
+ m_pActFieldDescr->SetControlDefault(Any());
sal_Bool bForce = _bForce || pOldType == NULL || pOldType->nType != _pType->nType;
switch(_pType->nType)
@@ -209,7 +210,18 @@ namespace dbaui
{
_rStr.WriteByteString(pFieldDesc->GetName());
_rStr.WriteByteString(pFieldDesc->GetDescription());
- _rStr.WriteByteString(pFieldDesc->GetDefaultValue());
+ double nValue = 0.0;
+ Any aValue = pFieldDesc->GetControlDefault();
+ if ( aValue >>= nValue )
+ {
+ _rStr << sal_Int32(1);
+ _rStr << nValue;
+ }
+ else
+ {
+ _rStr << sal_Int32(2);
+ _rStr.WriteByteString(::comphelper::getString(aValue));
+ }
_rStr << pFieldDesc->GetType();
@@ -240,11 +252,28 @@ namespace dbaui
_rStr.ReadByteString(sValue);
pFieldDesc->SetDescription(sValue);
- _rStr.ReadByteString(sValue);
- pFieldDesc->SetDefaultValue(sValue);
-
sal_Int32 nValue;
_rStr >> nValue;
+ Any aControlDefault;
+ switch ( nValue )
+ {
+ case 1:
+ {
+ double nControlDefault;
+ _rStr >> nControlDefault;
+ aControlDefault <<= nControlDefault;
+ break;
+ }
+ case 2:
+ _rStr.ReadByteString(sValue);
+ aControlDefault <<= ::rtl::OUString(sValue);
+ break;
+ }
+
+ pFieldDesc->SetControlDefault(aControlDefault);
+
+
+ _rStr >> nValue;
pFieldDesc->SetTypeValue(nValue);
_rStr >> nValue;
@@ -264,6 +293,8 @@ namespace dbaui
pFieldDesc->SetPrimaryKey(nValue != 0);
_rStr >> nValue;
pFieldDesc->SetCurrency(nValue != 0);
+
+
}
return _rStr;
}
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx
index 64bd3934d441..44900e317bf5 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.cxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableUndo.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2002-08-19 07:45:25 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -171,12 +171,8 @@ void OTableDesignCellUndoAct::Undo()
// Wenn erstes Undo zurueckgenommen wurde, ist Zelle nicht mehr modifiziert
if (m_pTabDgnCtrl->GetCurUndoActId() == 1)
{
-#if SUPD > 636
CellControllerRef xController = m_pTabDgnCtrl->Controller();
-#else
- DbCellControllerRef xController = m_pTabDgnCtrl->Controller();
-#endif
- if(xController.Is())
+ if ( xController.Is() )
xController->ClearModified();
m_pTabDgnCtrl->GetView()->getController()->setModified(sal_False);
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx
index 21209d71b8e7..8abcb162c784 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.hxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableUndo.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-03-22 07:56:56 $
+ * last change: $Author: oj $ $Date: 2002-09-24 09:19:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,8 +67,11 @@
#ifndef _SV_MULTISEL_HXX
#include <tools/multisel.hxx>
#endif
-#ifndef _VECTOR_
+
#include <vector>
+
+#ifndef _COM_SUN_STAR_UNO_ANY_H_
+#include <com/sun/star/uno/Any.h>
#endif
namespace dbaui
@@ -107,8 +110,8 @@ namespace dbaui
protected:
USHORT m_nCol;
long m_nRow;
- ::rtl::OUString m_sOldText;
- ::rtl::OUString m_sNewText;
+ ::com::sun::star::uno::Any m_sOldText;
+ ::com::sun::star::uno::Any m_sNewText;
virtual void Undo();
virtual void Redo();