vcl/source/filter/GraphicFormatDetector.cxx |   24 ++++++++++++++++++++++++
 vcl/source/filter/idxf/dxfgrprd.cxx         |    2 +-
 2 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 2a16a922c4b78850375def4bc5dfecd11d87e1d7
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Sep 7 22:51:48 2025 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Sep 10 19:40:05 2025 +0200

    Related tdf#168265: fix DXFGroupReader::ReadF
    
    Change-Id: I9a316a2b01b7726e679cecb0121e650ee49d6ba3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190646
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Tested-by: Jenkins
    (cherry picked from commit 1d6298f1c64a8ba6c6634335960d2b247d0d2f30)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190652
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 5389294d747f8ca3d964f126cab627eb89c4ec91)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190761
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/source/filter/idxf/dxfgrprd.cxx 
b/vcl/source/filter/idxf/dxfgrprd.cxx
index 3319882e3245..a2ab23e6867b 100644
--- a/vcl/source/filter/idxf/dxfgrprd.cxx
+++ b/vcl/source/filter/idxf/dxfgrprd.cxx
@@ -197,7 +197,7 @@ double DXFGroupReader::ReadF()
         bStatus=false;
         return 0.0;
     }
-    return atof(p);
+    return o3tl::toDouble(s);
 }
 
 void DXFGroupReader::ReadS()
commit f4ab2874ca9782283f3a09329fdb5c6781b5a3ab
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sat Sep 6 09:30:36 2025 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Sep 10 19:39:51 2025 +0200

    tdf#168265: pass comment (999) section to detect dxf file
    
    Change-Id: I6d54e4dcc578792bd122e24743f41c0049974a2a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190632
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit b5044aa84af207dc44944c9ad51847b50e7f43b1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190653
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit f9eacf3d535e3dac7c1f30a5f74f4ff7a77a94be)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190760
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/source/filter/GraphicFormatDetector.cxx 
b/vcl/source/filter/GraphicFormatDetector.cxx
index 7963505f4b2e..80dfc885e39c 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -1156,6 +1156,30 @@ bool GraphicFormatDetector::checkDXF()
         ++i;
     }
 
+    // tdf#168265: pass comment section which begins with 999
+    // see 
https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-3F0380A5-1C15-464D-BC66-2C5F094BCFB9
+    if (i < 256 - 2 && maFirstBytes[i] == '9' && maFirstBytes[i + 1] == '9'
+        && maFirstBytes[i + 2] == '9')
+    {
+        // we're on the 999 line
+        i = i + 3;
+        // we want to pass this line
+        while (i < 256 && maFirstBytes[i] <= 32)
+        {
+            ++i;
+        }
+        // we're on the comment line and we want to go until new line
+        while (i < 256 && maFirstBytes[i] != 10)
+        {
+            ++i;
+        }
+        // we're on the new line
+        while (i < 256 && maFirstBytes[i] <= 32)
+        {
+            ++i;
+        }
+    }
+
     if (i < 256 && maFirstBytes[i] == '0')
     {
         ++i;

Reply via email to