[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/inc sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Apr 1 12:27:12 PDT 2011
sc/inc/dbcolect.hxx | 8 +++-----
sc/inc/document.hxx | 3 ---
sc/inc/queryparam.hxx | 4 +---
sc/source/core/data/documen3.cxx | 14 --------------
sc/source/core/data/table3.cxx | 2 +-
sc/source/core/tool/dbcolect.cxx | 15 ++++-----------
sc/source/core/tool/queryparam.cxx | 16 +++-------------
sc/source/ui/dbgui/filtdlg.cxx | 2 +-
sc/source/ui/inc/dbfunc.hxx | 2 +-
sc/source/ui/view/dbfunc.cxx | 12 +++---------
sc/source/ui/view/gridwin.cxx | 1 -
sc/source/ui/view/tabvwshc.cxx | 6 ++----
12 files changed, 19 insertions(+), 66 deletions(-)
New commits:
commit 1d74574c80d8c14f8768fe7c4b81f896c4137d33
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Apr 1 15:24:18 2011 -0400
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.
diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
index 8e4e28b..d34d383 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 ba341a3..8f793e8 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 6042c20..d62061e 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 a2fa691..ea3b653 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 dac8b6c..8968e83 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 ffb4066..600d987 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 013a0e6..0141f1c 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 d487585..36551ba 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 ff168d0..01c74b1 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 2965a7f..a142cc2 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 31c66f0..a14c9c2 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 b0439c1..2cd6870 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(),
More information about the Libreoffice-commits
mailing list