diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 10:22:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 13:23:42 +0200 |
commit | bf39807c67eb2dc7596926486a22d781e8969d47 (patch) | |
tree | 55adb68b8fa059dd3b68fcc0012cf7fe7de94794 /editeng/qa | |
parent | 20e1822a2582d4207b13368b3521b9d42407ce69 (diff) |
loplugin:oncevar editeng..extensions
Change-Id: I3a63e3e3b873ef8a2d708d39be084124a6ad1346
Reviewed-on: https://gerrit.libreoffice.org/39153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/qa')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index b71c90c72dfc..1f67db2b479a 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -332,8 +332,8 @@ void Test::testAutocorrect() { OUString sInput("TEst-TEst"); - sal_Unicode cNextChar(' '); - OUString sExpected("Test-Test "); + sal_Unicode const cNextChar(' '); + OUString const sExpected("Test-Test "); TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US); aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true); @@ -343,8 +343,8 @@ void Test::testAutocorrect() { OUString sInput("TEst/TEst"); - sal_Unicode cNextChar(' '); - OUString sExpected("Test/Test "); + sal_Unicode const cNextChar(' '); + OUString const sExpected("Test/Test "); TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US); aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true); @@ -355,8 +355,8 @@ void Test::testAutocorrect() { // test auto-bolding with '*' OUString sInput("*foo"); - sal_Unicode cNextChar('*'); - OUString sExpected("foo"); + sal_Unicode const cNextChar('*'); + OUString const sExpected("foo"); TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US); aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true); @@ -366,8 +366,8 @@ void Test::testAutocorrect() { OUString sInput("Test. test"); - sal_Unicode cNextChar(' '); - OUString sExpected("Test. Test "); + sal_Unicode const cNextChar(' '); + OUString const sExpected("Test. Test "); TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US); aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true); @@ -378,8 +378,8 @@ void Test::testAutocorrect() // don't autocapitalize after a field mark { OUString sInput("Test. \x01 test"); - sal_Unicode cNextChar(' '); - OUString sExpected("Test. \x01 test "); + sal_Unicode const cNextChar(' '); + OUString const sExpected("Test. \x01 test "); TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US); aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true); @@ -771,8 +771,7 @@ void Test::testBoldItalicCopyPaste() std::vector<editeng::Section> aAttrs1; pEditText1->GetAllSections( aAttrs1 ); // There should be 3 sections - woBold - wBold - woBold (w - with, wo - without) - size_t nSecCountCheck1 = 3; - CPPUNIT_ASSERT_EQUAL( nSecCountCheck1, aAttrs1.size() ); + CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() ); const editeng::Section* pSecAttr = &aAttrs1[0]; CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph ); @@ -804,8 +803,7 @@ void Test::testBoldItalicCopyPaste() std::vector<editeng::Section> aAttrs2; pEditText2->GetAllSections( aAttrs2 ); // There should be 5 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic (w - with, wo - without) - size_t nSecCountCheck2 = 5; - CPPUNIT_ASSERT_EQUAL( nSecCountCheck2, aAttrs2.size() ); + CPPUNIT_ASSERT_EQUAL( size_t(5), aAttrs2.size() ); pSecAttr = &aAttrs2[0]; CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph ); @@ -856,8 +854,7 @@ void Test::testBoldItalicCopyPaste() pEditText3->GetAllSections( aAttrs3 ); // There should be 9 sections - woBold&woItalic - wBold&woItalic - wBold&wItalic - woBold&wItalic - woBold&woItalic - wBold&woItalic // - wBold&wItalic - woBold&wItalic - woBold&woItalic(w - with, wo - without) - size_t nSecCountCheck3 = 9; - CPPUNIT_ASSERT_EQUAL( nSecCountCheck3, aAttrs3.size() ); + CPPUNIT_ASSERT_EQUAL( size_t(9), aAttrs3.size() ); pSecAttr = &aAttrs3[0]; CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph ); @@ -972,8 +969,7 @@ void Test::testUnderlineCopyPaste() pEditText1->GetAllSections( aAttrs1 ); // There should be 3 sections - woUnderline - wUnderline - woUnderline (w - with, wo - without) - size_t nSecCountCheck1 = 3; - CPPUNIT_ASSERT_EQUAL( nSecCountCheck1, aAttrs1.size() ); + CPPUNIT_ASSERT_EQUAL( size_t(3), aAttrs1.size() ); const editeng::Section* pSecAttr = &aAttrs1[0]; CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph ); @@ -1010,8 +1006,7 @@ void Test::testUnderlineCopyPaste() pEditText2->GetAllSections( aAttrs2 ); // There should be 4 sections - woUnderline - wUnderline - woUnderline - wUnderline (w - with, wo - without) - size_t nSecCountCheck2 = 4; - CPPUNIT_ASSERT_EQUAL( nSecCountCheck2, aAttrs2.size() ); + CPPUNIT_ASSERT_EQUAL( size_t(4), aAttrs2.size() ); pSecAttr = &aAttrs2[0]; CPPUNIT_ASSERT_EQUAL( 0, (int)pSecAttr->mnParagraph ); @@ -1098,8 +1093,7 @@ void Test::testSectionAttributes() aEngine.Clear(); aEngine.SetText("one\n\ntwo\n\nthree"); sal_Int32 nParaCount = aEngine.GetParagraphCount(); - sal_Int32 nCheck = 5; - CPPUNIT_ASSERT_EQUAL(nCheck, nParaCount); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nParaCount); // Apply boldness to paragraphs 1, 3, 5 only. Leave 2 and 4 unformatted. pSet.reset(new SfxItemSet(aEngine.GetEmptyItemSet())); @@ -1113,8 +1107,7 @@ void Test::testSectionAttributes() CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get()); std::vector<editeng::Section> aAttrs; pEditText->GetAllSections(aAttrs); - size_t nSecCountCheck = 5; - CPPUNIT_ASSERT_EQUAL(nSecCountCheck, aAttrs.size()); + CPPUNIT_ASSERT_EQUAL(size_t(5), aAttrs.size()); // 1st, 3rd and 5th sections should correspond with 1st, 3rd and 5th paragraphs. const editeng::Section* pSecAttr = &aAttrs[0]; |