[Libreoffice-commits] .: patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Jan 19 10:14:25 PST 2011
patches/dev300/apply | 3
patches/dev300/calc-formula-db-function-fix.diff | 198 -----------------------
2 files changed, 201 deletions(-)
New commits:
commit f398c6bbca0bea6ddb1b3f31f3647cf85acdf894
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Jan 19 13:14:11 2011 -0500
Removed another obsolete patch.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index e2ab41c..2d0ba97 100755
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2166,9 +2166,6 @@ speed-sfx2-dont-throw-too-much.diff, i#107512, jholesov
calc-pdf-export-allow-filtered-range-sc.diff, n#585028, kohei
calc-pdf-export-allow-filtered-range-filter.diff, n#585028, kohei
-# Fix handling of DB functions.
-calc-formula-db-function-fix.diff, n#594332, n#595713, kohei
-
[ GentooExperimental ]
SectionOwner => hmth
# make Python2 optional
diff --git a/patches/dev300/calc-formula-db-function-fix.diff b/patches/dev300/calc-formula-db-function-fix.diff
deleted file mode 100644
index 29dfd32..0000000
--- a/patches/dev300/calc-formula-db-function-fix.diff
+++ /dev/null
@@ -1,198 +0,0 @@
----
- sc/inc/queryparam.hxx | 6 ++++++
- sc/source/core/tool/doubleref.cxx | 26 ++++++++------------------
- sc/source/core/tool/interpr1.cxx | 21 +++++++++++++++++++++
- sc/source/core/tool/queryparam.cxx | 17 +++++++++++++++++
- 4 files changed, 52 insertions(+), 18 deletions(-)
-
-diff --git sc/inc/queryparam.hxx sc/inc/queryparam.hxx
-index 01ddffb..555f4a5 100644
---- sc/inc/queryparam.hxx
-+++ sc/inc/queryparam.hxx
-@@ -50,6 +50,8 @@ struct ScQueryParamBase
-
- virtual ~ScQueryParamBase();
-
-+ virtual bool IsValidFieldIndex() const;
-+
- SC_DLLPUBLIC SCSIZE GetEntryCount() const;
- SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const;
- void Resize(SCSIZE nNew);
-@@ -129,6 +131,8 @@ struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTa
- {
- ScDBQueryParamInternal();
- virtual ~ScDBQueryParamInternal();
-+
-+ virtual bool IsValidFieldIndex() const;
- };
-
- // ============================================================================
-@@ -139,6 +143,8 @@ struct ScDBQueryParamMatrix : public ScDBQueryParamBase
-
- ScDBQueryParamMatrix();
- virtual ~ScDBQueryParamMatrix();
-+
-+ virtual bool IsValidFieldIndex() const;
- };
-
- #endif
-diff --git sc/source/core/tool/doubleref.cxx sc/source/core/tool/doubleref.cxx
-index c90e7d5..29c7928 100644
---- sc/source/core/tool/doubleref.cxx
-+++ sc/source/core/tool/doubleref.cxx
-@@ -330,11 +330,13 @@ SCSIZE ScDBInternalRange::getVisibleDataCellCount() const
-
- OUString ScDBInternalRange::getString(SCCOL nCol, SCROW nRow) const
- {
-- String aStr;
-+ OUString aStr;
- const ScAddress& s = maRange.aStart;
-- // #i109200# this is used in formula calculation, use GetInputString, not GetString
-- // (consistent with ScDBInternalRange::getCellString)
-- getDoc()->GetInputString(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab(), aStr);
-+ ScBaseCell* pCell = getDoc()->GetCell(ScAddress(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab()));
-+ if (!pCell)
-+ return aStr;
-+
-+ getCellString(aStr, pCell);
- return aStr;
- }
-
-@@ -347,15 +349,11 @@ SCCOL ScDBInternalRange::findFieldColumn(SCCOL nIndex) const
- {
- const ScRange& rRange = getRange();
- const ScAddress& s = rRange.aStart;
-- const ScAddress& e = rRange.aEnd;
-
- SCCOL nDBCol1 = s.Col();
-- SCCOL nDBCol2 = e.Col();
--
-- if ( nIndex <= 0 || nIndex > (nDBCol2 - nDBCol1 + 1) )
-- return nDBCol1;
-
-- return Min(nDBCol2, static_cast<SCCOL>(nDBCol1 + nIndex - 1));
-+ // Don't handle out-of-bound condition here. We'll do that later.
-+ return nIndex + nDBCol1 - 1;
- }
-
- sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) const
-@@ -517,14 +515,6 @@ SCCOL ScDBExternalRange::getFirstFieldColumn() const
-
- SCCOL ScDBExternalRange::findFieldColumn(SCCOL nIndex) const
- {
-- if (nIndex < 1)
-- // 1st field
-- return 0;
--
-- if (nIndex > mnCols)
-- // last field
-- return mnCols - 1;
--
- return nIndex - 1;
- }
-
-diff --git sc/source/core/tool/interpr1.cxx sc/source/core/tool/interpr1.cxx
-index 32e1a16..40325cf 100644
---- sc/source/core/tool/interpr1.cxx
-+++ sc/source/core/tool/interpr1.cxx
-@@ -5984,6 +5984,11 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc )
- auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
- if (pQueryParam.get())
- {
-+ if (!pQueryParam->IsValidFieldIndex())
-+ {
-+ SetError(errNoValue);
-+ return;
-+ }
- ScDBQueryDataIterator aValIter(pDok, pQueryParam.release());
- ScDBQueryDataIterator::Value aValue;
- if ( aValIter.GetFirst(aValue) && !aValue.mnError )
-@@ -6060,6 +6065,7 @@ void ScInterpreter::ScDBCount()
- // return empty cells, which would mean to adapt all callers of
- // iterators.
- ScDBQueryParamInternal* p = static_cast<ScDBQueryParamInternal*>(pQueryParam.get());
-+ p->nCol2 = p->nCol1; // Don't forget to select only one column.
- SCTAB nTab = p->nTab;
- // ScQueryCellIterator doesn't make use of ScDBQueryParamBase::mnField,
- // so the source range has to be restricted, like before the introduction
-@@ -6076,6 +6082,11 @@ void ScInterpreter::ScDBCount()
- }
- else
- { // count only matching records with a value in the "result" field
-+ if (!pQueryParam->IsValidFieldIndex())
-+ {
-+ SetError(errNoValue);
-+ return;
-+ }
- ScDBQueryDataIterator aValIter( pDok, pQueryParam.release());
- ScDBQueryDataIterator::Value aValue;
- if ( aValIter.GetFirst(aValue) && !aValue.mnError )
-@@ -6102,6 +6113,11 @@ void ScInterpreter::ScDBCount2()
- auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
- if (pQueryParam.get())
- {
-+ if (!pQueryParam->IsValidFieldIndex())
-+ {
-+ SetError(errNoValue);
-+ return;
-+ }
- ULONG nCount = 0;
- pQueryParam->mbSkipString = false;
- ScDBQueryDataIterator aValIter( pDok, pQueryParam.release());
-@@ -6163,6 +6179,11 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount )
- auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
- if (pQueryParam.get())
- {
-+ if (!pQueryParam->IsValidFieldIndex())
-+ {
-+ SetError(errNoValue);
-+ return;
-+ }
- ScDBQueryDataIterator aValIter(pDok, pQueryParam.release());
- ScDBQueryDataIterator::Value aValue;
- if (aValIter.GetFirst(aValue) && !aValue.mnError)
-diff --git sc/source/core/tool/queryparam.cxx sc/source/core/tool/queryparam.cxx
-index 80dd170..ae93478 100644
---- sc/source/core/tool/queryparam.cxx
-+++ sc/source/core/tool/queryparam.cxx
-@@ -57,6 +57,11 @@ ScQueryParamBase::~ScQueryParamBase()
- {
- }
-
-+bool ScQueryParamBase::IsValidFieldIndex() const
-+{
-+ return true;
-+}
-+
- SCSIZE ScQueryParamBase::GetEntryCount() const
- {
- return maEntries.size();
-@@ -366,6 +371,11 @@ ScDBQueryParamInternal::~ScDBQueryParamInternal()
- {
- }
-
-+bool ScDBQueryParamInternal::IsValidFieldIndex() const
-+{
-+ return nCol1 <= mnField && mnField <= nCol2;
-+}
-+
- // ============================================================================
-
- ScDBQueryParamMatrix::ScDBQueryParamMatrix() :
-@@ -373,6 +383,13 @@ ScDBQueryParamMatrix::ScDBQueryParamMatrix() :
- {
- }
-
-+bool ScDBQueryParamMatrix::IsValidFieldIndex() const
-+{
-+ SCSIZE nC, nR;
-+ mpMatrix->GetDimensions(nC, nR);
-+ return 0 <= mnField && mnField <= static_cast<SCCOL>(nC);
-+}
-+
- ScDBQueryParamMatrix::~ScDBQueryParamMatrix()
- {
- }
---
-1.7.0.1
-
More information about the Libreoffice-commits
mailing list