summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-10 22:33:22 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-11 15:28:38 +0100
commitecc72fdb53f714e28dfeaf4c711bba4d823ef4c4 (patch)
treee9bb2a7fa7dc337deeef91590c56d95f08817201
parentfd0752545e06936bc26b85d4a91c84b11c31e4ae (diff)
correct import for row height and col width
Change-Id: Id26ae200b3262769e66528e1d00639471e72c0d7
-rw-r--r--sc/source/filter/orcus/interface.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 69b09c20fdb7..253b2abc1698 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -229,22 +229,33 @@ double translateToInternal(double nVal, orcus::length_unit_t unit)
switch(unit)
{
case orcus::length_unit_inch:
+ return nVal * 72.0 * 20.0;
+ break;
case orcus::length_unit_twip:
+ return nVal;
+ break;
case orcus::length_unit_point:
+ return nVal * 20.0;
+ break;
case orcus::length_unit_centimeter:
+ return nVal * 20.0 * 72.0 / 2.54;
+ break;
case orcus::length_unit_unknown:
+ SAL_WARN("sc,orcus", "unknown unit");
+ break;
default:
break;
}
- return 0;
+ return nVal;
}
}
-void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t /*unit*/)
+void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t unit)
{
- mrDoc.getDoc().SetColWidthOnly(col, mnTab, width);
+ double nNewWidth = translateToInternal(width, unit);
+ mrDoc.getDoc().SetColWidthOnly(col, mnTab, nNewWidth);
}
void ScOrcusSheetProperties::set_column_hidden(os::col_t col, bool hidden)
@@ -253,9 +264,10 @@ void ScOrcusSheetProperties::set_column_hidden(os::col_t col, bool hidden)
mrDoc.getDoc().SetColHidden(col, col, mnTab, hidden);
}
-void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t /*unit*/)
+void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t unit)
{
- mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, height);
+ double nNewHeight = translateToInternal(height, unit);
+ mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, nNewHeight);
}
void ScOrcusSheetProperties::set_row_hidden(os::row_t row, bool hidden)