[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source

Tamas Bunth tamas.bunth at collabora.co.uk
Sat Oct 7 07:09:32 UTC 2017


 sw/source/core/tox/ToxTextGenerator.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 382af3b87fabb1b5d748e6e339c3e60146dd5a6f
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Tue Sep 19 16:53:16 2017 +0200

    tdf#99689 allow Subscript in Illustration Index...
    
    ... and Index of Tables.
    
    Change-Id: I5a677f431d1a2e3836bcacdd382708b0ce397faf
    Reviewed-on: https://gerrit.libreoffice.org/42481
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
    Tested-by: Tamás Bunth <btomi96 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/43212
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx
index 4eaaf8c3730c..c748bdb42041 100644
--- a/sw/source/core/tox/ToxTextGenerator.cxx
+++ b/sw/source/core/tox/ToxTextGenerator.cxx
@@ -200,9 +200,8 @@ ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector<SwTOXSortTabBase*>
                 {
                     // for TOC numbering
                     rText += GetNumStringOfFirstNode( rBase, true, MAXLEVEL );
-                    SwIndex aIdx( pTOXNd, rText.getLength() );
-                    ToxWhitespaceStripper stripper(rBase.GetText().sText);
-                    pTOXNd->InsertText(stripper.GetStrippedString(), aIdx);
+                    HandledTextToken htt = HandleTextToken(rBase, pDoc->GetAttrPool() );
+                    ApplyHandledTextToken(htt, *pTOXNd);
                 }
                 break;
 
@@ -316,8 +315,14 @@ ToxTextGenerator::HandleTextToken(const SwTOXSortTabBase& source, SwAttrPool& po
         clone->SetStyleHandle(attributesToClone);
 
         result.autoFormats.push_back(clone);
-        result.startPositions.push_back(stripper.GetPositionInStrippedString(hint->GetStart()));
-        result.endPositions.push_back(stripper.GetPositionInStrippedString(*hint->GetAnyEnd()));
+
+        ModelToViewHelper aConversionMap( *pSrc, ExpandMode::ExpandFields );
+        result.startPositions.push_back(
+                stripper.GetPositionInStrippedString(aConversionMap.ConvertToViewPosition(
+                        hint->GetStart() )));
+        result.endPositions.push_back(
+                stripper.GetPositionInStrippedString(aConversionMap.ConvertToViewPosition(
+                        *hint->GetAnyEnd() )));
     }
     return result;
 }


More information about the Libreoffice-commits mailing list