summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-06-23 10:29:48 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2015-06-23 14:30:37 +0000
commit9a809eedf7327f925cd6be56545b8ed300ef28f4 (patch)
tree27127b185096162438a20b490b82f16f217ebe50 /svtools
parentfead68bbf107ca9f2632bdaf1d8407921a0320f2 (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 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox2.cxx7
-rw-r--r--svtools/source/contnr/imivctl1.cxx2
-rw-r--r--svtools/source/control/calendar.cxx2
-rw-r--r--svtools/source/control/roadmap.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx6
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
-rw-r--r--svtools/source/control/valueset.cxx8
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx2
8 files changed, 20 insertions, 17 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 1fa03aa9f59d..1ffc334f76db 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -634,12 +634,15 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
if (nTitleLines)
{
if (!bHeaderBar)
+ {
rRenderContext.DrawLine(Point(0, GetTitleHeight() - 1),
- Point(rRenderContext.GetOutputSizePixel().Width(),
- GetTitleHeight() - 1));
+ Point(GetOutputSizePixel().Width(), GetTitleHeight() - 1));
+ }
else if (bHandleCol)
+ {
rRenderContext.DrawLine(Point(0, GetTitleHeight() - 1),
Point(pFirstCol->Width(), GetTitleHeight() - 1));
+ }
}
// Title Bar
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 7c790ff30b27..6b4d02ca2c3e 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -607,7 +607,7 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
Color aColor(COL_BLACK);
rRenderContext.SetLineColor( aColor );
Point aOffs(rRenderContext.GetMapMode().GetOrigin());
- Size aXSize(rRenderContext.GetOutputSizePixel());
+ Size aXSize(GetOutputSizePixel());
{
Point aStart(LROFFS_WINBORDER, 0);
Point aEnd(LROFFS_WINBORDER, aXSize.Height());
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e560bcd67dcc..d0ae9e4daeeb 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -785,7 +785,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
ImplFormat();
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- Size aOutSize = rRenderContext.GetOutputSizePixel();
+ Size aOutSize(GetOutputSizePixel());
long i;
long j;
long nY;
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index b327ebac5b8a..a934bd29af63 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -569,7 +569,7 @@ void ORoadmap::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect
if (!!m_pImpl->getPicture())
{
Size aBitmapSize = m_pImpl->getPicture().GetSizePixel();
- Size aMySize = rRenderContext.GetOutputSizePixel();
+ Size aMySize(GetOutputSizePixel());
Point aBitmapPos(aMySize.Width() - aBitmapSize.Width(), aMySize.Height() - aBitmapSize.Height());
@@ -585,7 +585,7 @@ void ORoadmap::DrawHeadline(vcl::RenderContext& rRenderContext)
{
Point aTextPos = LogicToPixel(Point(ROADMAP_INDENT_X, 8), MAP_APPFONT);
- Size aOutputSize(rRenderContext.GetOutputSizePixel());
+ Size aOutputSize(GetOutputSizePixel());
// draw it
rRenderContext.DrawText(Rectangle(aTextPos, aOutputSize), GetText(),
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index d84695a53889..aebebd3617b7 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -50,7 +50,7 @@ class TabDrawer
private:
TabBar& mrParent;
vcl::RenderContext& mrRenderContext;
- const StyleSettings& mrStyleSettings;
+ const StyleSettings& mrStyleSettings;
Rectangle maRect;
@@ -82,7 +82,7 @@ public:
// draw extra line if above and below border
if ((nWinStyle & WB_BORDER) || (nWinStyle & WB_TOPBORDER))
{
- Size aOutputSize = mrRenderContext.GetOutputSizePixel();
+ Size aOutputSize(mrParent.GetOutputSizePixel());
Rectangle aOutRect = mrParent.GetPageArea();
// also draw border in 3D for 3D-tabs
@@ -384,7 +384,7 @@ void ImplTabSizer::Tracking( const TrackingEvent& rTEvt )
void ImplTabSizer::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
{
DecorationView aDecoView(&rRenderContext);
- Rectangle aOutputRect(Point(0, 0), rRenderContext.GetOutputSizePixel());
+ Rectangle aOutputRect(Point(0, 0), GetOutputSizePixel());
aDecoView.DrawHandle(aOutputRect, true);
}
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 79d60caedf8d..115ea353c48e 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -849,7 +849,7 @@ ToolbarMenuEntry* ToolbarMenu::implSearchEntry( int nEntryId ) const
void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHighlightEntry, bool bHighlight)
{
- Size aSz(rRenderContext.GetOutputSizePixel());
+ Size aSz(GetOutputSizePixel());
long nX = 0;
long nY = 0;
@@ -887,7 +887,7 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
{
- Size aPxSize(rRenderContext.GetOutputSizePixel());
+ Size aPxSize(GetOutputSizePixel());
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(Rectangle(Point(nX, nY), Size(aSz.Width(), pEntry->maSize.Height())));
Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width() - nX, aPxSize.Height()));
@@ -1295,7 +1295,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
int nOuterSpace = 0; // ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder;
Point aTopLeft(nOuterSpace, nOuterSpace), aTmpPos;
- Size aOutSz(rRenderContext.GetOutputSizePixel());
+ Size aOutSz(GetOutputSizePixel());
const int nEntryCount = mpImpl->maEntryVector.size();
int nEntry;
for (nEntry = 0; nEntry < nEntryCount; nEntry++)
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 9f9f47760937..106799670bc2 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -350,7 +350,7 @@ Reference<XAccessible> ValueSet::CreateAccessible()
void ValueSet::Format(vcl::RenderContext& rRenderContext)
{
- Size aWinSize = rRenderContext.GetOutputSizePixel();
+ Size aWinSize(GetOutputSizePixel());
size_t nItemCount = mItemList.size();
WinBits nStyle = GetStyle();
long nTxtHeight = rRenderContext.GetTextHeight();
@@ -694,7 +694,7 @@ void ValueSet::ImplDrawItemText(vcl::RenderContext& rRenderContext, const OUStri
if (!(GetStyle() & WB_NAMEFIELD))
return;
- Size aWinSize = rRenderContext.GetOutputSizePixel();
+ Size aWinSize(GetOutputSizePixel());
long nTxtWidth = rRenderContext.GetTextWidth(rText);
long nTxtOffset = mnTextOffset;
@@ -977,7 +977,7 @@ void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext)
if (!(GetStyle() & WB_FLATVALUESET))
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- Size aWinSize = rRenderContext.GetOutputSizePixel();
+ Size aWinSize(GetOutputSizePixel());
Point aPos1(NAME_LINE_OFF_X, mnTextOffset + NAME_LINE_OFF_Y);
Point aPos2(aWinSize.Width() - (NAME_LINE_OFF_X * 2), mnTextOffset + NAME_LINE_OFF_Y);
if (!(rStyleSettings.GetOptions() & StyleSettingsOptions::Mono))
@@ -1435,7 +1435,7 @@ void ValueSet::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.SetLineColor();
rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
long nOffY = maVirDev->GetOutputSizePixel().Height();
- Size aWinSize = rRenderContext.GetOutputSizePixel();
+ Size aWinSize(GetOutputSizePixel());
rRenderContext.DrawRect(Rectangle(Point(0, nOffY ), Point( aWinSize.Width(), aWinSize.Height())));
}
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 4fc0d97dc559..e94da73ef89f 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -108,7 +108,7 @@ namespace svt
void ToolPanelDrawer::Paint(vcl::RenderContext& rRenderContext)
{
m_pPaintDevice->SetMapMode(rRenderContext.GetMapMode());
- m_pPaintDevice->SetOutputSize(rRenderContext.GetOutputSizePixel());
+ m_pPaintDevice->SetOutputSize(GetOutputSizePixel());
m_pPaintDevice->SetSettings(rRenderContext.GetSettings());
m_pPaintDevice->SetDrawMode(rRenderContext.GetDrawMode());