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.
I want to work on this easyhack. I'm trying to reproduce this issue, but I'm not sure how to create "Link Start" and "Link End" component. Can anyone provide steps to reproduce this bug? Or atleast how to create "Link Start" and "Link End" components? Thanks.
(In reply to Mohit Marathe from comment #11) > Can anyone provide steps to reproduce this bug? Or atleast how to create > "Link Start" and "Link End" components? For 24.8.0.0 1. Insert > Table of Contents and Index > Table of Contents, Index, or Bibliography 2. (on Type tab) Type: anything except "Alphabetic Index" or "Bibliography" 3. Choose Entries tab. 4. Notice LE and LS in "Structure" line. Select each one and press Del key (which will remove these entries). 5. Place cursor at beginning of structure line, press "Hyperlink" Result: LS icon added to the structure list, and Character Style (shown under Structure line) is now "Index Link" 6. Change this character style to anything else (e.g., Footnote Characters) 7. Place the cursor in the Structure line again (after the LS icon), and click on "Hyperlink" again. Result: LE icon added to Structure list, and notice Character Style is "Index Link". iiuc, the OP would like the Character Style in this case to match the Character Style that was set for LS. Note also the end of comment 9. iiuc, the Character Style for LE has no visible effect in the document, so the point in having the character style for LE to match LS is only a UI trick to reduce possible user confusion.