diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-02-09 20:48:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-02-10 10:33:25 +0100 |
commit | 4cae353cae28f6530544ad5864d4ce3075ac5bcc (patch) | |
tree | 6d5adffbaa05ac9d1cd320ac393040490d3c289f /sw | |
parent | 4b92707c19ef47cdb9474224e83e5153c54b661d (diff) |
Fix loplugin:stringliteralvar
...detection of
OUString( const sal_Unicode * value, sal_Int32 length )
ctor. (On platforms where sal_Int32 is a typedef for int, an argument that
already is of type int will not be wrapped in an ImplicitCastExpr to the
sal_Int32 typedef.)
Change-Id: Ifc5456a62d42c1acad76ea949549dc24bd67201a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110654
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index fdd4e276b951..2d2ec84a1eed 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -876,8 +876,8 @@ namespace sw::mark { return vListEntries[nCurrentIdx]; } - static const sal_Unicode vEnSpaces[ODF_FORMFIELD_DEFAULT_LENGTH] = {8194, 8194, 8194, 8194, 8194}; - return OUString(vEnSpaces, ODF_FORMFIELD_DEFAULT_LENGTH); + static constexpr OUStringLiteral vEnSpaces = u"\u2002\u2002\u2002\u2002\u2002"; + return vEnSpaces; } } diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index a25de40e60ec..582bcb524bf2 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -690,12 +690,12 @@ FIELD_INSERT: if(pCursorPos) { // Insert five En Space into the text field so the field has extent - static const sal_Unicode vEnSpaces[ODF_FORMFIELD_DEFAULT_LENGTH] = {8194, 8194, 8194, 8194, 8194}; - bool bSuccess = rSh.GetDoc()->getIDocumentContentOperations().InsertString(*pCursorPos, OUString(vEnSpaces, ODF_FORMFIELD_DEFAULT_LENGTH)); + static constexpr OUStringLiteral vEnSpaces = u"\u2002\u2002\u2002\u2002\u2002"; + bool bSuccess = rSh.GetDoc()->getIDocumentContentOperations().InsertString(*pCursorPos, vEnSpaces); if(bSuccess) { IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess(); - SwPaM aFieldPam(pCursorPos->GetPoint()->nNode, pCursorPos->GetPoint()->nContent.GetIndex() - ODF_FORMFIELD_DEFAULT_LENGTH, + SwPaM aFieldPam(pCursorPos->GetPoint()->nNode, pCursorPos->GetPoint()->nContent.GetIndex() - vEnSpaces.getLength(), pCursorPos->GetPoint()->nNode, pCursorPos->GetPoint()->nContent.GetIndex()); pMarksAccess->makeFieldBookmark(aFieldPam, OUString(), ODF_FORMTEXT, aFieldPam.Start()); |