summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-05-28 19:41:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-17 11:55:13 +0200
commit9881bea8d41997fb46579eb5f0314300159c96cc (patch)
treef52daa7055d2d28959e2d1ad576d963b7c0d3b2d /sw
parentec4034c4a4f23574401ba2a74b635d9ed4befbc8 (diff)
remove unnecessary use of OUString::getStr
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/access/accpara.cxx7
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
-rw-r--r--sw/source/core/edit/edlingu.cxx4
-rw-r--r--sw/source/core/txtnode/txtedt.cxx2
-rw-r--r--sw/source/core/unocore/unochart.cxx2
-rw-r--r--sw/source/uibase/uiview/viewling.cxx2
6 files changed, 8 insertions, 11 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 68f6b067be2a..d413cda631af 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -766,11 +766,8 @@ bool SwAccessibleParagraph::GetSentenceBoundary(
sal_Int32 nPos )
{
const sal_Unicode* pStr = rText.getStr();
- if (pStr)
- {
- while( nPos < rText.getLength() && pStr[nPos] == u' ' )
- nPos++;
- }
+ while( nPos < rText.getLength() && pStr[nPos] == u' ' )
+ nPos++;
GetPortionData().GetSentenceBoundary( rBound, nPos );
return true;
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 18abfe6ae3f4..3aa7991b4881 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3488,7 +3488,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, SwRect& rSelectRect )
// modify the selection accordingly.
const sal_Unicode* pChar = aText.getStr();
sal_Int32 nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ while (*pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : nullptr;
sal_Int32 nRight = 0;
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 94186299947a..d62d1cc118a3 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -897,7 +897,7 @@ uno::Reference< XSpellAlternatives >
// modify the selection accordingly.
const sal_Unicode* pChar = aText.getStr();
sal_Int32 nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ while (*pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : nullptr;
sal_Int32 nRight = 0;
@@ -1022,7 +1022,7 @@ bool SwEditShell::GetGrammarCorrection(
// order to modify the selection accordingly.
const sal_Unicode* pChar = aText.getStr();
sal_Int32 nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ while (*pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : nullptr;
sal_Int32 nRight = 0;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 56b0c0c466cf..9c83bdfcb335 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1063,7 +1063,7 @@ bool SwTextNode::Spell(SwSpellArgs* pArgs)
// selection accordingly.
const sal_Unicode* pChar = rWord.getStr();
sal_Int32 nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ while (*pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = rWord.getLength() ? rWord.getStr() + rWord.getLength() - 1 : nullptr;
sal_Int32 nRight = 0;
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index c2c4086b27f6..25217f56e2fa 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -2066,7 +2066,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
if (bUseCol)
{
aRplc = "%COLUMNLETTER";
- aNew = OUString(aCellName.getStr(), pBuf - aCellName.getStr());
+ aNew = aCellName.copy(0, pBuf - aCellName.getStr());
}
else
{
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 187f81e33fde..7ac25e45d11d 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -516,7 +516,7 @@ void SwView::InsertThesaurusSynonym( const OUString &rSynonmText, const OUString
// the selection accordingly.
const sal_Unicode* pChar = rLookUpText.getStr();
sal_Int32 nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ while (*pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = rLookUpText.getLength() ? rLookUpText.getStr() + rLookUpText.getLength() - 1 : nullptr;
sal_Int32 nRight = 0;