summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2012-01-04 15:28:35 +0100
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-04 10:00:54 -0500
commitc29a7e78774ed88bdc8695c28e2603ea76447b6c (patch)
treeb30de3b1dc77942cb92d31c47537e9b3fcb6c0a7 /sc
parent8edd479f579afe9b26790c99a9a6648261aec4e3 (diff)
move static casts outside loops
some little perf. improvements on saving spreadsheets
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table5.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index f5a2abe35f92..fffd42fa36e5 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -966,9 +966,11 @@ void lcl_syncFlags(ScFlatBoolColSegments& rColSegments, ScFlatBoolRowSegments& r
{
using ::sal::static_int_cast;
- pRowFlags->AndValue(0, MAXROW, static_int_cast<sal_uInt8>(~nFlagMask));
+ sal_uInt8 nFlagMaskComplement = static_int_cast<sal_uInt8>(~nFlagMask);
+
+ pRowFlags->AndValue(0, MAXROW, nFlagMaskComplement);
for (SCCOL i = 0; i <= MAXCOL; ++i)
- pColFlags[i] &= static_int_cast<sal_uInt8>(~nFlagMask);
+ pColFlags[i] &= nFlagMaskComplement;
{
// row hidden flags.
@@ -981,7 +983,7 @@ void lcl_syncFlags(ScFlatBoolColSegments& rColSegments, ScFlatBoolRowSegments& r
break;
if (aData.mbValue)
- pRowFlags->OrValue(nRow, aData.mnRow2, static_int_cast<sal_uInt8>(nFlagMask));
+ pRowFlags->OrValue(nRow, aData.mnRow2, nFlagMask);
nRow = aData.mnRow2 + 1;
}
@@ -1014,16 +1016,18 @@ void ScTable::SyncColRowFlags()
{
using ::sal::static_int_cast;
+ sal_uInt8 nManualBreakComplement = static_int_cast<sal_uInt8>(~CR_MANUALBREAK);
+
// Manual breaks.
- pRowFlags->AndValue(0, MAXROW, static_int_cast<sal_uInt8>(~CR_MANUALBREAK));
+ pRowFlags->AndValue(0, MAXROW, nManualBreakComplement);
for (SCCOL i = 0; i <= MAXCOL; ++i)
- pColFlags[i] &= static_int_cast<sal_uInt8>(~CR_MANUALBREAK);
+ pColFlags[i] &= nManualBreakComplement;
if (!maRowManualBreaks.empty())
{
for (set<SCROW>::const_iterator itr = maRowManualBreaks.begin(), itrEnd = maRowManualBreaks.end();
itr != itrEnd; ++itr)
- pRowFlags->OrValue(*itr, static_int_cast<sal_uInt8>(CR_MANUALBREAK));
+ pRowFlags->OrValue(*itr, CR_MANUALBREAK);
}
if (!maColManualBreaks.empty())