Skip to content

Commit

Permalink
Fixed crash introduced in "Allow 'group by sort' in multi-line view a…
Browse files Browse the repository at this point in the history
…gain."
  • Loading branch information
Betterbird committed Dec 31, 2021
1 parent 0213183 commit 733174d
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions 91/features/04-feature-multiline-tree-allow-grouping.patch
@@ -1,6 +1,6 @@
# HG changeset patch
# User Betterbird <betterbird@betterbird.eu>
# Date 1640909365 -3600
# Date 1640972233 -3600
# Parent b70f6940d9916817f0eedd4f9b9d7733c7d2dd71
Feature: Multi-line tree follow-up: Allow "group by sort" again.

Expand Down Expand Up @@ -99,7 +99,7 @@ diff --git a/mail/base/content/threadPane.js b/mail/base/content/threadPane.js
diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -2171,76 +2171,136 @@ nsMsgDBView::GetColspanTextProperties(in
@@ -2171,76 +2171,135 @@ nsMsgDBView::GetColspanTextProperties(in
break;
}
}
Expand All @@ -117,6 +117,7 @@ diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.c
*isMulti =
mozilla::Preferences::GetBool("mail.pane_config.multiline_all", false);
if (*isMulti) {
+ if (!cols) return NS_OK;
mIsMultiline = true;
- if (mTree) {
- RefPtr<nsTreeColumns> cols = mTree->GetColumns();
Expand All @@ -130,14 +131,13 @@ diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.c
- el->SetAttribute(u"hidden"_ns, u"true"_ns, rv1);
- break;
- }
+ if (cols) {
+ for (col = cols->GetFirstColumn(); col; col = col->GetNext()) {
+ const nsAString& colID = col->GetId();
+ if (colID.EqualsLiteral("subjectCol")) {
+ el = col->Element();
+ el->SetAttribute(u"hidden"_ns, u"true"_ns, rv1);
+ break;
}
- }
+ for (col = cols->GetFirstColumn(); col; col = col->GetNext()) {
+ const nsAString& colID = col->GetId();
+ if (colID.EqualsLiteral("subjectCol")) {
+ el = col->Element();
+ el->SetAttribute(u"hidden"_ns, u"true"_ns, rv1);
+ break;
}
}
} else {
Expand All @@ -148,8 +148,7 @@ diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.c
// IsMultiline().
- if (!mTree) return NS_OK;
- RefPtr<nsTreeColumns> cols = mTree->GetColumns();
- if (!cols) return NS_OK;
+ if (!mTree || !cols) return NS_OK;
if (!cols) return NS_OK;

// There are strange cases where we find no columns here, in this case
// we use the previous result.
Expand Down

0 comments on commit 733174d

Please sign in to comment.