diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-05 00:25:40 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-05 00:27:40 -0500 |
commit | a1d605a6b8772426229941449c23d68ea91aa81a (patch) | |
tree | a52c9bf1588ee55d9641e477cf39fb5c0cfd342b /sc | |
parent | 578292d707077c18079de050c928afaae268a25d (diff) |
Removed the restriction to always pass Calc A1 formatted data ranges.
This change also fixes the bug where changing data series ranges was
impossible to do when the formula syntax was not Calc A1.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documen5.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/charthelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/rangeutl.cxx | 13 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeResizer.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 10 |
6 files changed, 14 insertions, 21 deletions
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 4a1c2b45825e..f19a067b4f41 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -297,8 +297,8 @@ void ScDocument::SetChartRanges( const rtl::OUString& rChartName, const ::std::v for( sal_Int32 nN=0; nN<nCount; nN++ ) { ScRangeList aScRangeList( rRangesVector[nN] ); - rtl::OUString sRangeStr; // This range must be in Calc A1 format. - aScRangeList.Format( sRangeStr, SCR_ABS_3D, this ); + rtl::OUString sRangeStr; + aScRangeList.Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() ); aRangeStrings[nN]=sRangeStr; } ScChartHelper::SetChartRanges( xChartDoc, aRangeStrings ); diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index e1f05005b56a..6cd84f136079 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -248,7 +248,6 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument if( xLabel.is()) { - // the range string must be in Calc A1 format. uno::Reference< chart2::data::XDataSequence > xNewSeq( xDataProvider->createDataSequenceByRangeRepresentation( rRanges[nRange++] )); @@ -264,7 +263,6 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument if( xValues.is()) { - // the range string must be in Calc A1 format. uno::Reference< chart2::data::XDataSequence > xNewSeq( xDataProvider->createDataSequenceByRangeRepresentation( rRanges[nRange++] )); diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 5e1db5d7dedc..572ff179d079 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -834,13 +834,13 @@ static void lcl_appendCellAddress( rBuf.append(sal_Unicode('.')); String aAddr; - rCell.Format(aAddr, SCA_ABS, NULL, ::formula::FormulaGrammar::CONV_OOO); + rCell.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention()); rBuf.append(aAddr); } else { String aAddr; - rCell.Format(aAddr, SCA_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + rCell.Format(aAddr, SCA_ABS_3D, pDoc, pDoc->GetAddressConvention()); rBuf.append(aAddr); } } @@ -869,7 +869,7 @@ static void lcl_appendCellRangeAddress( rBuf.append(sal_Unicode('.')); String aAddr; - rCell1.Format(aAddr, SCA_ABS, NULL, ::formula::FormulaGrammar::CONV_OOO); + rCell1.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention()); rBuf.append(aAddr); rBuf.appendAscii(":"); @@ -881,7 +881,7 @@ static void lcl_appendCellRangeAddress( rBuf.append(sal_Unicode('.')); } - rCell2.Format(aAddr, SCA_ABS, NULL, ::formula::FormulaGrammar::CONV_OOO); + rCell2.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention()); rBuf.append(aAddr); } else @@ -890,7 +890,7 @@ static void lcl_appendCellRangeAddress( aRange.aStart = rCell1; aRange.aEnd = rCell2; String aAddr; - aRange.Format(aAddr, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); + aRange.Format(aAddr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()); rBuf.append(aAddr); } } @@ -898,7 +898,8 @@ static void lcl_appendCellRangeAddress( void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, const OUString& rXMLRange, ScDocument* pDoc ) { FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); - const sal_Unicode cSep = ' ', cSepNew = ';'; + const sal_Unicode cSep = ' '; + const sal_Unicode cSepNew = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); const sal_Unicode cQuote = '\''; OUStringBuffer aRetStr; diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 5ae92152e3b4..8cf884d2ef00 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -847,7 +847,7 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin if( xDataProv.is() && mxTokenArray ) { ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray ); - aComp.SetGrammar( ::formula::FormulaGrammar::GRAM_ENGLISH ); + aComp.SetGrammar(GetDoc().GetGrammar()); OUStringBuffer aRangeRep; aComp.CreateStringFromTokenArray( aRangeRep ); try diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index 2007b789b3bf..6bf445fa1dab 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -79,7 +79,6 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc, } OUString aRangeStr; - // This one returns ranges with ';' as the separators. ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, rRangeList, pDoc); if (!aRangeStr.getLength()) { @@ -96,8 +95,9 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc, SAL_WNODEPRECATED_DECLARATIONS_PUSH auto_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>); SAL_WNODEPRECATED_DECLARATIONS_POP + const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - *pRefTokens, aRangeStr, pDoc, ';', formula::FormulaGrammar::GRAM_ENGLISH); + *pRefTokens, aRangeStr, pDoc, cSep, pDoc->GetGrammar()); if (!pRefTokens->empty()) { ScChartListener* pCL(new ScChartListener(rName, pDoc, pRefTokens.release())); diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index c9a1aad89110..86f5bcf00384 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2071,16 +2071,10 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL if(!m_pDocument || (aRangeRepresentation.getLength() == 0)) return xResult; - // Note: the range representation must be in Calc A1 format, with English - // function names and ';' as the union operator in case of multiple - // ranges. The import filters use this method to pass data ranges, and - // they have no idea what the current formula syntax is. In the future we - // should add another method to allow the client code to directly pass - // tokens representing ranges. - vector<ScTokenRef> aRefTokens; + const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aRefTokens, aRangeRepresentation, m_pDocument, ';', FormulaGrammar::GRAM_ENGLISH); + aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); if (aRefTokens.empty()) return xResult; |