diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
commit | b6693080a17418cf79b55f77add3bf7a84f00060 (patch) | |
tree | 2f2609e3549481a37d47fbf869224be6e0642b34 /dbaccess/source/ui/tabledesign | |
parent | 52cc8fded55d1761c6913a3704a03a7c137a7f3d (diff) | |
parent | fd8c2dd9780e8b3f4e9d26783f477452ff62a17c (diff) |
dba33f: merge with m76-branch
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r-- | dbaccess/source/ui/tabledesign/FieldDescriptions.cxx | 33 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 146 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 49 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableRow.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/table.src | 6 |
6 files changed, 159 insertions, 80 deletions
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index bd2a83d87364..bb0231ba30b0 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -154,6 +154,12 @@ OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedC SetName(::comphelper::getString(xAffectedCol->getPropertyValue(PROPERTY_NAME))); if(xPropSetInfo->hasPropertyByName(PROPERTY_DESCRIPTION)) SetDescription(::comphelper::getString(xAffectedCol->getPropertyValue(PROPERTY_DESCRIPTION))); + if(xPropSetInfo->hasPropertyByName(PROPERTY_HELPTEXT)) + { + ::rtl::OUString sHelpText; + xAffectedCol->getPropertyValue(PROPERTY_HELPTEXT) >>= sHelpText; + SetHelpText(sHelpText); + } if(xPropSetInfo->hasPropertyByName(PROPERTY_DEFAULTVALUE)) SetDefaultValue( xAffectedCol->getPropertyValue(PROPERTY_DEFAULTVALUE) ); @@ -285,6 +291,21 @@ void OFieldDescription::SetName(const ::rtl::OUString& _rName) } } // ----------------------------------------------------------------------------- +void OFieldDescription::SetHelpText(const ::rtl::OUString& _sHelpText) +{ + try + { + if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) + m_xDest->setPropertyValue(PROPERTY_HELPTEXT,makeAny(_sHelpText)); + else + m_sHelpText = _sHelpText; + } + catch(const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} +// ----------------------------------------------------------------------------- void OFieldDescription::SetDescription(const ::rtl::OUString& _rDescription) { try @@ -501,6 +522,14 @@ void OFieldDescription::SetCurrency(sal_Bool _bIsCurrency) return m_sDescription; } // ----------------------------------------------------------------------------- +::rtl::OUString OFieldDescription::GetHelpText() const +{ + if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) + return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_HELPTEXT)); + else + return m_sHelpText; +} +// ----------------------------------------------------------------------------- ::com::sun::star::uno::Any OFieldDescription::GetControlDefault() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT) ) @@ -654,8 +683,8 @@ void OFieldDescription::copyColumnSettingsTo(const Reference< XPropertySet >& _r _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 ( GetHelpText().getLength() && xInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) + _rxColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(GetHelpText())); if ( GetControlDefault().hasValue() && xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT) ) _rxColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,GetControlDefault()); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 40741ac02bb7..2910380070c5 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -105,6 +105,7 @@ #ifndef DBAUI_TABLEFIELDCONTROL_HXX #include "TableFieldControl.hxx" #endif +#include "dsntypes.hxx" using namespace ::dbaui; using namespace ::comphelper; @@ -199,13 +200,21 @@ void OTableEditorCtrl::Init() ////////////////////////////////////////////////////////////////////// // Spalten einfuegen String aColumnName( ModuleRes(STR_TAB_FIELD_COLUMN_NAME) ); - InsertDataColumn( 1, aColumnName, FIELDNAME_WIDTH ); + InsertDataColumn( FIELD_NAME, aColumnName, FIELDNAME_WIDTH ); aColumnName = String( ModuleRes(STR_TAB_FIELD_COLUMN_DATATYPE) ); - InsertDataColumn( 2, aColumnName, FIELDTYPE_WIDTH ); + InsertDataColumn( FIELD_TYPE, aColumnName, FIELDTYPE_WIDTH ); - aColumnName = String( ModuleRes(STR_TAB_FIELD_DESCR) ); - InsertDataColumn( 3, aColumnName, FIELDDESCR_WIDTH ); + ::dbaccess::ODsnTypeCollection aDsnTypes(GetView()->getController().getORB()); + sal_Bool bShowColumnDescription = aDsnTypes.supportsColumnDescription(::comphelper::getString(GetView()->getController().getDataSource()->getPropertyValue(PROPERTY_URL))); + aColumnName = String( ModuleRes(STR_TAB_HELP_TEXT) ); + InsertDataColumn( HELP_TEXT, aColumnName, bShowColumnDescription ? FIELDTYPE_WIDTH : FIELDDESCR_WIDTH ); + + if ( bShowColumnDescription ) + { + aColumnName = String( ModuleRes(STR_COLUMN_DESCRIPTION) ); + InsertDataColumn( COLUMN_DESCRIPTION, aColumnName, FIELDTYPE_WIDTH ); + } InitCellController(); @@ -229,6 +238,7 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow) :OTableRowView(pWindow) ,pNameCell(NULL) ,pTypeCell(NULL) + ,pHelpTextCell(NULL) ,pDescrCell(NULL) ,pDescrWin(NULL) ,nIndexEvent(0) @@ -342,12 +352,16 @@ void OTableEditorCtrl::InitCellController() pDescrCell = new Edit( &GetDataWindow(), WB_LEFT ); pDescrCell->SetMaxTextLen( MAX_DESCR_LEN ); + pHelpTextCell = new Edit( &GetDataWindow(), WB_LEFT ); + pHelpTextCell->SetMaxTextLen( MAX_DESCR_LEN ); + pNameCell->SetHelpId(HID_TABDESIGN_NAMECELL); pTypeCell->SetHelpId(HID_TABDESIGN_TYPECELL); pDescrCell->SetHelpId(HID_TABDESIGN_COMMENTCELL); + pHelpTextCell->SetHelpId(HID_TABDESIGN_HELPTEXT); Size aHeight; - const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell}; + const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell}; for(sal_Size i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i) { const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); @@ -365,6 +379,7 @@ void OTableEditorCtrl::ClearModified() DBG_CHKTHIS(OTableEditorCtrl,NULL); pNameCell->ClearModifyFlag(); pDescrCell->ClearModifyFlag(); + pHelpTextCell->ClearModifyFlag(); pTypeCell->SaveValue(); } @@ -396,6 +411,7 @@ OTableEditorCtrl::~OTableEditorCtrl() delete pNameCell; delete pTypeCell; delete pDescrCell; + delete pHelpTextCell; } //------------------------------------------------------------------------------ @@ -471,10 +487,16 @@ CellController* OTableEditorCtrl::GetController(long nRow, sal_uInt16 nColumnId) if (pActFieldDescr && (pActFieldDescr->GetName().getLength() != 0)) return new ListBoxCellController( pTypeCell ); else return NULL; - case FIELD_DESCR: + case HELP_TEXT: + if (pActFieldDescr && (pActFieldDescr->GetName().getLength() != 0)) + return new EditCellController( pHelpTextCell ); + else + return NULL; + case COLUMN_DESCRIPTION: if (pActFieldDescr && (pActFieldDescr->GetName().getLength() != 0)) return new EditCellController( pDescrCell ); - else return NULL; + else + return NULL; default: return NULL; } @@ -516,7 +538,13 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16 } break; - case FIELD_DESCR: + case HELP_TEXT: + if( pActFieldDescr ) + aInitString = pActFieldDescr->GetHelpText(); + pHelpTextCell->SetText( aInitString ); + pHelpTextCell->SaveValue(); + break; + case COLUMN_DESCRIPTION: if( pActFieldDescr ) aInitString = pActFieldDescr->GetDescription(); pDescrCell->SetText( aInitString ); @@ -576,7 +604,8 @@ void OTableEditorCtrl::DisplayData(long nRow, sal_Bool bGrabFocus) CellControllerRef aTemp; InitController(aTemp, nRow, FIELD_NAME); InitController(aTemp, nRow, FIELD_TYPE); - InitController(aTemp, nRow, FIELD_DESCR); + InitController(aTemp, nRow, COLUMN_DESCRIPTION); + InitController(aTemp, nRow, HELP_TEXT); GoToRow(nRow); // das Description-Window aktualisieren @@ -601,7 +630,8 @@ void OTableEditorCtrl::CursorMoved() CellControllerRef aTemp; InitController(aTemp,m_nDataPos,FIELD_NAME); InitController(aTemp,m_nDataPos,FIELD_TYPE); - InitController(aTemp,m_nDataPos,FIELD_DESCR); + InitController(aTemp,m_nDataPos,COLUMN_DESCRIPTION); + InitController(aTemp,m_nDataPos,HELP_TEXT); } OTableRowView::CursorMoved(); @@ -675,7 +705,20 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) ////////////////////////////////////////////////////////////// // Speichern Inhalt DescrCell - case FIELD_DESCR: + case HELP_TEXT: + { + ////////////////////////////////////////////////////////////// + // Wenn aktuelle Feldbeschreibung NULL, Default setzen + if( !pActFieldDescr ) + { + pHelpTextCell->SetText(String()); + pHelpTextCell->ClearModifyFlag(); + } + else + pActFieldDescr->SetHelpText( pHelpTextCell->GetText() ); + break; + } + case COLUMN_DESCRIPTION: { ////////////////////////////////////////////////////////////// // Wenn aktuelle Feldbeschreibung NULL, Default setzen @@ -811,7 +854,8 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) { case FIELD_NAME: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_NAME ) ); break; case FIELD_TYPE: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_TYPE ) ); break; - case FIELD_DESCR: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_DESCRIPTION ) ); break; + case HELP_TEXT: + case COLUMN_DESCRIPTION: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_DESCRIPTION ) ); break; default: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ) ); break; } @@ -1176,7 +1220,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s OSL_ENSURE(sal_False, "OTableEditorCtrl::SetCellData: invalid column!"); break; - case FIELD_DESCR: + case COLUMN_DESCRIPTION: pFieldDescr->SetDescription( sValue = ::comphelper::getString(_rNewData) ); break; @@ -1265,9 +1309,12 @@ Any OTableEditorCtrl::GetCellData( long nRow, sal_uInt16 nColId ) sValue = pFieldDescr->getTypeInfo()->aUIName; break; - case FIELD_DESCR: + case COLUMN_DESCRIPTION: sValue = pFieldDescr->GetDescription(); break; + case HELP_TEXT: + sValue = pFieldDescr->GetHelpText(); + break; case FIELD_PROPERTY_DEFAULT: return pFieldDescr->GetControlDefault(); @@ -1347,16 +1394,24 @@ sal_Bool OTableEditorCtrl::IsCutAllowed( long nRow ) if(bIsCutAllowed) { - if(m_eChildFocus == DESCRIPTION) - bIsCutAllowed = pDescrCell->GetSelected().Len() != 0; - else if(m_eChildFocus == NAME) - bIsCutAllowed = pNameCell->GetSelected().Len() != 0; - else if(m_eChildFocus == ROW) - // only rows are selected for cutting so we look if all rows are valid - // wwe don't waant to copy empty rows here - bIsCutAllowed = IsCopyAllowed(nRow); - else - bIsCutAllowed = sal_False; + switch(m_eChildFocus) + { + case DESCRIPTION: + bIsCutAllowed = pDescrCell->GetSelected().Len() != 0; + break; + case HELPTEXT: + bIsCutAllowed = pHelpTextCell->GetSelected().Len() != 0; + break; + case NAME: + bIsCutAllowed = pNameCell->GetSelected().Len() != 0; + break; + case ROW: + bIsCutAllowed = IsCopyAllowed(nRow); + break; + default: + bIsCutAllowed = sal_False; + break; + } } // Reference<XPropertySet> xTable = GetView()->getController().getTable(); @@ -1372,8 +1427,10 @@ sal_Bool OTableEditorCtrl::IsCopyAllowed( long /*nRow*/ ) { DBG_CHKTHIS(OTableEditorCtrl,NULL); sal_Bool bIsCopyAllowed = sal_False; - if(m_eChildFocus == DESCRIPTION) + if(m_eChildFocus == DESCRIPTION ) bIsCopyAllowed = pDescrCell->GetSelected().Len() != 0; + else if(HELPTEXT == m_eChildFocus ) + bIsCopyAllowed = pHelpTextCell->GetSelected().Len() != 0; else if(m_eChildFocus == NAME) bIsCopyAllowed = pNameCell->GetSelected().Len() != 0; else if(m_eChildFocus == ROW) @@ -1435,9 +1492,18 @@ void OTableEditorCtrl::cut() { if(GetView()->getController().isAlterAllowed()) { - SaveData(-1,FIELD_DESCR); + SaveData(-1,COLUMN_DESCRIPTION); pDescrCell->Cut(); - CellModified(-1,FIELD_DESCR); + CellModified(-1,COLUMN_DESCRIPTION); + } + } + else if(HELPTEXT == m_eChildFocus ) + { + if(GetView()->getController().isAlterAllowed()) + { + SaveData(-1,HELP_TEXT); + pHelpTextCell->Cut(); + CellModified(-1,HELP_TEXT); } } else if(m_eChildFocus == ROW) @@ -1455,7 +1521,9 @@ void OTableEditorCtrl::copy() OTableRowView::copy(); else if(m_eChildFocus == NAME) pNameCell->Copy(); - else if(m_eChildFocus == DESCRIPTION) + else if(HELPTEXT == m_eChildFocus ) + pHelpTextCell->Copy(); + else if(m_eChildFocus == DESCRIPTION ) pDescrCell->Copy(); } @@ -1477,6 +1545,14 @@ void OTableEditorCtrl::paste() CellModified(); } } + else if(HELPTEXT == m_eChildFocus ) + { + if(GetView()->getController().isAlterAllowed()) + { + pHelpTextCell->Paste(); + CellModified(); + } + } else if(m_eChildFocus == DESCRIPTION) { if(GetView()->getController().isAlterAllowed()) @@ -1493,16 +1569,6 @@ sal_Bool OTableEditorCtrl::IsDeleteAllowed( long /*nRow*/ ) DBG_CHKTHIS(OTableEditorCtrl,NULL); return GetSelectRowCount() != 0 && GetView()->getController().isDropAllowed(); -// Reference<XPropertySet> xTable = GetView()->getController().getTable(); -// if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) -// return sal_False; -// -// // Wenn nur Felder hinzugefuegt werden duerfen, Delete nur auf neuen Feldern -// Reference<XConnection> xCon = GetView()->getController().getConnection(); -// Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : NULL; -// -// return !(xTable.is() && xTable->getPropertySetInfo()->getPropertyByName(PROPERTY_NAME).Attributes & PropertyAttribute::READONLY) || -// ( xMetaData.is() && xMetaData->supportsAlterTableWithAddColumn() && xMetaData->supportsAlterTableWithDropColumn()); } //------------------------------------------------------------------------------ @@ -1933,7 +1999,9 @@ long OTableEditorCtrl::PreNotify( NotifyEvent& rNEvt ) { if (rNEvt.GetType() == EVENT_GETFOCUS) { - if( pDescrCell && pDescrCell->HasChildPathFocus() ) + if( pHelpTextCell && pHelpTextCell->HasChildPathFocus() ) + m_eChildFocus = HELPTEXT; + else if( pDescrCell && pDescrCell->HasChildPathFocus() ) m_eChildFocus = DESCRIPTION; else if(pNameCell && pNameCell->HasChildPathFocus() ) m_eChildFocus = NAME; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index 1b930af6aaba..2a7a36f3a051 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -56,6 +56,7 @@ namespace dbaui { enum ChildFocusState { + HELPTEXT, DESCRIPTION, NAME, ROW, @@ -67,6 +68,7 @@ namespace dbaui OSQLNameEdit* pNameCell; ::svt::ListBoxControl* pTypeCell; + Edit* pHelpTextCell; Edit* pDescrCell; OTableFieldDescWin* pDescrWin; // properties of one column diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index e8f4ca9a0b99..542096508337 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -868,7 +868,7 @@ void OTableController::loadData() sal_Int32 nAlign = 0; sal_Bool bIsAutoIncrement = false, bIsCurrency = false; - ::rtl::OUString sName,sDescription,sTypeName; + ::rtl::OUString sName,sDescription,sTypeName,sHelpText; Any aControlDefault; // get the properties from the column @@ -880,10 +880,11 @@ void OTableController::loadData() xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; xColumn->getPropertyValue(PROPERTY_SCALE) >>= nScale; xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision; - + xColumn->getPropertyValue(PROPERTY_DESCRIPTION) >>= sDescription; if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) - xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription; + xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sHelpText; + if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) aControlDefault = xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT); if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY)) @@ -909,6 +910,7 @@ void OTableController::loadData() pActFieldDescr->SetFormatKey(nFormatKey); // pActFieldDescr->SetPrimaryKey(pPrimary->GetValue()); pActFieldDescr->SetDescription(sDescription); + pActFieldDescr->SetHelpText(sHelpText); pActFieldDescr->SetAutoIncrement(bIsAutoIncrement); pActFieldDescr->SetHorJustify(dbaui::mapTextJustify(nAlign)); pActFieldDescr->SetCurrency(bIsCurrency); @@ -966,39 +968,7 @@ void OTableController::loadData() // ----------------------------------------------------------------------------- Reference<XNameAccess> OTableController::getKeyColumns() const { - // use keys and indexes for excat postioning - // first the keys - Reference<XKeysSupplier> xKeySup(m_xTable,UNO_QUERY); - Reference<XIndexAccess> xKeys; - if(xKeySup.is()) - xKeys = xKeySup->getKeys(); - - Reference<XColumnsSupplier> xKeyColsSup; - Reference<XNameAccess> xKeyColumns; - if(xKeys.is()) - { - Reference<XPropertySet> xProp; - sal_Int32 nCount = xKeys->getCount(); - for(sal_Int32 i=0;i< nCount;++i) - { - xKeys->getByIndex(i) >>= xProp; - OSL_ENSURE(xProp.is(),"Key is invalid: NULL!"); - if ( xProp.is() ) - { - sal_Int32 nKeyType = 0; - xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType; - if(KeyType::PRIMARY == nKeyType) - { - xKeyColsSup.set(xProp,UNO_QUERY); - OSL_ENSURE(xKeyColsSup.is(),"Columnsupplier is null!"); - xKeyColumns = xKeyColsSup->getColumns(); - break; - } - } - } - } - - return xKeyColumns; + return getPrimaryKeyColumns_throw(m_xTable); } // ----------------------------------------------------------------------------- sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::sdbc::SQLException) @@ -1117,13 +1087,14 @@ void OTableController::alterColumns() sal_Int32 nType=0,nPrecision=0,nScale=0,nNullable=0; sal_Bool bAutoIncrement = false; - ::rtl::OUString sTypeName; + ::rtl::OUString sTypeName,sDescription; xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision; xColumn->getPropertyValue(PROPERTY_SCALE) >>= nScale; xColumn->getPropertyValue(PROPERTY_ISNULLABLE) >>= nNullable; xColumn->getPropertyValue(PROPERTY_ISAUTOINCREMENT) >>= bAutoIncrement; + xColumn->getPropertyValue(PROPERTY_DESCRIPTION) >>= sDescription; try { xColumn->getPropertyValue(PROPERTY_TYPENAME) >>= sTypeName; } catch( const Exception& ) @@ -1142,6 +1113,7 @@ void OTableController::alterColumns() (nPrecision != pField->GetPrecision() && nPrecision ) || nScale != pField->GetScale() || nNullable != pField->GetIsNullable() || + sDescription != pField->GetDescription() || bAutoIncrement != pField->IsAutoIncrement())&& xColumnFactory.is()) { @@ -1261,7 +1233,8 @@ void OTableController::alterColumns() xColumns->getByName(pField->GetName()) >>= xColumn; Reference<XPropertySetInfo> xInfo = xColumn->getPropertySetInfo(); if ( xInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) - xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription())); + xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetHelpText())); + if(xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault()); if(xInfo->hasPropertyByName(PROPERTY_FORMATKEY)) diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx index 7130c081f209..33f358b6e408 100644 --- a/dbaccess/source/ui/tabledesign/TableRow.cxx +++ b/dbaccess/source/ui/tabledesign/TableRow.cxx @@ -137,6 +137,7 @@ namespace dbaui _rStr << (sal_Int32)1; _rStr.WriteByteString(pFieldDesc->GetName()); _rStr.WriteByteString(pFieldDesc->GetDescription()); + _rStr.WriteByteString(pFieldDesc->GetHelpText()); double nValue = 0.0; Any aValue = pFieldDesc->GetControlDefault(); if ( aValue >>= nValue ) @@ -181,6 +182,8 @@ namespace dbaui _rStr.ReadByteString(sValue); pFieldDesc->SetDescription(sValue); + _rStr.ReadByteString(sValue); + pFieldDesc->SetHelpText(sValue); _rStr >> nValue; Any aControlDefault; diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index d40da4e3c358..e2a73292ec8d 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -103,10 +103,14 @@ String STR_TAB_FIELD_LENGTH { Text [ en-US ] = "Field length" ; }; -String STR_TAB_FIELD_DESCR +String STR_TAB_HELP_TEXT { Text [ en-US ] = "Description" ; }; +String STR_COLUMN_DESCRIPTION +{ + Text [ en-US ] = "Column Description" ; +}; String STR_TAB_FIELD_NULLABLE { Text [ en-US ] = "Input required" ; |