summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-02 15:18:09 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-02 15:18:34 +0100
commit861b28b88909ec39fc83fccc0ab23d288128aa0e (patch)
tree352a84c4144892f0cd07cbee7f00d172ce4906ae /sc
parentgtktiledviewer: show zoom in the status bar (diff)
downloadcore-861b28b88909ec39fc83fccc0ab23d288128aa0e.tar.gz
core-861b28b88909ec39fc83fccc0ab23d288128aa0e.zip
sc lok: fix rounding errors with non-100% zoom
There were two problems here: 1) ScTabView::getRowColumnHeaders() did not expose twip values directly, but used ScRow/ColBar::GetEntrySize(), which does a twip -> pixel conversion, and then converted it back to twip. Avoid this unnecessary roundtrip. 2) ScViewData::ToPixel() trunaces the resulting float to an integer, so if the result is e.g. 67.7 pixels, then Calc handled that as 67, but gtktiledviewer rounded that up to 68, resulting in non-matching headers for the rendered tiles. Change-Id: Ie6ed1ea923a423d1526eeb235b7b87106fd2f20b
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabview.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 744ccb0ca9ba..d11133b3fd67 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2289,15 +2289,12 @@ OUString ScTabView::getRowColumnHeaders()
SCROW nEndRow = 0;
pDoc->GetTiledRenderingArea(aViewData.GetTabNo(), nEndCol, nEndRow);
- double nPPTX = aViewData.GetPPTX();
- double nPPTY = aViewData.GetPPTY();
-
boost::property_tree::ptree aRows;
for (SCROW nRow = 0; nRow <= nEndRow; ++nRow)
{
boost::property_tree::ptree aRow;
- sal_uInt16 nSize = pRowBar[SC_SPLIT_BOTTOM]->GetEntrySize(nRow);
- aRow.put("size", OString::number(nSize / nPPTY).getStr());
+ sal_uInt16 nSize = pDoc->GetOriginalHeight(nRow, aViewData.GetTabNo());
+ aRow.put("size", OString::number(nSize).getStr());
OUString aText = pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow);
aRow.put("text", aText.toUtf8().getStr());
aRows.push_back(std::make_pair("", aRow));
@@ -2307,8 +2304,8 @@ OUString ScTabView::getRowColumnHeaders()
for (SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
{
boost::property_tree::ptree aCol;
- sal_uInt16 nSize = pColBar[SC_SPLIT_LEFT]->GetEntrySize(nCol);
- aCol.put("size", OString::number(nSize / nPPTX).getStr());
+ sal_uInt16 nSize = pDoc->GetColWidth(nCol, aViewData.GetTabNo());
+ aCol.put("size", OString::number(nSize).getStr());
OUString aText = pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol);
aCol.put("text", aText.toUtf8().getStr());
aCols.push_back(std::make_pair("", aCol));