Bug 37129 - Dotted and Dashed table borders are not drawn correctly.
Summary: Dotted and Dashed table borders are not drawn correctly.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.2 release
Hardware: All All
: medium normal
Assignee: Cédric Bosdonnat
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2011-05-12 02:05 UTC by Yifan Jiang
Modified: 2013-09-23 19:31 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (53.79 KB, image/png)
2011-05-12 02:17 UTC, Yifan Jiang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yifan Jiang 2011-05-12 02:05:42 UTC
Platform: SLED 11 sp1 i586
build info: Libreoffice 3.4 beta5

[Steps]

    1. Launch Calc

    2. Select some cells

    3. Right click the mouse and select 'Format Cells...' in the context menu

    4. Switch to 'Border' tab

    5. Select in the 'Default' section: 'Set Outer border and All Inner Lines'

    6. Select in the 'Style' section: Dash border

    7. Set in the 'Width' field: 0.25pt

    8. Press OK


[Problem]

    The border lines of the cells were drawn but in solid style. It is
    expected selected dash/dotted borders were drawn.

[Extra Information]

    - This is a regression problem against 3.3

    - attached SCREENSHOT: When set the Width longer (1.5pt for example), 
    the border looks abnormal.

    - The problem also happens in the Writer table, but looks drawn well in
    table of Presentation.
Comment 1 Yifan Jiang 2011-05-12 02:06:25 UTC
For Kohei's review, thank you!
Comment 2 vitriol 2011-05-12 02:13:09 UTC
Same problem with tables in Writer. Keywords regression.
Comment 3 Cédric Bosdonnat 2011-05-12 02:15:08 UTC
borders bugs are mine
Comment 4 Yifan Jiang 2011-05-12 02:17:21 UTC
Created attachment 46625 [details]
screenshot
Comment 5 Cédric Bosdonnat 2011-05-12 02:28:04 UTC
After some investigations, it appears that this is coming from the very small size of the line.
Comment 6 vitriol 2011-06-02 10:22:58 UTC
The result is correct on printing/exporting in PDF, but it's wrong on screen. This behavior gives to user a very bad feedback.
Comment 7 Tomofumi Yagi 2011-06-06 15:12:49 UTC
Temporarily, how about reverting a part of the patches?


I'm guessing that this problem occurs because of the following commit.

  Commit bf9aaaec78793e1572df1812308c7aae2cb9f4b3
  "Use svx:: frame:: DrawRange with the drawinglayer in calc now"

Because in Calc, this problem is solved in the following modifications.
----- here -----
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1232,7 +1232,7 @@ void ScOutputData::DrawFrame()
         {
             size_t nRow2 = nRow1;
             while( (nRow2 + 1 <= nLastRow) && pRowInfo[ nRow2 + 1 ].bChanged ) ++nRow2;
-            rArray.DrawRange( pProcessor, nFirstCol, nRow1, nLastCol, nRow2, pForceColor );
+            rArray.DrawRange( *pDev, nFirstCol, nRow1, nLastCol, nRow2, pForceColor );
             nRow1 = nRow2 + 1;
         }
     }
----- now  -----
Comment 8 Cédric Bosdonnat 2011-06-07 00:53:03 UTC
(In reply to comment #7)
> Temporarily, how about reverting a part of the patches?

[...]

> -            rArray.DrawRange( pProcessor, nFirstCol, nRow1, nLastCol, nRow2,
> pForceColor );
> +            rArray.DrawRange( *pDev, nFirstCol, nRow1, nLastCol, nRow2,
> pForceColor );

Surely not revert that part of the patch or you'll loose all the benefits of the new borders in Calc.

What should be done is to make a better decomposition for the border2DPrimitive when it comes to dots and dashes... but the troubles comes from the different zoom levels possible.
Comment 9 pumpkin 2011-08-31 03:10:47 UTC
Same problem with Writer 3.4.2 on Windows XP

If I click-right on the table and choose Table option in menu, it's impossible to choose dotted border, for example. Only plain or none works.

But if I use the toolbox wich appears when I click on the table, it works.

The problem doesn't appears with LibreOffice 3.3.2 and 3.3.3.
Comment 10 pumpkin 2011-09-02 04:05:52 UTC
(In reply to comment #9)
> Same problem with Writer 3.4.2 on Windows XP
> 
> If I click-right on the table and choose Table option in menu, it's impossible
> to choose dotted border, for example. Only plain or none works.
> 
> But if I use the toolbox wich appears when I click on the table, it works.
> 
> The problem doesn't appears with LibreOffice 3.3.2 and 3.3.3.

Same problem with 3.4.3 in Linux x86_64 (debian squeeze).
Comment 11 vitriol 2011-09-02 04:11:13 UTC
Please, don't change version!
Comment 12 Cédric Bosdonnat 2011-10-20 02:14:18 UTC
Fixed by this commit in master:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c2902ecbf135fae070ea032fa10a59bb76ec1b0

Many thanks for the patch!
Comment 13 Tamás Zolnai 2013-09-23 19:31:38 UTC
Hi,

  I noticed that with this bug fix the dashed/dotted borders' snippets don't change their size while zooming. That makes snippets to be bigger compared to the content when zoom level is lower and to be smaller compared to the content in case of upper zoom level.
  The root of the problem is that the pattern which used to construct dashed line is constant and so doesn't change with zoom level as it would be expected (See ctrlbox.cxx:GetDashing()) method).