b=493963; don't call win32 printing functions with --disable-printing; r=stuart

This commit is contained in:
Vladimir Vukicevic 2009-06-16 11:57:34 -07:00
Родитель d5881b5fa9
Коммит 0da9c9be48
1 изменённых файлов: 33 добавлений и 7 удалений

Просмотреть файл

@ -169,9 +169,11 @@ gfxWindowsSurface::OptimizeToDDB(HDC dc, const gfxIntSize& size, gfxImageFormat
return raw;
}
nsresult gfxWindowsSurface::BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName)
nsresult
gfxWindowsSurface::BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName)
{
#ifdef NS_PRINTING
#define DOC_TITLE_LENGTH 30
DOCINFOW docinfo;
@ -191,44 +193,68 @@ nsresult gfxWindowsSurface::BeginPrinting(const nsAString& aTitle,
::StartDocW(mDC, &docinfo);
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
nsresult gfxWindowsSurface::EndPrinting()
nsresult
gfxWindowsSurface::EndPrinting()
{
#ifdef NS_PRINTING
int result = ::EndDoc(mDC);
if (result <= 0)
return NS_ERROR_FAILURE;
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
nsresult gfxWindowsSurface::AbortPrinting()
nsresult
gfxWindowsSurface::AbortPrinting()
{
#ifdef NS_PRINTING
int result = ::AbortDoc(mDC);
if (result <= 0)
return NS_ERROR_FAILURE;
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
nsresult gfxWindowsSurface::BeginPage()
nsresult
gfxWindowsSurface::BeginPage()
{
#ifdef NS_PRINTING
int result = ::StartPage(mDC);
if (result <= 0)
return NS_ERROR_FAILURE;
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
nsresult gfxWindowsSurface::EndPage()
nsresult
gfxWindowsSurface::EndPage()
{
#ifdef NS_PRINTING
if (mForPrinting)
cairo_surface_show_page(CairoSurface());
int result = ::EndPage(mDC);
if (result <= 0)
return NS_ERROR_FAILURE;
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
PRInt32 gfxWindowsSurface::GetDefaultContextFlags() const
PRInt32
gfxWindowsSurface::GetDefaultContextFlags() const
{
if (mForPrinting)
return gfxContext::FLAG_SIMPLIFY_OPERATORS |