summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-04-01 15:24:18 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-04-01 15:24:18 -0400
commitf2384d6f10178c3bec96e96009255f61e083cda6 (patch)
treeffd0114c01d3a0600ef8253e44b56dd6d9ea9e3d /sc
parentd99726db9fa723e6c418690d158d619034f2a581 (diff)
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.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/dbcolect.hxx8
-rw-r--r--sc/inc/document.hxx3
-rw-r--r--sc/inc/queryparam.hxx4
-rw-r--r--sc/source/core/data/documen3.cxx14
-rw-r--r--sc/source/core/data/table3.cxx2
-rw-r--r--sc/source/core/tool/dbcolect.cxx15
-rw-r--r--sc/source/core/tool/queryparam.cxx16
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx2
-rw-r--r--sc/source/ui/inc/dbfunc.hxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx12
-rw-r--r--sc/source/ui/view/gridwin.cxx1
-rw-r--r--sc/source/ui/view/tabvwshc.cxx6
12 files changed, 19 insertions, 66 deletions
diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
index 5ccbbbb6f41e..b24c0df87c46 100644
--- a/sc/inc/dbcolect.hxx
+++ b/sc/inc/dbcolect.hxx
@@ -90,7 +90,6 @@ private:
ScQueryConnect eQueryConnect[MAXQUERY];
bool bIsAdvanced; // sal_True if created by advanced filter
ScRange aAdvSource; // source range
- SCROW nDynamicEndRow;
ScSubTotalParam maSubTotal;
@@ -126,17 +125,16 @@ 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, bool bUseDynamicRange = false) const;
- SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const;
+ void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
+ SC_DLLPUBLIC void GetArea(ScRange& rRange) const;
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; }
bool HasHeader() const { return bHasHeader; }
void SetHeader(bool bHasH) { bHasHeader = bHasH; }
void SetIndex(sal_uInt16 nInd) { nIndex = nInd; }
- sal_uInt16 GetIndex() const { return nIndex; }
+ sal_uInt16 GetIndex() const { return nIndex; }
bool IsDoSize() const { return bDoSize; }
void SetDoSize(bool bSet) { bDoSize = bSet; }
bool IsKeepFmt() const { return bKeepFmt; }
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6127f5b39c4f..f41edffbe291 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1465,9 +1465,6 @@ 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;
-
sal_Bool GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
SC_DLLPUBLIC sal_Bool GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
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 );
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index f61971724a28..c99145cd0309 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1336,18 +1336,6 @@ sal_Bool ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndC
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow );
}
-void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const
-{
- SCCOL nCol1, nCol2;
- SCROW nRow1, nRow2;
- SCTAB nTab;
- rDBData.GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
- SCCOL nCol1a = nCol1, nCol2a = nCol2;
- SCROW nRow1a = nRow1, nRow2a = nRow2;
- GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
- rDBData.SetDynamicEndRow(nRow2a);
-}
-
//
// GetFilterEntries - Eintraege fuer AutoFilter-Listbox
//
@@ -1360,7 +1348,6 @@ sal_Bool ScDocument::GetFilterEntries(
ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, false); //!??
if (pDBData)
{
- UpdateDynamicEndRow(*pDBData);
SCTAB nAreaTab;
SCCOL nStartCol;
SCROW nStartRow;
@@ -1372,7 +1359,6 @@ sal_Bool ScDocument::GetFilterEntries(
ScQueryParam aParam;
pDBData->GetQueryParam( aParam );
- nEndRow = aParam.nDynamicEndRow;
rStrings.SetCaseSensitive( aParam.bCaseSens );
// return all filter entries, if a filter condition is connected with a boolean OR
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 01a6e69ebe89..0335f96c0ecc 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1644,7 +1644,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
if (aParam.bInplace)
InitializeNoteCaptions();
- SCROW nRealRow2 = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2;
+ SCROW nRealRow2 = aParam.nRow2;
for (SCROW j = aParam.nRow1 + nHeader; j <= nRealRow2; ++j)
{
sal_Bool bResult; // Filterergebnis
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
index 4c7d253ab676..4e871274b955 100644
--- a/sc/source/core/tool/dbcolect.cxx
+++ b/sc/source/core/tool/dbcolect.cxx
@@ -315,19 +315,18 @@ String ScDBData::GetOperations() const
return aVal;
}
-void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2,
- bool bUseDynamicRange) const
+void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const
{
rTab = nTable;
rCol1 = nStartCol;
rRow1 = nStartRow;
rCol2 = nEndCol;
- rRow2 = bUseDynamicRange ? nDynamicEndRow : nEndRow;
+ rRow2 = nEndRow;
}
-void ScDBData::GetArea(ScRange& rRange, bool bUseDynamicRange) const
+void ScDBData::GetArea(ScRange& rRange) const
{
- SCROW nNewEndRow = bUseDynamicRange ? nDynamicEndRow : nEndRow;
+ SCROW nNewEndRow = nEndRow;
rRange = ScRange( nStartCol, nStartRow, nTable, nEndCol, nNewEndRow, nTable );
}
@@ -340,11 +339,6 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
nEndRow = nRow2;
}
-void ScDBData::SetDynamicEndRow(SCROW nRow)
-{
- nDynamicEndRow = nRow;
-}
-
void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
{
sal_uInt16 i;
@@ -452,7 +446,6 @@ 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++)
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index e991b4d7277c..11f7e6f685db 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -188,8 +188,7 @@ ScQueryParam::ScQueryParam() :
ScQueryParam::ScQueryParam( const ScQueryParam& r ) :
ScQueryParamBase(r),
ScQueryParamTable(r),
- bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow),
- nDynamicEndRow(r.nDynamicEndRow), bUseDynamicRange(r.bUseDynamicRange)
+ bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow)
{
}
@@ -199,9 +198,7 @@ ScQueryParam::ScQueryParam( const ScDBQueryParamInternal& r ) :
bDestPers(true),
nDestTab(0),
nDestCol(0),
- nDestRow(0),
- nDynamicEndRow(0),
- bUseDynamicRange(false)
+ nDestRow(0)
{
}
@@ -235,8 +232,6 @@ void ScQueryParam::ClearDestParams()
nDestTab = 0;
nDestCol = 0;
nDestRow = 0;
- nDynamicEndRow = 0;
- bUseDynamicRange = false;
}
//------------------------------------------------------------------------
@@ -259,8 +254,6 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
bDuplicate = r.bDuplicate;
bByRow = r.bByRow;
bDestPers = r.bDestPers;
- nDynamicEndRow = r.nDynamicEndRow;
- bUseDynamicRange = r.bUseDynamicRange;
maEntries = r.maEntries;
@@ -299,9 +292,7 @@ sal_Bool ScQueryParam::operator==( const ScQueryParam& rOther ) const
&& (bDestPers == rOther.bDestPers)
&& (nDestTab == rOther.nDestTab)
&& (nDestCol == rOther.nDestCol)
- && (nDestRow == rOther.nDestRow)
- && (nDynamicEndRow == rOther.nDynamicEndRow)
- && (bUseDynamicRange == rOther.bUseDynamicRange) )
+ && (nDestRow == rOther.nDestRow) )
{
bEqual = sal_True;
for ( SCSIZE i=0; i<nUsed && bEqual; i++ )
@@ -325,7 +316,6 @@ 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 );
size_t n = maEntries.size();
for (size_t i=0; i<n; i++)
maEntries[i].nField += nDifX;
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 6695d818ff80..4532a7f0c5c7 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -516,7 +516,7 @@ void ScFilterDlg::UpdateValueList( sal_uInt16 nList )
sal_uInt16 nOffset = GetSliderPos();
SCTAB nTab = nSrcTab;
SCROW nFirstRow = theQueryData.nRow1;
- SCROW nLastRow = theQueryData.bUseDynamicRange ? theQueryData.nDynamicEndRow : theQueryData.nRow2;
+ SCROW nLastRow = theQueryData.nRow2;
mbHasDates[nOffset+nList-1] = false;
// first without the first line
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index c2116a5b1ee9..b7a51aab5183 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -78,7 +78,7 @@ public:
void GotoDBArea( const String& rDBName );
// DB-Bereich vom Cursor
- ScDBData* GetDBData( sal_Bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP, bool bShrinkToData = false, bool bExpandRows = false );
+ ScDBData* GetDBData( sal_Bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP, bool bShrinkToData = false);
ScDBData* GetAnonymousDBData();
void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index a7b86d102c34..a34dff3982f3 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -100,7 +100,7 @@ void ScDBFunc::GotoDBArea( const String& rDBName )
// aktuellen Datenbereich fuer Sortieren / Filtern suchen
-ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel, bool /*bShrinkToData*/, bool bExpandRows )
+ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel, bool /*bShrinkToData*/ )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDBData* pData = NULL;
@@ -181,16 +181,10 @@ ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelecti
if (!pData)
return NULL;
- if (bExpandRows)
- {
- // Dynamically expand rows to include any new data rows that are
- // immediately below the original range.
- GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData);
- }
if (bMark)
{
ScRange aFound;
- pData->GetArea(aFound, bExpandRows);
+ pData->GetArea(aFound);
MarkRange( aFound, false );
}
return pData;
@@ -369,7 +363,7 @@ void ScDBFunc::ToggleAutoFilter()
ScQueryParam aParam;
ScDocument* pDoc = GetViewData()->GetDocument();
- ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, false, true);
+ ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, false);
pDBData->SetByRow( sal_True ); //! Undo, vorher abfragen ??
pDBData->GetQueryParam( aParam );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 8a2a0eab3b3d..985240bd248d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1300,7 +1300,6 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
pViewData->GetViewShell()->UpdateInputHandler();
}
- aParam.bUseDynamicRange = true;
pViewData->GetView()->Query( aParam, NULL, true );
pDBData->SetQueryParam( aParam ); // speichern
}
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 8e3bf1c4d24f..1abfe983bf23 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -175,9 +175,8 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true);
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true);
pDBData->GetQueryParam( aQueryParam );
- aQueryParam.bUseDynamicRange = true;
ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
ScRange aAdvSource;
@@ -201,9 +200,8 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true);
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true);
pDBData->GetQueryParam( aQueryParam );
- aQueryParam.bUseDynamicRange = true;
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
GetViewData(),