Bug 849422 Allow plain text document word-wrap to be turned on after the fact r=bz

This commit is contained in:
Neil Rashbrook
2013-03-13 19:56:24 +00:00
parent fc007717d1
commit 76a37bffb8
2 changed files with 7 additions and 7 deletions

View File

@@ -7,13 +7,16 @@
#include "nsHtml5AttributeName.h"
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "mozilla/Preferences.h"
// static
nsHtml5HtmlAttributes*
nsHtml5PlainTextUtils::NewLinkAttributes()
{
nsHtml5HtmlAttributes* linkAttrs = new nsHtml5HtmlAttributes(0);
nsString* rel = new nsString(NS_LITERAL_STRING("stylesheet"));
nsString* rel = mozilla::Preferences::GetBool("plain_text.wrap_long_lines") ?
new nsString(NS_LITERAL_STRING("stylesheet")) :
new nsString(NS_LITERAL_STRING("alternate stylesheet"));
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_REL, rel);
nsString* type = new nsString(NS_LITERAL_STRING("text/css"));
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_TYPE, type);