Bug 664437 editor should use mozilla::Preferences r=ehsan

This commit is contained in:
Masayuki Nakano
2011-06-17 09:59:29 +09:00
parent c0fe3e49f7
commit 354cc7faf5
11 changed files with 133 additions and 232 deletions

View File

@@ -58,14 +58,14 @@
#include "nsIDOMEventTarget.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsIServiceManager.h"
#include "nsIDOMCSSValue.h"
#include "nsIDOMCSSPrimitiveValue.h"
#include "nsIDOMRGBColor.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
#define BLACK_BG_RGB_TRIGGER 0xd0
NS_IMETHODIMP
@@ -503,14 +503,8 @@ nsHTMLEditor::AddPositioningOffset(PRInt32 & aX, PRInt32 & aY)
{
// Get the positioning offset
nsresult res;
nsCOMPtr<nsIPrefBranch> prefBranch =
do_GetService(NS_PREFSERVICE_CONTRACTID, &res);
PRInt32 positioningOffset = 0;
if (NS_SUCCEEDED(res) && prefBranch) {
res = prefBranch->GetIntPref("editor.positioning.offset", &positioningOffset);
if (NS_FAILED(res)) // paranoia
positioningOffset = 0;
}
PRInt32 positioningOffset =
Preferences::GetInt("editor.positioning.offset", 0);
aX += positioningOffset;
aY += positioningOffset;