diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-22 10:06:26 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-22 10:06:26 +0000 |
commit | 0554b3bf93e56f8304529a93d961fa3fa60c199d (patch) | |
tree | 9f72e55aa3310502de84f74c4db5764559338d53 /oox/source/xls/formulabase.cxx | |
parent | f9ce9a1d243d8a4e550b8f9aea92246c21ad6a73 (diff) |
CWS-TOOLING: integrate CWS dr67
2009-04-08 13:23:56 +0200 dr r270638 : #i100534# reverted
2009-04-08 10:14:55 +0200 dr r270621 : CWS-TOOLING: rebase CWS dr67 to trunk@270033 (milestone: DEV300:m45)
2009-04-07 21:06:33 +0200 dr r270610 : #i100534# sc does not link in debug mode
2009-03-12 11:20:09 +0100 dr r269375 : #i10000# wae
2009-03-11 19:43:55 +0100 dr r269351 : #i10000# adjust oox namespace ids according to oox/inc/oox/core/namespaces.hxx
2009-03-11 15:38:52 +0100 dr r269339 : CWS-TOOLING: rebase CWS dr67 to trunk@269297 (milestone: DEV300:m43)
2009-02-27 15:20:21 +0100 dr r268598 : CWS-TOOLING: rebase CWS dr67 to trunk@268395 (milestone: DEV300:m42)
2009-02-19 13:32:17 +0100 dr r268277 : moved hf parser into page settings
2009-02-19 12:25:15 +0100 dr r268272 : renamed some structs according to chart filter
2009-02-16 15:51:31 +0100 dr r267823 : #i97873# import autosort settings from BIFF8/OOBIN/OOXML
2009-02-06 17:09:29 +0100 dr r267477 : #i97873# minor changes
2009-02-06 16:38:56 +0100 dr r267473 : #i97873# import date grouping settings from BIFF5/BIFF8/OOBIN/OOXML
2009-02-06 16:38:11 +0100 dr r267472 : #i97873# check min/max/step of passed GroupInfo
2009-02-06 16:35:13 +0100 dr r267471 : #i97873# more doc for createDategroup()
2009-02-06 13:53:42 +0100 dr r267459 : #i97873# make XDataPilotGrouping::createDateGroup() implementation working and robust against wrong input data
2009-02-06 13:52:16 +0100 dr r267458 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-06 12:35:49 +0100 dr r267453 : fix other IDLC warnings in sheet module
2009-02-06 12:05:19 +0100 dr r267448 : #i97873# fix and extend IDL doc for datapilot grouping
2009-02-02 17:58:46 +0100 dr r267284 : #i10000# rebase errors
2009-02-02 17:52:21 +0100 dr r267282 : #i10000# rebase errors
2009-02-02 17:35:58 +0100 dr r267280 : #i10000# rebase errors
2009-02-02 15:58:04 +0100 dr r267274 : CWS-TOOLING: rebase CWS dr67 to trunk@267171 (milestone: DEV300:m41)
2009-02-02 09:16:32 +0100 dr r267247 : #i97873# typo
2009-01-30 17:09:09 +0100 dr r267215 : #i97873# import numeric grouping settings for datapilot fields from BIFF5/BIFF8/OOBIN/OOXML
2009-01-29 16:36:24 +0100 dr r267154 : #i97873# import datapilot discrete grouping from BIFF5/BIFF8/OOBIN/OOXLS
2009-01-29 16:33:37 +0100 dr r267152 : #i97873# do not kill _all_ the other group fields when writing back DataPilotField::GroupInfo property
2009-01-29 14:15:45 +0100 dr r267133 : #i93839# remove ScChengeTrack::Load and ::Store, adapt xls export filter
2009-01-28 13:30:37 +0100 dr r267056 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-28 12:09:05 +0100 dr r267051 : #i98397# enhance DataPilot API: allow to rename groups and items in a group field
2009-01-27 16:13:58 +0100 dr r267005 : #i97873# minor changes in DataPilot API implementation as preparation for additional changes needed for OOX import filter
2009-01-27 10:08:01 +0100 dr r266961 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-27 10:06:50 +0100 dr r266960 : #i97873# changing orientation of a DP field moves it to last position in new dimension
2009-01-23 12:52:31 +0100 dr r266808 : #i97873# DP documentation extended
2009-01-21 20:07:15 +0100 dr r266702 : #i97873# this trivial patch adds BIFF5/BIFF8 pivot table import to the oox filter
2009-01-20 16:06:23 +0100 dr r266592 : select BIFF filter via env.var
2009-01-16 18:51:01 +0100 dr r266452 : #i97873# import page fields
2009-01-16 15:05:36 +0100 dr r266420 : #i97873# field item settings (collapsed/hidden), settings of hidden fields
2009-01-15 16:01:17 +0100 dr r266377 : #i97873# import OOXML7/OOBIN7 autoshow settings
2009-01-14 15:24:27 +0100 dr r266310 : #i97873# import auto show settings generated by MSO2003
2009-01-14 12:29:44 +0100 dr r266281 : #i97873# set global dp settings
2009-01-13 15:04:30 +0100 dr r266229 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-13 14:46:50 +0100 dr r266225 : #i98029# SdrGroupObj does not remember predefined bounding rectangle anymore
2009-01-12 15:04:22 +0100 dr r266161 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 15:03:42 +0100 dr r266160 : #i97873# remove misleading hasDataLayoutField()
2009-01-12 14:57:33 +0100 dr r266159 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-12 14:52:43 +0100 dr r266158 : #i97900# reverted previous change, adjusted code to new EnableRTL() behaviour
2009-01-09 16:34:55 +0100 dr r266098 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 16:32:16 +0100 dr r266097 : #i97900# RTL handling in TabBar changed with CWS rtlcontrols
2009-01-09 12:02:39 +0100 dr r266072 : #i97623# RTL handling changed after CWS rtlcontrols
2009-01-09 09:48:53 +0100 dr r266050 : #i158444# SXLI must be filled completely before starting CONTINUE
2009-01-08 18:50:08 +0100 dr r266032 : #158444# allow to disable dump of record positions
2009-01-08 15:46:45 +0100 dr r266020 : #i97873# data layout field handling
2009-01-08 15:45:45 +0100 dr r266019 : #i97873# data layout field handling
2009-01-08 15:42:25 +0100 dr r266018 : #i97873# data layout field handling
2009-01-02 17:28:32 +0100 dr r265844 : #i10000# unxmacxi warning
2009-01-02 16:59:13 +0100 dr r265842 : #i10000# rebase corrections
2009-01-02 16:44:44 +0100 dr r265838 : #i10000# rebase corrections
2009-01-02 11:32:44 +0100 dr r265834 : CWS-TOOLING: rebase CWS dr67 to trunk@265758 (milestone: DEV300:m38)
2008-12-29 16:55:40 +0100 dr r265822 : more pivot table import, field layout settings
2008-12-29 14:27:35 +0100 dr r265817 : more pivot table import, additions for data field settings
2008-12-26 14:39:21 +0100 dr r265805 : updates
2008-12-19 16:31:39 +0100 dr r265734 : typo
2008-12-19 16:30:00 +0100 dr r265733 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:43 +0100 dr r265732 : add API for sequence of DP field subtotal functions
2008-12-19 16:29:07 +0100 dr r265731 : add API for sequence of DP field subtotal functions
2008-12-18 18:07:58 +0100 dr r265710 : #i96758# try to cache row default formatting and apply it at row ranges instead of single rows
2008-12-18 16:00:25 +0100 dr r265698 : more additions to pivot import
2008-12-17 13:38:19 +0100 dr r265599 : do not assert HIDDEN orientation
2008-12-12 13:51:29 +0100 dr r265415 : minor typos
2008-12-12 10:15:04 +0100 dr r265394 : pivot cache import extended to XLSB, added creation of cache data for missing/external sheets
2008-12-04 13:16:16 +0100 dr r264837 : #i96860# remove old dumper files
2008-12-04 12:17:38 +0100 dr r264834 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-04 12:16:38 +0100 dr r264833 : #i96858# XTO broken, if textbox is empty but contains formatting
2008-12-03 14:51:05 +0100 dr r264784 : #i10000# warnings
2008-12-03 14:32:46 +0100 dr r264778 : #i10000# warning
2008-12-03 11:28:38 +0100 dr r264758 : #i96758# ignore zero-sized objects
2008-12-03 10:09:34 +0100 dr r264748 : #i96758# change ::oox::Property(Set|Map) keys to sal_Int32 property identifiers, to save construction of property names
2008-12-01 16:09:02 +0100 dr r264615 : #i96758# headerdoc
2008-12-01 14:49:04 +0100 dr r264607 : #i96758# import performance of formatted documents
2008-11-26 17:08:15 +0100 dr r264424 : make it more simple
2008-11-26 16:31:41 +0100 dr r264419 : c:crossesAt is for crossing axis, not for own axis. This is different to BIFF
2008-11-26 13:55:55 +0100 dr r264382 : #i86346# import of MissingValueTreatment from XLSX
2008-11-26 12:49:38 +0100 dr r264370 : #i86346# import/export of MissingValueTreatment from/to XLS
2008-11-25 17:48:59 +0100 dr r264320 : update row height with single progress bar when using 'IsAdjustHeightEnabled' document property
2008-11-25 17:24:26 +0100 dr r264319 : #i96438# disable importing comment text until API is fixed
2008-11-25 17:11:30 +0100 dr r264318 : #i90124# set control tooltips, patch from npower
2008-11-25 15:09:28 +0100 dr r264309 : #i94028# #i94991# update drawing objects when changing row height
2008-11-24 15:21:35 +0100 dr r264224 : prevent ::rtl::OUString::copy assertion
2008-11-24 15:19:39 +0100 dr r264223 : #i95183# #158573# handle non-ascii characters in sheet names in OOXML import
2008-11-24 12:54:30 +0100 dr r264221 : #i94157# support ESC key to leave full-screen in page preview
2008-11-21 18:15:17 +0100 dr r264165 : #i90360# disable chart perspective if it is set to 0
2008-11-21 18:14:41 +0100 dr r264164 : #i90360# disable chart perspective if it is set to 0
2008-11-21 17:43:26 +0100 dr r264155 : #i96140# missing parenth
2008-11-21 17:36:35 +0100 dr r264154 : #i96438# first steps of note import
2008-11-20 15:15:03 +0100 dr r264059 : get rid of ContextWrapper
2008-11-18 11:39:52 +0100 dr r263755 : #i78476# moved to CWS dr67
Diffstat (limited to 'oox/source/xls/formulabase.cxx')
-rw-r--r-- | oox/source/xls/formulabase.cxx | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index 6696c211e61d..2c5fed66ce30 100644 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp> #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp> #include <com/sun/star/sheet/XFormulaTokens.hpp> +#include "properties.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/recordinputstream.hxx" #include "oox/core/filterbase.hxx" @@ -1254,13 +1255,15 @@ void SimpleFormulaContext::setTokens( const ApiTokenSequence& rTokens ) namespace { +const sal_Int32 nForbiddenFlags = COLUMN_DELETED | ROW_DELETED | SHEET_DELETED | COLUMN_RELATIVE | ROW_RELATIVE | SHEET_RELATIVE | RELATIVE_NAME; + bool lclConvertToCellAddress( CellAddress& orAddress, const SingleReference& rSingleRef, sal_Int32 nFilterBySheet ) { orAddress = CellAddress( static_cast< sal_Int16 >( rSingleRef.Sheet ), rSingleRef.Column, rSingleRef.Row ); return ((nFilterBySheet < 0) || (nFilterBySheet == rSingleRef.Sheet)) && - !getFlag( rSingleRef.Flags, COLUMN_DELETED | ROW_DELETED | SHEET_DELETED ); + !getFlag( rSingleRef.Flags, nForbiddenFlags ); } bool lclConvertToCellRange( CellRangeAddress& orRange, const ComplexReference& rComplexRef, sal_Int32 nFilterBySheet ) @@ -1271,8 +1274,8 @@ bool lclConvertToCellRange( CellRangeAddress& orRange, const ComplexReference& r return (rComplexRef.Reference1.Sheet == rComplexRef.Reference2.Sheet) && ((nFilterBySheet < 0) || (nFilterBySheet == rComplexRef.Reference1.Sheet)) && - !getFlag( rComplexRef.Reference1.Flags, COLUMN_DELETED | ROW_DELETED | SHEET_DELETED ) && - !getFlag( rComplexRef.Reference2.Flags, COLUMN_DELETED | ROW_DELETED | SHEET_DELETED ); + !getFlag( rComplexRef.Reference1.Flags, nForbiddenFlags ) && + !getFlag( rComplexRef.Reference2.Flags, nForbiddenFlags ); } enum TokenToRangeListState { STATE_REF, STATE_SEP, STATE_OPEN, STATE_CLOSE, STATE_ERROR }; @@ -1283,7 +1286,7 @@ TokenToRangeListState lclProcessRef( ApiCellRangeList& orRanges, const Any& rDat if( rData >>= aSingleRef ) { CellAddress aAddress; - // ignore invalid addresses (with #REF! errors), but to not stop parsing + // ignore invalid addresses (with #REF! errors), but do not stop parsing if( lclConvertToCellAddress( aAddress, aSingleRef, nFilterBySheet ) ) orRanges.push_back( CellRangeAddress( aAddress.Sheet, aAddress.Column, aAddress.Row, aAddress.Column, aAddress.Row ) ); return STATE_REF; @@ -1292,7 +1295,7 @@ TokenToRangeListState lclProcessRef( ApiCellRangeList& orRanges, const Any& rDat if( rData >>= aComplexRef ) { CellRangeAddress aRange; - // ignore invalid ranges (with #REF! errors), but to not stop parsing + // ignore invalid ranges (with #REF! errors), but do not stop parsing if( lclConvertToCellRange( aRange, aComplexRef, nFilterBySheet ) ) orRanges.push_back( aRange ); return STATE_REF; @@ -1317,8 +1320,7 @@ TokenToRangeListState lclProcessClose( sal_Int32& ornParenLevel ) // ---------------------------------------------------------------------------- FormulaProcessorBase::FormulaProcessorBase( const WorkbookHelper& rHelper ) : - OpCodeProvider( rHelper ), - maAbsNameProp( CREATE_OUSTRING( "AbsoluteName" ) ) + OpCodeProvider( rHelper ) { } @@ -1379,9 +1381,8 @@ OUString FormulaProcessorBase::generateApiAddressString( const CellAddress& rAdd OUString aCellName; try { - Reference< XCellRange > xSheet( getSheet( rAddress.Sheet ), UNO_QUERY_THROW ); - PropertySet aCellProp( xSheet->getCellByPosition( rAddress.Column, rAddress.Row ) ); - aCellProp.getProperty( aCellName, maAbsNameProp ); + PropertySet aCellProp( getCellFromDoc( rAddress ) ); + aCellProp.getProperty( aCellName, PROP_AbsoluteName ); } catch( Exception& ) { @@ -1395,9 +1396,8 @@ OUString FormulaProcessorBase::generateApiRangeString( const CellRangeAddress& r OUString aRangeName; try { - Reference< XCellRange > xSheet( getSheet( rRange.Sheet ), UNO_QUERY_THROW ); - PropertySet aRangeProp( xSheet->getCellRangeByPosition( rRange.StartColumn, rRange.StartRow, rRange.EndColumn, rRange.EndRow ) ); - aRangeProp.getProperty( aRangeName, maAbsNameProp ); + PropertySet aRangeProp( getCellRangeFromDoc( rRange ) ); + aRangeProp.getProperty( aRangeName, PROP_AbsoluteName ); } catch( Exception& ) { @@ -1472,6 +1472,18 @@ Any FormulaProcessorBase::extractReference( const ApiTokenSequence& rTokens ) co return Any(); } +bool FormulaProcessorBase::extractAbsoluteRange( CellRangeAddress& orRange, const ApiTokenSequence& rTokens ) const +{ + ApiCellRangeList aRanges; + lclProcessRef( aRanges, extractReference( rTokens ), -1 ); + if( !aRanges.empty() ) + { + orRange = aRanges.front(); + return true; + } + return false; +} + void FormulaProcessorBase::extractCellRangeList( ApiCellRangeList& orRanges, const ApiTokenSequence& rTokens, sal_Int32 nFilterBySheet ) const { |