As things stand, each time you click the "Hyperlink" button to add a link component to the Structure of an Entry in an Index/Table, the Character Style of that component defaults to "Internet Link". Putting aside the fact that "Internet Link" is a silly default style in this context... the problem is that if you add an "LS" (Link Start) component to the Entry Structure, and change its Character Style to something sensible, the "LE" (Link End) component you then add will still default its Character Style to "Internet Link". This in effect means that you have to change the Character Style *twice* per Entry Level, which is a bit silly. The logic should be "If LS exists, this.char_style = LE.char_style, else this.char_style = Internet Link". Or, you know, else "a plain style that makes sense for TOC links" :) Could someone confirm this is still an issue in 3.5.x?
It is a easyhack now...
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
whiteboard: standardize spelling 'easyhack' -> 'EasyHack'
adding LibreOffice developer list as CC to unresolved Writer EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Migrating Whiteboard tags to Keywords: (easyHack)
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
Code pointer is missing (mandatory for easy hacks)
Changing status: NEEDINFO -> NEW Adding keyword 'needsDevEval' [ninjaedit]
the dialog code is in sw/source/ui/index/cnttab.cxx it works with instances of FormToken that have the sCharStyle member to represent the character style. it appears to me that the character style set on the LE link-end token does not have a visible effect on the resulting entries; in ToxTextGenerator::GenerateText a formatting hint is inserted, but it is inserted with SetAttrMode::DONTEXPAND on an empty range, so it will not have a visible effect. this is unique to the LE token, the other ones can at least sometime generate text to which the char style will be applied. for the entire range between LS and LE, the sCharStyle of the LS token is applied, overwriting any style set on inner tokens. so either the LE token's char style should be synced to the LS token in the UI so as to not confuse users, or the style widget should be disabled for the LE token.
I have looked into the file and I am trying to add a method m_xHyperLinkEndPB for TOKEN_END similar to m_xHyperLinkPB(For TOKEN_START) for setting the scharstyle of LE as to same as LS. But I am getting stuck at the point of how can I know the existence of LE. Either there might be a way to iterate over the tokens present so I can iterate over them to check the LS presence and change LE charstyle to the same. I am somewhat trying to do this https://pastebin.com/fTbGjsrU Please help me out there. Thank You.