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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 0e6cb82..360c18e 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);