vcl/source/pdf/pdfwriter_impl.cxx |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit cda0150c8371139acd77ba603d974a5325c88634
Author:     Christopher Sherlock <[email protected]>
AuthorDate: Fri Oct 10 03:08:21 2025 +1100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Oct 14 17:44:42 2025 +0200

    vcl: flatten appendPdfTimeDate()
    
    Change-Id: Iceae48b57f013851fc25b17254d9dbab4fc9503b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192120
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/source/pdf/pdfwriter_impl.cxx 
b/vcl/source/pdf/pdfwriter_impl.cxx
index c277e0d48d37..e387e9b8c498 100644
--- a/vcl/source/pdf/pdfwriter_impl.cxx
+++ b/vcl/source/pdf/pdfwriter_impl.cxx
@@ -456,23 +456,22 @@ void appendPdfTimeDate(OStringBuffer & rBuffer,
     if (tzDelta == 0)
     {
         rBuffer.append("Z");
+        return;
     }
+
+    if (tzDelta > 0 )
+        rBuffer.append("+");
     else
     {
-        if (tzDelta > 0 )
-            rBuffer.append("+");
-        else
-        {
-            rBuffer.append("-");
-            tzDelta = -tzDelta;
-        }
-
-        rBuffer.append(char('0' + ((tzDelta / 36000) % 10)));
-        rBuffer.append(char('0' + ((tzDelta / 3600) % 10)));
-        rBuffer.append("'");
-        rBuffer.append(char('0' + ((tzDelta / 600) % 6)));
-        rBuffer.append(char('0' + ((tzDelta / 60) % 10)));
+        rBuffer.append("-");
+        tzDelta = -tzDelta;
     }
+
+    rBuffer.append(char('0' + ((tzDelta / 36000) % 10)));
+    rBuffer.append(char('0' + ((tzDelta / 3600) % 10)));
+    rBuffer.append("'");
+    rBuffer.append(char('0' + ((tzDelta / 600) % 6)));
+    rBuffer.append(char('0' + ((tzDelta / 60) % 10)));
 }
 
 const char* getPDFVersionStr(PDFWriter::PDFVersion ePDFVersion)

Reply via email to