#97926# use default type if db does not support some

This commit is contained in:
Ocke Janssen 2002-07-02 07:05:32 +00:00
parent 6ad8d456a9
commit c1d52e7881
3 changed files with 26 additions and 14 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: TableController.hxx,v $
*
* $Revision: 1.22 $
* $Revision: 1.23 $
*
* last change: $Author: fs $ $Date: 2002-01-24 17:38:31 $
* last change: $Author: oj $ $Date: 2002-07-02 08:05:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -178,6 +178,8 @@ namespace dbaui
const OTypeInfo* getTypeInfo(sal_Int32 _nPos) const { return m_aTypeInfoIndex[_nPos]->second; }
const OTypeInfo* getTypeInfoByType(sal_Int32 _nDataType) const;
const OTypeInfo* getTypeInfoFallBack() const { return m_pTypeInfo; }
virtual sal_Bool Construct(Window* pParent);
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);

View file

@ -2,9 +2,9 @@
*
* $RCSfile: TEditControl.cxx,v $
*
* $Revision: 1.27 $
* $Revision: 1.28 $
*
* last change: $Author: fs $ $Date: 2002-05-24 12:53:56 $
* last change: $Author: oj $ $Date: 2002-07-02 07:58:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -801,10 +801,17 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId )
GetUndoManager()->EnterListAction(String::CreateFromAscii("TODO"), String());
if (!pActFieldDescr)
{
OTypeInfoMap::const_iterator aTypeIter = GetView()->getController()->getTypeInfo()->find(DataType::VARCHAR);
if(aTypeIter == GetView()->getController()->getTypeInfo()->end())
aTypeIter = GetView()->getController()->getTypeInfo()->begin();
pActRow->SetFieldType( aTypeIter->second );
const OTypeInfoMap* pTypeInfoMap = GetView()->getController()->getTypeInfo();
if ( !pTypeInfoMap->empty() )
{
OTypeInfoMap::const_iterator aTypeIter = pTypeInfoMap->find(DataType::VARCHAR);
if(aTypeIter == pTypeInfoMap->end())
aTypeIter = pTypeInfoMap->begin();
pActRow->SetFieldType( aTypeIter->second );
}
else
pActRow->SetFieldType( GetView()->getController()->getTypeInfoFallBack() );
nInvalidateTypeEvent = Application::PostUserEvent( LINK(this, OTableEditorCtrl, InvalidateFieldType) );
pActFieldDescr = pActRow->GetActFieldDescr();
pDescrWin->DisplayData( pActFieldDescr );

View file

@ -2,9 +2,9 @@
*
* $RCSfile: TableController.cxx,v $
*
* $Revision: 1.70 $
* $Revision: 1.71 $
*
* last change: $Author: oj $ $Date: 2002-06-27 07:49:38 $
* last change: $Author: oj $ $Date: 2002-07-02 08:03:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -737,6 +737,7 @@ sal_Bool OTableController::Construct(Window* pParent)
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL OTableController::suspend(sal_Bool _bSuspend) throw( RuntimeException )
{
sal_Bool bCheck = sal_True;
if ( isModified() )
{
::std::vector<OTableRow*>::iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(),::std::mem_fun(&OTableRow::isValid));
@ -748,10 +749,10 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool _bSuspend) throw( RuntimeEx
case RET_YES:
Execute(ID_BROWSER_SAVEDOC);
if ( isModified() )
return sal_False; // when we save the table this must be false else some press cancel
bCheck = sal_False; // when we save the table this must be false else some press cancel
break;
case RET_CANCEL:
return sal_False;
bCheck = sal_False;
default:
break;
}
@ -777,13 +778,15 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool _bSuspend) throw( RuntimeEx
}
break;
case RET_CANCEL:
return sal_False;
bCheck = sal_False;
default:
break;
}
}
}
return sal_True;
if ( bCheck )
OSingleDocumentController::suspend(_bSuspend);
return bCheck;
}
// -----------------------------------------------------------------------------
void OTableController::AddSupportedFeatures()