[ooo-build-commit] .: oox/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Oct 5 13:20:14 PDT 2010
oox/source/xls/stylesbuffer.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit e700890044eb986b3f2a542d49912353f8e6a59a
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Oct 5 16:17:30 2010 -0400
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)
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index 91966c2..4b10200 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
More information about the ooo-build-commit
mailing list