summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/gridwin.hxx3
-rw-r--r--sc/source/ui/view/gridwin4.cxx18
2 files changed, 14 insertions, 7 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index dede1497db5f..84fcf8a02e25 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -292,6 +292,7 @@ protected:
virtual void Resize( const Size& rSize );
virtual void PrePaint() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
+ virtual void Paint( const Rectangle& rRect, OutputDevice* pOutDev);
virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
@@ -361,7 +362,7 @@ public:
using Window::Draw;
void Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
ScUpdateMode eMode = SC_UPDATE_ALL,
- OutputDevice* pOutDev = 0 );
+ OutputDevice* pOutDev = 0);
void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress);
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index eafcdf1b807d..3db37cb3e8f8 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -301,6 +301,11 @@ void ScGridWindow::PrePaint()
void ScGridWindow::Paint( const Rectangle& rRect )
{
+ Paint( rRect, this );
+}
+
+void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev )
+{
ScDocument* pDoc = pViewData->GetDocument();
if ( pDoc->IsInInterpreter() )
{
@@ -330,7 +335,7 @@ void ScGridWindow::Paint( const Rectangle& rRect )
bIsInPaint = true;
- Rectangle aPixRect = LogicToPixel( rRect );
+ Rectangle aPixRect = pOutDev->LogicToPixel( rRect );
SCCOL nX1 = pViewData->GetPosX(eHWhich);
SCROW nY1 = pViewData->GetPosY(eVWhich);
@@ -371,8 +376,7 @@ void ScGridWindow::Paint( const Rectangle& rRect )
ScViewData::AddPixelsWhile( nScrY, aPixRect.Bottom(), nY2, MAXROW, nPPTY, pDoc, nTab);
}
- Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS ); // nicht weiterzeichnen
-
+ Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS, pOutDev ); // nicht weiterzeichnen
bIsInPaint = false;
}
@@ -588,7 +592,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
// get logic positions
- aDrawingRectLogic = PixelToLogic(aDrawingRectPixel, aDrawMode);
+ aDrawingRectLogic = pOutDev->PixelToLogic(aDrawingRectPixel, aDrawMode);
}
// device for document content, used by overlay manager
@@ -846,7 +850,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
DrawRect( Rectangle( aStart,aEnd ) );
SetMapMode(pViewData->GetLogicMode());
- pEditView->Paint( PixelToLogic( Rectangle( Point( nScrX, nScrY ),
+ pEditView->Paint( pOutDev->PixelToLogic( Rectangle( Point( nScrX, nScrY ),
Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) ) );
SetMapMode(MAP_PIXEL);
}
@@ -906,7 +910,9 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
pDrawView->AddWindowToPaintView( &rDevice );
}
- Draw( 0, 0, 3, 3, SC_UPDATE_ALL, &rDevice );
+ Paint( Rectangle( Point(nTilePosX, nTilePosY),
+ rDevice.PixelToLogic(Size(nOutputWidth, nOutputHeight))),
+ &rDevice );
if ( pDrawView )
{