diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 16:17:30 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 16:17:30 -0400 |
commit | 81c9c7e29b6b77cd354482e804d97857f2035be5 (patch) | |
tree | 6d8c27cc02cfe9014e2df5725ad0eb86a7bb42f1 /oox | |
parent | f0bb6509a87a4712c1e229d7238482604323826b (diff) |
Ported calc-xlsx-import-default-cellstyle.diff from ooo-build.
Import default cell styles into the 'Default' calc style. Not
doing this severely degrade the performance of the export of the
same document; since each cell is treated as having a non-default
cell style. (n#558577)
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/xls/stylesbuffer.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 09c59e0757b0..8388507fded9 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -3015,6 +3015,9 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = maBuiltinStyles.begin(), aEnd = maBuiltinStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); + if (rModel.isDefaultStyle()) + continue; + OUString aStyleName = lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel ); OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0), "CellStyleBuffer::finalizeImport - multiple styles with equal built-in identifier" ); @@ -3055,6 +3058,16 @@ void CellStyleBuffer::finalizeImport() // set final names and create user-defined and modified built-in cell styles aCellStyles.forEachMemWithKey( &CellStyle::finalizeImport ); + + if (mxDefStyle) + { + Reference<XNameAccess> xNA(getStyleFamily(false), UNO_QUERY_THROW); + if (xNA->hasByName(CREATE_OUSTRING("Default"))) + { + PropertySet aPropSet(xNA->getByName(CREATE_OUSTRING("Default"))); + getStyles().writeStyleXfToPropertySet(aPropSet, mxDefStyle->getModel().mnXfId); + } + } } sal_Int32 CellStyleBuffer::getDefaultXfId() const |