[Libreoffice-commits] core.git: 3 commits - include/vcl vcl/source
Michael Meeks
michael.meeks at collabora.com
Wed Feb 17 22:36:49 UTC 2016
include/vcl/salnativewidgets.hxx | 6 ++++++
include/vcl/toolbox.hxx | 3 ++-
vcl/source/control/spinfld.cxx | 3 ++-
vcl/source/window/toolbox.cxx | 13 ++++++-------
4 files changed, 16 insertions(+), 9 deletions(-)
New commits:
commit 497c511f082d8c0eb0db0f7cbc490a6c91f78d66
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Feb 17 21:56:54 2016 +0000
tdf#97922 - Mend nonsensical spin invalidation to improve rendering.
Change-Id: Ief3d95b0b03e8062115785461b3834a03f9fb52b
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 9c1e93b..0d076a4 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3581,7 +3581,7 @@ bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, bool bCancel )
mbUpper = false;
mbLower = false;
mbIn = false;
- InvalidateSpin(false, false);
+ InvalidateSpin();
return true;
}
commit c4c3aa5cd957067709e24037d7f40246039660fc
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Feb 17 21:05:50 2016 +0000
tdf#97922 - Mend nonsensical spin invalidation to improve rendering.
Change-Id: I3a398c47c69cc292a681ebe2414d844c224f3e3e
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 12a0b70..11958cd 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -155,7 +155,8 @@ public:
using Window::ImplInit;
private:
SAL_DLLPRIVATE void InvalidateItem(sal_uInt16 nPosition);
- SAL_DLLPRIVATE void InvalidateSpin(bool bUpperIn, bool bLowerIn);
+ SAL_DLLPRIVATE void InvalidateSpin(bool bInvalidateUpper = true,
+ bool bInvalidateLower = true);
SAL_DLLPRIVATE void InvalidateMenuButton();
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index b147b0e..9c1e93b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3457,8 +3457,7 @@ bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, bool bRepeat )
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- Invalidate();
- InvalidateSpin(mbIn, false);
+ InvalidateSpin(true, false);
}
return true;
}
@@ -3469,7 +3468,7 @@ bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, bool bRepeat )
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- InvalidateSpin(false, mbIn);
+ InvalidateSpin(false, true);
}
return true;
}
@@ -4482,7 +4481,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
ShowLine( false );
else if ( (mnCurLine+mnVisLines-1 < mnCurLines) && (pData->GetDelta() < 0) )
ShowLine( true );
- InvalidateSpin(false, false);
+ InvalidateSpin();
return;
}
}
@@ -5188,7 +5187,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = 1;
mbFormat = true;
ImplFormat();
- InvalidateSpin(false, false);
+ InvalidateSpin();
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
@@ -5201,7 +5200,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLines;
mbFormat = true;
ImplFormat();
- InvalidateSpin(false, false);
+ InvalidateSpin();
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
commit 469ce3ed324c784a2af1e2fdb0a1f09e28170def
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Feb 17 20:42:52 2016 +0000
tdf#97922 - get control area right for spinbuttons.
Also avoid caching both spin-buttons and some other complex types.
The cache key needs to be able to include more state.
Change-Id: I8eff6b1c5c51d27afb796cae66b45390433138b4
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 55de313..0b60312 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -286,6 +286,12 @@ public:
case CTRL_RADIOBUTTON:
case CTRL_LISTNODE:
case CTRL_SLIDER:
+ // FIXME: these guys have complex state hidden in ImplControlValue
+ // structs which affects rendering, needs to be a and needs to be
+ // part of the key to our cache.
+ case CTRL_SPINBOX:
+ case CTRL_SPINBUTTONS:
+ case CTRL_TAB_ITEM:
return false;
case CTRL_MENUBAR:
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 1ef9c96..e0bcf16 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -143,8 +143,9 @@ bool ImplDrawNativeSpinbuttons(vcl::RenderContext& rRenderContext, const Spinbut
if (rRenderContext.IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL))
{
+ Rectangle aArea = rSpinbuttonValue.maUpperRect.GetUnion(rSpinbuttonValue.maLowerRect);
// only paint the standalone spin buttons, all buttons are painted at once
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Rectangle(),
+ bNativeOK = rRenderContext.DrawNativeControl(CTRL_SPINBUTTONS, PART_ALL_BUTTONS, aArea,
ControlState::ENABLED, rSpinbuttonValue, OUString());
}
return bNativeOK;
More information about the Libreoffice-commits
mailing list