diff -uPr old/sc/source/core/data/validat.cxx new/sc/source/core/data/validat.cxx --- old/sc/source/core/data/validat.cxx 2009-04-16 12:56:26.000000000 +0800 +++ new/sc/source/core/data/validat.cxx 2009-04-22 13:40:54.000000000 +0800 @@ -695,6 +695,29 @@ SCSIZE nCol, nRow, nCols, nRows, n = 0; pValues->GetDimensions( nCols, nRows ); + BOOL bRef = FALSE; + ScRange aRange; + if (rTokArr.IsReference(aRange)) + { + bRef = TRUE; + } + else + { + ScTokenArray* pArr = (ScTokenArray*) &rTokArr; + pArr->Reset(); + for( FormulaToken* t = pArr->Next(); t && !bRef; t = pArr->Next() ) + { + if( t->GetOpCode() == ocDBArea ) + { + if( ScDBData* pDBData = pDocument->GetDBCollection()->FindIndex( t->GetIndex() ) ) + { + pDBData->GetArea(aRange); + bRef = TRUE; + } + } + } + } + /* XL artificially limits things to a single col or row in the UI but does * not list the constraint in MOOXml. If a defined name or INDIRECT * resulting in 1D is entered in the UI and the definition later modified @@ -735,7 +758,13 @@ { // FIXME FIXME FIXME // Feature regression. Date formats are lost passing through the matrix - pFormatter->GetInputLineString( pMatVal->fVal, 0, aValStr ); + if ( bRef ) + { + pDocument->GetInputString((SCCOL)(nCol+aRange.aStart.Col()), + (SCROW)(nRow+aRange.aStart.Row()), aRange.aStart.Tab() , aValStr); + } + else + pFormatter->GetInputLineString( pMatVal->fVal, 0, aValStr ); } if( pCell && rMatch < 0 )