summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/inc/stylesbuffer.hxx3
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx5
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx7
3 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx
index dcad8cde2984..1b5480945023 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -624,8 +624,9 @@ public:
{
std::list<ScAttrEntry> maAttrs;
bool mbLatinNumFmtOnly;
+ const ScPatternAttr* mpDefPattern;
- AttrList();
+ AttrList(const ScPatternAttr* pDefPatternAttr);
};
explicit Xf( const WorkbookHelper& rHelper );
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 06768e3e2371..3909e38851df 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -501,8 +501,9 @@ void SheetDataBuffer::finalizeImport()
for ( ColStyles::iterator col = maStylesPerColumn.begin(), col_end = maStylesPerColumn.end(); col != col_end; ++col )
{
RowStyles& rRowStyles = col->second;
- Xf::AttrList aAttrs;
SCCOL nScCol = static_cast< SCCOL >( col->first );
+ const ScPatternAttr* pDefPattern = rDoc.getDoc().GetPattern(nScCol, 0, getSheetIndex());
+ Xf::AttrList aAttrs(pDefPattern);
for ( RowStyles::iterator rRows = rRowStyles.begin(), rRows_end = rRowStyles.end(); rRows != rRows_end; ++rRows )
{
Xf* pXf = rStyles.getCellXf( rRows->mnNumFmt.first ).get();
@@ -514,7 +515,7 @@ void SheetDataBuffer::finalizeImport()
{
ScAttrEntry aEntry;
aEntry.nRow = MAXROW;
- aEntry.pPattern = rDoc.getDoc().GetPattern(nScCol, 0, getSheetIndex());
+ aEntry.pPattern = pDefPattern;
rDoc.getDoc().GetPool()->Put(*aEntry.pPattern);
aAttrs.maAttrs.push_back(aEntry);
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 1e48469ee192..4ebe396319c7 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -2051,7 +2051,10 @@ XfModel::XfModel() :
{
}
-Xf::AttrList::AttrList() : mbLatinNumFmtOnly(true) {}
+Xf::AttrList::AttrList(const ScPatternAttr* pDefPattern):
+ mbLatinNumFmtOnly(true),
+ mpDefPattern(pDefPattern)
+{}
Xf::Xf( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
@@ -2181,7 +2184,7 @@ void Xf::applyPatternToAttrList( AttrList& rAttrs, SCROW nRow1, SCROW nRow2, sal
// Fill this gap with the default pattern.
ScAttrEntry aEntry;
aEntry.nRow = nRow1 - 1;
- aEntry.pPattern = rDoc.GetDefPattern();
+ aEntry.pPattern = static_cast<const ScPatternAttr*>(&rDoc.GetPool()->Put(*rAttrs.mpDefPattern));
rAttrs.maAttrs.push_back(aEntry);
// Check if the default pattern is 'General'.