summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-21 11:13:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-21 21:29:54 +0200
commit128282219cab1e94f092276067a40ee5a34b59ff (patch)
treee4140b57021b052fc5a92665e147d5ba221192e3
parentd5329c153149d29b25f1ec9d19ada8b62e350b6d (diff)
WB_FLATSPLITDRAW is dead
since commit 2235846149e89dd9fe83cd4fbaf32908983aa571 Date: Tue Nov 23 18:50:48 2010 +0100 vcl117: reduce duplication of enums Change-Id: Ib9c8015934bc794df4b96cd35f5f93b23f372f70 Reviewed-on: https://gerrit.libreoffice.org/41386 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/tools/wintypes.hxx1
-rw-r--r--vcl/source/window/splitwin.cxx38
2 files changed, 11 insertions, 28 deletions
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 1fb95291e028..a6b3826698fa 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -219,7 +219,6 @@ WinBits const WB_DOCKBORDER = 0x00001000;
// Window-Bits for SplitWindow
WinBits const WB_NOSPLITDRAW = 0x01000000;
-WinBits const WB_FLATSPLITDRAW = 0x02000000;
// Window-Bits for MessageBoxen
WinBits const WB_OK = 0x00100000;
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 4314a48d53b6..10854d9767bf 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1009,7 +1009,7 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, ImplSplitSet*
}
}
-static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet, bool bRows, bool bFlat, bool bDown = true)
+static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet, bool bRows, bool bDown)
{
if (pSet->mpItems.empty())
return;
@@ -1034,31 +1034,23 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet
nTop = rItems[i]->mnLeft;
nBottom = rItems[i]->mnLeft+rItems[i]->mnWidth-1;
- if (bFlat)
- nPos--;
-
if (bDown || (nItemSplitSize >= nSplitSize))
{
rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
rRenderContext.DrawLine(Point(nTop, nPos + 1), Point(nBottom, nPos + 1));
}
nPos += nSplitSize-2;
- if (bFlat)
- nPos+=2;
if ((!bDown && (nItemSplitSize >= 2)) ||
(bDown && (nItemSplitSize >= nSplitSize - 1)))
{
rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
rRenderContext.DrawLine(Point(nTop, nPos), Point(nBottom, nPos));
}
- if (!bFlat)
+ nPos++;
+ if (!bDown || (nItemSplitSize >= nSplitSize))
{
- nPos++;
- if (!bDown || (nItemSplitSize >= nSplitSize))
- {
- rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
- rRenderContext.DrawLine(Point(nTop, nPos), Point(nBottom, nPos));
- }
+ rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
+ rRenderContext.DrawLine(Point(nTop, nPos), Point(nBottom, nPos));
}
}
else
@@ -1066,30 +1058,23 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet
nTop = rItems[i]->mnTop;
nBottom = rItems[i]->mnTop+pSet->mpItems[i]->mnHeight-1;
- if (bFlat)
- nPos--;
if (bDown || (nItemSplitSize >= nSplitSize))
{
rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
rRenderContext.DrawLine(Point(nPos + 1, nTop), Point(nPos+1, nBottom));
}
nPos += pSet->mnSplitSize - 2;
- if (bFlat)
- nPos += 2;
if ((!bDown && (nItemSplitSize >= 2)) ||
(bDown && (nItemSplitSize >= nSplitSize - 1)))
{
rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
rRenderContext.DrawLine(Point(nPos, nTop), Point(nPos, nBottom));
}
- if( !bFlat )
+ nPos++;
+ if (!bDown || (nItemSplitSize >= nSplitSize))
{
- nPos++;
- if (!bDown || (nItemSplitSize >= nSplitSize))
- {
- rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
- rRenderContext.DrawLine(Point(nPos, nTop), Point(nPos, nBottom));
- }
+ rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
+ rRenderContext.DrawLine(Point(nPos, nTop), Point(nPos, nBottom));
}
}
}
@@ -1099,7 +1084,7 @@ static void ImplDrawSplit(vcl::RenderContext& rRenderContext, ImplSplitSet* pSet
{
if (rItems[i]->mpSet && rItems[i]->mnWidth && rItems[i]->mnHeight)
{
- ImplDrawSplit(rRenderContext, rItems[i]->mpSet, !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet), bFlat);
+ ImplDrawSplit(rRenderContext, rItems[i]->mpSet, !(rItems[i]->mnBits & SplitWindowItemFlags::ColSet), true/*bDown*/);
}
}
}
@@ -2302,8 +2287,7 @@ void SplitWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
// draw splitter
if (!(mnWinStyle & WB_NOSPLITDRAW))
{
- bool bFlat = (GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
- ImplDrawSplit(rRenderContext, mpMainSet, mbHorz, bFlat, !mbBottomRight);
+ ImplDrawSplit(rRenderContext, mpMainSet, mbHorz, !mbBottomRight);
}
}