[Libreoffice-commits] core.git: vcl/source
Maxim Monastirsky
momonasmon at gmail.com
Sat Aug 22 15:08:33 PDT 2015
vcl/source/window/toolbox.cxx | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
New commits:
commit 0eda6093121f09f0151500a806ba2b6551bd7050
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Aug 23 00:59:44 2015 +0300
tdf#84277 Use the same logic for native separators
If in some cases we don't want a visible separator, I can't
understand why it shouldn't apply also to platforms that
support native separator drawing.
Change-Id: Ib88bece62cfbb092808f3257a7ba9bd63f4cb1d7
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 89d378d..628bb3b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2908,30 +2908,29 @@ void ToolBox::ImplDrawSpin(vcl::RenderContext& rRenderContext, bool bUpperIn, bo
void ToolBox::ImplDrawSeparator(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, const Rectangle& rRect)
{
- bool bNativeOk = false;
ImplToolItem* pItem = &mpData->m_aItems[nPos];
+ ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
- ControlPart nPart = IsHorizontal() ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ;
- if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, nPart))
- {
- ImplControlValue aControlValue;
- ControlState nState = ControlState::NONE;
- bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, nPart, rRect, nState, aControlValue, OUString());
- }
-
- /* Draw the widget only if it can't be drawn natively. */
- if(!bNativeOk)
+ // no separator before or after windows or at breaks
+ if (pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size() - 1)
{
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
-
- // no separator before or after windows or at breaks
- if (pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size() - 1)
+ pTempItem = &mpData->m_aItems[nPos+1];
+ if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
{
- pTempItem = &mpData->m_aItems[nPos+1];
- if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
+ bool bNativeOk = false;
+ ControlPart nPart = IsHorizontal() ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ;
+ if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, nPart))
+ {
+ ImplControlValue aControlValue;
+ ControlState nState = ControlState::NONE;
+ bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, nPart, rRect, nState, aControlValue, OUString());
+ }
+
+ /* Draw the widget only if it can't be drawn natively. */
+ if (!bNativeOk)
{
long nCenterPos, nSlim;
+ const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
rRenderContext.SetLineColor(rStyleSettings.GetSeparatorColor());
if (IsHorizontal())
{
More information about the Libreoffice-commits
mailing list