Author: steve_y Date: Fri Dec 27 05:30:08 2013 New Revision: 1553626 URL: http://svn.apache.org/r1553626 Log: Bug 123910 - The reference in validation condition change to #REF! in exported xls file
Modified: openoffice/trunk/main/oox/source/xls/worksheethelper.cxx Modified: openoffice/trunk/main/oox/source/xls/worksheethelper.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/oox/source/xls/worksheethelper.cxx?rev=1553626&r1=1553625&r2=1553626&view=diff ============================================================================== --- openoffice/trunk/main/oox/source/xls/worksheethelper.cxx (original) +++ openoffice/trunk/main/oox/source/xls/worksheethelper.cxx Fri Dec 27 05:30:08 2013 @@ -1073,6 +1073,26 @@ void WorksheetGlobals::finalizeValidatio { PropertySet aValProps( xValidation ); + try + { + sal_Int32 nIndex = 0; + OUString aToken = aIt->msRef.getToken( 0, ' ', nIndex ); + + Reference<XSpreadsheet> xSheet = getSheetFromDoc( getCurrentSheetIndex() ); + Reference<XCellRange> xDBCellRange; + Reference<XCell> xCell; + xDBCellRange = xSheet->getCellRangeByName( aToken ); + + xCell = xDBCellRange->getCellByPosition( 0, 0 ); + Reference<XCellAddressable> xCellAddressable( xCell, UNO_QUERY_THROW ); + CellAddress aFirstCell = xCellAddressable->getCellAddress(); + Reference<XSheetCondition> xCondition( xValidation, UNO_QUERY_THROW ); + xCondition->setSourcePosition( aFirstCell ); + } + catch( Exception& ) + { + } + // convert validation type to API enum ValidationType eType = ValidationType_ANY; switch( aIt->mnType )