* fix some longjump warnings

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26400 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Karsten Heimrich
2008-07-13 11:16:15 +00:00
parent 0ef072a3f9
commit d903f7e019
@@ -602,7 +602,7 @@ PDFWriter::FindTransparency(uint8 alpha)
float a = (float)alpha/255.0; float a = (float)alpha/255.0;
sprintf(trans, "opacitystroke=%f opacityfill=%f", a, a); sprintf(trans, "opacitystroke=%f opacityfill=%f", a, a);
int handle = -1; volatile int handle = -1;
PDF_TRY(fPdf) { PDF_TRY(fPdf) {
handle = PDF_create_gstate(fPdf, trans); handle = PDF_create_gstate(fPdf, trans);
} PDF_CATCH(fPdf) { } PDF_CATCH(fPdf) {
@@ -621,30 +621,34 @@ PDFWriter::FindTransparency(uint8 alpha)
} }
// -------------------------------------------------- // --------------------------------------------------
void void
PDFWriter::BeginTransparency() PDFWriter::BeginTransparency()
{ {
if (!SupportsOpacity() || !MakesPDF() || !IsDrawing()) return; if (!SupportsOpacity() || !MakesPDF() || !IsDrawing())
return;
REPORT(kDebug, fPage, ">>> BeginTransparency"); REPORT(kDebug, fPage, ">>> BeginTransparency");
REPORT(kDebug, fPage, "current_color(%d, %d, %d, %d)", fState->currentColor.red, fState->currentColor.green, fState->currentColor.blue, fState->currentColor.alpha); REPORT(kDebug, fPage, "current_color(%d, %d, %d, %d)", fState->currentColor.red,
REPORT(kDebug, fPage, "drawing_mode %d alpha %d", (int)fState->drawingMode, (int)fState->currentColor.alpha); fState->currentColor.green, fState->currentColor.blue, fState->currentColor.alpha);
REPORT(kDebug, fPage, "drawing_mode %d alpha %d", (int)fState->drawingMode,
Transparency* t = NULL; (int)fState->currentColor.alpha);
uint8 alpha = fState->currentColor.alpha; uint8 alpha = fState->currentColor.alpha;
if (fState->drawingMode == B_OP_ALPHA && alpha < 255) { if (fState->drawingMode == B_OP_ALPHA && alpha < 255) {
PDF_save(fPdf); PDF_save(fPdf);
t = FindTransparency(alpha); Transparency* t = FindTransparency(alpha);
if (t != NULL) { if (t != NULL) {
PDF_TRY(fPdf) { PDF_TRY(fPdf) {
PDF_set_gstate(fPdf, t->Handle()); PDF_set_gstate(fPdf, t->Handle());
} PDF_CATCH(fPdf) { } PDF_CATCH(fPdf) {
REPORT(kError, 0, PDF_get_errmsg(fPdf)); REPORT(kError, 0, PDF_get_errmsg(fPdf));
} }
} fTransparencyStack.AddItem(t);
return;
}
} }
// if transparency is not set then push NULL to transparency stack // if transparency is not set then push NULL to transparency stack
fTransparencyStack.AddItem(t); fTransparencyStack.AddItem(NULL);
} }
// -------------------------------------------------- // --------------------------------------------------