From 7de833a626cea8cd741ba1d971fea6f0c3a2660b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 11 Jul 2017 11:04:35 +0200 Subject: simplify calls OUString::copy in foo.copy(x, foo.getLength() - x) Change-Id: I20318c77dcc3bc2a64336541ef5a3f412bfd9483 Reviewed-on: https://gerrit.libreoffice.org/39803 Tested-by: Jenkins Reviewed-by: Noel Grandin --- lotuswordpro/source/filter/lwpfribmark.cxx | 2 +- lotuswordpro/source/filter/lwpmarker.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index 05f4bc81daea..6c5ce34e8a20 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -374,7 +374,7 @@ void LwpFribField::RegisterTimeField(LwpFieldMark* pFieldMark) OUString tag = sFormula.copy(0,index); if (tag == "Now()" || tag == "CreateDate" || tag == "EditDate") - RegisterDateTimeStyle(sFormula.copy(index+1,sFormula.getLength()-index-1)); + RegisterDateTimeStyle(sFormula.copy(index+1)); } } diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx index 97ddd200511e..5743daae7ebc 100644 --- a/lotuswordpro/source/filter/lwpmarker.cxx +++ b/lotuswordpro/source/filter/lwpmarker.cxx @@ -436,19 +436,19 @@ bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula) if (tag == "Now()") { type = DATETIME_NOW; - formula = sFormula.copy(index+1,sFormula.getLength()-index-1); + formula = sFormula.copy(index+1); return true; } else if (tag == "CreateDate") { type = DATETIME_CREATE; - formula = sFormula.copy(index+1,sFormula.getLength()-index-1); + formula = sFormula.copy(index+1); return true; } else if (tag == "EditDate") { type = DATETIME_LASTEDIT; - formula = sFormula.copy(index+1,sFormula.getLength()-index-1); + formula = sFormula.copy(index+1); return true; } else if (tag == "YesterdaysDate" || tag == "TomorrowsDate" @@ -482,13 +482,13 @@ bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName) OUString tag = sFormula.copy(0,index); if (tag == "PageRef") { - sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1); + sMarkName = sFormula.copy(index+1); nType = CROSSREF_PAGE; return true; } else if (tag == "ParaRef") { - sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1); + sMarkName = sFormula.copy(index+1); nType = CROSSREF_PARANUMBER; return true; } -- cgit