vcl: Fix gcc 13.2 build (vcl::PDFWriterImpl::emitType3Font)

Fix this build failure seen with a gcc 13.2.0 `--enable-werror`
build on Debian testing:

    .../vcl/source/gdi/pdfwriter_impl.cxx: In member function ‘bool vcl::PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace*, const vcl::pdf::FontSubset&, std::__debug::map<int, int>&)’:
    .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: error: moving a temporary object prevents copy elision [-Werror=pessimizing-move]
     2719 |                 BitmapEx aBitmapEx = std::move(aReader.read());
          |                                      ~~~~~~~~~^~~~~~~~~~~~~~~~
    .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: note: remove ‘std::move’ call
    cc1plus: all warnings being treated as errors
    make[1]: *** [.../solenv/gbuild/LinkTarget.mk:337: .../workdir/CxxObject/vcl/source/gdi/pdfwriter_impl.o] Error 1

Change-Id: I9f0ba1afd0dee2a8aaa4708672c755ab3a97e5a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156021
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn 2023-08-23 23:08:56 +02:00
parent b5aaf19486
commit f0a6c9c7da

View file

@ -2716,7 +2716,7 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace,
// When rendering an image with an alpha mask during PDF
// export, the alpha mask needs to be inverted
BitmapEx aBitmapEx = std::move(aReader.read());
BitmapEx aBitmapEx = aReader.read();
if ( aBitmapEx.IsAlpha())
{
AlphaMask aAlpha = aBitmapEx.GetAlphaMask();