From 0edc52ad5adc0932cbab8ca99d709241af298bd6 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 4 Nov 2015 18:02:20 -0800 Subject: [PATCH] Bug 1038663 (part 2) - Move GetFirstFontMetrics() up. r=heycam. This is necessary for a subsequent patch. --HG-- extra : rebase_source : 4d80215e1ee75105344db5d101cfa5d5d47ea33a --- layout/generic/nsTextFrame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index c3a2d7c9446b..21a62b7f4405 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -1597,6 +1597,16 @@ HasTerminalNewline(const nsTextFrame* aFrame) return frag->CharAt(aFrame->GetContentEnd() - 1) == '\n'; } +static gfxFont::Metrics +GetFirstFontMetrics(gfxFontGroup* aFontGroup, bool aVerticalMetrics) +{ + if (!aFontGroup) + return gfxFont::Metrics(); + gfxFont* font = aFontGroup->GetFirstValidFont(); + return font->GetMetrics(aVerticalMetrics ? gfxFont::eVertical + : gfxFont::eHorizontal); +} + static nscoord LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr) { @@ -1826,16 +1836,6 @@ GetHyphenTextRun(gfxTextRun* aTextRun, gfxContext* aContext, nsTextFrame* aTextF MakeHyphenTextRun(ctx, aTextRun->GetAppUnitsPerDevUnit()); } -static gfxFont::Metrics -GetFirstFontMetrics(gfxFontGroup* aFontGroup, bool aVerticalMetrics) -{ - if (!aFontGroup) - return gfxFont::Metrics(); - gfxFont* font = aFontGroup->GetFirstValidFont(); - return font->GetMetrics(aVerticalMetrics ? gfxFont::eVertical - : gfxFont::eHorizontal); -} - PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NORMAL == 0); PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_PRE == 1); PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NOWRAP == 2);