[Libreoffice-commits] core.git: 2 commits - cui/source include/vcl
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 8 20:23:46 UTC 2019
cui/source/options/optcolor.cxx | 6 ++++--
include/vcl/weld.hxx | 9 +++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 05117c0dc231ea5c195c8de9a46d46def2e565ac
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Dec 7 20:21:18 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Dec 8 21:23:01 2019 +0100
document get_extents_relative_to return code
Change-Id: I25d3d6a2ca6155adc43f2e1079033cacbd16ccb8
Reviewed-on: https://gerrit.libreoffice.org/84697
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index c8eeb9ba04a0..82dd5fb2c00c 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -146,6 +146,15 @@ public:
virtual int get_margin_left() const = 0;
virtual int get_margin_right() const = 0;
+ /*
+ * Report the extents of this widget relative to the rRelative target widget.
+ *
+ * To succeed, both widgets must be realized, and must share a common toplevel.
+ *
+ * returns false if the relative extents could not be determined, e.g. if
+ * either widget was not realized, or there was no common ancestor.
+ * Otherwise true.
+ */
virtual bool get_extents_relative_to(Widget& rRelative, int& x, int& y, int& width, int& height)
= 0;
commit 235e1efd2fd938ac673a7c196a6264a0df5cfbc5
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Dec 7 20:11:53 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Dec 8 21:22:50 2019 +0100
Resolves: tdf#129243 check return to see if results valid
Change-Id: Ia4169cda3c1a596ceedd074dd0e59898f9c72ff9
Reviewed-on: https://gerrit.libreoffice.org/84695
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 0e6cb822715a..360c18e80d49 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -876,8 +876,10 @@ IMPL_LINK_NOARG(SvxColorOptionsTabPage, AdjustHeaderBar, const Size&, void)
{
// horizontal positions
int nX0 = 0, nX1, nX2, y, width, height;
- m_rWidget1.get_extents_relative_to(*m_xTable, nX1, y, width, height);
- m_rWidget2.get_extents_relative_to(*m_xTable, nX2, y, width, height);
+ if (!m_rWidget1.get_extents_relative_to(*m_xTable, nX1, y, width, height))
+ return;
+ if (!m_rWidget2.get_extents_relative_to(*m_xTable, nX2, y, width, height))
+ return;
auto nTextWidth1 = nX1 - nX0;
auto nTextWidth2 = nX2 - nX1;
m_xOnFT->set_size_request(nTextWidth1, -1);
More information about the Libreoffice-commits
mailing list