summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/document.hxx1
-rw-r--r--sc/source/core/data/document10.cxx9
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx1
3 files changed, 11 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index bd6db82a7d00..48dbe6c04e69 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2454,6 +2454,7 @@ public:
void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rTopPos, SCROW nLength );
std::unique_ptr<sc::ColumnIterator> GetColumnIterator( SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const;
+ void CreateColumnIfNotExists( SCTAB nTab, SCCOL nCol );
SC_DLLPUBLIC void StoreTabToCache(SCTAB nTab, SvStream& rStrm) const;
SC_DLLPUBLIC void RestoreTabFromCache(SCTAB nTab, SvStream& rStream);
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index c286ecba4c98..429fc33074fb 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -916,6 +916,15 @@ std::unique_ptr<sc::ColumnIterator> ScDocument::GetColumnIterator( SCTAB nTab, S
return pTab->GetColumnIterator(nCol, nRow1, nRow2);
}
+void ScDocument::CreateColumnIfNotExists( SCTAB nTab, SCCOL nCol )
+{
+ const ScTable* pTab = FetchTable(nTab);
+ if (!pTab)
+ return;
+
+ pTab->CreateColumnIfNotExists(nCol);
+}
+
bool ScDocument::EnsureFormulaCellResults( const ScRange& rRange, bool bSkipRunning )
{
bool bAnyDirty = false;
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 6b2fb2e4a2a4..9cc648340a3c 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -455,6 +455,7 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable,
return ;
SCTAB nTab = static_cast<SCTAB>(nTable);
+ pDoc->CreateColumnIfNotExists(nTab, nLastCol);
sal_Int32 nPos;
ScMyDefaultStyleList* pDefaults = &maColDefaults;
bool bPrevAutoStyle(false);