[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 2 commits - vcl/inc vcl/source
Khaled Hosny
khaledhosny at eglug.org
Sat Sep 24 22:15:03 UTC 2016
Rebased ref, commits from common ancestor:
commit c956c33793b539f96371cc6c393c129e505f0c4a
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Sat Sep 24 23:13:47 2016 +0200
Use range loop
Change-Id: I5ce49e57ed57378b4b9e16c8bb020048644252a9
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index f951e2b..8963624 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -371,12 +371,12 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
if (bRightToLeft)
std::reverse(aScriptSubRuns.begin(), aScriptSubRuns.end());
- for (HbScriptRuns::iterator it = aScriptSubRuns.begin(); it != aScriptSubRuns.end(); ++it)
+ for (const auto& aScriptRun : aScriptSubRuns)
{
- int nMinRunPos = it->mnMin;
- int nEndRunPos = it->mnEnd;
+ int nMinRunPos = aScriptRun.mnMin;
+ int nEndRunPos = aScriptRun.mnEnd;
int nRunLen = nEndRunPos - nMinRunPos;
- aHbScript = it->maScript;
+ aHbScript = aScriptRun.maScript;
// hb_language_from_string() accept ISO639-3 language tag except for Chinese.
LanguageTag &rTag = rArgs.maLanguageTag;
OString sLanguage = OUStringToOString(rTag.getBcp47(), RTL_TEXTENCODING_ASCII_US);
commit ad561d11c5579bdaea606a77149db75b1e8f438f
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Sat Sep 24 23:04:39 2016 +0200
Use const reference
Change-Id: I0f632f3a8b480f785608aa081add1b1d2fefd312
diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 89214d4..e9116ba 100644
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -36,7 +36,7 @@
class CommonSalLayout : public GenericSalLayout
{
hb_font_t* mpHbFont;
- FontSelectPattern maFontSelData;
+ const FontSelectPattern& mrFontSelData;
css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
#ifdef _WIN32
HDC mhDC;
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 38d6117..f951e2b 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -129,7 +129,7 @@ static hb_unicode_funcs_t* getUnicodeFuncs()
CommonSalLayout::CommonSalLayout(WinSalGraphics* WSL, WinFontInstance& rWinFontInstance, const WinFontFace& rWinFontFace)
: mhFont((HFONT)GetCurrentObject(WSL->getHDC(), OBJ_FONT)),
mhDC(WSL->getHDC()),
- maFontSelData(rWinFontInstance.maFontSelData),
+ mrFontSelData(rWinFontInstance.maFontSelData),
mpD2DRenderer(nullptr)
{
mpHbFont = rWinFontFace.GetHbFont();
@@ -153,7 +153,7 @@ CommonSalLayout::CommonSalLayout(WinSalGraphics* WSL, WinFontInstance& rWinFontI
hb_face_destroy(pHbFace);
}
- scaleHbFont(mpHbFont, maFontSelData);
+ scaleHbFont(mpHbFont, mrFontSelData);
}
void CommonSalLayout::InitFont() const
@@ -163,7 +163,7 @@ void CommonSalLayout::InitFont() const
#elif defined(MACOSX) || defined(IOS)
CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle)
-: maFontSelData(rCoreTextStyle.maFontSelData),
+: mrFontSelData(rCoreTextStyle.maFontSelData),
mrCoreTextStyle(rCoreTextStyle)
{
mpHbFont = rCoreTextStyle.GetHbFont();
@@ -184,12 +184,12 @@ CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle)
hb_face_destroy(pHbFace);
}
- scaleHbFont(mpHbFont, maFontSelData);
+ scaleHbFont(mpHbFont, mrFontSelData);
}
#else
CommonSalLayout::CommonSalLayout(ServerFont& rServerFont)
-: maFontSelData(rServerFont.GetFontSelData()),
+: mrFontSelData(rServerFont.GetFontSelData()),
mrServerFont(rServerFont)
{
mpHbFont = rServerFont.GetHbFont();
@@ -203,7 +203,7 @@ CommonSalLayout::CommonSalLayout(ServerFont& rServerFont)
hb_face_destroy(pHbFace);
}
- scaleHbFont(mpHbFont, maFontSelData);
+ scaleHbFont(mpHbFont, mrFontSelData);
}
#endif
More information about the Libreoffice-commits
mailing list