diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-08-27 14:29:07 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-01-12 12:29:29 +0900 |
commit | 8ddada7c71e300bdbf6f97a81fa3c9388215d3c9 (patch) | |
tree | 371ea57b63292887baef150f82f14dec48eeeecf | |
parent | Match TiledRendering scaling to the new ViewData PaintMapMode. (diff) | |
download | core-8ddada7c71e300bdbf6f97a81fa3c9388215d3c9.tar.gz core-8ddada7c71e300bdbf6f97a81fa3c9388215d3c9.zip |
Use GetScrPos so that col/row-headers match the grid.
Without this we can still get single pixel errors which can sum
up over multiple columns/row.
Change-Id: Id428dafab1ca771c123c84d815261263a7d33fed
-rw-r--r-- | sc/source/ui/view/colrowba.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index d56a18a8a1ea..846c07340b0a 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -81,9 +81,18 @@ sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo ) const ScDocument* pDoc = pViewData->GetDocument(); SCTAB nTab = pViewData->GetTabNo(); if (pDoc->ColHidden(static_cast<SCCOL>(nEntryNo), nTab)) + { return 0; + } else - return (sal_uInt16) ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(nEntryNo), nTab ), pViewData->GetPPTX() ); + { + Point aBefore = pViewData->GetScrPos( nEntryNo, 0, SC_SPLIT_BOTTOMLEFT ); + Point aAfter = pViewData->GetScrPos( nEntryNo + 1, 0, SC_SPLIT_BOTTOMLEFT ); + + bool bLayoutRTL = IsLayoutRTL(); + long nLayoutSign = bLayoutRTL ? -1 : 1; + return ( aAfter.getX() - aBefore.getX() ) * nLayoutSign; + } } OUString ScColBar::GetEntryText( SCCOLROW nEntryNo ) const @@ -236,10 +245,16 @@ sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo ) const SCTAB nTab = pViewData->GetTabNo(); SCROW nLastRow = -1; if (pDoc->RowHidden(nEntryNo, nTab, NULL, &nLastRow)) + { return 0; + } else - return (sal_uInt16) ScViewData::ToPixel( pDoc->GetOriginalHeight( nEntryNo, - nTab ), pViewData->GetPPTY() ); + { + Point aBefore = pViewData->GetScrPos( 0, nEntryNo, SC_SPLIT_BOTTOMLEFT ); + Point aAfter = pViewData->GetScrPos( 0, nEntryNo + 1, SC_SPLIT_BOTTOMLEFT ); + + return aAfter.getY() - aBefore.getY(); + } } OUString ScRowBar::GetEntryText( SCCOLROW nEntryNo ) const |