diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-19 01:47:52 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-19 01:38:35 +0000 |
commit | 1be6c440c645e441af0e04ba7711e4b2d80aad63 (patch) | |
tree | f63925a92094465f5d75a34934f2e5ffa3c65d7a /sc | |
parent | a71576f1c5a2a76eaedca99c025d027b55ce8c90 (diff) |
use the column style for as default, tdf#71897
Change-Id: I583235c28957a203df843d65887b4ca05f2a81ae
Reviewed-on: https://gerrit.libreoffice.org/24230
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/stylesbuffer.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/sheetdatabuffer.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 7 |
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'. |