vcl: BreakLines() -> BreakLine() and BreakLinesSimple() -> BreakLineSimple()
Change-Id: I8cb778a09566c1b7d6c2ba4ac5766a5675e62465 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158465 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
parent
938d3b35b8
commit
7c1a359663
3 changed files with 9 additions and 9 deletions
|
@ -52,13 +52,13 @@ namespace vcl
|
|||
public:
|
||||
OUString GetEllipsisString(OUString const& rOrigStr, tools::Long nMaxWidth, DrawTextFlags nStyle);
|
||||
|
||||
std::tuple<sal_Int32, sal_Int32> BreakLines(const tools::Long nWidth, OUString const& rStr,
|
||||
std::tuple<sal_Int32, sal_Int32> BreakLine(const tools::Long nWidth, OUString const& rStr,
|
||||
css::uno::Reference< css::linguistic2::XHyphenator > const& xHyph,
|
||||
css::uno::Reference<css::i18n::XBreakIterator>& xBI,
|
||||
const bool bHyphenate, const tools::Long nOrigLineWidth,
|
||||
const sal_Int32 nPos, const sal_Int32 nLen);
|
||||
|
||||
std::tuple<sal_Int32, sal_Int32> BreakLinesSimple(const tools::Long nWidth, OUString const& rStr,
|
||||
std::tuple<sal_Int32, sal_Int32> BreakLineSimple(const tools::Long nWidth, OUString const& rStr,
|
||||
const sal_Int32 nPos, sal_Int32 nBreakPos, const tools::Long nOrigLineWidth);
|
||||
|
||||
tools::Long GetTextLines(tools::Rectangle const& rRect, const tools::Long nTextHeight,
|
||||
|
|
|
@ -49,7 +49,7 @@ CPPUNIT_TEST_FIXTURE(VclTextLayoutTest, testBreakLines_invalid_softbreak)
|
|||
const auto nTextLen = 13;
|
||||
|
||||
auto[nBreakPos, nLineWidth]
|
||||
= aTextLayout.BreakLines(nTextWidth, sTestStr, xHyph, xBI, false, nTextWidth, nTextLen, 15);
|
||||
= aTextLayout.BreakLine(nTextWidth, sTestStr, xHyph, xBI, false, nTextWidth, nTextLen, 15);
|
||||
|
||||
const sal_Int32 nExpectedBreakPos = 13;
|
||||
CPPUNIT_ASSERT_EQUAL(nExpectedBreakPos, nBreakPos);
|
||||
|
@ -75,7 +75,7 @@ CPPUNIT_TEST_FIXTURE(VclTextLayoutTest, testBreakLines_hyphens)
|
|||
css::uno::Reference<css::i18n::XBreakIterator> xBI = vcl::unohelper::CreateBreakIterator();
|
||||
|
||||
auto[nBreakPos, nLineWidth]
|
||||
= aTextLayout.BreakLines(nTextWidth, sTestStr, xHyph, xBI, true, nTextWidth, 13, 12);
|
||||
= aTextLayout.BreakLine(nTextWidth, sTestStr, xHyph, xBI, true, nTextWidth, 13, 12);
|
||||
|
||||
const sal_Int32 nExpectedBreakPos = 13;
|
||||
CPPUNIT_ASSERT_EQUAL(nExpectedBreakPos, nBreakPos);
|
||||
|
@ -101,7 +101,7 @@ CPPUNIT_TEST_FIXTURE(VclTextLayoutTest, testBreakLines_hyphen_word_under_two_cha
|
|||
css::uno::Reference<css::i18n::XBreakIterator> xBI = vcl::unohelper::CreateBreakIterator();
|
||||
|
||||
auto[nBreakPos, nLineWidth]
|
||||
= aTextLayout.BreakLines(nTextWidth, sTestStr, xHyph, xBI, true, nTextWidth, 2, 10);
|
||||
= aTextLayout.BreakLine(nTextWidth, sTestStr, xHyph, xBI, true, nTextWidth, 2, 10);
|
||||
|
||||
const sal_Int32 nExpectedBreakPos = 2;
|
||||
CPPUNIT_ASSERT_EQUAL(nExpectedBreakPos, nBreakPos);
|
||||
|
|
|
@ -218,7 +218,7 @@ namespace vcl
|
|||
return aStr;
|
||||
}
|
||||
|
||||
std::tuple<sal_Int32, sal_Int32> TextLayoutCommon::BreakLines(const tools::Long nWidth, OUString const& rStr,
|
||||
std::tuple<sal_Int32, sal_Int32> TextLayoutCommon::BreakLine(const tools::Long nWidth, OUString const& rStr,
|
||||
css::uno::Reference< css::linguistic2::XHyphenator > const& xHyph,
|
||||
css::uno::Reference<css::i18n::XBreakIterator>& xBI,
|
||||
const bool bHyphenate, const tools::Long nOrigLineWidth,
|
||||
|
@ -228,7 +228,7 @@ namespace vcl
|
|||
xBI = vcl::unohelper::CreateBreakIterator();
|
||||
|
||||
if (!xBI.is())
|
||||
return BreakLinesSimple(nWidth, rStr, nPos, nLen, nOrigLineWidth);
|
||||
return BreakLineSimple(nWidth, rStr, nPos, nLen, nOrigLineWidth);
|
||||
|
||||
const css::lang::Locale& rDefLocale(Application::GetSettings().GetUILanguageTag().getLocale());
|
||||
|
||||
|
@ -338,7 +338,7 @@ namespace vcl
|
|||
return { nBreakPos, GetTextWidth(rStr, nPos, nBreakPos - nPos) };
|
||||
}
|
||||
|
||||
std::tuple<sal_Int32, sal_Int32> TextLayoutCommon::BreakLinesSimple(const tools::Long nWidth, OUString const& rStr,
|
||||
std::tuple<sal_Int32, sal_Int32> TextLayoutCommon::BreakLineSimple(const tools::Long nWidth, OUString const& rStr,
|
||||
const sal_Int32 nPos, const sal_Int32 nLen, const tools::Long nOrigLineWidth)
|
||||
{
|
||||
sal_Int32 nBreakPos = nLen;
|
||||
|
@ -425,7 +425,7 @@ namespace vcl
|
|||
|
||||
|
||||
if (lcl_ShouldBreakWord(nLineWidth, nWidth, nStyle))
|
||||
std::tie(nBreakPos, nLineWidth) = BreakLines(nWidth, rStr, xHyph, xBI, bHyphenate, nLineWidth, nPos, nBreakPos);
|
||||
std::tie(nBreakPos, nLineWidth) = BreakLine(nWidth, rStr, xHyph, xBI, bHyphenate, nLineWidth, nPos, nBreakPos);
|
||||
|
||||
if ( nLineWidth > nMaxLineWidth )
|
||||
nMaxLineWidth = nLineWidth;
|
||||
|
|
Loading…
Reference in a new issue