Bug 169933 - Dashed and dotted lines are converted to solid lines in PDF output
Summary: Dashed and dotted lines are converted to solid lines in PDF output
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:26.8.0 target:26.2.0.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2025-12-11 06:53 UTC by shinbird
Modified: 2026-01-22 20:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODS file to reproduce the issue (8.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-12-11 07:02 UTC, shinbird
Details
test low dashed pdf disappearance - win-10x64 - 25.8.3.2 vs 26.2.0.0-b1 (19.88 KB, image/png)
2025-12-11 13:47 UTC, steve.contrib@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shinbird 2025-12-11 06:53:16 UTC
Description:
When exporting a Calc document to PDF using the command-line option `--convert-to pdf`, any dashed or dotted lines are incorrectly rendered as solid lines in the resulting PDF. Line styles are not preserved.

Steps to Reproduce:
1. Prepare a Calc (or Excel) file that contains cells with dashed or dotted lines.
2. Export it using: `soffice --headless --convert-to pdf filename.xlsx`
3. Open the generated PDF.

Actual Results:
Dashed and dotted lines are converted to solid lines.

Expected Results:
Dashed and dotted lines should retain their original line styles in the exported PDF.


Reproducible: Always


User Profile Reset: No

Additional Info:
The issue appears to originate from the graphic stroke reading logic.
A minimal fix is shown below:

```
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index c0aeed2b0290..52f5e915fd14 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -149,7 +149,7 @@ SvStream& ReadSvtGraphicStroke( SvStream& rIStm, SvtGraphicStroke& rClass )
     sal_uInt32 nSize;
     rIStm.ReadUInt32( nSize );
     rClass.maDashArray.resize(nSize);
-    for (double dash : rClass.maDashArray)
+    for (double& dash : rClass.maDashArray)
         rIStm.ReadDouble(dash);
 
     return rIStm;
```
Comment 1 shinbird 2025-12-11 07:02:29 UTC
Created attachment 204571 [details]
Sample ODS file to reproduce the issue

This file demonstrates the issue: dashed/dotted lines are exported as solid lines when using `--convert-to pdf`.
Comment 2 steve.contrib@gmail.com 2025-12-11 13:47:08 UTC
Created attachment 204583 [details]
test low dashed pdf disappearance - win-10x64 - 25.8.3.2 vs 26.2.0.0-b1

can't test for this 'Dashed and dotted lines are converted to solid lines' but There is definitely a problem with the dashed lines when creating a PDF.
Comment 3 Saburo 2026-01-03 10:50:36 UTC
reproduce
Version: 26.2.0.0.beta1 (AARCH64)
Build ID: 1ff380402efe713308d6f0e5c815a6e3a1b3b67c
CPU threads: 8; OS: macOS 13.1; UI render: Skia/Raster; VCL: osx
Locale: ja-JP (ja_JP.UTF-8); UI: en-US
Calc: threaded

bibisected with mac64-26.2
commit 93d9464d91e4436ed1e51b1db400a3ea647a570e
author	Nam Bui

tdf#145538 Use range based for loops

Used ranged-based for loops on rClass.maDashArray in
WriteSvtGraphicStroke() and ReadSvtGraphicStroke().

***
adding CC: Nam Bui
please, take a look?
Comment 4 Saburo 2026-01-08 23:49:42 UTC
Some PDF readers may not display the lines.

(In reply to shinbird from comment #0)
> diff --git a/vcl/source/gdi/graphictools.cxx
> b/vcl/source/gdi/graphictools.cxx
> index c0aeed2b0290..52f5e915fd14 100644
> --- a/vcl/source/gdi/graphictools.cxx
> +++ b/vcl/source/gdi/graphictools.cxx
> @@ -149,7 +149,7 @@ SvStream& ReadSvtGraphicStroke( SvStream& rIStm,
> SvtGraphicStroke& rClass )
>      sal_uInt32 nSize;
>      rIStm.ReadUInt32( nSize );
>      rClass.maDashArray.resize(nSize);
> -    for (double dash : rClass.maDashArray)
> +    for (double& dash : rClass.maDashArray)
>          rIStm.ReadDouble(dash);
>  
>      return rIStm;
> ```

The above fix seems to be correct.

Could you please submit a corresponding change to Gerrit?

https://wiki.documentfoundation.org/Development/GetInvolved
Comment 5 Saburo 2026-01-14 08:00:41 UTC
@shinbird
If you have difficulty sending the patch, would you like me to send it for you?
Please reply.
Comment 6 shinbird 2026-01-14 08:41:21 UTC
I'm currently setting up my environment, but it may take a bit of time.
I expect to be able to submit the patch within a few days.
However, if this needs to be addressed sooner, I would appreciate it if you could submit it on my behalf.
Comment 7 Roman Kuznetsov 2026-01-15 18:16:46 UTC
https://gerrit.libreoffice.org/c/core/+/197373
Comment 8 Commit Notification 2026-01-16 12:10:38 UTC
Masayuki Iizuka committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/561c7438870685baf94cad28b220dcc6a15c6ac1

tdf#169933 Fix unwanted conversion of dashed and dotted lines

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2026-01-16 22:18:32 UTC
Masayuki Iizuka committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/3d0a8eb2580e52906ed1a72a0bbaecbb6df18976

tdf#169933 Fix unwanted conversion of dashed and dotted lines

It will be available in 26.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2026-01-17 07:34:43 UTC
Masayuki Iizuka committed a patch related to this issue.
It has been pushed to "libreoffice-26-2-0":

https://git.libreoffice.org/core/commit/602cb51fd96689daa095f6f7928b28327fcb9ebb

tdf#169933 Fix unwanted conversion of dashed and dotted lines

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.