diff options
author | offtkp <parisoplop@gmail.com> | 2022-07-16 19:20:02 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-07-19 13:25:41 +0200 |
commit | b8c0b8b06cd24480c66f3bf657576e3dde03a5a6 (patch) | |
tree | 58292f5af4c94f0ce9c922a99aee6c661b16a255 /vcl | |
parent | 7785a62cd74e5924e4ade4d69519966c63a0decf (diff) |
Replace old png writer in gtksalmenu.cxx
Change-Id: I6851d7a6c8bbd1fbb02b3ba74f46d13e1fd80223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137137
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtksalmenu.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx index 22261c62bbf4..53c1f66504cd 100644 --- a/vcl/unx/gtk3/gtksalmenu.cxx +++ b/vcl/unx/gtk3/gtksalmenu.cxx @@ -14,7 +14,7 @@ #include <unx/gtk/gloactiongroup.h> #include <vcl/toolkit/floatwin.hxx> #include <vcl/menu.hxx> -#include <vcl/pngwrite.hxx> +#include <vcl/filter/PngImageWriter.hxx> #include <vcl/pdfwriter.hxx> // for escapeStringXML #include <o3tl/string_view.hxx> @@ -813,8 +813,9 @@ bool GtkSalMenu::AddMenuBarButton(const SalMenuButtonItem& rNewItem) if (!!rNewItem.maImage) { SvMemoryStream* pMemStm = new SvMemoryStream; - vcl::PNGWriter aWriter(rNewItem.maImage.GetBitmapEx()); - aWriter.Write(*pMemStm); + auto aBitmapEx = rNewItem.maImage.GetBitmapEx(); + vcl::PngImageWriter aWriter(*pMemStm); + aWriter.write(aBitmapEx); GBytes *pBytes = g_bytes_new_with_free_func(pMemStm->GetData(), pMemStm->TellEnd(), @@ -1071,11 +1072,11 @@ void GtkSalMenu::ApplyPersona() { if (maPersonaBitmap != rPersonaBitmap) { - vcl::PNGWriter aPNGWriter(rPersonaBitmap); mxPersonaImage.reset(new utl::TempFile); mxPersonaImage->EnableKillingFile(true); SvStream* pStream = mxPersonaImage->GetStream(StreamMode::WRITE); - aPNGWriter.Write(*pStream); + vcl::PngImageWriter aPNGWriter(*pStream); + aPNGWriter.write(rPersonaBitmap); mxPersonaImage->CloseStream(); } @@ -1260,8 +1261,9 @@ void GtkSalMenu::NativeSetItemIcon( unsigned nSection, unsigned nItemPos, const if (!!rImage) { SvMemoryStream* pMemStm = new SvMemoryStream; - vcl::PNGWriter aWriter(rImage.GetBitmapEx()); - aWriter.Write(*pMemStm); + auto aBitmapEx = rImage.GetBitmapEx(); + vcl::PngImageWriter aWriter(*pMemStm); + aWriter.write(aBitmapEx); GBytes *pBytes = g_bytes_new_with_free_func(pMemStm->GetData(), pMemStm->TellEnd(), |