diff options
author | Laurent Godard <lgodard.libre@laposte.net> | 2012-01-04 15:28:35 +0100 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-04 10:00:54 -0500 |
commit | c29a7e78774ed88bdc8695c28e2603ea76447b6c (patch) | |
tree | b30de3b1dc77942cb92d31c47537e9b3fcb6c0a7 /sc | |
parent | 8edd479f579afe9b26790c99a9a6648261aec4e3 (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.cxx | 16 |
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()) |