diff options
author | Steve Yin <steve_y@apache.org> | 2013-12-30 05:52:36 +0000 |
---|---|---|
committer | Steve Yin <steve_y@apache.org> | 2013-12-30 05:52:36 +0000 |
commit | 7e7e0c820f442e3a7ee1b5f6ad80fe7999a75f0b (patch) | |
tree | 48f61d34e93d2f3f66da6e56a6266905f7855cd6 /oox | |
parent | 26223e11dbc00d97c32980ddca19a7b08bf3ce0c (diff) |
Bug 123910 - The reference in validation condition change to #REF! in exported xls file
Build break fix
Notes
Notes:
merged as: 5249a2022aa7152cba5bb6541eade43b9e77b755
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/xls/worksheethelper.hxx | 1 | ||||
-rw-r--r-- | oox/source/xls/worksheetfragment.cxx | 1 | ||||
-rw-r--r-- | oox/source/xls/worksheethelper.cxx | 20 |
3 files changed, 22 insertions, 0 deletions
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx index f32f53acd172..c0b8b2e6c7bf 100644 --- a/oox/inc/oox/xls/worksheethelper.hxx +++ b/oox/inc/oox/xls/worksheethelper.hxx @@ -154,6 +154,7 @@ struct ValidationModel ApiCellRangeList maRanges; ApiTokenSequence maTokens1; ApiTokenSequence maTokens2; + ::rtl::OUString msRef; ::rtl::OUString maInputTitle; ::rtl::OUString maInputMessage; ::rtl::OUString maErrorTitle; diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx index 5c28866b4cc9..cff036383107 100644 --- a/oox/source/xls/worksheetfragment.cxx +++ b/oox/source/xls/worksheetfragment.cxx @@ -158,6 +158,7 @@ void DataValidationsContext::importDataValidation( const AttributeList& rAttribs { mxValModel.reset( new ValidationModel ); getAddressConverter().convertToCellRangeList( mxValModel->maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true ); + mxValModel->msRef = rAttribs.getString( XML_sqref, OUString() ); mxValModel->maInputTitle = rAttribs.getXString( XML_promptTitle, OUString() ); mxValModel->maInputMessage = rAttribs.getXString( XML_prompt, OUString() ); mxValModel->maErrorTitle = rAttribs.getXString( XML_errorTitle, OUString() ); diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 81743417b077..0f84cad7bf92 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -1093,6 +1093,26 @@ void WorksheetGlobals::finalizeValidationRanges() const { } + 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 ) |