summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-27 14:29:07 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-29 06:30:51 +0100
commit713d6b45bb3141db12777b5bc068a9a7719ae458 (patch)
tree12c0996a43feee7861d247db4282e6ab03ddda49
parent503f504dc53d9d488e60920877405cc8264bfabd (diff)
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.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index e5608552ec0c..ad616541b1cd 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