summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-11-09 23:50:53 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-11-10 01:01:55 +0200
commit58d149f3b4d1e8ca47189b5f22421fc3f3bee732 (patch)
treef07be2c3b91d6ac660f3243620c67b3f1707ab11
parent7446faec4e319afaf2f0b043c45ed0df6d1885dd (diff)
Minor cleanup
Drop useless typedef and use more general nomenclature as I’m going to extend this in the next commits. Change-Id: I12aa01fe9f5a6c9aca67f850f36b81661ee14913
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index b7e5578c87f3..57986af462b0 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -225,21 +225,19 @@ CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont)
}
#endif
-struct HbScriptRun
+struct SubRun
{
int32_t mnMin;
int32_t mnEnd;
UScriptCode maScript;
- HbScriptRun(int32_t nMin, int32_t nEnd, UScriptCode aScript)
+ SubRun(int32_t nMin, int32_t nEnd, UScriptCode aScript)
: mnMin(nMin)
, mnEnd(nEnd)
, maScript(aScript)
{}
};
-typedef std::vector<HbScriptRun> HbScriptRuns;
-
namespace vcl {
struct Run
{
@@ -411,7 +409,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
// Find script subruns.
int nCurrentPos = nBidiMinRunPos;
- HbScriptRuns aScriptSubRuns;
+ std::vector<SubRun> aSubRuns;
size_t k = 0;
for (; k < pTextLayout->runs.size(); ++k)
{
@@ -426,8 +424,8 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
{
int32_t nMinRunPos = nCurrentPos;
int32_t nEndRunPos = std::min(pTextLayout->runs[k].nEnd, nBidiEndRunPos);
- HbScriptRun aRun(nMinRunPos, nEndRunPos, pTextLayout->runs[k].nCode);
- aScriptSubRuns.push_back(aRun);
+ SubRun aSubRun(nMinRunPos, nEndRunPos, pTextLayout->runs[k].nCode);
+ aSubRuns.push_back(aSubRun);
nCurrentPos = nEndRunPos;
++k;
@@ -436,16 +434,16 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
// RTL subruns should be reversed to ensure that final glyph order is
// correct.
if (bRightToLeft)
- std::reverse(aScriptSubRuns.begin(), aScriptSubRuns.end());
+ std::reverse(aSubRuns.begin(), aSubRuns.end());
- for (const auto& aScriptRun : aScriptSubRuns)
+ for (const auto& aSubRun : aSubRuns)
{
hb_buffer_clear_contents(pHbBuffer);
- int nMinRunPos = aScriptRun.mnMin;
- int nEndRunPos = aScriptRun.mnEnd;
+ int nMinRunPos = aSubRun.mnMin;
+ int nEndRunPos = aSubRun.mnEnd;
int nRunLen = nEndRunPos - nMinRunPos;
- aHbScript = hb_icu_script_to_script(aScriptRun.maScript);
+ aHbScript = hb_icu_script_to_script(aSubRun.maScript);
OString sLanguage = msLanguage;
if (sLanguage.isEmpty())
@@ -453,7 +451,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
bool bVertical = false;
if ((rArgs.mnFlags & SalLayoutFlags::Vertical) &&
- GetVerticalFlagsForScript(aScriptRun.maScript) == GF_ROTL)
+ GetVerticalFlagsForScript(aSubRun.maScript) == GF_ROTL)
{
bVertical = true;
}