[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 10 09:33:15 UTC 2020
vcl/source/gdi/pdfwriter_impl.cxx | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
New commits:
commit 9cd5645f3be28b45cb704ac06c89cb3b3c3ae0f5
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Thu Jul 9 10:12:12 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Jul 10 11:32:48 2020 +0200
pdfwriter: nDelta is a signed number appendPdfTimeDate
includes cid#1465240: DEADCODE
See https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
7.9.4 Dates
"O shall be the relationship of local time to Universal Time (UT),
and shall be denoted by one of the characters
PLUS SIGN (U+002B) (+), HYPHEN-MINUS (U+002D) (-), or LATIN CAPITAL LETTER Z (U+005A) (Z) (see below)
...
A PLUS SIGN as the value of the O field signifies that local time is later than UT,
a HYPHEN-MINUS signifies that local time is earlier than UT,
and the LATIN CAPITAL LETTER Z signifies that local time is equal to UT.
If no UT information is specified, the relationship of the specified time to UT shall be considered to be GMT.
Regardless of whether the time zone is specified, the rest of the date shall be specified in local time."
Change-Id: If9ce87752afd00866a426a1196fafa7e0942270e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98454
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ea3058f5f616..75ce97166652 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -739,7 +739,7 @@ namespace
{
void appendPdfTimeDate(OStringBuffer & rBuffer,
- sal_Int16 year, sal_uInt16 month, sal_uInt16 day, sal_uInt16 hours, sal_uInt16 minutes, sal_uInt16 seconds, sal_uInt32 tzDelta)
+ sal_Int16 year, sal_uInt16 month, sal_uInt16 day, sal_uInt16 hours, sal_uInt16 minutes, sal_uInt16 seconds, sal_Int32 tzDelta)
{
rBuffer.append("D:");
rBuffer.append(char('0' + ((year / 1000) % 10)));
@@ -766,7 +766,10 @@ void appendPdfTimeDate(OStringBuffer & rBuffer,
if (tzDelta > 0 )
rBuffer.append("+");
else
+ {
rBuffer.append("-");
+ tzDelta = -tzDelta;
+ }
rBuffer.append(char('0' + ((tzDelta / 36000) % 10)));
rBuffer.append(char('0' + ((tzDelta / 3600) % 10)));
@@ -1508,15 +1511,7 @@ OString PDFWriter::GetDateTime()
osl_getLocalTimeFromSystemTime(&aGMT, &aTVal);
osl_getDateTimeFromTimeValue(&aTVal, &aDT);
- sal_uInt32 nDelta = 0;
- if (aGMT.Seconds > aTVal.Seconds)
- {
- nDelta = aGMT.Seconds-aTVal.Seconds;
- }
- else if (aGMT.Seconds < aTVal.Seconds)
- {
- nDelta = aTVal.Seconds-aGMT.Seconds;
- }
+ sal_Int32 nDelta = aTVal.Seconds-aGMT.Seconds;
appendPdfTimeDate(aRet, aDT.Year, aDT.Month, aDT.Day, aDT.Hours, aDT.Minutes, aDT.Seconds, nDelta);
More information about the Libreoffice-commits
mailing list