sw/source/core/crsr/crstrvl.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit e575acbb93c325648d3ad16ec97661dfa1f3178a
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Wed Jan 29 16:35:26 2025 +0100
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Thu Jan 30 13:50:13 2025 +0100

    tdf#143157 - Include first and secondary keys in index fields
    
    Include first and secondary keys in the tooltip of index fields.
    
    Change-Id: Ic35257d04c89c5aec979909e0aca9725f21e8702
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180908
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    Tested-by: Jenkins
    Tested-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 35ca30cf5bb8..04d08f60f8e0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1814,8 +1814,24 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             rContentAtPos.sStr =
                                 pTextNd->GetExpandText(GetLayout(), 
pTextAttr->GetStart(), *pEnd - pTextAttr->GetStart());
                         else if( RES_TXTATR_TOXMARK == pTextAttr->Which())
-                            rContentAtPos.sStr =
-                                pTextAttr->GetTOXMark().GetAlternativeText();
+                        {
+                            // tdf#143157 - include first and secondary keys 
in index fields
+                            const auto& aSwTOXMark = pTextAttr->GetTOXMark();
+                            const auto aSecondaryKey = 
aSwTOXMark.GetSecondaryKey();
+
+                            OUStringBuffer 
aStringBuffer(aSwTOXMark.GetPrimaryKey());
+                            if (!aSecondaryKey.isEmpty())
+                            {
+                                if (!aStringBuffer.isEmpty())
+                                    aStringBuffer.append(" > ");
+                                aStringBuffer.append(aSecondaryKey);
+                            }
+                            if (!aStringBuffer.isEmpty())
+                                aStringBuffer.append(" > ");
+                            
aStringBuffer.append(aSwTOXMark.GetAlternativeText());
+
+                            rContentAtPos.sStr = 
aStringBuffer.makeStringAndClear();
+                        }
 
                         rContentAtPos.eContentAtPos =
                             RES_TXTATR_TOXMARK == pTextAttr->Which()

Reply via email to