From 47ec29ae934c82a58436bca0511117503568e907 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 6 Mar 2013 06:50:22 +0100 Subject: prevent non-3D refs from being accepted in chart2, related fdo#61781 Change-Id: I4c7f79393721bff3d5e6fda98b8d4bf16a5ee398 --- sc/source/ui/unoobj/chart2uno.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sc/source/ui') diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index fd2961fa4b14..ccb152484ff5 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -34,6 +34,7 @@ #include "chartlis.hxx" #include "stlalgorithm.hxx" #include "tokenuno.hxx" +#include "docsh.hxx" #include "formula/opcode.hxx" @@ -1052,7 +1053,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint vector aTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); + aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true); return !aTokens.empty(); } @@ -1481,7 +1482,7 @@ ScChart2DataProvider::createDataSource( vector aRefTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); + aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true); if (aRefTokens.empty()) // Invalid range representation. Bail out. throw lang::IllegalArgumentException(); @@ -1815,7 +1816,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum vector aTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aTokens, xLabel->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar()); + aTokens, xLabel->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar(), true); aLabel.initRangeAnalyzer(aTokens); vector::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end(); for (; itr != itrEnd; ++itr) @@ -1834,7 +1835,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum vector aTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aTokens, xValues->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar()); + aTokens, xValues->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar(), true); aValues.initRangeAnalyzer(aTokens); vector::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end(); for (; itr != itrEnd; ++itr) @@ -2043,7 +2044,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum vector aTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); + aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true); return !aTokens.empty(); } @@ -2063,7 +2064,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL vector aRefTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); + aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true); if (aRefTokens.empty()) return xResult; @@ -2234,7 +2235,7 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUStr vector aRefTokens; const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0); ScRefTokenHelper::compileRangeRepresentation( - aRefTokens, sRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar()); + aRefTokens, sRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true); if (aRefTokens.empty()) throw lang::IllegalArgumentException(); -- cgit