Commit 4a4e2912 authored by Albert Astals Cid's avatar Albert Astals Cid

Make newer gcc happy about fallthrough

on HtmlOutputDev.cc fixes a leak when printHtml is false
parent 0790dd3a
......@@ -1307,8 +1307,10 @@ Guint FoFiTrueType::computeTableChecksum(Guchar *data, int length) {
switch (length & 3) {
case 3:
word |= (data[i+2] & 0xff) << 8;
// fallthrough
case 2:
word |= (data[i+1] & 0xff) << 16;
// fallthrough
case 1:
word |= (data[i ] & 0xff) << 24;
break;
......
......@@ -4681,7 +4681,7 @@ void AnnotWidget::drawBorder() {
appearBuf->appendf(" {0:.2f}", dash[i]);
}
appearBuf->append("] 0 d\n");
// fall through to the solid case
// fallthrough
case AnnotBorder::borderSolid:
case AnnotBorder::borderUnderlined:
appearBuf->appendf("{0:.2f} w\n", w);
......@@ -4713,7 +4713,7 @@ void AnnotWidget::drawBorder() {
appearBuf->appendf(" {0:.2f}", dash[i]);
}
appearBuf->append("] 0 d\n");
// fall through to the solid case
// fallthrough
case AnnotBorder::borderSolid:
appearBuf->appendf("{0:.2f} w\n", w);
setColor(aColor, gFalse);
......
......@@ -128,6 +128,7 @@ static inline void convertGfxColor(SplashColorPtr dest,
break;
case splashModeXBGR8:
color[3] = 255;
// fallthrough
case splashModeBGR8:
case splashModeRGB8:
colorSpace->getRGB(src, &rgb);
......@@ -175,6 +176,7 @@ static inline void convertGfxShortColor(SplashColorPtr dest,
break;
case splashModeXBGR8:
dest[3] = 255;
// fallthrough
case splashModeBGR8:
case splashModeRGB8:
{
......@@ -1016,6 +1018,7 @@ static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
break;
case splashModeXBGR8:
src[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
setSat(src[0], src[1], src[2], getSat(dest[0], dest[1], dest[2]),
......@@ -1066,6 +1069,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
break;
case splashModeXBGR8:
src[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
setSat(dest[0], dest[1], dest[2], getSat(src[0], src[1], src[2]),
......@@ -1113,6 +1117,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
break;
case splashModeXBGR8:
src[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
setLum(src[0], src[1], src[2], getLum(dest[0], dest[1], dest[2]),
......@@ -1157,6 +1162,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
break;
case splashModeXBGR8:
src[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
setLum(dest[0], dest[1], dest[2], getLum(src[0], src[1], src[2]),
......@@ -1570,6 +1576,7 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
break;
case splashModeXBGR8:
color[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
color[0] = color[1] = color[2] = 0;
......@@ -4428,6 +4435,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
break;
case splashModeXBGR8:
color[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb);
......
......@@ -580,12 +580,14 @@ void Splash::pipeRun(SplashPipe *pipe) {
#endif
case splashModeXBGR8:
cSrcNonIso[3] = 255;
// fallthrough
case splashModeRGB8:
case splashModeBGR8:
cSrcNonIso[2] = clip255(pipe->cSrc[2] +
((pipe->cSrc[2] - cDest[2]) * t) / 255);
cSrcNonIso[1] = clip255(pipe->cSrc[1] +
((pipe->cSrc[1] - cDest[1]) * t) / 255);
// fallthrough
case splashModeMono1:
case splashModeMono8:
cSrcNonIso[0] = clip255(pipe->cSrc[0] +
......
......@@ -1656,10 +1656,9 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
return file;
}
case actionLaunch:
{
LinkLaunch *ha=(LinkLaunch *) link->getAction();
GooString* file=new GooString(ha->getFileName()->getCString());
if (printHtml) {
if (printHtml) {
LinkLaunch *ha=(LinkLaunch *) link->getAction();
GooString* file=new GooString(ha->getFileName()->getCString());
p=file->getCString()+file->getLength()-4;
if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")){
file->del(file->getLength()-4,4);
......@@ -1670,7 +1669,7 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
return file;
}
}
// fallthrough
default:
return new GooString();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment