diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-03 16:19:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-04 11:57:40 +0200 |
commit | b58c0531cfb1bc9d1d948f6298b30e8afe0f6f35 (patch) | |
tree | 0e88f6fdc1fb1961cd7d8b73810402271258e276 | |
parent | 66a71a288bea335cd5737710ee2f7e36ebd934a4 (diff) |
simplify lcl_parseHandleRef
Change-Id: I0a7cb2754ab43b8b627f196c99778b5fa3f2e005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133808
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | oox/source/drawingml/customshapepresetdata.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index cd4efc2d4c93..4e93f4f76a06 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -335,13 +335,12 @@ void lcl_parseHandleRange(std::vector<beans::PropertyValue>& rHandle, const OStr void lcl_parseHandleRef(std::vector<beans::PropertyValue>& rHandle, const OString& rValue, const OUString& rName) { - static const char aPrefix[] = "\", Handle = (long) 0, Value = (any) { (long) "; - const sal_Int32 nCheck = SAL_N_ELEMENTS(aPrefix) - 1; + static constexpr std::string_view aPrefix = "\", Handle = (long) 0, Value = (any) { (long) "; const sal_Int32 nStart = SAL_N_ELEMENTS("Name = \"") - 1 + rName.getLength(); - if (rValue.copy(nStart, nCheck).equalsL(aPrefix, nCheck)) + if (rValue.subView(nStart, aPrefix.size()) == aPrefix) { - sal_Int32 nIndex = nStart + nCheck; + sal_Int32 nIndex = nStart + aPrefix.size(); beans::PropertyValue aPropertyValue; aPropertyValue.Name = rName; // We only expect a Value here |