summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-07 21:33:40 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-07 21:33:40 +0200
commitb07f066c87eebff6a2a5d27f7725aa2c27c2d962 (patch)
tree75514bcc6c73d0f46892c717f3d7a5dd168b9708
parentff41179619156a1ffaf6026489e68b06b7e0f46d (diff)
Introduce GetScrPos to ScGridWin.
The ViewData version still uses old scaling and is therefore problematic. Change-Id: I42d904251d8bbe1804fd099306d54045c9cf0c92
-rw-r--r--sc/source/ui/inc/gridwin.hxx11
-rw-r--r--sc/source/ui/view/gridwin.cxx156
-rw-r--r--sc/source/ui/view/gridwin2.cxx8
-rw-r--r--sc/source/ui/view/gridwin3.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx81
5 files changed, 188 insertions, 70 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index dfb9b84c5f85..e0bff214b890 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -203,6 +203,8 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe
bool bAutoMarkVisible:1;
bool bListValButton:1;
+ MapMode aPaintMapMode;
+
DECL_LINK( PopupModeEndHdl, void* );
DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* );
@@ -304,6 +306,15 @@ protected:
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
+private:
+ void getCellGeometry( Point& rScrPos, Size& rScrSize,
+ SCCOL nCol, SCROW nRow ) const;
+ Point GetScrPos( SCCOL nWhereX, SCROW nWhereY,
+ bool bAllowNeg = false ) const;
+ void DrawScenarioFrames( OutputDevice* pContentDev,
+ SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
+ void UpdatePaintMapMode();
+
public:
enum AutoFilterMode { Normal, Top10, Custom, Empty, NonEmpty, SortAscending, SortDescending };
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index bf777ae03a20..1578e308ecce 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -686,7 +686,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
std::auto_ptr<AutoFilterData> pData(new AutoFilterData);
pData->maPos = ScAddress(nCol, nRow, nTab);
- Point aPos = pViewData->GetScrPos(nCol, nRow, eWhich);
+ Point aPos = GetScrPos( nCol, nRow );
long nSizeX = 0;
long nSizeY = 0;
pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
@@ -892,12 +892,10 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode)
pDBData->SetQueryParam(aParam);
}
-namespace {
-
-void getCellGeometry(Point& rScrPos, Size& rScrSize, const ScViewData* pViewData, SCCOL nCol, SCROW nRow, ScSplitPos eWhich)
+void ScGridWindow::getCellGeometry( Point& rScrPos, Size& rScrSize, SCCOL nCol, SCROW nRow ) const
{
// Get the screen position of the cell.
- rScrPos = pViewData->GetScrPos(nCol, nRow, eWhich);
+ rScrPos = GetScrPos(nCol, nRow );
// Get the screen size of the cell.
long nSizeX, nSizeY;
@@ -905,8 +903,6 @@ void getCellGeometry(Point& rScrPos, Size& rScrSize, const ScViewData* pViewData
rScrSize = Size(nSizeX-1, nSizeY-1);
}
-}
-
void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow )
{
if (nCol == 0)
@@ -920,7 +916,7 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow )
Point aScrPos;
Size aScrSize;
- getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich);
+ getCellGeometry(aScrPos, aScrSize, nCol, nRow);
DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj);
}
@@ -933,7 +929,7 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow )
Point aScrPos;
Size aScrSize;
- getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich);
+ getCellGeometry(aScrPos, aScrSize, nCol, nRow);
DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj);
}
@@ -961,7 +957,7 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
// The button height should not use the merged cell height, should still use single row height
nSizeY = ScViewData::ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY());
- Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich );
+ Point aPos = GetScrPos( nCol, nRow );
if ( bLayoutRTL )
aPos.X() -= nSizeX;
Rectangle aCellRect( OutputToScreenPixel(aPos), Size(nSizeX,nSizeY) );
@@ -1082,7 +1078,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
long nSizeY = 0;
long nHeight = 0;
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
- Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich );
+ Point aPos = GetScrPos( nCol, nRow );
if ( bLayoutRTL )
aPos.X() -= nSizeX;
@@ -1596,8 +1592,8 @@ bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
pDoc->GetEmbedded( aRange );
if ( pViewData->GetTabNo() == aRange.aStart.Tab() )
{
- Point aStartPos = pViewData->GetScrPos( aRange.aStart.Col(), aRange.aStart.Row(), eWhich );
- Point aEndPos = pViewData->GetScrPos( aRange.aEnd.Col()+1, aRange.aEnd.Row()+1, eWhich );
+ Point aStartPos = GetScrPos( aRange.aStart.Col(), aRange.aStart.Row() );
+ Point aEndPos = GetScrPos( aRange.aEnd.Col()+1, aRange.aEnd.Row()+1 );
Point aMousePos = rMEvt.GetPosPixel();
if ( bLayoutRTL )
{
@@ -3083,7 +3079,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
SCCOL nCurX = pViewData->GetCurX();
SCROW nCurY = pViewData->GetCurY();
- aMenuPos = pViewData->GetScrPos( nCurX, nCurY, eWhich, true );
+ aMenuPos = GetScrPos( nCurX, nCurY, eWhich );
long nSizeXPix;
long nSizeYPix;
pViewData->GetMergeSizePixel( nCurX, nCurY, nSizeXPix, nSizeYPix );
@@ -4636,12 +4632,12 @@ void ScGridWindow::UpdateFormulas()
rDoc.ExtendHidden( nX1, nY1, nX2, nY2, nTab );
- Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
+ Point aScrPos = GetScrPos( nX1, nY1 );
long nMirrorWidth = GetSizePixel().Width();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
if ( bLayoutRTL )
{
- long nEndPixel = pViewData->GetScrPos( nX2+1, nPosY, eWhich ).X();
+ long nEndPixel = GetScrPos( nX2+1, nPosY ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.X() = nEndPixel + 1;
}
@@ -4778,7 +4774,7 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, RfCorner& rCorner,
// zusammengefasste (einzeln/Bereich) ???
ScAddress aAddr( nPosX, nPosY, nTab );
- Point aCellStart = pViewData->GetScrPos( nPosX, nPosY, eWhich, true );
+ Point aCellStart = GetScrPos( nPosX, nPosY, eWhich );
Point aCellEnd = aCellStart;
long nSizeXPix;
long nSizeYPix;
@@ -5426,13 +5422,13 @@ bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRang
Point aButtonPos;
if ( bTextBelow )
{
- aButtonPos = pViewData->GetScrPos( aRange.aEnd.Col()+1, aRange.aEnd.Row()+1,
- eWhich, true );
+ aButtonPos = GetScrPos( aRange.aEnd.Col()+1, aRange.aEnd.Row()+1,
+ true );
}
else
{
- aButtonPos = pViewData->GetScrPos( aRange.aEnd.Col()+1, aRange.aStart.Row(),
- eWhich, true );
+ aButtonPos = GetScrPos( aRange.aEnd.Col()+1, aRange.aStart.Row(),
+ true );
aButtonPos.Y() -= nBHeight;
}
if ( bLayoutRTL )
@@ -5732,8 +5728,8 @@ void ScGridWindow::UpdateCopySourceOverlay()
SCCOL nClipEndX = p->aEnd.Col();
SCROW nClipEndY = p->aEnd.Row();
- Point aClipStartScrPos = pViewData->GetScrPos( nClipStartX, nClipStartY, eWhich );
- Point aClipEndScrPos = pViewData->GetScrPos( nClipEndX + 1, nClipEndY + 1, eWhich );
+ Point aClipStartScrPos = GetScrPos( nClipStartX, nClipStartY);
+ Point aClipEndScrPos = GetScrPos( nClipEndX + 1, nClipEndY + 1 );
aClipStartScrPos -= Point(1, 1);
long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X();
long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y();
@@ -5800,7 +5796,7 @@ void ScGridWindow::UpdateCursorOverlay()
if ( bVis && !bOverlapped && !pViewData->HasEditView(eWhich) && pViewData->IsActive() )
{
- Point aScrPos = pViewData->GetScrPos( nX, nY, eWhich, true );
+ Point aScrPos = GetScrPos( nX, nY, true );
bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
// completely right of/below the screen?
@@ -5958,7 +5954,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
ScDocument* pDoc = pViewData->GetDocument();
bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
- Point aFillPos = pViewData->GetScrPos( nX, nY, eWhich, true );
+ Point aFillPos = GetScrPos( nX, nY, true );
long nSizeXPix;
long nSizeYPix;
pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
@@ -6037,7 +6033,7 @@ void ScGridWindow::UpdateDragRectOverlay()
if (nY1 < nPosY) nY1 = nPosY;
if (nY2 < nPosY) nY2 = nPosY;
- Point aScrPos( pViewData->GetScrPos( nX1, nY1, eWhich ) );
+ Point aScrPos( GetScrPos( nX1, nY1 ) );
long nSizeXPix=0;
long nSizeYPix=0;
@@ -6203,10 +6199,10 @@ void ScGridWindow::UpdateShrinkOverlay()
if ( aRange.aStart.Col() <= aRange.aEnd.Col() &&
aRange.aStart.Row() <= aRange.aEnd.Row() )
{
- Point aStart = pViewData->GetScrPos( aRange.aStart.Col(),
- aRange.aStart.Row(), eWhich );
- Point aEnd = pViewData->GetScrPos( aRange.aEnd.Col()+1,
- aRange.aEnd.Row()+1, eWhich );
+ Point aStart = GetScrPos( aRange.aStart.Col(),
+ aRange.aStart.Row() );
+ Point aEnd = GetScrPos( aRange.aEnd.Col()+1,
+ aRange.aEnd.Row()+1 );
aEnd.X() -= 1;
aEnd.Y() -= 1;
@@ -6282,4 +6278,104 @@ void ScGridWindow::SetInRefMode( bool bInRefMode )
SetStyle( nBits );
}
+Point ScGridWindow::GetScrPos( SCCOL nWhereX, SCROW nWhereY, bool bAllowNeg ) const
+{
+ ScHSplitPos eWhichX = SC_SPLIT_LEFT;
+ ScVSplitPos eWhichY = SC_SPLIT_BOTTOM;
+ switch( eWhich )
+ {
+ case SC_SPLIT_TOPLEFT:
+ eWhichX = SC_SPLIT_LEFT;
+ eWhichY = SC_SPLIT_TOP;
+ break;
+ case SC_SPLIT_TOPRIGHT:
+ eWhichX = SC_SPLIT_RIGHT;
+ eWhichY = SC_SPLIT_TOP;
+ break;
+ case SC_SPLIT_BOTTOMLEFT:
+ eWhichX = SC_SPLIT_LEFT;
+ eWhichY = SC_SPLIT_BOTTOM;
+ break;
+ case SC_SPLIT_BOTTOMRIGHT:
+ eWhichX = SC_SPLIT_RIGHT;
+ eWhichY = SC_SPLIT_BOTTOM;
+ break;
+ }
+
+ ScDocument* pDoc = pViewData->GetDocument();
+
+ Size aScrSize = PixelToLogic( GetSizePixel() );
+
+ sal_uInt16 nTSize;
+
+ SCCOL nPosX = pViewData->GetPosX(eWhichX);
+ SCCOL nX;
+
+ SCTAB nTab = pViewData->GetTabNo();
+
+ long nScrPosX=0;
+ if (nWhereX >= nPosX)
+ for (nX=nPosX; nX<nWhereX && (bAllowNeg || nScrPosX<=aScrSize.Width()); nX++)
+ {
+ if ( nX > MAXCOL )
+ nScrPosX = 65535;
+ else
+ {
+ nTSize = pDoc->GetColWidth( nX, nTab );
+ nScrPosX += nTSize;
+ }
+ }
+ else if (bAllowNeg)
+ for (nX=nPosX; nX>nWhereX;)
+ {
+ --nX;
+ nTSize = pDoc->GetColWidth( nX, nTab );
+ nScrPosX -= nTSize;
+ }
+
+ SCROW nPosY = pViewData->GetPosY(eWhichY);
+ SCROW nY;
+
+ long nScrPosY=0;
+ if (nWhereY >= nPosY)
+ for (nY=nPosY; nY<nWhereY && (bAllowNeg || nScrPosY<=aScrSize.Height()); nY++)
+ {
+ if ( nY > MAXROW )
+ nScrPosY = 65535;
+ else
+ {
+ nTSize = pDoc->GetRowHeight( nY, nTab );
+ if (nTSize)
+ {
+ nScrPosY += nTSize;
+ }
+ else if ( nY < MAXROW )
+ {
+ // skip multiple hidden rows (forward only for now)
+ SCROW nNext = pDoc->FirstVisibleRow(nY + 1, MAXROW, nTab );
+ if ( nNext > MAXROW )
+ nY = MAXROW;
+ else
+ nY = nNext - 1; // +=nDir advances to next visible row
+ }
+ }
+ }
+ else if (bAllowNeg)
+ for (nY=nPosY; nY>nWhereY;)
+ {
+ --nY;
+ nTSize = pDoc->GetRowHeight( nY, nTab );
+ nScrPosY -= nTSize;
+ }
+
+ if ( pDoc->IsLayoutRTL( nTab ) )
+ {
+ // mirror horizontal position
+ nScrPosX = aScrSize.Width() - 1 - nScrPosX;
+ }
+
+ return LogicToPixel( Point( nScrPosX, nScrPosY ), aPaintMapMode );
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 6578bd62963d..1d7c7e31df4f 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -114,7 +114,7 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent&
{
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
- Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich);
+ Point aScrPos = GetScrPos(nCol, nRow );
Point aDiffPix = rMEvt.GetPosPixel();
aDiffPix -= aScrPos;
@@ -354,7 +354,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
// Get the geometry of the cell.
- Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich);
+ Point aScrPos = GetScrPos(rPos.Col(), rPos.Row() );
long nSizeX, nSizeY;
pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeX, nSizeY);
Size aScrSize(nSizeX-1, nSizeY-1);
@@ -669,8 +669,8 @@ sal_uInt16 ScGridWindow::HitPageBreak( const Point& rMouse, ScRange* pSource,
SCsCOL nPosX;
SCsROW nPosY;
pViewData->GetPosFromPixel( nMouseX, nMouseY, eWhich, nPosX, nPosY );
- Point aTL = pViewData->GetScrPos( nPosX, nPosY, eWhich );
- Point aBR = pViewData->GetScrPos( nPosX+1, nPosY+1, eWhich );
+ Point aTL = GetScrPos( nPosX, nPosY );
+ Point aBR = GetScrPos( nPosX+1, nPosY+1 );
// Horizontal mehr Toleranz als vertikal, weil mehr Platz ist
if ( nMouseX <= aTL.X() + 4 )
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index e9ac6ca2054a..9f5d0bbda6f0 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -300,7 +300,7 @@ void ScGridWindow::CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddres
if(rOpts.GetOption( VOPT_ANCHOR ))
{
bool bNegativePage = pViewData->GetDocument()->IsNegativePage( pViewData->GetTabNo() );
- Point aPos = pViewData->GetScrPos( rAddress.Col(), rAddress.Row(), eWhich, true );
+ Point aPos = GetScrPos( rAddress.Col(), rAddress.Row(), true );
aPos = PixelToLogic(aPos);
rHdl.AddHdl(new SdrHdl(aPos, bNegativePage ? HDL_ANCHOR_TR : HDL_ANCHOR));
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 60a6f471d092..3128f1ef2ac9 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -178,8 +178,7 @@ static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel,
pDev->DrawRect( aOuter );
}
-static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, ScSplitPos eWhich,
- SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 )
+void ScGridWindow::DrawScenarioFrames( OutputDevice* pContentDev, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 )
{
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
@@ -216,10 +215,10 @@ static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, S
if ( aRange.Intersects( aViewRange ) ) //! Platz fuer Text/Button?
{
- Point aStartPos = pViewData->GetScrPos(
- aRange.aStart.Col(), aRange.aStart.Row(), eWhich, true );
- Point aEndPos = pViewData->GetScrPos(
- aRange.aEnd.Col()+1, aRange.aEnd.Row()+1, eWhich, true );
+ Point aStartPos = GetScrPos(
+ aRange.aStart.Col(), aRange.aStart.Row(), true );
+ Point aEndPos = GetScrPos(
+ aRange.aEnd.Col()+1, aRange.aEnd.Row()+1, true );
// on the grid:
aStartPos.X() -= nLayoutSign;
aStartPos.Y() -= 1;
@@ -244,7 +243,7 @@ static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, S
//! eigener Text "(keins)" statt "(leer)" ???
- lcl_DrawOneFrame( pDev, Rectangle( aStartPos, aEndPos ),
+ lcl_DrawOneFrame( pContentDev, Rectangle( aStartPos, aEndPos ),
aCurrent, aColor, bTextBelow,
pViewData->GetPPTX(), pViewData->GetPPTY(), pViewData->GetZoomY(),
pDoc, pViewData, bLayoutRTL );
@@ -301,14 +300,26 @@ void ScGridWindow::PrePaint()
}
}
+void ScGridWindow::UpdatePaintMapMode()
+{
+ aPaintMapMode = GetMapMode();
+ aPaintMapMode.SetMapUnit( MAP_TWIP );
+ aPaintMapMode.SetScaleX( pViewData->GetZoomX() * Fraction(0.96) );
+ aPaintMapMode.SetScaleY( pViewData->GetZoomY() * Fraction(0.96) );
+}
+
void ScGridWindow::Paint( const Rectangle& rRect )
{
- MapMode aMapMode( GetMapMode() );
- aMapMode.SetMapUnit( MAP_TWIP );
- aMapMode.SetScaleX( pViewData->GetZoomX() * Fraction(0.96) );
- aMapMode.SetScaleY( pViewData->GetZoomY() * Fraction(0.96) );
- SetMapMode( aMapMode );
+ const MapMode aOriginalMapMode = GetMapMode();
+ UpdatePaintMapMode();
+ SetMapMode( aPaintMapMode );
Paint( rRect, this );
+ // All other functions except for Paint(Rectangle, OutputDevice)
+ // work in pixel coordinates, hence it is simplest to only set
+ // our logic-coordinate mapping only for actual painting, and
+ // reset it for all other uses.
+ SetMapMode( aOriginalMapMode );
+ EnableMapMode( false );
}
void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev )
@@ -501,13 +512,13 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
rDoc.ExtendHidden( nX1, nY1, nX2, nY2, nTab );
- Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
+ Point aScrPos = GetScrPos( nX1, nY1 );
long nMirrorWidth = GetSizePixel().Width();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( bLayoutRTL )
{
- long nEndPixel = pViewData->GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X();
+ long nEndPixel = GetScrPos( nX2+1, maVisibleRange.mnRow1 ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.X() = nEndPixel + 1;
}
@@ -825,7 +836,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.DrawChangeTrack();
if ( bHasScenario )
- lcl_DrawScenarioFrames( pContentDev, pViewData, eWhich, nX1,nY1,nX2,nY2 );
+ DrawScenarioFrames( pContentDev, nX1,nY1,nX2,nY2 );
lcl_DrawHighlight( aOutputData, pViewData, rHigh );
@@ -918,8 +929,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SCROW nRow2 = pViewData->GetEditEndRow();
SetLineColor();
SetFillColor( pEditView->GetBackgroundColor() );
- Point aStart = pViewData->GetScrPos( nCol1, nRow1, eWhich );
- Point aEnd = pViewData->GetScrPos( nCol2+1, nRow2+1, eWhich );
+ Point aStart = GetScrPos( nCol1, nRow1 );
+ Point aEnd = GetScrPos( nCol2+1, nRow2+1 );
aEnd.X() -= 2 * nLayoutSign; // don't overwrite grid
aEnd.Y() -= 2;
DrawRect( Rectangle( aStart,aEnd ) );
@@ -1077,10 +1088,10 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
else
pContentDev->SetFillColor( aManual );
- Point aStart = pViewData->GetScrPos(
- aRange.aStart.Col(), aRange.aStart.Row(), eWhich, true );
- Point aEnd = pViewData->GetScrPos(
- aRange.aEnd.Col() + 1, aRange.aEnd.Row() + 1, eWhich, true );
+ Point aStart = GetScrPos(
+ aRange.aStart.Col(), aRange.aStart.Row(), true );
+ Point aEnd = GetScrPos(
+ aRange.aEnd.Col() + 1, aRange.aEnd.Row() + 1, true );
aStart.X() -= 2;
aStart.Y() -= 2;
@@ -1113,8 +1124,8 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pContentDev->SetFillColor( aManual );
else
pContentDev->SetFillColor( aAutomatic );
- Point aBreak = pViewData->GetScrPos(
- nBreak, aRange.aStart.Row(), eWhich, true );
+ Point aBreak = GetScrPos(
+ nBreak, aRange.aStart.Row(), true );
pContentDev->DrawRect( Rectangle( aBreak.X()-1, aStart.Y(), aBreak.X(), aEnd.Y() ) );
}
}
@@ -1132,8 +1143,8 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pContentDev->SetFillColor( aManual );
else
pContentDev->SetFillColor( aAutomatic );
- Point aBreak = pViewData->GetScrPos(
- aRange.aStart.Col(), nBreak, eWhich, true );
+ Point aBreak = GetScrPos(
+ aRange.aStart.Col(), nBreak, true );
pContentDev->DrawRect( Rectangle( aStart.X(), aBreak.Y()-1, aEnd.X(), aBreak.Y() ) );
}
}
@@ -1152,10 +1163,10 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
SCCOL nPrEndX = pColEnd[nColPos];
if ( nPrEndX >= nX1 && nPrStartX <= nX2 )
{
- Point aPageStart = pViewData->GetScrPos(
- nPrStartX, nPrStartY, eWhich, true );
- Point aPageEnd = pViewData->GetScrPos(
- nPrEndX+1,nPrEndY+1, eWhich, true );
+ Point aPageStart = GetScrPos(
+ nPrStartX, nPrStartY, true );
+ Point aPageEnd = GetScrPos(
+ nPrEndX+1,nPrEndY+1, true );
long nPageNo = rData.GetFirstPage();
if ( rData.IsTopDown() )
@@ -1315,7 +1326,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
pDoc->ExtendOverlapped(nStartCol, nStartRow,nCol, nRow, nTab);//get nStartCol,nStartRow
pViewData->GetMergeSizePixel( nStartCol, nStartRow, nSizeX, nSizeY );//get nSizeX
nSizeY = ScViewData::ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY());
- Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
+ Point aScrPos = GetScrPos( nCol, nRow );
aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL);
aCellBtn.setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
@@ -1337,7 +1348,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
if (pInfo->bHOverlapped || pInfo->bVOverlapped)
continue;
- Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
+ Point aScrPos = GetScrPos( nCol, nRow );
long nSizeX;
long nSizeY;
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
@@ -1410,7 +1421,7 @@ Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos )
if ( nCellSizeY < aBtnSize.Height() )
aBtnSize.Height() = nCellSizeY;
- Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich, true );
+ Point aPos = GetScrPos( nCol, nRow, true );
aPos.X() += nCellSizeX * nLayoutSign; // start of next cell
if (!bNextCell)
aPos.X() -= aBtnSize.Width() * nLayoutSign; // right edge of cell if next cell not available
@@ -1515,7 +1526,7 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
ScInvertMerger aInvert( &rPixelRects );
- Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
+ Point aScrPos = GetScrPos( nX1, nY1 );
long nScrY = aScrPos.Y();
bool bWasHidden = false;
for (SCROW nY=nY1; nY<=nY2; nY++)
@@ -1600,9 +1611,9 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
ScMergeAttr* pMerge = (ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE);
if (pMerge->GetColMerge() > 0 || pMerge->GetRowMerge() > 0)
{
- Point aEndPos = pViewData->GetScrPos(
+ Point aEndPos = GetScrPos(
nThisX + pMerge->GetColMerge(),
- nThisY + pMerge->GetRowMerge(), eWhich );
+ nThisY + pMerge->GetRowMerge() );
if ( aEndPos.X() * nLayoutSign > nScrX * nLayoutSign && aEndPos.Y() > nScrY )
{
aInvert.AddRect( Rectangle( nScrX,nScrY,