Continuing nsIPresContext deCOMtamination (bug 229371). Remove GetImageLoadFlags (unused). Make failure to fetch the LookAndFeel service cause Init() to fail, don't null check it after that, and inlined the getter. Move IOService caching to nsImageFrame, the only user of it. r+sr=bzbarsky.

git-svn-id: svn://10.0.0.236/trunk@151636 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2004-01-21 09:35:59 +00:00
parent 1091515534
commit 70bf134ff4
38 changed files with 193 additions and 364 deletions

View File

@@ -66,9 +66,12 @@
#include "nsIPresContext.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
class nsHTMLEditUtils;
static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
// ==================================================================
// DocumentResizeEventListener
// ==================================================================
@@ -911,19 +914,12 @@ nsHTMLEditor::MouseMove(nsIDOMEvent* aMouseEvent)
mouseEvent->GetClientX(&clientX);
mouseEvent->GetClientY(&clientY);
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
if (!ps) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIPresContext> pcontext;
ps->GetPresContext(getter_AddRefs(pcontext));
if (!pcontext) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsILookAndFeel> look;
nsresult res = pcontext->GetLookAndFeel(getter_AddRefs(look));
nsCOMPtr<nsILookAndFeel> look = do_GetService(kLookAndFeelCID);
NS_ASSERTION(look, "Look and feel service must be implemented for this toolkit");
PRInt32 xThreshold=1, yThreshold=1;
if (NS_SUCCEEDED(res) && look) {
look->GetMetric(nsILookAndFeel::eMetric_DragThresholdX, xThreshold);
look->GetMetric(nsILookAndFeel::eMetric_DragThresholdY, yThreshold);
}
look->GetMetric(nsILookAndFeel::eMetric_DragThresholdX, xThreshold);
look->GetMetric(nsILookAndFeel::eMetric_DragThresholdY, yThreshold);
if (PR_ABS(clientX - mOriginalX ) * 2 >= xThreshold ||
PR_ABS(clientY - mOriginalY ) * 2 >= yThreshold) {