summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-11 11:04:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-11 14:13:03 +0200
commit7de833a626cea8cd741ba1d971fea6f0c3a2660b (patch)
tree2750dbed735b4df7a9e82add532df49049cc52e8 /unoxml
parent6f9f9491bdef676f969898bd653db9905d14f5e8 (diff)
simplify calls OUString::copy in foo.copy(x, foo.getLength() - x)
Change-Id: I20318c77dcc3bc2a64336541ef5a3f412bfd9483 Reviewed-on: https://gerrit.libreoffice.org/39803 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/characterdata.cxx6
-rw-r--r--unoxml/source/dom/document.cxx4
2 files changed, 5 insertions, 5 deletions
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx
index 35466db362f8..e8ac2aee7c23 100644
--- a/unoxml/source/dom/characterdata.cxx
+++ b/unoxml/source/dom/characterdata.cxx
@@ -98,7 +98,7 @@ namespace DOM
count = tmp.getLength() - offset;
OUString tmp2 = tmp.copy(0, offset);
- tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
+ tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
@@ -167,7 +167,7 @@ namespace DOM
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
- tmp2 += tmp.copy(offset, tmp.getLength() - offset);
+ tmp2 += tmp.copy(offset);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
@@ -203,7 +203,7 @@ namespace DOM
OUString tmp2 = tmp.copy(0, offset);
tmp2 += arg;
- tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
+ tmp2 += tmp.copy(offset+count);
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 9cba7eec823d..11fe708fe902 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -457,7 +457,7 @@ namespace DOM
if (i != -1)
{
oPrefix = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
- oName = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
+ oName = OUStringToOString(qname.copy(i+1), RTL_TEXTENCODING_UTF8);
}
else
{
@@ -548,7 +548,7 @@ namespace DOM
if ( i != -1) {
o1 = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
pPrefix = reinterpret_cast<xmlChar const *>(o1.getStr());
- o2 = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
+ o2 = OUStringToOString(qname.copy(i+1), RTL_TEXTENCODING_UTF8);
pName = reinterpret_cast<xmlChar const *>(o2.getStr());
} else {
// default prefix