[Libreoffice-commits] core.git: 4 commits - sc/inc sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Wed Feb 6 07:49:02 PST 2013
sc/inc/column.hxx | 15 +++++----------
sc/source/core/data/column.cxx | 28 ++++++++++++++++------------
sc/source/core/data/column3.cxx | 5 ++---
sc/source/core/data/table1.cxx | 2 +-
sc/source/core/data/table4.cxx | 4 ++--
5 files changed, 26 insertions(+), 28 deletions(-)
New commits:
commit e7b1c7954e159197ad414e8aff7e7a04c30da29c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 19:17:19 2012 -0500
Re-order the header includes. Make sure column.hxx comes first.
Change-Id: I9f93724c4e0b565a9148d0893feda9e82109bff7
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 4ee7923..fc22a5b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -17,15 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <map>
-
-#include <svl/poolcach.hxx>
-#include <svl/zforlist.hxx>
-#include <editeng/scripttypeitem.hxx>
-#include <string.h>
-
-#include "scitems.hxx"
#include "column.hxx"
+#include "scitems.hxx"
#include "cell.hxx"
#include "document.hxx"
#include "docpool.hxx"
@@ -37,6 +30,13 @@
#include "detfunc.hxx" // for Notes in Sort/Swap
#include "postit.hxx"
+#include <svl/poolcach.hxx>
+#include <svl/zforlist.hxx>
+#include <editeng/scripttypeitem.hxx>
+
+#include <cstring>
+#include <map>
+
using ::editeng::SvxBorderLine;
using namespace formula;
commit 9c8d87e46bba0eb9a3b8d923c6c630a359bf0f6c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 19:07:08 2012 -0500
Use initializer to initialize data members.
Change-Id: I912cede3a240ccd4e1cc94be46c7dfee36a85af6
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index cfe4bbe..35316cd 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -67,14 +67,7 @@ struct ScNeededSizeOptions
bool bGetFont;
bool bTotalSize;
- ScNeededSizeOptions()
- {
- pPattern = NULL;
- bFormula = false;
- bSkipMerged = true;
- bGetFont = true;
- bTotalSize = false;
- }
+ ScNeededSizeOptions();
};
struct ColEntry
@@ -83,7 +76,6 @@ struct ColEntry
ScBaseCell* pCell;
};
-
class ScColumn
{
private:
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index d803755..4ee7923 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -49,6 +49,11 @@ inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
nScript != 0 );
}
+ScNeededSizeOptions::ScNeededSizeOptions() :
+ pPattern(NULL), bFormula(false), bSkipMerged(true), bGetFont(true), bTotalSize(false)
+{
+}
+
ScColumn::ScColumn() :
nCol( 0 ),
pAttrArray( NULL ),
commit ba42d88d95cdc7fe6130b3bd3a41e8c731110238
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 17:17:22 2012 -0500
Make ScColumn explicitly non-copyable.
Change-Id: I0e3f552f8ed8a57f399ba9e01c06a23d9a9da854
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 9ed577ec..cfe4bbe 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -107,6 +107,9 @@ friend class ScCellIterator;
friend class ScHorizontalCellIterator;
friend class ScHorizontalAttrIterator;
+ ScColumn(const ScColumn&); // disabled
+ ScColumn& operator= (const ScColumn&); // disabled
+
public:
ScColumn();
~ScColumn();
commit 2b70c47a37f33819cff0e42d00c37cfaea0461ec
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 14:00:54 2012 -0500
Rename ScColumn::Resize() to ReserveSize().
The new name is more aligned with what it actually does.
Change-Id: I703e20253fe5957c775026d8d08f2906f2d7889c
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index f6dff3b..9ed577ec 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -121,7 +121,7 @@ public:
void Delete( SCROW nRow );
void DeleteAtIndex( SCSIZE nIndex );
void FreeAll();
- void Resize( SCSIZE nSize );
+ void ReserveSize( SCSIZE nSize );
void SwapRow( SCROW nRow1, SCROW nRow2 );
void SwapCell( SCROW nRow, ScColumn& rCol);
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index f29dc2d..d803755 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -760,8 +760,7 @@ ScBaseCell* ScColumn::GetCell( SCROW nRow ) const
return NULL;
}
-
-void ScColumn::Resize( SCSIZE nSize )
+void ScColumn::ReserveSize( SCSIZE nSize )
{
if (nSize > sal::static_int_cast<SCSIZE>(MAXROWCOUNT))
nSize = MAXROWCOUNT;
@@ -1178,7 +1177,7 @@ void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, bool bKee
if (nBlockCount)
{
- rColumn.Resize( rColumn.GetCellCount() + nBlockCount );
+ rColumn.ReserveSize(rColumn.GetCellCount() + nBlockCount);
ScAddress aOwnPos( nCol, 0, nTab );
ScAddress aDestPos( rColumn.nCol, 0, rColumn.nTab );
for (i = nStartIndex; i <= nEndIndex; i++)
@@ -1368,7 +1367,7 @@ void ScColumn::CopyToColumn(
if (nBlockCount)
{
- rColumn.Resize( rColumn.GetCellCount() + nBlockCount );
+ rColumn.ReserveSize(rColumn.GetCellCount() + nBlockCount);
ScAddress aDestPos( rColumn.nCol, 0, rColumn.nTab );
for (i = nStartIndex; i <= nEndIndex; i++)
{
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 1e0ce3c..043cec9 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -681,7 +681,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
//! IDF_ALL muss immer mehr Flags enthalten, als bei "Inhalte Einfuegen"
//! einzeln ausgewaehlt werden koennen!
- Resize( maItems.size() + static_cast<SCSIZE>(nRow2-nRow1+1) );
+ ReserveSize(maItems.size() + static_cast<SCSIZE>(nRow2-nRow1+1));
ScAddress aDestPos( nCol, 0, nTab ); // Row wird angepasst
@@ -715,8 +715,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
//! Always do the Resize from the outside, where the number of repetitions is known
//! (then it can be removed here)
- SCSIZE nNew = maItems.size() + nColCount;
- Resize( nNew );
+ ReserveSize(maItems.size() + nColCount);
}
sal_Bool bAtEnd = false;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index a04dece..446686e 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1868,7 +1868,7 @@ void ScTable::CopyPrintRange(const ScTable& rTable)
void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd )
{
for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
- aCol[nCol].Resize(aCol[nCol].GetCellCount() + nAdd);
+ aCol[nCol].ReserveSize(aCol[nCol].GetCellCount() + nAdd);
}
void ScTable::SetRepeatColRange( const ScRange* pNew )
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 00aa1c3..38adeb8 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -694,7 +694,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nInc,nMinDigits, pListData,nListIndex);
if (bVertical)
- aCol[nCol].Resize( aCol[nCol].GetCellCount() + nFillCount );
+ aCol[nCol].ReserveSize(aCol[nCol].GetCellCount() + nFillCount);
if (pListData)
{
@@ -1389,7 +1389,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
ScBaseCell* pSrcCell = aCol[nCol].GetCell(static_cast<SCROW>(nRow));
if (bVertical && bAttribs)
- aCol[nCol].Resize( aCol[nCol].GetCellCount() + nFillCount );
+ aCol[nCol].ReserveSize(aCol[nCol].GetCellCount() + nFillCount);
if (bAttribs)
{
More information about the Libreoffice-commits
mailing list