From a69a01fcb415209a53236dae31cb8c658cec95a8 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 29 Jul 2009 14:46:52 +0000 Subject: CWS-TOOLING: integrate CWS dr71 2009-07-07 16:26:00 +0200 dr r273805 : #i10000# unused variables 2009-07-07 10:27:14 +0200 dr r273780 : CWS-TOOLING: rebase CWS dr71 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 11:28:24 +0200 dr r273559 : #101471# special handling for XL library functions in ODF formulas (EUROCONVERT) 2009-06-29 17:48:46 +0200 dr r273478 : #i101471# typo 2009-06-29 17:35:16 +0200 dr r273477 : #i101471# import msoxl: formulas from conditional formatting and data validation 2009-06-18 13:45:17 +0200 dr r273115 : #101471# changed interface css.sheet.XFormulaParser 2009-06-18 13:44:43 +0200 dr r273114 : #101471# changed interface css.sheet.XFormulaParser 2009-06-17 17:29:23 +0200 dr r273089 : #i101471# extend the XFormulaParser interface with a ReferencePosition parameter, make rel-refs from msoxl: namespace working 2009-06-17 17:28:39 +0200 dr r273088 : #i101471# extend the XFormulaParser interface with a ReferencePosition parameter 2009-06-17 17:28:19 +0200 dr r273087 : #i101471# extend the XFormulaParser interface with a ReferencePosition parameter 2009-06-17 17:27:19 +0200 dr r273086 : #i101471# extend the XFormulaParser interface with a ReferencePosition parameter, remove that property from FormulaParser service 2009-06-17 12:52:20 +0200 dr r273059 : #i101471# import cell formulas from msoxl: namespace 2009-06-16 11:40:50 +0200 dr r273013 : #i101471# import formula namespace from xml elements 2009-06-12 18:34:13 +0200 dr r272935 : #i101471# external formula parser for oox in odf 2009-06-12 18:33:13 +0200 dr r272934 : #i101471# external formula parsers 2009-06-12 18:29:46 +0200 dr r272933 : #i101471# external formula parsers 2009-06-05 15:53:47 +0200 dr r272705 : #i101471# provide OOX formula parser as UNO service --- formula/inc/formula/IFunctionDescription.hxx | 1 + formula/source/ui/dlg/formula.cxx | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'formula') diff --git a/formula/inc/formula/IFunctionDescription.hxx b/formula/inc/formula/IFunctionDescription.hxx index 3db1e6d49a94..5be54237a956 100644 --- a/formula/inc/formula/IFunctionDescription.hxx +++ b/formula/inc/formula/IFunctionDescription.hxx @@ -153,6 +153,7 @@ namespace formula virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0; + virtual ::com::sun::star::table::CellAddress getReferencePosition() const = 0; virtual void setDispatcherLock( BOOL bLock ) = 0; virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked) = 0; diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index ed9337c4762e..1e5b55b7b67f 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -497,6 +497,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) if ( m_aTokenList.getLength() ) { const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser()); + const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); const sheet::FormulaToken* pIter = m_aTokenList.getConstArray(); const sheet::FormulaToken* pEnd = pIter + m_aTokenList.getLength(); @@ -509,7 +510,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) const sal_Int32 eOp = pIter->OpCode; uno::Sequence aArgs(1); aArgs[0] = *pIter; - const String aString = xParser->printFormula(aArgs); + const String aString = xParser->printFormula(aArgs, aRefPos); const sheet::FormulaToken* pNextToken = pIter + 1; if(!bUserMatrixFlag && FormulaCompiler::IsMatrixFunction((OpCode)eOp) ) @@ -533,7 +534,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) if ( pNextToken != pEnd ) { aArgs[0] = *pNextToken; - const String a2String = xParser->printFormula(aArgs); + const String a2String = xParser->printFormula(aArgs, aRefPos); const xub_StrLen n3 = aFormString.Search(a2String,nXXX); if ( n3 < nTokPos ) nTokPos = n3; @@ -681,7 +682,8 @@ void FormulaDlg_Impl::MakeTree(IStructHelper* _pTree,SvLBoxEntry* pParent,Formul aArgs[0] = m_aTokenMap.find(pOrigToken)->second; try { - const String aResult = m_pHelper->getFormulaParser()->printFormula(aArgs); + const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); + const String aResult = m_pHelper->getFormulaParser()->printFormula(aArgs, aRefPos); if ( nParas > 0 ) { @@ -749,7 +751,8 @@ void FormulaDlg_Impl::UpdateTokenArray( const String& rStrExp) m_aTokenList.realloc(0); try { - m_aTokenList = m_pHelper->getFormulaParser()->parseFormula(rStrExp); + const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); + m_aTokenList = m_pHelper->getFormulaParser()->parseFormula(rStrExp, aRefPos); } catch(const uno::Exception&) { @@ -962,7 +965,8 @@ String FormulaDlg_Impl::RepairFormula(const String& aFormula) if ( m_aTokenList.getLength() ) { - const String sFormula(m_pHelper->getFormulaParser()->printFormula(m_aTokenList)); + const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); + const String sFormula(m_pHelper->getFormulaParser()->printFormula(m_aTokenList, aRefPos)); if ( !sFormula.Len() || sFormula.GetChar(0) != '=' ) aResult += sFormula; else -- cgit