[ooo-build-commit] patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jun 16 06:51:13 PDT 2009
patches/dev300/calc-filter-by-date-strip-time.diff | 485 ++++++++++++++++++++-
patches/dev300/sc-dbrange-dynamic-resize.diff | 337 +++++++-------
2 files changed, 641 insertions(+), 181 deletions(-)
New commits:
commit bf7a40380c35a7c093e53fcc6918cad82a3d4ed1
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jun 15 22:26:52 2009 -0400
Strip time elements from date values *only when* the field contains dates.
See i#94695 for details.
* patches/dev300/calc-filter-by-date-strip-time.diff: updated the patch
per Eike's comment.
* patches/dev300/sc-dbrange-dynamic-resize.diff: adjusted to get it to
apply again.
diff --git a/patches/dev300/calc-filter-by-date-strip-time.diff b/patches/dev300/calc-filter-by-date-strip-time.diff
index 76a66ec..84f857c 100644
--- a/patches/dev300/calc-filter-by-date-strip-time.diff
+++ b/patches/dev300/calc-filter-by-date-strip-time.diff
@@ -1,23 +1,244 @@
---- sc/source/core/data/column3.cxx.old 2009-04-02 10:45:01.000000000 +0000
-+++ sc/source/core/data/column3.cxx 2009-04-06 16:41:49.000000000 +0000
-@@ -1418,6 +1418,15 @@ void ScColumn::GetFilterEntries(SCROW nS
- nValue = 0.0;
- }
+diff --git sc/inc/column.hxx sc/inc/column.hxx
+index ff0c25f..c39ae25 100644
+--- sc/inc/column.hxx
++++ sc/inc/column.hxx
+@@ -379,7 +379,7 @@ public:
+ /// Including current, may return -1
+ SCsROW GetNextUnprotected( SCROW nRow, BOOL bUp ) const;
+
+- void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings);
++ void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates);
+ BOOL GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit);
+
+ //UNUSED2008-05 SCROW NoteCount( SCROW nMaxRow = MAXROW ) const;
+diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx
+index dd18ba2..73b4c3e 100644
+--- sc/inc/dbcolect.hxx
++++ sc/inc/dbcolect.hxx
+@@ -90,6 +90,7 @@ private:
+ SCCOLROW nQueryField[MAXQUERY];
+ ScQueryOp eQueryOp[MAXQUERY];
+ BOOL bQueryByString[MAXQUERY];
++ bool bQueryByDate[MAXQUERY];
+ String* pQueryStr[MAXQUERY];
+ double nQueryVal[MAXQUERY];
+ ScQueryConnect eQueryConnect[MAXQUERY];
+diff --git sc/inc/document.hxx sc/inc/document.hxx
+index bf96edb..ed4c76c 100644
+--- sc/inc/document.hxx
++++ sc/inc/document.hxx
+@@ -1365,9 +1365,9 @@ public:
+ void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
+
+ BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
+- TypedScStrCollection& rStrings, bool bFilter = false );
++ bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
+ SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
+- SCTAB nTab, TypedScStrCollection& rStrings );
++ SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates );
+ BOOL GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ TypedScStrCollection& rStrings, BOOL bLimit = FALSE );
+ BOOL GetFormulaEntries( TypedScStrCollection& rStrings );
+diff --git sc/inc/global.hxx sc/inc/global.hxx
+index 173175c..4892a3e 100644
+--- sc/inc/global.hxx
++++ sc/inc/global.hxx
+@@ -797,6 +797,7 @@ struct ScQueryEntry
+ {
+ BOOL bDoQuery;
+ BOOL bQueryByString;
++ bool bQueryByDate;
+ SCCOLROW nField;
+ ScQueryOp eOp;
+ ScQueryConnect eConnect;
+diff --git sc/inc/table.hxx sc/inc/table.hxx
+index 42e94e8..74fa999 100644
+--- sc/inc/table.hxx
++++ sc/inc/table.hxx
+@@ -598,8 +598,8 @@ public:
+ SCSIZE Query(ScQueryParam& rQueryParam, BOOL bKeepSub);
+ BOOL CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
+
+- void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings);
+- void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings );
++ void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates);
++ void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates );
+ BOOL GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit);
+
+ BOOL HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
+diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
+index 1a55c3d..38533c6 100644
+--- sc/source/core/data/column3.cxx
++++ sc/source/core/data/column3.cxx
+@@ -1381,8 +1381,9 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
+ }
+
+
+-void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings)
++void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates)
+ {
++ bool bHasDates = false;
+ SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
+ String aString;
+ SCROW nRow = 0;
+@@ -1418,6 +1419,18 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
+ nValue = 0.0;
+ }
+ if (pFormatter)
+ {
+ short nType = pFormatter->GetType(nFormat);
+ if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME))
++ {
+ // special case for date values. Disregard the time
+ // element if the number format is of date type.
+ nValue = ::rtl::math::approxFloor(nValue);
++ bHasDates = true;
++ }
+ }
+
- pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
- }
+ pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
+ }
#if 0 // DR
---- sc/source/core/data/table3.cxx.old 2009-04-06 16:41:48.000000000 +0000
-+++ sc/source/core/data/table3.cxx 2009-04-06 16:41:49.000000000 +0000
+@@ -1436,6 +1449,8 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
+
+ ++nIndex;
+ }
++
++ rHasDates = bHasDates;
+ }
+
+ //
+diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
+index f633dbc..79022cf 100644
+--- sc/source/core/data/documen3.cxx
++++ sc/source/core/data/documen3.cxx
+@@ -1294,7 +1294,8 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
+ // GetFilterEntries - Eintraege fuer AutoFilter-Listbox
+ //
+
+-BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScStrCollection& rStrings, bool bFilter )
++BOOL ScDocument::GetFilterEntries(
++ SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates)
+ {
+ if ( ValidTab(nTab) && pTab[nTab] && pDBCollection )
+ {
+@@ -1331,11 +1332,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
+
+ if ( bFilter )
+ {
+- pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings );
++ pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings, rHasDates );
+ }
+ else
+ {
+- pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings );
++ pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates );
+ }
+
+ return TRUE;
+@@ -1350,11 +1351,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
+ //
+
+ BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
+- SCTAB nTab, TypedScStrCollection& rStrings )
++ SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates )
+ {
+ if ( ValidTab(nTab) && pTab[nTab] )
+ {
+- pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings );
++ pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates );
+ return TRUE;
+ }
+
+diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx
+index 70beb27..3b0d0f6 100644
+--- sc/source/core/data/global2.cxx
++++ sc/source/core/data/global2.cxx
+@@ -144,30 +144,32 @@ BOOL ScImportParam::operator==( const ScImportParam& rOther ) const
+ //------------------------------------------------------------------------
+ // struct ScQueryParam:
+
+-ScQueryEntry::ScQueryEntry()
++ScQueryEntry::ScQueryEntry() :
++ bDoQuery(FALSE),
++ bQueryByString(FALSE),
++ bQueryByDate(false),
++ eOp(SC_EQUAL),
++ eConnect(SC_AND),
++ nField(0),
++ nVal(0.0),
++ pStr(new String),
++ pSearchParam(NULL),
++ pSearchText(NULL)
++{
++}
++
++ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) :
++ bDoQuery(r.bDoQuery),
++ bQueryByString(r.bQueryByString),
++ bQueryByDate(r.bQueryByDate),
++ eOp(r.eOp),
++ eConnect(r.eConnect),
++ nField(r.nField),
++ nVal(r.nVal),
++ pStr(new String(*r.pStr)),
++ pSearchParam(NULL),
++ pSearchText(NULL)
+ {
+- bDoQuery = FALSE;
+- bQueryByString = FALSE;
+- eOp = SC_EQUAL;
+- eConnect = SC_AND;
+- nField = 0;
+- nVal = 0.0;
+- pStr = new String;
+- pSearchParam = NULL;
+- pSearchText = NULL;
+-}
+-
+-ScQueryEntry::ScQueryEntry(const ScQueryEntry& r)
+-{
+- bDoQuery = r.bDoQuery;
+- bQueryByString = r.bQueryByString;
+- eOp = r.eOp;
+- eConnect = r.eConnect;
+- nField = r.nField;
+- nVal = r.nVal;
+- pStr = new String(*r.pStr);
+- pSearchParam = NULL;
+- pSearchText = NULL;
+ }
+
+ ScQueryEntry::~ScQueryEntry()
+@@ -184,6 +186,7 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r )
+ {
+ bDoQuery = r.bDoQuery;
+ bQueryByString = r.bQueryByString;
++ bQueryByDate = r.bQueryByDate;
+ eOp = r.eOp;
+ eConnect = r.eConnect;
+ nField = r.nField;
+@@ -204,6 +207,7 @@ void ScQueryEntry::Clear()
+ {
+ bDoQuery = FALSE;
+ bQueryByString = FALSE;
++ bQueryByDate = false;
+ eOp = SC_EQUAL;
+ eConnect = SC_AND;
+ nField = 0;
+@@ -222,6 +226,7 @@ BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const
+ {
+ return bDoQuery == r.bDoQuery
+ && bQueryByString == r.bQueryByString
++ && bQueryByDate == r.bQueryByDate
+ && eOp == r.eOp
+ && eConnect == r.eConnect
+ && nField == r.nField
+diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx
+index a44c7fd..fc5a6da 100644
+--- sc/source/core/data/table3.cxx
++++ sc/source/core/data/table3.cxx
@@ -61,6 +61,7 @@
#include "progress.hxx"
#include "cellform.hxx"
@@ -26,21 +247,245 @@
#include <vector>
-@@ -1166,6 +1167,17 @@ BOOL ScTable::ValidQuery(SCROW nRow, con
+@@ -1166,6 +1167,20 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
}
else
nCellVal = GetValue( static_cast<SCCOL>(rEntry.nField), nRow );
+
-+ sal_uInt32 nNumFmt = GetNumberFormat(static_cast<SCCOL>(rEntry.nField), nRow);
-+ const SvNumberformat* pEntry = pDocument->GetFormatTable()->GetEntry(nNumFmt);
-+ if (pEntry)
++ if (rEntry.bQueryByDate)
+ {
-+ short nNumFmtType = pEntry->GetType();
-+ if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME))
-+ // The format is of date type. Strip off the time element.
-+ nCellVal = ::rtl::math::approxFloor(nCellVal);
++ sal_uInt32 nNumFmt = GetNumberFormat(static_cast<SCCOL>(rEntry.nField), nRow);
++ const SvNumberformat* pEntry = pDocument->GetFormatTable()->GetEntry(nNumFmt);
++ if (pEntry)
++ {
++ short nNumFmtType = pEntry->GetType();
++ if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME))
++ // The format is of date type. Strip off the time element.
++ nCellVal = ::rtl::math::approxFloor(nCellVal);
++ }
+ }
+
- switch (rEntry.eOp)
- {
- case SC_EQUAL :
+ switch (rEntry.eOp)
+ {
+ case SC_EQUAL :
+@@ -1888,12 +1903,13 @@ BOOL ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol *
+ return TRUE;
+ }
+
+-void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings)
++void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates)
+ {
+- aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings );
++ aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings, rHasDates );
+ }
+
+-void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings )
++void ScTable::GetFilteredFilterEntries(
++ SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates )
+ {
+ // remove the entry for this column from the query parameter
+ ScQueryParam aParam( rParam );
+@@ -1911,15 +1927,18 @@ void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, co
+
+ BOOL* pSpecial = new BOOL[nEntryCount];
+ lcl_PrepareQuery( pDocument, this, aParam, pSpecial );
+-
++ bool bHasDates = false;
+ for ( SCROW j = nRow1; j <= nRow2; ++j )
+ {
+ if ( ValidQuery( j, aParam, pSpecial ) )
+ {
+- aCol[nCol].GetFilterEntries( j, j, rStrings );
++ bool bThisHasDates = false;
++ aCol[nCol].GetFilterEntries( j, j, rStrings, bThisHasDates );
++ bHasDates |= bThisHasDates;
+ }
+ }
+
++ rHasDates = bHasDates;
+ delete[] pSpecial;
+ }
+
+diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx
+index ee42a4e..1304c49 100644
+--- sc/source/core/tool/dbcolect.cxx
++++ sc/source/core/tool/dbcolect.cxx
+@@ -158,6 +158,7 @@ ScDBData::ScDBData( const ScDBData& rData ) :
+ nQueryField[i] = rData.nQueryField[i];
+ eQueryOp[i] = rData.eQueryOp[i];
+ bQueryByString[i] = rData.bQueryByString[i];
++ bQueryByDate[i] = rData.bQueryByDate[i];
+ pQueryStr[i] = new String( *(rData.pQueryStr[i]) );
+ nQueryVal[i] = rData.nQueryVal[i];
+ eQueryConnect[i] = rData.eQueryConnect[i];
+@@ -248,6 +249,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData)
+ nQueryField[i] = rData.nQueryField[i];
+ eQueryOp[i] = rData.eQueryOp[i];
+ bQueryByString[i] = rData.bQueryByString[i];
++ bQueryByDate[i] = rData.bQueryByDate[i];
+ *pQueryStr[i] = *rData.pQueryStr[i];
+ nQueryVal[i] = rData.nQueryVal[i];
+ eQueryConnect[i] = rData.eQueryConnect[i];
+@@ -518,6 +520,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
+ rEntry.nField = nQueryField[i];
+ rEntry.eOp = eQueryOp[i];
+ rEntry.bQueryByString = bQueryByString[i];
++ rEntry.bQueryByDate = bQueryByDate[i];
+ *rEntry.pStr = *pQueryStr[i];
+ rEntry.nVal = nQueryVal[i];
+ rEntry.eConnect = eQueryConnect[i];
+@@ -549,6 +552,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
+ nQueryField[i] = rEntry.nField;
+ eQueryOp[i] = rEntry.eOp;
+ bQueryByString[i] = rEntry.bQueryByString;
++ bQueryByDate[i] = rEntry.bQueryByDate;
+ *pQueryStr[i] = *rEntry.pStr;
+ nQueryVal[i] = rEntry.nVal;
+ eQueryConnect[i] = rEntry.eConnect;
+diff --git sc/source/ui/dbgui/filtdlg.cxx sc/source/ui/dbgui/filtdlg.cxx
+index b028879..846cbad 100644
+--- sc/source/ui/dbgui/filtdlg.cxx
++++ sc/source/ui/dbgui/filtdlg.cxx
+@@ -391,21 +391,23 @@ void ScFilterDlg::UpdateValueList( USHORT nList )
+ SCTAB nTab = nSrcTab;
+ SCROW nFirstRow = theQueryData.nRow1;
+ SCROW nLastRow = theQueryData.nRow2;
++ mbHasDates[nList-1] = false;
+
+ // erstmal ohne die erste Zeile
+
+ pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 );
+ pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() );
+ pDoc->GetFilterEntriesArea( nColumn, nFirstRow+1, nLastRow,
+- nTab, *pEntryLists[nColumn] );
++ nTab, *pEntryLists[nColumn], mbHasDates[nList-1] );
+
+ // Eintrag fuer die erste Zeile
+ //! Eintrag (pHdrEntry) ohne Collection erzeugen?
+
+ nHeaderPos[nColumn] = USHRT_MAX;
+ TypedScStrCollection aHdrColl( 1, 1 );
++ bool bDummy = false;
+ pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nFirstRow,
+- nTab, aHdrColl );
++ nTab, aHdrColl, bDummy );
+ TypedStrData* pHdrEntry = aHdrColl[0];
+ if ( pHdrEntry )
+ {
+@@ -547,6 +549,7 @@ ScQueryItem* ScFilterDlg::GetOutputItem()
+ if ( bDoThis )
+ {
+ ScQueryEntry& rEntry = theParam.GetEntry(i);
++ rEntry.bQueryByDate = mbHasDates[i];
+
+ String aStrVal( aValueEdArr[i]->GetText() );
+
+diff --git sc/source/ui/dbgui/pfiltdlg.cxx sc/source/ui/dbgui/pfiltdlg.cxx
+index 35bfc35..42c2c26 100644
+--- sc/source/ui/dbgui/pfiltdlg.cxx
++++ sc/source/ui/dbgui/pfiltdlg.cxx
+@@ -352,11 +352,12 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList )
+ SCROW nFirstRow = theQueryData.nRow1;
+ SCROW nLastRow = theQueryData.nRow2;
+ nFirstRow++;
++ bool bHasDates = false;
+
+ pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 );
+ pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() );
+ pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nLastRow,
+- nTab, *pEntryLists[nColumn] );
++ nTab, *pEntryLists[nColumn], bHasDates );
+ }
+
+ TypedScStrCollection* pColl = pEntryLists[nColumn];
+diff --git sc/source/ui/inc/filtdlg.hxx sc/source/ui/inc/filtdlg.hxx
+index 62f68e8..c901ef3 100644
+--- sc/source/ui/inc/filtdlg.hxx
++++ sc/source/ui/inc/filtdlg.hxx
+@@ -158,6 +158,7 @@ private:
+ ComboBox* aValueEdArr[3];
+ ListBox* aFieldLbArr[3];
+ ListBox* aCondLbArr[3];
++ bool mbHasDates[3];
+ USHORT nFieldCount;
+ BOOL bRefInputMode;
+
+diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx
+index 4664398..f9d9eaa 100644
+--- sc/source/ui/inc/gridwin.hxx
++++ sc/source/ui/inc/gridwin.hxx
+@@ -254,7 +254,7 @@ private:
+
+ BOOL IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab );
+ void ExecFilter( ULONG nSel, SCCOL nCol, SCROW nRow,
+- const String& aValue );
++ const String& aValue, bool bCheckForDates );
+ void FilterSelect( ULONG nSel );
+
+ void ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr );
+diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
+index b28ce3f..439f98d 100644
+--- sc/source/ui/view/gridwin.cxx
++++ sc/source/ui/view/gridwin.cxx
+@@ -171,6 +171,7 @@ private:
+ BOOL bInit;
+ BOOL bCancelled;
+ BOOL bInSelect;
++ bool mbListHasDates;
+ ULONG nSel;
+ ScFilterBoxMode eMode;
+
+@@ -194,6 +195,8 @@ public:
+ BOOL IsInInit() const { return bInit; }
+ void SetCancelled() { bCancelled = TRUE; }
+ BOOL IsInSelect() const { return bInSelect; }
++ void SetListHasDates(bool b) { mbListHasDates = b; }
++ bool HasDates() const { return mbListHasDates; }
+ };
+
+ //-------------------------------------------------------------------
+@@ -209,6 +212,7 @@ ScFilterListBox::ScFilterListBox( Window* pParent, ScGridWindow* pGrid,
+ bInit( TRUE ),
+ bCancelled( FALSE ),
+ bInSelect( FALSE ),
++ mbListHasDates(false),
+ nSel( 0 ),
+ eMode( eNewMode )
+ {
+@@ -888,7 +892,9 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect )
+ pFilterBox->SetSeparatorPos( nDefCount - 1 );
+
+ // get list entries
+- pDoc->GetFilterEntries( nCol, nRow, nTab, aStrings, true );
++ bool bHasDates = false;
++ pDoc->GetFilterEntries( nCol, nRow, nTab, true, aStrings, bHasDates);
++ pFilterBox->SetListHasDates(bHasDates);
+
+ // check widths of numerical entries (string entries are not included)
+ // so all numbers are completely visible
+@@ -1052,7 +1058,7 @@ void ScGridWindow::FilterSelect( ULONG nSel )
+ ExecDataSelect( nCol, nRow, aString );
+ break;
+ case SC_FILTERBOX_FILTER:
+- ExecFilter( nSel, nCol, nRow, aString );
++ ExecFilter( nSel, nCol, nRow, aString, pFilterBox->HasDates() );
+ break;
+ case SC_FILTERBOX_SCENARIO:
+ pViewData->GetView()->UseScenario( aString );
+@@ -1085,7 +1091,7 @@ void ScGridWindow::ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr )
+
+ void ScGridWindow::ExecFilter( ULONG nSel,
+ SCCOL nCol, SCROW nRow,
+- const String& aValue )
++ const String& aValue, bool bCheckForDates )
+ {
+ SCTAB nTab = pViewData->GetTabNo();
+ ScDocument* pDoc = pViewData->GetDocument();
+@@ -1150,6 +1156,7 @@ void ScGridWindow::ExecFilter( ULONG nSel,
+ rNewEntry.bDoQuery = TRUE;
+ rNewEntry.bQueryByString = TRUE;
+ rNewEntry.nField = nCol;
++ rNewEntry.bQueryByDate = bCheckForDates;
+ if ( nSel == SC_AUTOFILTER_TOP10 )
+ {
+ rNewEntry.eOp = SC_TOPVAL;
diff --git a/patches/dev300/sc-dbrange-dynamic-resize.diff b/patches/dev300/sc-dbrange-dynamic-resize.diff
index b8aa01f..8614030 100644
--- a/patches/dev300/sc-dbrange-dynamic-resize.diff
+++ b/patches/dev300/sc-dbrange-dynamic-resize.diff
@@ -1,83 +1,91 @@
diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx
-index 13db55d..feeec81 100644
+index 73b4c3e..021a1e0 100644
--- sc/inc/dbcolect.hxx
+++ sc/inc/dbcolect.hxx
-@@ -95,6 +95,7 @@ private:
- ScQueryConnect eQueryConnect[MAXQUERY];
- BOOL bIsAdvanced; // TRUE if created by advanced filter
- ScRange aAdvSource; // source range
+@@ -96,6 +96,7 @@ private:
+ ScQueryConnect eQueryConnect[MAXQUERY];
+ BOOL bIsAdvanced; // TRUE if created by advanced filter
+ ScRange aAdvSource; // source range
+ SCROW nDynamicEndRow;
- // SubTotalParam
- BOOL bSubRemoveOnly;
- BOOL bSubReplace;
-@@ -142,9 +143,10 @@ public:
- const String& GetName() const { return aName; }
- void GetName(String& rName) const { rName = aName; }
- void SetName(const String& rName) { aName = rName; }
+ // SubTotalParam
+ BOOL bSubRemoveOnly;
+ BOOL bSubReplace;
+@@ -143,9 +144,10 @@ public:
+ const String& GetName() const { return aName; }
+ void GetName(String& rName) const { rName = aName; }
+ void SetName(const String& rName) { aName = rName; }
- void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
- SC_DLLPUBLIC void GetArea(ScRange& rRange) const;
+ void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, bool bUseDynamicRange = false) const;
+ SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const;
- void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+ void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+ void SetDynamicEndRow(SCROW nRow);
- void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
- BOOL IsByRow() const { return bByRow; }
- void SetByRow(BOOL bByR) { bByRow = bByR; }
+ void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+ BOOL IsByRow() const { return bByRow; }
+ void SetByRow(BOOL bByR) { bByRow = bByR; }
diff --git sc/inc/document.hxx sc/inc/document.hxx
-index fe8ebe1..b4844a1 100644
+index 3675b1b..14c1ddc 100644
--- sc/inc/document.hxx
+++ sc/inc/document.hxx
-@@ -844,7 +844,7 @@ public:
- USHORT GetErrCode( const ScAddress& ) const;
+@@ -858,7 +858,7 @@ public:
+ USHORT GetErrCode( const ScAddress& ) const;
- void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
+ void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld );
+ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const;
- SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
- SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
- SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
-@@ -1350,6 +1350,9 @@ public:
- SCTAB nTab, ScQueryParam& rQueryParam );
- void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
+ SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
+ SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
+ SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
+@@ -1377,6 +1377,9 @@ public:
+ SCTAB nTab, ScQueryParam& rQueryParam );
+ void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
+ /** Update the dynamic end row position of a current data area. */
+ void UpdateDynamicEndRow(ScDBData& rDBData) const;
+
- BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
- TypedScStrCollection& rStrings, bool bFilter = false );
- SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
+ BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
+ SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
diff --git sc/inc/global.hxx sc/inc/global.hxx
-index f94ed38..7d48689 100644
+index 4892a3e..05fbc13 100644
--- sc/inc/global.hxx
+++ sc/inc/global.hxx
-@@ -831,6 +831,8 @@ struct SC_DLLPUBLIC ScQueryParam
- SCTAB nDestTab;
- SCCOL nDestCol;
- SCROW nDestRow;
+@@ -837,6 +837,8 @@ struct SC_DLLPUBLIC ScQueryParam
+ SCTAB nDestTab;
+ SCCOL nDestCol;
+ SCROW nDestRow;
+ SCROW nDynamicEndRow;
+ bool bUseDynamicRange;
private:
- SCSIZE nEntryCount;
+ SCSIZE nEntryCount;
diff --git sc/inc/table.hxx sc/inc/table.hxx
-index 931e8ac..2378728 100644
+index 2b4017b..d754363 100644
--- sc/inc/table.hxx
+++ sc/inc/table.hxx
-@@ -337,7 +337,7 @@ public:
- SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow );
+@@ -347,11 +347,10 @@ public:
+ SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow );
- void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
+ void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
- BOOL bIncludeOld );
+ BOOL bIncludeOld ) const;
- SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
- SCCOL nEndCol, SCROW nEndRow, ScDirection eDir );
+ SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
+ SCCOL nEndCol, SCROW nEndRow, ScDirection eDir );
+-
+ void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY );
+ void GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
+ BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark );
diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
-index 7ad994d..ec6c46c 100644
+index 5db1f9a..411d542 100644
--- sc/source/core/data/documen3.cxx
+++ sc/source/core/data/documen3.cxx
-@@ -1269,6 +1269,18 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
- //return FALSE;
+@@ -1290,14 +1290,24 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
+ //if (VALIDTAB(nTab))
+ // if (pTab[nTab])
+ // return pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow );
+-
+ //return FALSE;
}
+void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const
@@ -95,88 +103,92 @@ index 7ad994d..ec6c46c 100644
//
// GetFilterEntries - Eintraege fuer AutoFilter-Listbox
//
-@@ -1280,6 +1292,7 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
- ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!??
- if (pDBData)
- {
+-
+ BOOL ScDocument::GetFilterEntries(
+ SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates)
+ {
+@@ -1306,6 +1316,7 @@ BOOL ScDocument::GetFilterEntries(
+ ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!??
+ if (pDBData)
+ {
+ UpdateDynamicEndRow(*pDBData);
- SCTAB nAreaTab;
- SCCOL nStartCol;
- SCROW nStartRow;
-@@ -1291,6 +1304,7 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
+ SCTAB nAreaTab;
+ SCCOL nStartCol;
+ SCROW nStartRow;
+@@ -1317,6 +1328,7 @@ BOOL ScDocument::GetFilterEntries(
- ScQueryParam aParam;
- pDBData->GetQueryParam( aParam );
+ ScQueryParam aParam;
+ pDBData->GetQueryParam( aParam );
+ nEndRow = aParam.nDynamicEndRow;
- rStrings.SetCaseSensitive( aParam.bCaseSens );
+ rStrings.SetCaseSensitive( aParam.bCaseSens );
// return all filter entries, if a filter condition is connected with a boolean OR
diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index fa98376..5844fa0 100644
+index d08a3c0..f43ec20 100644
--- sc/source/core/data/document.cxx
+++ sc/source/core/data/document.cxx
-@@ -598,7 +598,7 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons
+@@ -601,7 +601,7 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons
// zusammenhaengender Bereich
void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld )
+ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const
{
- if (VALIDTAB(nTab))
- if (pTab[nTab])
+ if (VALIDTAB(nTab))
+ if (pTab[nTab])
diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx
-index 6d3169f..58b43e2 100644
+index 3b0d0f6..43740e8 100644
--- sc/source/core/data/global2.cxx
+++ sc/source/core/data/global2.cxx
-@@ -256,7 +256,8 @@ ScQueryParam::ScQueryParam( const ScQueryParam& r ) :
- bHasHeader(r.bHasHeader), bByRow(r.bByRow), bInplace(r.bInplace), bCaseSens(r.bCaseSens),
- bRegExp(r.bRegExp), bMixedComparison(r.bMixedComparison),
+@@ -261,7 +261,8 @@ ScQueryParam::ScQueryParam( const ScQueryParam& r ) :
+ bHasHeader(r.bHasHeader), bByRow(r.bByRow), bInplace(r.bInplace), bCaseSens(r.bCaseSens),
+ bRegExp(r.bRegExp), bMixedComparison(r.bMixedComparison),
bDuplicate(r.bDuplicate), bDestPers(r.bDestPers),
- nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow)
+ nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow),
+ nDynamicEndRow(r.nDynamicEndRow), bUseDynamicRange(r.bUseDynamicRange)
{
- nEntryCount = 0;
+ nEntryCount = 0;
-@@ -282,6 +283,8 @@ void ScQueryParam::Clear()
- nTab = SCTAB_MAX;
- bHasHeader = bCaseSens = bRegExp = bMixedComparison = FALSE;
- bInplace = bByRow = bDuplicate = bDestPers = TRUE;
+@@ -287,6 +288,8 @@ void ScQueryParam::Clear()
+ nTab = SCTAB_MAX;
+ bHasHeader = bCaseSens = bRegExp = bMixedComparison = FALSE;
+ bInplace = bByRow = bDuplicate = bDestPers = TRUE;
+ nDynamicEndRow = 0;
+ bUseDynamicRange = false;
- Resize( MAXQUERY );
- for (USHORT i=0; i<MAXQUERY; i++)
-@@ -308,6 +311,8 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
- bDuplicate = r.bDuplicate;
- bByRow = r.bByRow;
- bDestPers = r.bDestPers;
+ Resize( MAXQUERY );
+ for (USHORT i=0; i<MAXQUERY; i++)
+@@ -313,6 +316,8 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
+ bDuplicate = r.bDuplicate;
+ bByRow = r.bByRow;
+ bDestPers = r.bDestPers;
+ nDynamicEndRow = r.nDynamicEndRow;
+ bUseDynamicRange = r.bUseDynamicRange;
- Resize( r.nEntryCount );
- for (USHORT i=0; i<nEntryCount; i++)
-@@ -345,7 +350,9 @@ BOOL ScQueryParam::operator==( const ScQueryParam& rOther ) const
- && (bDestPers == rOther.bDestPers)
- && (nDestTab == rOther.nDestTab)
- && (nDestCol == rOther.nDestCol)
+ Resize( r.nEntryCount );
+ for (USHORT i=0; i<nEntryCount; i++)
+@@ -350,7 +355,9 @@ BOOL ScQueryParam::operator==( const ScQueryParam& rOther ) const
+ && (bDestPers == rOther.bDestPers)
+ && (nDestTab == rOther.nDestTab)
+ && (nDestCol == rOther.nDestCol)
- && (nDestRow == rOther.nDestRow) )
+ && (nDestRow == rOther.nDestRow)
+ && (nDynamicEndRow == rOther.nDynamicEndRow)
+ && (bUseDynamicRange == rOther.bUseDynamicRange) )
- {
- bEqual = TRUE;
- for ( USHORT i=0; i<nUsed && bEqual; i++ )
-@@ -407,6 +414,7 @@ void ScQueryParam::MoveToDest()
+ {
+ bEqual = TRUE;
+ for ( USHORT i=0; i<nUsed && bEqual; i++ )
+@@ -412,6 +419,7 @@ void ScQueryParam::MoveToDest()
nCol2 = sal::static_int_cast<SCCOL>( nCol2 + nDifX );
nRow2 = sal::static_int_cast<SCROW>( nRow2 + nDifY );
nTab = sal::static_int_cast<SCTAB>( nTab + nDifZ );
+ nDynamicEndRow = sal::static_int_cast<SCROW>( nDynamicEndRow + nDifY );
- for (USHORT i=0; i<nEntryCount; i++)
- pEntries[i].nField += nDifX;
+ for (USHORT i=0; i<nEntryCount; i++)
+ pEntries[i].nField += nDifX;
diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx
-index c831b0b..92442ff 100644
+index fa6efb6..e0c3ff2 100644
--- sc/source/core/data/table1.cxx
+++ sc/source/core/data/table1.cxx
@@ -664,7 +664,7 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const
@@ -186,45 +198,45 @@ index c831b0b..92442ff 100644
- BOOL bIncludeOld )
+ BOOL bIncludeOld ) const
{
- BOOL bLeft = FALSE;
- BOOL bRight = FALSE;
+ BOOL bLeft = FALSE;
+ BOOL bRight = FALSE;
diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx
-index f840689..f17fcef 100644
+index fc5a6da..6f41234 100644
--- sc/source/core/data/table3.cxx
+++ sc/source/core/data/table3.cxx
-@@ -1558,6 +1558,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
- BOOL* pSpecial = new BOOL[nEntryCount];
+@@ -1574,6 +1574,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
+ BOOL* pSpecial = new BOOL[nEntryCount];
lcl_PrepareQuery( pDocument, this, aParam, pSpecial );
+ SCROW nEndRow = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2;
- if (!aParam.bInplace)
- {
- nOutRow = aParam.nDestRow + nHeader;
-@@ -1566,7 +1567,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
- aParam.nDestCol, aParam.nDestRow, aParam.nDestTab );
- }
+ if (!aParam.bInplace)
+ {
+ nOutRow = aParam.nDestRow + nHeader;
+@@ -1582,7 +1583,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
+ aParam.nDestCol, aParam.nDestRow, aParam.nDestTab );
+ }
- for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++)
+ for (SCROW j=aParam.nRow1 + nHeader; j<=nEndRow; j++)
- {
- BOOL bResult; // Filterergebnis
- BOOL bValid = ValidQuery(j, aParam, pSpecial);
+ {
+ BOOL bResult; // Filterergebnis
+ BOOL bValid = ValidQuery(j, aParam, pSpecial);
diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx
-index 74fae17..419e7e8 100644
+index 1304c49..2627d87 100644
--- sc/source/core/tool/dbcolect.cxx
+++ sc/source/core/tool/dbcolect.cxx
-@@ -378,18 +378,20 @@ String ScDBData::GetOperations() const
- return aVal;
+@@ -380,18 +380,20 @@ String ScDBData::GetOperations() const
+ return aVal;
}
-void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const
+void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2,
+ bool bUseDynamicRange) const
{
- rTab = nTable;
- rCol1 = nStartCol;
- rRow1 = nStartRow;
- rCol2 = nEndCol;
+ rTab = nTable;
+ rCol1 = nStartCol;
+ rRow1 = nStartRow;
+ rCol2 = nEndCol;
- rRow2 = nEndRow;
+ rRow2 = bUseDynamicRange ? nDynamicEndRow : nEndRow;
}
@@ -238,8 +250,8 @@ index 74fae17..419e7e8 100644
}
void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
-@@ -401,6 +403,11 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
- nEndRow = nRow2;
+@@ -403,6 +405,11 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
+ nEndRow = nRow2;
}
+void ScDBData::SetDynamicEndRow(SCROW nRow)
@@ -249,112 +261,115 @@ index 74fae17..419e7e8 100644
+
void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
{
- USHORT i;
-@@ -508,6 +515,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
- rQueryParam.nDestTab = nQueryDestTab;
- rQueryParam.nDestCol = nQueryDestCol;
- rQueryParam.nDestRow = nQueryDestRow;
+ USHORT i;
+@@ -510,6 +517,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
+ rQueryParam.nDestTab = nQueryDestTab;
+ rQueryParam.nDestCol = nQueryDestCol;
+ rQueryParam.nDestRow = nQueryDestRow;
+ rQueryParam.nDynamicEndRow = nDynamicEndRow;
- rQueryParam.Resize( MAXQUERY );
- for (SCSIZE i=0; i<MAXQUERY; i++)
+ rQueryParam.Resize( MAXQUERY );
+ for (SCSIZE i=0; i<MAXQUERY; i++)
diff --git sc/source/ui/dbgui/filtdlg.cxx sc/source/ui/dbgui/filtdlg.cxx
-index 2654ef9..dc4fb13 100644
+index 846cbad..369785e 100644
--- sc/source/ui/dbgui/filtdlg.cxx
+++ sc/source/ui/dbgui/filtdlg.cxx
@@ -390,7 +390,7 @@ void ScFilterDlg::UpdateValueList( USHORT nList )
- {
- SCTAB nTab = nSrcTab;
- SCROW nFirstRow = theQueryData.nRow1;
+ {
+ SCTAB nTab = nSrcTab;
+ SCROW nFirstRow = theQueryData.nRow1;
- SCROW nLastRow = theQueryData.nRow2;
+ SCROW nLastRow = theQueryData.bUseDynamicRange ? theQueryData.nDynamicEndRow : theQueryData.nRow2;
+ mbHasDates[nList-1] = false;
- // erstmal ohne die erste Zeile
-
+ // erstmal ohne die erste Zeile
diff --git sc/source/ui/inc/dbfunc.hxx sc/source/ui/inc/dbfunc.hxx
-index cb4797c..8556472 100644
+index 814fc5f..f5e9ae4 100644
--- sc/source/ui/inc/dbfunc.hxx
+++ sc/source/ui/inc/dbfunc.hxx
@@ -80,7 +80,7 @@ public:
- void GotoDBArea( const String& rDBName );
+ void GotoDBArea( const String& rDBName );
- // DB-Bereich vom Cursor
+ // DB-Bereich vom Cursor
- ScDBData* GetDBData( BOOL bMarkArea = TRUE, ScGetDBMode eMode = SC_DB_MAKE );
+ ScDBData* GetDBData( bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, bool bExpandRows = false );
- void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
+ void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
diff --git sc/source/ui/view/dbfunc.cxx sc/source/ui/view/dbfunc.cxx
-index ee42e57..3bb5742 100644
+index ed25c8e..9a96e42 100644
--- sc/source/ui/view/dbfunc.cxx
+++ sc/source/ui/view/dbfunc.cxx
-@@ -107,7 +107,7 @@ void ScDBFunc::GotoDBArea( const String& rDBName )
+@@ -105,9 +105,10 @@ void ScDBFunc::GotoDBArea( const String& rDBName )
+ }
+ }
++
// aktuellen Datenbereich fuer Sortieren / Filtern suchen
-ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode )
+ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, bool bExpandRows )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDBData* pData = NULL;
-@@ -119,11 +119,20 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode )
- ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ),
- eMode, FALSE );
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDBData* pData = NULL;
+@@ -119,11 +120,20 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode )
+ ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ GetViewData()->GetTabNo() ),
+ eMode, FALSE );
+ if (!pData)
+ return NULL;
-
-- if ( pData && bMark )
++
+ if (bExpandRows)
+ {
+ // Dynamically expand rows to include any new data rows that are
+ // immediately below the original range.
+ GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData);
+ }
-+
+
+- if ( pData && bMark )
+ if (bMark)
- {
- ScRange aFound;
+ {
+ ScRange aFound;
- pData->GetArea(aFound);
+ pData->GetArea(aFound, bExpandRows);
- MarkRange( aFound, FALSE );
- }
- return pData;
+ MarkRange( aFound, FALSE );
+ }
+ return pData;
diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
-index 0dd7b47..63a1785 100644
+index 439f98d..b56189d 100644
--- sc/source/ui/view/gridwin.cxx
+++ sc/source/ui/view/gridwin.cxx
-@@ -1235,6 +1235,7 @@ void ScGridWindow::ExecFilter( ULONG nSel,
- pViewData->GetViewShell()->UpdateInputHandler();
- }
+@@ -1198,6 +1198,7 @@ void ScGridWindow::ExecFilter( ULONG nSel,
+ pViewData->GetViewShell()->UpdateInputHandler();
+ }
+ aParam.bUseDynamicRange = true;
- pViewData->GetView()->Query( aParam, NULL, TRUE );
- pDBData->SetQueryParam( aParam ); // speichern
- }
+ pViewData->GetView()->Query( aParam, NULL, TRUE );
+ pDBData->SetQueryParam( aParam ); // speichern
+ }
diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx
-index 9c17453..aa38b7a 100644
+index 5e61e4e..0312ded 100644
--- sc/source/ui/view/tabvwshc.cxx
+++ sc/source/ui/view/tabvwshc.cxx
@@ -178,8 +178,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
- SCITEM_QUERYDATA,
- SCITEM_QUERYDATA );
+ SCITEM_QUERYDATA,
+ SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData();
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true);
- pDBData->GetQueryParam( aQueryParam );
+ pDBData->GetQueryParam( aQueryParam );
+ aQueryParam.bUseDynamicRange = true;
- ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
- ScRange aAdvSource;
+ ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
+ ScRange aAdvSource;
@@ -203,8 +204,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
- SCITEM_QUERYDATA,
- SCITEM_QUERYDATA );
+ SCITEM_QUERYDATA,
+ SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData();
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true);
- pDBData->GetQueryParam( aQueryParam );
+ pDBData->GetQueryParam( aQueryParam );
+ aQueryParam.bUseDynamicRange = true;
- aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
- GetViewData(),
+ aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
+ GetViewData(),
More information about the ooo-build-commit
mailing list