[Libreoffice-commits] core.git: Branch 'private/kohei/excel-2003-xml-orcus-filter' - sc/inc sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Sat Dec 9 03:24:07 UTC 2017
sc/inc/documentimport.hxx | 2 ++
sc/source/core/data/documentimport.cxx | 19 +++++++++++++++++++
sc/source/filter/orcus/interface.cxx | 3 ++-
3 files changed, 23 insertions(+), 1 deletion(-)
New commits:
commit a502d07146590e3f629516e9b8374fb5a8ef828c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri Dec 8 22:21:58 2017 -0500
Handle merged cells.
Change-Id: Iaa7194d4226300e495982bb1f90f72c31d748955
diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx
index 03f415c381cc..b4c35e1f99b5 100644
--- a/sc/inc/documentimport.hxx
+++ b/sc/inc/documentimport.hxx
@@ -114,6 +114,8 @@ public:
void setRowsVisible(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible);
+ void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+
void finalize();
private:
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index c41e134558bf..ddfcf8b10a94 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -512,6 +512,25 @@ void ScDocumentImport::setRowsVisible(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd
}
}
+void ScDocumentImport::setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
+{
+ ScTable* pTab = mpImpl->mrDoc.FetchTable(nTab);
+ if (!pTab)
+ return;
+
+ ScMergeAttr aAttr(nCol2-nCol1+1, nRow2-nRow1+1);
+ pTab->ApplyAttr(nCol1, nRow1, aAttr);
+
+ if (nCol1 < nCol2)
+ pTab->ApplyFlags(nCol1+1, nRow1, nCol2, nRow2, ScMF::Hor);
+
+ if (nRow1 < nRow2)
+ pTab->ApplyFlags(nCol1, nRow1+1, nCol1, nRow2, ScMF::Ver);
+
+ if (nCol1 < nCol2 && nRow1 < nRow2)
+ pTab->ApplyFlags(nCol1+1, nRow1+1, nCol2, nRow2, ScMF::Hor | ScMF::Ver);
+}
+
namespace {
class CellStoreInitializer
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index d321954c7741..c31eb3720ff8 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -307,8 +307,9 @@ void ScOrcusSheetProperties::set_row_hidden(os::row_t row, bool hidden)
mrDoc.getDoc().SetRowHidden(row, row, mnTab, hidden);
}
-void ScOrcusSheetProperties::set_merge_cell_range(const orcus::spreadsheet::range_t& /*range*/)
+void ScOrcusSheetProperties::set_merge_cell_range(const orcus::spreadsheet::range_t& range)
{
+ mrDoc.setMergedCells(mnTab, range.first.column, range.first.row, range.last.column, range.last.row);
}
ScOrcusConditionalFormat::ScOrcusConditionalFormat(SCTAB nTab, ScDocument& rDoc):
More information about the Libreoffice-commits
mailing list