Kaydet (Commit) c576d649 authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

Handle merged cells.

Change-Id: Iaa7194d4226300e495982bb1f90f72c31d748955
Reviewed-on: https://gerrit.libreoffice.org/46660Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst 7d4eeddd
......@@ -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:
......
......@@ -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
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment