Den lör 5 jan. 2019 kl 18:39 skrev Remy Gauthier <remygauth...@yahoo.com>:
> Hi, > > If you apply any style that has borders re-defined in any way (including > "no borders"), setting the cell style will override whatever settings you > previously made. I did a few tests and if, in your style definition you > only change - for instance - the background color, then the borders that > were set previously around the cell (Format > Cells...) remain unchanged > when the style is applied. > Yes, I know that ”no borders” means ”no borders”, so pre-existing ones will be removed. But when you select your borders in the borders tab of the style dialogue, clicking a border once makes it look like a black (or whatever selected in the colour combo box) line. If I click it again, the line turns thicker and gray. I though THAT meant ”don't change”, at least that would have made sense. So what does it mean instead? And if I click it again, the line disappears, which obviously means ”no border”. > > If you want to re-initialise the border definition, you can press the > "Standard" button in the bottom right corner of the Style Edit panel when > the Borders tab is selected. This will reset the definition to the setting > of the parent (Herited from on the Organizer tab) - important note here: if > the parent has any border settings, then you will not be able to achieve > your objective of having a style that uses "whatever was already there". > This means you should create your styles as children of Default, and never > change Default itself unless it's for font settings or background color. > > Now, what is it you are trying to do? Are you creating styles to apply > Conditional Formatting? > No. > Or are you just trying to make your table "pretty"? > No. > If it's the latter, I suggest you do it "à la Excel" and just apply the > formatting (background, borders, fonts, etc.) manually, without styles. If > it's Conditional Formatting, apply the borders manually, then apply the > highlighting styles to obtain the effect you are looking for, based on the > condition set. You can also use the STYLE function to dynamically apply a > style from a formula: > > - If the result is a number, the formula would then be: > =Calculation_of_the_number+STYLE("StyleName") > - If the result is text, the formula could be: > =CONCATENATE(Calculatiom_of_the_text,TEXT(STYLE("StyleName")," ")) > > This also works, but still requires you to manually apply the borders. > Also note that trying multiple styles to a cell does not work (e.g. > =Calculation_of_the_number+STYLE("StyleName1")+STYLE("StyleName2")+STYLE("StyleName3")+...): > only the last applied style is kept. > I think I described what I was trying to do in my first post. I have that table looking thing with borders. I have a few cell styles with different background colours representing different ”modes” of something. If this thing worked properly (which it maybe does once I understand it), all I have to do is to select a cell range and double click a style in the right hand panel. It has to be easy and quick, because I am going to do this a lot and also I prefer to use styles, since it's so easy to change specific things for a specific style rather than searching and replacing things directly on the spreadsheet. > > I hope this helps. > At least I now have some more things to try, but I'm still puzzled about that third boarder line mode that I mentioned above. I thing it would be awesome if the third mode actually was the ”don't change” mode. That would be intuitive. Overall though, unfortunately I think that the styles thing in LibreOffice (and Apache OpenOffice) is a mess. There are som many ways to format a cell that it's sometimes very hard to find the source for a cell format when something isn't correctly formatted and it's not obvious where the problem lies. If you format a cell in several ways at once, it's hard to realise which format will ”dominate”. Never mind, that spreadsheet document isn't my most important one anyway, I just thought that if I ran into a bug I could report it. I just wanted to check here first if I maybe missed something. I don't want to annoy the developers with imaginary bugs… Kind regards Johnny Rosenberg > Rémy. > Le vendredi 04 janvier 2019 à 23:33 +0100, Johnny Rosenberg a écrit : > > Sorry for bothering again, but how do I set certain things in a style to > > ”don't change”? > > For instance, I have cell styles with different background colours that I > > apply to cells in a sheet looking like a table with different borders and > > things like that, for instance the first cell in a column has an upper > > border line, the last one has a lower border line. When I apply a cell > > style to these, the lines disappear and I have to add them again, manually. > > Or if I add the lines to the style, they are also added where I don't want > > them. Creating a style for each thinkable scenario is of course > > overwhelming, and not a convenient way to go. > > I just want to set all border lines to ”whatever was already there”, and I > > thought I could, but it didn't work. > > When I click a line in the border line section in the styles dialogue, a > > line appears, if I click again the line turns thicker and grayer and a > > third click removes the line again, but neither of those three states seems > > to do what I want. Either lines are drawn or removed, never left untouched > > when applying the style. > > What am I missing? > > > Yes, even the bug-monster Excel can do this. :o > > > > Kind regards > > > Johnny Rosenberg > > > > -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy