From a88549452d574983c90149f67122a3470353c1b3 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 24 Sep 2019 08:55:37 +0200 Subject: [PATCH] GUI preview: fix issue with displaying some Tamil text --- src/qtgui/preview_plaintorich.cpp | 33 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/qtgui/preview_plaintorich.cpp b/src/qtgui/preview_plaintorich.cpp index 30885cf5..032424d7 100644 --- a/src/qtgui/preview_plaintorich.cpp +++ b/src/qtgui/preview_plaintorich.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 J.F.Dockes +/* Copyright (C) 2014-2019 J.F.Dockes * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -71,22 +71,28 @@ string PlainToRichQtPreview::PlainToRichQtPreview::header() string PlainToRichQtPreview::startMatch(unsigned int grpidx) { - LOGDEB2("startMatch, grpidx " << (grpidx) << "\n" ); + LOGDEB2("startMatch, grpidx " << grpidx << "\n"); grpidx = m_hdata->index_term_groups[grpidx].grpsugidx; - LOGDEB2("startMatch, ugrpidx " << (grpidx) << "\n" ); + LOGDEB2("startMatch, ugrpidx " << grpidx << "\n"); m_groupanchors[grpidx].push_back(++m_lastanchor); - m_groupcuranchors[grpidx] = 0; - return string(""). - append(""); + m_groupcuranchors[grpidx] = 0; + // We used to create the region as: + // term + // For some reason, this caused problems with the display of some + // Tamil text (qt bug?). Just inserting a space character after + // the opening " + + "" + }; + return startmarker; } string PlainToRichQtPreview::endMatch() { - return string(""); + return ""; } string PlainToRichQtPreview::termAnchorName(int i) const @@ -104,7 +110,7 @@ string PlainToRichQtPreview::startChunk() int PlainToRichQtPreview::nextAnchorNum(int grpidx) { - LOGDEB2("nextAnchorNum: group " << (grpidx) << "\n" ); + LOGDEB2("nextAnchorNum: group " << grpidx << "\n"); map::iterator curit = m_groupcuranchors.find(grpidx); map >::iterator vecit = @@ -121,7 +127,7 @@ int PlainToRichQtPreview::nextAnchorNum(int grpidx) else m_groupcuranchors[grpidx]++; m_curanchor = vecit->second[m_groupcuranchors[grpidx]]; - LOGDEB2("nextAnchorNum: curanchor now " << (m_curanchor) << "\n" ); + LOGDEB2("nextAnchorNum: curanchor now " << m_curanchor << "\n"); } return m_curanchor; } @@ -182,4 +188,3 @@ void ToRichThread::run() m_output.push_back(QString::fromUtf8(it->c_str(), it->length())); } } -