summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-10 22:33:22 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-08-27 17:39:15 +0200
commit45c801f06e10e8a61c135acbedd962f1631db4f4 (patch)
tree89f8b1488f9ea219524dbba71447e854ba22ecd1
parent7b6122e4f38ac23fc76890f6ead982d5a6b8c5f9 (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 e1db5955554e..10a1ce44df2b 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -228,22 +228,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)
@@ -252,9 +263,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)