Hierarchical styles and cell borders

i tried to use the hierarchical properties of the styles for my borders but failed…

Steps to reproduce

  • create a new style border_base - based on default
    in this set border width to 1,5pt
  • create a new style border_top - based on border_base
    set Line Arrangement top border
  • apply style border_top to a cell

expected result

cell has a top border of 1,5pt

actual result

cell has a top border of 0,05pt (the default value)

thoughts

so it seems the border property is not as fine-granular override-able…

are there any other thoughts / tips about this?

Border property is a single property in Writer document model. So you are right, it’s impossible to define part of that single property in a parent style, and another part in child style.

1 Like

@mikekaganski , we are talking about Calc.

Thanks; overlooked that. However, that likely doesn’t change that - I suspect that the two modules share the same model object for the property.

That’s what I suspected from your explanation, so I voted “like”.

Steps to reproduce

i have made (it would have been better if you had uploaded a sample file here)

As soon as I use the cell style border_top the top line is not displayed in the correct line width.
Only when I scroll this border line out of the visible area and back again, the line width is displayed correctly.

It seems to be a display update problem.
You can report this problem on Bugzilla.

Please post the link from the bug here. Thanks.


EDIT, last: 2022-03-10 13.45 MEZ

In your sample document, the views of the cells correspond exactly to the specified styles.



If you don’t get the desired result, maybe you forgot to click the Presets (or -User-defined) button in the Styles dialog before you clicked OK?

hm - i don’t see the drawing bug you mentioned.

but i found that it can not work:
border_test.ods (9.4 KB)


i have set border 4pt and blue.
but in the organizer overview tab i see no contained changes in the style:

and if i click ok and reopen the style to modifiy it is back at the defaults:

and if i look at the border_left style - where i manually have set Line Arrangement Left and the color and width:


i get

so it seems that - exactly as visible here - Borders Left and Spacing is saved in the style…


To Verify i have

  • created border_2 with all borders lime 5pt
  • created border_2_bottom based on border_2 and removed Borders Right, Left, Top
  • that first sems to work.
  • now i change the color in border_2 to blue
  • expected: border_2_bottom changes to blue also.
  • actual: border_2_bottom stays at lime…
  • conclusion: the contains section in the organizer tab shows relative exactly what is contained:
    • for border_2_bottom its Border Bottom lime 5pt

i have attached my test file.

border_test.ods (9.4 KB)

Please see my edited answer. Thank you.


hm - i don’t see the drawing bug you mentioned

It could possibly be related to the different operating systems.

With me:
Version: 7.3.1.3 (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

yah that is true!
and the problem :wink:
i try to reword my original question:
i would like to set the width and color of the borders in border_base
and would like to set the Line Arrangement in multible sub style (border_top, border_left, …).
so that if i change the base style the sub style inherits this change.
and that is not happening.

what buttons do you mean? - i could not locate them.

OK, that seems to me to be a bug as well.
The inheritance only takes place when a new cell style is created under it.
After that, the lower cell style can no longer be influenced by the one above it.


How to report bugs (or alternatively a feature request), see above in my answer.

Really, I would not call this a bug at all. I don’t think inheritance is even the question. Let me explain.

  1. A single border is parameterized by com.sun.star.table.BorderLine (or BorderLine2, which extends BorderLine with LineStyle and LineWidth). This has no element regarding inheritance. That is, there is no where in the BorderLine struct where LO could possibly be signaled to look elsewhere. That in itself isn’t the whole story, but…

  2. A cell’s border states are parameterized by com.sun.star.table.TableBorder. Here it is very clear that a border is “on” or “off” based on the Is…LineValid element (such as IsTopLineValid). The API reference shows that this is a boolean:

Logically, a person might want to override a base style by either adding or removing a single border, so each border would have to have a tri-state for Is…LineValid.

What is happening is that the first time a child style is created it simply gets a copy of the TableBorder struct and a copy of the BorderLine and BorderLine2 structs. That looks like “inheritance,” but it is just cloning. Thereafter the Boolean Is…LineValid flags have no way to handle inheritance, effectively what @mikekaganski was saying.

1 Like

thanks @joshua4 for this detailed explanation!!

seems very similar to what i thought is happening… :slight_smile:
and yes - i also do not see this as bug. maybe as feature-request…
and this would mean a very good thinking of what edge-cases does happen with this idea and
is there any user (except me) out there that understands the use-case and wants to uses / needs it…

1 Like