Bug 1531019 - Ignore the return value of IsSelectable in order to make sure Coverity isn't confused by unchecked return value with IsSelectable returning a boolean; r=emilio
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 27 Feb 2019 16:25:52 +0000
changeset 519352 66106f6c975168680c1e5f2a4009d40d976b9f82
parent 519351 94fb56d47147bea9bb6cd05bb20c1a9fe8ee7066
child 519353 c660601ee72374ffda52fecbcf5924156ecc2f04
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1531019
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531019 - Ignore the return value of IsSelectable in order to make sure Coverity isn't confused by unchecked return value with IsSelectable returning a boolean; r=emilio Differential Revision: https://phabricator.services.mozilla.com/D21362
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -7823,17 +7823,17 @@ static bool IsAcceptableCaretPosition(co
 
 nsIFrame::FrameSearchResult nsTextFrame::PeekOffsetCharacter(
     bool aForward, int32_t* aOffset, PeekOffsetCharacterOptions aOptions) {
   int32_t contentLength = GetContentLength();
   NS_ASSERTION(aOffset && *aOffset <= contentLength, "aOffset out of range");
 
   if (!aOptions.mIgnoreUserStyleAll) {
     StyleUserSelect selectStyle;
-    IsSelectable(&selectStyle);
+    Unused << IsSelectable(&selectStyle);
     if (selectStyle == StyleUserSelect::All) {
       return CONTINUE_UNSELECTABLE;
     }
   }
 
   gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated);
   if (!mTextRun) return CONTINUE_EMPTY;
 
@@ -8013,17 +8013,17 @@ ClusterIterator::ClusterIterator(nsTextF
 
 nsIFrame::FrameSearchResult nsTextFrame::PeekOffsetWord(
     bool aForward, bool aWordSelectEatSpace, bool aIsKeyboardSelect,
     int32_t* aOffset, PeekWordState* aState, bool aTrimSpaces) {
   int32_t contentLength = GetContentLength();
   NS_ASSERTION(aOffset && *aOffset <= contentLength, "aOffset out of range");
 
   StyleUserSelect selectStyle;
-  IsSelectable(&selectStyle);
+  Unused << IsSelectable(&selectStyle);
   if (selectStyle == StyleUserSelect::All) return CONTINUE_UNSELECTABLE;
 
   int32_t offset =
       GetContentOffset() + (*aOffset < 0 ? contentLength : *aOffset);
   ClusterIterator cIter(this, offset, aForward ? 1 : -1, aState->mContext,
                         aTrimSpaces);
 
   if (!cIter.NextCluster()) return CONTINUE_EMPTY;