[Libreoffice-commits] core.git: Branch 'aoo/trunk' - oox/source
Steve Yin
steve_y at apache.org
Thu Dec 26 22:07:22 PST 2013
oox/source/xls/worksheethelper.cxx | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
New commits:
commit 81912caea58b89f9490ba4b9e3a3127071e23190
Author: Steve Yin <steve_y at apache.org>
Date: Fri Dec 27 05:30:08 2013 +0000
Bug 123910 - The reference in validation condition change to #REF! in exported xls file
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index 17dff76..8174341 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -1073,6 +1073,26 @@ void WorksheetGlobals::finalizeValidationRanges() const
{
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 )
More information about the Libreoffice-commits
mailing list