[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 9 10:27:59 UTC 2020
vcl/source/gdi/jobset.cxx | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 6f827c2f927bb7e3d75b9e8b00be09299494db7f
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 9 10:05:42 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 9 12:27:22 2020 +0200
ofz: Invalid-enum-value
Change-Id: Ib604edbb62b5d6e7caa5aa444ee6d64611b9cf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104110
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index a861169c9698..efe5f4972985 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -273,7 +273,14 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup )
rJobData.SetOrientation( static_cast<Orientation>(SVBT16ToUInt16( pOldJobData->nOrientation )) );
rJobData.SetDuplexMode( DuplexMode::Unknown );
rJobData.SetPaperBin( SVBT16ToUInt16( pOldJobData->nPaperBin ) );
- rJobData.SetPaperFormat( static_cast<Paper>(SVBT16ToUInt16( pOldJobData->nPaperFormat )) );
+ sal_uInt16 nPaperFormat = SVBT16ToUInt16(pOldJobData->nPaperFormat);
+ if (nPaperFormat < NUM_PAPER_ENTRIES)
+ rJobData.SetPaperFormat(static_cast<Paper>(nPaperFormat));
+ else
+ {
+ SAL_WARN("vcl", "Parsing error: " << nPaperFormat <<
+ " paper format, but legal max is " << NUM_PAPER_ENTRIES);
+ }
rJobData.SetPaperWidth( static_cast<long>(SVBT32ToUInt32( pOldJobData->nPaperWidth )) );
rJobData.SetPaperHeight( static_cast<long>(SVBT32ToUInt32( pOldJobData->nPaperHeight )) );
if ( rJobData.GetDriverDataLen() )
More information about the Libreoffice-commits
mailing list