[Libreoffice-commits] core.git: vcl/qt5
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 15 20:34:20 UTC 2021
vcl/qt5/Qt5Widget.cxx | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
New commits:
commit 77f61fe0240b5744043dc216a3c48ef2eaf11ec8
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Feb 15 17:55:43 2021 +0100
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Mon Feb 15 21:33:30 2021 +0100
Qt don't fallthrough in inputMethodQuery
So my initiak code had a single case with fallthrough to the
default, but that is totally bogus for multiple cases. I honestly
have no idea, if that ever was correct. I also don't know, if
simply returning an empty QVariant is the correct error handling,
but the fallthroughs were definitly wrong.
Change-Id: I1880a960164eccbb6a5a3832c4ae9aaeda065d43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110946
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 4608482627be..a2bf8fe6472d 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -670,14 +670,14 @@ QVariant Qt5Widget::inputMethodQuery(Qt::InputMethodQuery property) const
sal_Int32 nCursorPos, nAnchor;
if (lcl_retrieveSurrounding(nCursorPos, nAnchor, &aText, nullptr))
return QVariant(aText);
- [[fallthrough]];
+ return QVariant();
}
case Qt::ImCursorPosition:
{
sal_Int32 nCursorPos, nAnchor;
if (lcl_retrieveSurrounding(nCursorPos, nAnchor, nullptr, nullptr))
return QVariant(static_cast<int>(nCursorPos));
- [[fallthrough]];
+ return QVariant();
}
case Qt::ImCursorRectangle:
{
@@ -692,7 +692,7 @@ QVariant Qt5Widget::inputMethodQuery(Qt::InputMethodQuery property) const
sal_Int32 nCursorPos, nAnchor;
if (lcl_retrieveSurrounding(nCursorPos, nAnchor, nullptr, nullptr))
return QVariant(static_cast<int>(nAnchor));
- [[fallthrough]];
+ return QVariant();
}
case Qt::ImCurrentSelection:
{
@@ -700,13 +700,11 @@ QVariant Qt5Widget::inputMethodQuery(Qt::InputMethodQuery property) const
sal_Int32 nCursorPos, nAnchor;
if (lcl_retrieveSurrounding(nCursorPos, nAnchor, nullptr, &aSelection))
return QVariant(aSelection);
- [[fallthrough]];
+ return QVariant();
}
default:
return QWidget::inputMethodQuery(property);
}
-
- return QVariant();
}
void Qt5Widget::endExtTextInput()
More information about the Libreoffice-commits
mailing list