From 6992106dc7894fab3f620263e99b4083b36bf9e8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 7 Feb 2019 22:06:24 +0100 Subject: Use existing image decoders to handle clipboard BMP data. This gets rid of the old nsImageClipboard widget code in favor of using the nsBMPDecoder in imglib. --- image/DecoderFactory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'image/DecoderFactory.cpp') diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp index 2085fb7c4..dffe4dc21 100644 --- a/image/DecoderFactory.cpp +++ b/image/DecoderFactory.cpp @@ -58,6 +58,10 @@ DecoderFactory::GetDecoderType(const char* aMimeType) } else if (!strcmp(aMimeType, IMAGE_BMP_MS)) { type = DecoderType::BMP; + // BMP_CLIPBOARD + } else if (!strcmp(aMimeType, IMAGE_BMP_MS_CLIPBOARD)) { + type = DecoderType::BMP_CLIPBOARD; + // ICO } else if (!strcmp(aMimeType, IMAGE_ICO)) { type = DecoderType::ICO; @@ -100,6 +104,9 @@ DecoderFactory::GetDecoder(DecoderType aType, case DecoderType::BMP: decoder = new nsBMPDecoder(aImage); break; + case DecoderType::BMP_CLIPBOARD: + decoder = new nsBMPDecoder(aImage, /* aForClipboard */ true); + break; case DecoderType::ICO: decoder = new nsICODecoder(aImage); break; -- cgit v1.2.3