From 71e59d5b39ba3cd94faccc6397021f1d9bff8e2c Mon Sep 17 00:00:00 2001 From: "hyatt%mozilla.org" Date: Thu, 7 Aug 2003 23:01:24 +0000 Subject: [PATCH] Update for 215440, make sure not to break SeaMonkey titlebars when the doc has no title, r/sr/a=brendan. --- xpfe/appshell/src/nsContentTreeOwner.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index 9d5a4a0f580b..aef52966f705 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -606,17 +606,21 @@ NS_IMETHODIMP nsContentTreeOwner::SetTitle(const PRUnichar* aTitle) if (docTitle.IsEmpty()) docTitle.Assign(mTitleDefault); - if (!mTitlePreface.IsEmpty()) { - // Title will be: "Preface: Doc Title - Mozilla" - title.Assign(mTitlePreface); - title.Append(docTitle); - } - else { - // Title will be: "Doc Title - Mozilla" - title = docTitle; - } + if (!docTitle.IsEmpty()) { + if (!mTitlePreface.IsEmpty()) { + // Title will be: "Preface: Doc Title - Mozilla" + title.Assign(mTitlePreface); + title.Append(docTitle); + } + else { + // Title will be: "Doc Title - Mozilla" + title = docTitle; + } - title += mTitleSeparator + mWindowTitleModifier; + title += mTitleSeparator + mWindowTitleModifier; + } + else + title.Assign(mWindowTitleModifier); // Title will just be plain "Mozilla" // XXX Don't need to fully qualify this once I remove nsWebShellWindow::SetTitle // return mXULWindow->SetTitle(title.get());