Kaydet (Commit) dc55f061 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

TSCP: skip empty classification sections

When the user inserts some classification text
into the editbox in the classifcation dialog then
deletes, EditEng is giving us an empty section.

This is to skip it, since it's completely superfluous.

Change-Id: I522f05d0a270cd2bd9892235ad3cb40a88b295ac
Reviewed-on: https://gerrit.libreoffice.org/43888Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
Tested-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst 1f788464
......@@ -166,17 +166,21 @@ std::vector<ClassificationResult> ClassificationDialog::getResult()
ESelection aSelection(rSection.mnParagraph, rSection.mnStart, rSection.mnParagraph, rSection.mnEnd);
const OUString sDisplayString = m_pEditWindow->pEdEngine->GetText(aSelection);
const ClassificationField* pClassificationField = pFieldItem ? dynamic_cast<const ClassificationField*>(pFieldItem->GetField()) : nullptr;
if (pClassificationField)
{
aClassificationResults.push_back({ pClassificationField->meType, pClassificationField->msFullClassName, sDisplayString, rSection.mnParagraph });
}
else
if (!sDisplayString.isEmpty())
{
aClassificationResults.push_back({ ClassificationType::TEXT, pClassificationField->msFullClassName, sDisplayString, rSection.mnParagraph });
const ClassificationField* pClassificationField = pFieldItem ? dynamic_cast<const ClassificationField*>(pFieldItem->GetField()) : nullptr;
if (pClassificationField)
{
aClassificationResults.push_back({ pClassificationField->meType, pClassificationField->msFullClassName, sDisplayString, rSection.mnParagraph });
}
else
{
aClassificationResults.push_back({ ClassificationType::TEXT, sDisplayString, sDisplayString, rSection.mnParagraph });
}
}
}
return aClassificationResults;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment