Explicitly set cursor position for x11 'gen' backend, tdf#144457 follow-up

... (and other backends?)

Change-Id: If45b83080aa2df50ef27ad282eb6fa1d4a022703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122037
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 92acc1b..5424c03 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1789,7 +1789,13 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, weld::Entry&, rEd, void )
        }
    }
    if (bModified)
        rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the cursor position so all good.
    {
        // gtk3 keeps the cursor position on equal length set_text() but at
        // least the 'gen' backend does not and resets to 0.
        const int nCursorPos = rEd.get_position();
        rEd.set_text(aBuf.makeStringAndClear());
        rEd.set_position(nCursorPos);
    }
    if (bValid)
        rEd.set_message_type(weld::EntryMessageType::Normal);
    else