Kaydet (Commit) a812c875 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Miklos Vajna

sc tiled rendering: Make the drawings and charts work.

Change-Id: Ibd7e9e398fe24ec2b3553c8488b46b65de316da6
üst 6cf7e174
...@@ -375,6 +375,7 @@ public: ...@@ -375,6 +375,7 @@ public:
bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard ); bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard );
void HideNoteMarker(); void HideNoteMarker();
/// MapMode for the drawinglayer objects.
MapMode GetDrawMapMode( bool bForce = false ); MapMode GetDrawMapMode( bool bForce = false );
void ContinueDrag(); void ContinueDrag();
......
...@@ -60,6 +60,7 @@ class ScFieldEditEngine; ...@@ -60,6 +60,7 @@ class ScFieldEditEngine;
class ScOutputData class ScOutputData
{ {
friend class ScDrawStringsVars; friend class ScDrawStringsVars;
friend class ScGridWindow;
private: private:
struct OutputAreaParam struct OutputAreaParam
{ {
...@@ -147,7 +148,6 @@ private: ...@@ -147,7 +148,6 @@ private:
RowInfo* pRowInfo; // Info block RowInfo* pRowInfo; // Info block
SCSIZE nArrCount; // occupied lines in info block SCSIZE nArrCount; // occupied lines in info block
ScDocument* mpDoc; // Document ScDocument* mpDoc; // Document
public:
SCTAB nTab; // sheet SCTAB nTab; // sheet
long nScrX; // Output Startpos. (Pixel) long nScrX; // Output Startpos. (Pixel)
long nScrY; long nScrY;
...@@ -158,7 +158,6 @@ public: ...@@ -158,7 +158,6 @@ public:
SCROW nY1; // ( incl. hidden ) SCROW nY1; // ( incl. hidden )
SCCOL nX2; SCCOL nX2;
SCROW nY2; SCROW nY2;
private:
SCCOL nVisX1; // Start-/End coordinates SCCOL nVisX1; // Start-/End coordinates
SCROW nVisY1; // ( visible range ) SCROW nVisY1; // ( visible range )
SCCOL nVisX2; SCCOL nVisX2;
......
...@@ -531,6 +531,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI ...@@ -531,6 +531,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
ScDocShell* pDocSh = pViewData->GetDocShell(); ScDocShell* pDocSh = pViewData->GetDocShell();
ScDocument& rDoc = pDocSh->GetDocument(); ScDocument& rDoc = pDocSh->GetDocument();
const ScViewOptions& rOpts = pViewData->GetOptions(); const ScViewOptions& rOpts = pViewData->GetOptions();
bool bIsTiledRendering = rDoc.GetDrawLayer()->isTiledRendering();
SCTAB nTab = aOutputData.nTab; SCTAB nTab = aOutputData.nTab;
SCCOL nX1 = aOutputData.nX1; SCCOL nX1 = aOutputData.nX1;
...@@ -595,7 +596,15 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI ...@@ -595,7 +596,15 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
} }
// define drawing layer map mode and paint rectangle // define drawing layer map mode and paint rectangle
const MapMode aDrawMode = GetDrawMapMode(); MapMode aDrawMode = GetDrawMapMode();
if (bIsTiledRendering)
{
// FIXME this shouldn't be necessary once we change this to work in the
// logic coordinates instead of in pixels (and get rid of all the
// SetMapMode()'s)
aDrawMode = pViewData->GetLogicMode(eWhich);
aDrawMode.SetOrigin(PixelToLogic(Point(nScrX, nScrY), aDrawMode));
}
Rectangle aDrawingRectLogic; Rectangle aDrawingRectLogic;
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab ); bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
...@@ -628,7 +637,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI ...@@ -628,7 +637,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
OutputDevice* pContentDev = &rDevice; // device for document content, used by overlay manager OutputDevice* pContentDev = &rDevice; // device for document content, used by overlay manager
SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly
bool bIsTiledRendering = rDoc.GetDrawLayer()->isTiledRendering();
if (!bIsTiledRendering) if (!bIsTiledRendering)
{ {
...@@ -894,10 +902,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI ...@@ -894,10 +902,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
flushOverlayManager(); flushOverlayManager();
// set MapMode for text edit // set MapMode for text edit
SetMapMode(pViewData->GetLogicMode()); rDevice.SetMapMode(pViewData->GetLogicMode());
} }
else else
SetMapMode(aDrawMode); rDevice.SetMapMode(aDrawMode);
if ( pNoteMarker ) if ( pNoteMarker )
pNoteMarker->Draw(); // ueber den Cursor, im Drawing-MapMode pNoteMarker->Draw(); // ueber den Cursor, im Drawing-MapMode
...@@ -917,6 +925,10 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, ...@@ -917,6 +925,10 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
// dependent of the zoom level. Determine the correct zoom level before // dependent of the zoom level. Determine the correct zoom level before
// we start. // we start.
// FIXME the painting works using a mixture of drawing with coordinates in
// pixels and in logic coordinates; it should be cleaned up to use logic
// coords only.
// TODO : zooming isn't perfect. Find out why. // TODO : zooming isn't perfect. Find out why.
double nOutWTwips = static_cast<double>(nOutputWidth) / PIXEL_PER_TWIPS; double nOutWTwips = static_cast<double>(nOutputWidth) / PIXEL_PER_TWIPS;
double nOutHTwips = static_cast<double>(nOutputHeight) / PIXEL_PER_TWIPS; double nOutHTwips = static_cast<double>(nOutputHeight) / PIXEL_PER_TWIPS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment