[Libreoffice-commits] .: Branch 'feature/smaller-base-cell' - 4 commits - sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 6 19:12:01 PST 2012
sc/inc/column.hxx | 13 ++-------
sc/source/core/data/column.cxx | 56 ++++++++++++++++++++++++++++++++--------
sc/source/core/data/column3.cxx | 9 ------
3 files changed, 49 insertions(+), 29 deletions(-)
New commits:
commit 3c6cefde8d2a8f0c63f44276681468200eeead07
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 22:08:42 2012 -0500
Add accessor methods for text widths using mdds::multi_type_vector.
We only use unsigned short and empty types in this container. Empty type
represents empty cells whereas unsigned short type represents non-empty
cells.
Change-Id: Id9b6e0941fdfabc48fc8bb2aa6479f466270381c
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index e50cf8f..8c9c1c2 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -45,6 +45,8 @@
#include <cstring>
#include <map>
+#include <mdds/multi_type_vector.hpp>
+#include <mdds/multi_type_vector_trait.hpp>
using ::editeng::SvxBorderLine;
using namespace formula;
@@ -64,6 +66,11 @@ inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
struct ScColumnImpl
{
+ typedef mdds::multi_type_vector<mdds::mtv::element_block_func> TextWidthType;
+
+ TextWidthType maTextWidths;
+
+ ScColumnImpl() : maTextWidths(MAXROWCOUNT) {}
};
ScNeededSizeOptions::ScNeededSizeOptions() :
@@ -2158,5 +2165,22 @@ bool ScColumn::SearchStyleRange(
return pAttrArray->SearchStyleRange( rRow, rEndRow, pSearchStyle, bUp, NULL );
}
+sal_uInt16 ScColumn::GetTextWidth(SCROW nRow) const
+{
+ switch (mpImpl->maTextWidths.get_type(nRow))
+ {
+ case mdds::mtv::element_type_ushort:
+ return mpImpl->maTextWidths.get<unsigned short>(nRow);
+ default:
+ ;
+ }
+ return TEXTWIDTH_DIRTY;
+}
+
+void ScColumn::SetTextWidth(SCROW nRow, sal_uInt16 nWidth)
+{
+ // We only use unsigned short type in this container.
+ mpImpl->maTextWidths.set(nRow, static_cast<unsigned short>(nWidth));
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f57a98a..aa817a4 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1950,13 +1950,4 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
return nStringLen;
}
-sal_uInt16 ScColumn::GetTextWidth(SCROW nRow) const
-{
- return 0;
-}
-
-void ScColumn::SetTextWidth(SCROW nRow, sal_uInt16 nWidth)
-{
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 49e72dfbe3295affa6fac1bc0503a80c61a61105
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 6633d71..e50cf8f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -26,15 +26,8 @@
*
************************************************************************/
-#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"
@@ -46,6 +39,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 6ea942daf5aa8978f9e80786e97028a28415337c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Nov 6 19:15:11 2012 -0500
Let's start using impl class for ScColumn.
No need to migrate the existing data members to it for now, but let's
define new members in the impl class from now on.
Change-Id: Idee66dae87beb4bb6efc9c7d7ffd658148ed887c
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 4a7ae45..816e734 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -67,6 +67,7 @@ struct ScMergePatternState;
class ScFlatBoolRowSegments;
struct ScSetStringParam;
struct ScColWidthParam;
+struct ScColumnImpl;
struct ScNeededSizeOptions
{
@@ -88,6 +89,8 @@ struct ColEntry
class ScColumn
{
private:
+ ScColumnImpl* mpImpl;
+
SCCOL nCol;
SCTAB nTab;
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 147f1ec..6633d71 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -46,13 +46,11 @@
#include "detfunc.hxx" // for Notes in Sort/Swap
#include "postit.hxx"
-//#pragma optimize ( "", off )
-// nur Search ohne Optimierung!
-
-// STATIC DATA -----------------------------------------------------------
using ::editeng::SvxBorderLine;
using namespace formula;
+namespace {
+
inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
{
//! move to a header file
@@ -62,12 +60,19 @@ inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
nScript != 0 );
}
+}
+
+struct ScColumnImpl
+{
+};
+
ScNeededSizeOptions::ScNeededSizeOptions() :
pPattern(NULL), bFormula(false), bSkipMerged(true), bGetFont(true), bTotalSize(false)
{
}
ScColumn::ScColumn() :
+ mpImpl(new ScColumnImpl),
nCol( 0 ),
pAttrArray( NULL ),
pDocument( NULL )
commit 187f14ac06b4abcb6b8204d89f3cfe3f87da2af9
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 d157edb..4a7ae45 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -76,14 +76,7 @@ struct ScNeededSizeOptions
bool bGetFont;
bool bTotalSize;
- ScNeededSizeOptions()
- {
- pPattern = NULL;
- bFormula = false;
- bSkipMerged = true;
- bGetFont = true;
- bTotalSize = false;
- }
+ ScNeededSizeOptions();
};
struct ColEntry
@@ -92,7 +85,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 bae732a..147f1ec 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -62,6 +62,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 ),
More information about the Libreoffice-commits
mailing list