diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-06-23 10:29:48 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2015-06-23 14:30:37 +0000 |
commit | 9a809eedf7327f925cd6be56545b8ed300ef28f4 (patch) | |
tree | 27127b185096162438a20b490b82f16f217ebe50 /svx | |
parent | fead68bbf107ca9f2632bdaf1d8407921a0320f2 (diff) |
rendercontext: Mass fix of using the wrong size.
In the paints, we must use the size of the Window for the computations, not of
the RenderContext - the RenderContext can be much bigger than the Window in
the double-buffering case.
Fixes for example the list boxes, and many others.
Change-Id: I4c7607569f88b2d097587140858d0862e54b5ea6
Reviewed-on: https://gerrit.libreoffice.org/16421
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/charmap.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 8 | ||||
-rw-r--r-- | svx/source/dialog/paraprev.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/swframeexample.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/layctrl.cxx | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index c334d3f577fe..9d0c9a58c960 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -372,7 +372,7 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, if (n1 > LastInView() || n2 < FirstInView()) return; - Size aOutputSize = rRenderContext.GetOutputSizePixel(); + Size aOutputSize(GetOutputSizePixel()); if (aVscrollSB->IsVisible()) aOutputSize.Width() -= aVscrollSB->GetOptimalSize().Width(); @@ -528,7 +528,7 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) if (nSelectedIndex >= 0) getSelectedChar() = mpFontCharMap->GetCharFromIndex(nSelectedIndex); - Size aSize = rRenderContext.GetOutputSizePixel(); + Size aSize(GetOutputSizePixel()); long nSBWidth = aVscrollSB->GetOptimalSize().Width(); aSize.Width() -= nSBWidth; diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 4d6debd44b3d..ecad4ef3a368 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1830,12 +1830,12 @@ void SvxPreviewBase::dispose() void SvxPreviewBase::LocalPrePaint(vcl::RenderContext& rRenderContext) { // init BufferDevice - if(mpBufferDevice->GetOutputSizePixel() != rRenderContext.GetOutputSizePixel()) + if (mpBufferDevice->GetOutputSizePixel() != GetOutputSizePixel()) { mpBufferDevice->SetDrawMode(rRenderContext.GetDrawMode()); mpBufferDevice->SetSettings(rRenderContext.GetSettings()); mpBufferDevice->SetAntialiasing(rRenderContext.GetAntialiasing()); - mpBufferDevice->SetOutputSizePixel(rRenderContext.GetOutputSizePixel()); + mpBufferDevice->SetOutputSizePixel(GetOutputSizePixel()); mpBufferDevice->SetMapMode(rRenderContext.GetMapMode()); } @@ -1869,8 +1869,8 @@ void SvxPreviewBase::LocalPostPaint(vcl::RenderContext& rRenderContext) mpBufferDevice->EnableMapMode(false); rRenderContext.EnableMapMode(false); - rRenderContext.DrawOutDev(aEmptyPoint, rRenderContext.GetOutputSizePixel(), - aEmptyPoint, rRenderContext.GetOutputSizePixel(), + rRenderContext.DrawOutDev(aEmptyPoint, GetOutputSizePixel(), + aEmptyPoint, GetOutputSizePixel(), *mpBufferDevice); mpBufferDevice->EnableMapMode(bWasEnabledSrc); diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx index e68f61fa50a0..a8e2b56ce0bb 100644 --- a/svx/source/dialog/paraprev.cxx +++ b/svx/source/dialog/paraprev.cxx @@ -59,7 +59,7 @@ void SvxParaPrevWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext, bool bAll) { - Size aWinSize = rRenderContext.GetOutputSizePixel(); + Size aWinSize(GetOutputSizePixel()); aWinSize = rRenderContext.PixelToLogic(aWinSize); Size aTmp(1, 1); aTmp = PixelToLogic(aTmp); diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index f4dfca86001f..ba99ac23460f 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -100,7 +100,7 @@ void SvxSwFrameExample::DataChanged(const DataChangedEvent& rDCEvt) void SvxSwFrameExample::InitAllRects_Impl(vcl::RenderContext& rRenderContext) { - aPage.SetSize(rRenderContext.GetOutputSizePixel()); + aPage.SetSize(GetOutputSizePixel()); sal_uIntPtr nOutWPix = aPage.GetWidth(); sal_uIntPtr nOutHPix = aPage.GetHeight(); diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 40e195179b64..55c6ebe7fca2 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -640,7 +640,7 @@ void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { long i; long nLineWidth; - Size aSize = rRenderContext.GetOutputSizePixel(); + Size aSize(GetOutputSizePixel()); for (i = 0; i < nWidth; i++) { |