diff --git a/content/build/nsContentDLF.cpp b/content/build/nsContentDLF.cpp index a29a0e20d80b..15641482361b 100644 --- a/content/build/nsContentDLF.cpp +++ b/content/build/nsContentDLF.cpp @@ -271,12 +271,13 @@ nsContentDLF::CreateInstanceForDocument(nsISupports* aContainer, rv = NS_NewDocumentViewer(getter_AddRefs(docv)); if (NS_FAILED(rv)) break; - docv->SetUAStyleSheet(gUAStyleSheet); + + docv->SetUAStyleSheet(NS_STATIC_CAST(nsIStyleSheet*, gUAStyleSheet)); // Bind the document to the Content Viewer - rv = docv->LoadStart(aDocument); - *aDocViewerResult = docv; - NS_IF_ADDREF(*aDocViewerResult); + nsIContentViewer* cv = NS_STATIC_CAST(nsIContentViewer*, docv.get()); + rv = cv->LoadStart(aDocument); + NS_ADDREF(*aDocViewerResult = cv); } while (PR_FALSE); return rv; diff --git a/content/build/nsContentDLF.h b/content/build/nsContentDLF.h index a62048a6fb4f..82c8a31f8aab 100644 --- a/content/build/nsContentDLF.h +++ b/content/build/nsContentDLF.h @@ -20,6 +20,8 @@ #include "nsIDocumentLoaderFactory.h" #include "nsIDocStreamLoaderFactory.h" +#include "nsIDocumentViewer.h" +#include "nsIDocument.h" class nsICSSStyleSheet; class nsIChannel; diff --git a/layout/build/nsContentDLF.cpp b/layout/build/nsContentDLF.cpp index a29a0e20d80b..15641482361b 100644 --- a/layout/build/nsContentDLF.cpp +++ b/layout/build/nsContentDLF.cpp @@ -271,12 +271,13 @@ nsContentDLF::CreateInstanceForDocument(nsISupports* aContainer, rv = NS_NewDocumentViewer(getter_AddRefs(docv)); if (NS_FAILED(rv)) break; - docv->SetUAStyleSheet(gUAStyleSheet); + + docv->SetUAStyleSheet(NS_STATIC_CAST(nsIStyleSheet*, gUAStyleSheet)); // Bind the document to the Content Viewer - rv = docv->LoadStart(aDocument); - *aDocViewerResult = docv; - NS_IF_ADDREF(*aDocViewerResult); + nsIContentViewer* cv = NS_STATIC_CAST(nsIContentViewer*, docv.get()); + rv = cv->LoadStart(aDocument); + NS_ADDREF(*aDocViewerResult = cv); } while (PR_FALSE); return rv; diff --git a/layout/build/nsContentDLF.h b/layout/build/nsContentDLF.h index a62048a6fb4f..82c8a31f8aab 100644 --- a/layout/build/nsContentDLF.h +++ b/layout/build/nsContentDLF.h @@ -20,6 +20,8 @@ #include "nsIDocumentLoaderFactory.h" #include "nsIDocStreamLoaderFactory.h" +#include "nsIDocumentViewer.h" +#include "nsIDocument.h" class nsICSSStyleSheet; class nsIChannel;