From f371fca09ddff5d5d32a0dcec05931be04b1b8c9 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 9 Sep 2009 10:57:16 -0400 Subject: #i102750# initial refactoring in an effort to support external references in DSUM, DGET etc. Not finished yet. --- sc/inc/queryparam.hxx | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sc/inc/queryparam.hxx (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx new file mode 100644 index 000000000000..3e106647b58b --- /dev/null +++ b/sc/inc/queryparam.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: interpre.hxx,v $ + * $Revision: 1.35.44.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_QUERYPARAM_HXX +#define SC_QUERYPARAM_HXX + +#include "global.hxx" +#include "scmatrix.hxx" + +struct ScQueryParamBase +{ + enum DataType { INTERNAL, MATRIX }; + + bool bHasHeader; + bool bByRow; + bool bInplace; + bool bCaseSens; + bool bRegExp; + bool bDuplicate; + + virtual ~ScQueryParamBase(); + + SCSIZE GetEntryCount() const { return nEntryCount; } + ScQueryEntry& GetEntry(SCSIZE n) const { return pEntries[n]; } + void Resize(SCSIZE nNew); + SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos ); + void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); + + DataType GetType() const; + +protected: + ScQueryParamBase(DataType eType); + ScQueryParamBase(const ScQueryParamBase& r); + + SCSIZE nEntryCount; + ScQueryEntry* pEntries; + +private: + ScQueryParamBase(); + DataType meType; +}; + +// ============================================================================ + +struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase +{ + SCCOL nCol1; + SCROW nRow1; + SCCOL nCol2; + SCROW nRow2; + SCTAB nTab; + BOOL bMixedComparison; // whether numbers are smaller than strings + BOOL bDestPers; // nicht gespeichert + SCTAB nDestTab; + SCCOL nDestCol; + SCROW nDestRow; + + ScQueryParam(); + ScQueryParam( const ScQueryParam& r ); + virtual ~ScQueryParam(); + + ScQueryParam& operator= ( const ScQueryParam& r ); + BOOL operator== ( const ScQueryParam& rOther ) const; + void Clear (); + void MoveToDest(); +}; + +// ============================================================================ + +struct ScQueryParamMatrix : public ScQueryParamBase +{ + ScMatrixRef mpMatrix; + + ScQueryParamMatrix(); + virtual ~ScQueryParamMatrix(); +}; + +#endif -- cgit From b78dc8dc8073b0a5b7c4ab8d5ef7088098a201b1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 9 Sep 2009 23:58:50 -0400 Subject: #i102750# more work toward supporting external refs in DB functions. Still a long way to go... --- sc/inc/queryparam.hxx | 59 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 3e106647b58b..569b55719100 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -36,14 +36,13 @@ struct ScQueryParamBase { - enum DataType { INTERNAL, MATRIX }; - bool bHasHeader; bool bByRow; bool bInplace; bool bCaseSens; bool bRegExp; bool bDuplicate; + bool bMixedComparison; // whether numbers are smaller than strings virtual ~ScQueryParamBase(); @@ -53,30 +52,33 @@ struct ScQueryParamBase SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos ); void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); - DataType GetType() const; - protected: - ScQueryParamBase(DataType eType); + ScQueryParamBase(); ScQueryParamBase(const ScQueryParamBase& r); SCSIZE nEntryCount; ScQueryEntry* pEntries; - -private: - ScQueryParamBase(); - DataType meType; }; // ============================================================================ -struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase +struct ScQueryParamTable { SCCOL nCol1; SCROW nRow1; SCCOL nCol2; SCROW nRow2; SCTAB nTab; - BOOL bMixedComparison; // whether numbers are smaller than strings + + ScQueryParamTable(); + ScQueryParamTable(const ScQueryParamTable& r); + virtual ~ScQueryParamTable(); +}; + +// ============================================================================ + +struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable +{ BOOL bDestPers; // nicht gespeichert SCTAB nDestTab; SCCOL nDestCol; @@ -94,12 +96,41 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase // ============================================================================ -struct ScQueryParamMatrix : public ScQueryParamBase +struct ScDBQueryParamBase : public ScQueryParamBase +{ + enum DataType { INTERNAL, MATRIX }; + + SCCOL mnField; /// the field in which the values are processed during iteration. + + DataType GetType() const; + + virtual ~ScDBQueryParamBase(); + +protected: + ScDBQueryParamBase(DataType eType); + +private: + ScDBQueryParamBase(); + + DataType meType; +}; + +// ============================================================================ + +struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable +{ + ScDBQueryParamInternal(); + virtual ~ScDBQueryParamInternal(); +}; + +// ============================================================================ + +struct ScDBQueryParamMatrix : public ScDBQueryParamBase { ScMatrixRef mpMatrix; - ScQueryParamMatrix(); - virtual ~ScQueryParamMatrix(); + ScDBQueryParamMatrix(); + virtual ~ScDBQueryParamMatrix(); }; #endif -- cgit From 66df527698911ad351fdc8a5c91e4a40b96c89bf Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 16 Sep 2009 10:58:37 -0400 Subject: Moved the string flag from the iterator to the query param struct. --- sc/inc/queryparam.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 569b55719100..154c2f05fa82 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -101,6 +101,7 @@ struct ScDBQueryParamBase : public ScQueryParamBase enum DataType { INTERNAL, MATRIX }; SCCOL mnField; /// the field in which the values are processed during iteration. + bool mbSkipString; DataType GetType() const; -- cgit From fe232c3a08c5e3c11d54ca1831bd28b87c500ab6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 16 Sep 2009 16:18:38 -0400 Subject: removed the duplicated ScTable::ValidQuery. --- sc/inc/queryparam.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 154c2f05fa82..ec8e22c49171 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -34,6 +34,8 @@ #include "global.hxx" #include "scmatrix.hxx" +struct ScDBQueryParamInternal; + struct ScQueryParamBase { bool bHasHeader; @@ -86,11 +88,13 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT ScQueryParam(); ScQueryParam( const ScQueryParam& r ); + ScQueryParam( const ScDBQueryParamInternal& r ); virtual ~ScQueryParam(); ScQueryParam& operator= ( const ScQueryParam& r ); BOOL operator== ( const ScQueryParam& rOther ) const; - void Clear (); + void Clear(); + void ClearDestParams(); void MoveToDest(); }; -- cgit From f8acf48d34271dc41ee4d4e1d51a465af42844d9 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 16 Sep 2009 17:38:14 -0400 Subject: last cleanup - use vector to store an array of ScQueryEntry, instead of the old-fashioned c-style dynamic array. --- sc/inc/queryparam.hxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index ec8e22c49171..8e84f1e53e36 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -34,6 +34,8 @@ #include "global.hxx" #include "scmatrix.hxx" +#include + struct ScDBQueryParamInternal; struct ScQueryParamBase @@ -48,18 +50,17 @@ struct ScQueryParamBase virtual ~ScQueryParamBase(); - SCSIZE GetEntryCount() const { return nEntryCount; } - ScQueryEntry& GetEntry(SCSIZE n) const { return pEntries[n]; } - void Resize(SCSIZE nNew); + SC_DLLPUBLIC SCSIZE GetEntryCount() const; + SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const; + void Resize(SCSIZE nNew); SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos ); - void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); + void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); protected: ScQueryParamBase(); ScQueryParamBase(const ScQueryParamBase& r); - SCSIZE nEntryCount; - ScQueryEntry* pEntries; + mutable ::std::vector maEntries; }; // ============================================================================ -- cgit From e1380111b4057192732ca70b81b4723f00d894b2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 15:11:13 +0200 Subject: sc-dbrange-dynamic-resize.diff: Dynamically resize filtered range. n#352662, i#85305 Dynamically resize filtered range when new data rows are present. --- sc/inc/queryparam.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 8e84f1e53e36..12f3842bc26b 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -86,6 +86,8 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT SCTAB nDestTab; SCCOL nDestCol; SCROW nDestRow; + SCROW nDynamicEndRow; + bool bUseDynamicRange; ScQueryParam(); ScQueryParam( const ScQueryParam& r ); -- cgit From ad3292e2b3adee95e6a0473ee8a5c29df2e20c90 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 27 Oct 2010 12:43:08 +0100 Subject: add modelines to .hxx files as well --- sc/inc/queryparam.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 12f3842bc26b..93302bd3c284 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -142,3 +143,5 @@ struct ScDBQueryParamMatrix : public ScDBQueryParamBase }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From cd42389ad67b403a07a0dda8e2a6e213def49251 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 17 Jan 2011 13:20:22 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from sc --- sc/inc/queryparam.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 8e84f1e53e36..9ffe038b7255 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -82,7 +82,7 @@ struct ScQueryParamTable struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable { - BOOL bDestPers; // nicht gespeichert + sal_Bool bDestPers; // nicht gespeichert SCTAB nDestTab; SCCOL nDestCol; SCROW nDestRow; @@ -93,7 +93,7 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT virtual ~ScQueryParam(); ScQueryParam& operator= ( const ScQueryParam& r ); - BOOL operator== ( const ScQueryParam& rOther ) const; + sal_Bool operator== ( const ScQueryParam& rOther ) const; void Clear(); void ClearDestParams(); void MoveToDest(); -- cgit From ebaaee24b13e1712a06cf483ccb7b6e169e83a00 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 19 Jan 2011 13:05:27 -0500 Subject: Ported calc-formula-db-function-fix.diff from the build repo. This patch fixes n#594332 and n#595713. --- sc/inc/queryparam.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 93302bd3c284..a87db5ffabcf 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -51,6 +51,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); @@ -130,6 +132,8 @@ struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTa { ScDBQueryParamInternal(); virtual ~ScDBQueryParamInternal(); + + virtual bool IsValidFieldIndex() const; }; // ============================================================================ @@ -140,6 +144,8 @@ struct ScDBQueryParamMatrix : public ScDBQueryParamBase ScDBQueryParamMatrix(); virtual ~ScDBQueryParamMatrix(); + + virtual bool IsValidFieldIndex() const; }; #endif -- cgit From 1666fb70272b097ac59ab8ce60225a513912c113 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Fri, 21 Jan 2011 10:13:01 +0100 Subject: Remove old RCS lines. --- sc/inc/queryparam.hxx | 3 --- 1 file changed, 3 deletions(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index a87db5ffabcf..7c1c212081e3 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: interpre.hxx,v $ - * $Revision: 1.35.44.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From be3230aa76ec2e95eecbd4c3d5026e0e45115f2f Mon Sep 17 00:00:00 2001 From: Nicolas Christener Date: Sun, 13 Mar 2011 19:39:41 +0100 Subject: translate german comments in /sc/inc --- sc/inc/queryparam.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 7c1c212081e3..bf75dd086167 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -82,7 +82,7 @@ struct ScQueryParamTable struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable { - BOOL bDestPers; // nicht gespeichert + BOOL bDestPers; // not saved SCTAB nDestTab; SCCOL nDestCol; SCROW nDestRow; -- cgit From f2384d6f10178c3bec96e96009255f61e083cda6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 1 Apr 2011 15:24:18 -0400 Subject: Removed the dynamic row bits from the db range. It was a hack. This concept was there before the Hamburg added their own mechanism to allow dynamic expansion of db ranges. There is no need to have two of them, or it would cause weird problems. --- sc/inc/queryparam.hxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sc/inc/queryparam.hxx') diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 1591efb46e8e..1515cd1df7bb 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -82,12 +82,10 @@ struct ScQueryParamTable struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable { - sal_Bool bDestPers; // not saved + bool bDestPers; // not saved SCTAB nDestTab; SCCOL nDestCol; SCROW nDestRow; - SCROW nDynamicEndRow; - bool bUseDynamicRange; ScQueryParam(); ScQueryParam( const ScQueryParam& r ); -- cgit