diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-08-23 00:59:44 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-08-23 01:06:32 +0300 |
commit | 0eda6093121f09f0151500a806ba2b6551bd7050 (patch) | |
tree | 2ef780b852e6c03f064e0c6f952344c617ddc56d /vcl/source/window/toolbox.cxx | |
parent | f2f97ec5bf4f2808544bef5eb583ed4d424acfa9 (diff) |
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
Diffstat (limited to 'vcl/source/window/toolbox.cxx')
-rw-r--r-- | vcl/source/window/toolbox.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 89d378d3b98a..628bb3bf4dd0 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()) { |