summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-29 13:06:41 +0200
committerTor Lillqvist <tml@collabora.com>2016-08-02 16:42:25 +0300
commitf88aa78c4c6393fd441ea638831b869face7bac0 (patch)
treee72b166cf82df42ce6405a0b56ab7e63b4925f2b
parentboost: suppress GCC6 -Wplacement-new= (diff)
downloadcore-f88aa78c4c6393fd441ea638831b869face7bac0.tar.gz
core-f88aa78c4c6393fd441ea638831b869face7bac0.zip
vcl: GTK: fix libstdc++ "irreflexive" assert
/usr/include/c++/6.1.1/bits/stl_algo.h:4737: Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)). GdkRectangleCoincident is clearly not a less-than operator as required for std::sort. Change-Id: If2e65d420dc8cdf0707081361a40d4eaea28424e (cherry picked from commit e2b267b1906817cc45f0e4896bed58cff5b6b0f9) Reviewed-on: https://gerrit.libreoffice.org/26767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 92cdfa1cb576cfe5048c17b10208eac71445d3c2)
-rw-r--r--vcl/unx/gtk/gtksys.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/vcl/unx/gtk/gtksys.cxx b/vcl/unx/gtk/gtksys.cxx
index e663bb91beb6..a29e7218a864 100644
--- a/vcl/unx/gtk/gtksys.cxx
+++ b/vcl/unx/gtk/gtksys.cxx
@@ -62,6 +62,17 @@ GtkSalSystem::GetDisplayXScreenCount()
namespace
{
+struct GdkRectangleCoincidentLess
+{
+ // fdo#78799 - detect and elide overlaying monitors of different sizes
+ bool operator()(GdkRectangle const& rLeft, GdkRectangle const& rRight)
+ {
+ return
+ rLeft.x < rRight.x
+ || rLeft.y < rRight.y
+ ;
+ }
+};
struct GdkRectangleCoincident
{
// fdo#78799 - detect and elide overlaying monitors of different sizes
@@ -101,10 +112,11 @@ GtkSalSystem::countScreenMonitors()
gdk_screen_get_monitor_geometry(pScreen, j, &aGeometry);
aGeometries.push_back(aGeometry);
}
- GdkRectangleCoincident aCmp;
- std::sort(aGeometries.begin(), aGeometries.end(), aCmp);
+ std::sort(aGeometries.begin(), aGeometries.end(),
+ GdkRectangleCoincidentLess());
const std::vector<GdkRectangle>::iterator aUniqueEnd(
- std::unique(aGeometries.begin(), aGeometries.end(), aCmp));
+ std::unique(aGeometries.begin(), aGeometries.end(),
+ GdkRectangleCoincident()));
nMonitors = std::distance(aGeometries.begin(), aUniqueEnd);
}
maScreenMonitors.push_back(std::make_pair(pScreen, nMonitors));