summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2023-10-26 03:27:29 +1100
committerTomaž Vajngerl <quikee@gmail.com>2023-12-28 02:34:56 +0100
commit7c1a359663355fac356e1eccf76f3f0247d4e3c6 (patch)
tree91bca9c5a327b5156252ae2bb61b14298de1d572
parent938d3b35b83093de4e310d32de5137f6bdbcf22b (diff)
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>
-rw-r--r--vcl/inc/textlayout.hxx4
-rw-r--r--vcl/qa/cppunit/textlayout.cxx6
-rw-r--r--vcl/source/text/textlayout.cxx8
3 files changed, 9 insertions, 9 deletions
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index d05259475d18..7f81fcbeb10a 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -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,
diff --git a/vcl/qa/cppunit/textlayout.cxx b/vcl/qa/cppunit/textlayout.cxx
index 3ace6a8b836d..36129aec6920 100644
--- a/vcl/qa/cppunit/textlayout.cxx
+++ b/vcl/qa/cppunit/textlayout.cxx
@@ -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);
diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index e90c56b6355a..8797689963c0 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -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;