summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 11:21:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 13:55:14 +0100
commit70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch)
treebc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /xmloff
parenta0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff)
Replace OUStringBuffer::appendCopy with append(std::u16string_view)
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmluconv.cxx5
-rw-r--r--xmloff/source/meta/xmlmetai.cxx8
-rw-r--r--xmloff/source/style/fonthdl.cxx6
-rw-r--r--xmloff/source/style/xmlexppr.cxx3
4 files changed, 17 insertions, 5 deletions
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 804265efb022..2f0f4017e6da 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
#include <xmloff/xmluconv.hxx>
@@ -393,7 +396,7 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer,
// Truncate nFractionDecimals+1 digit if it was not rounded to zero.
const sal_Int32 nCount = nLen - 2 - static_cast<int>(nLen > nFractionDecimals + 2);
rBuffer.append( '.');
- rBuffer.appendCopy( aFraction, 2, nCount); // strip 0.
+ rBuffer.append( std::u16string_view(aFraction).substr(2, nCount)); // strip 0.
}
}
}
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 21f634fe50e5..c64e2f7cd068 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.hpp>
@@ -236,8 +240,8 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno:
if ( nBegin != -1 )
{
sBuffer.append( '$' );
- sBuffer.appendCopy( i_rBuildId,
- nBegin + sBuildCompare.getLength() );
+ sBuffer.append( std::u16string_view(i_rBuildId).substr(
+ nBegin + sBuildCompare.getLength()) );
sBuildId = sBuffer.makeStringAndClear();
}
}
diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx
index 60da2fca83e1..e446aab5b437 100644
--- a/xmloff/source/style/fonthdl.cxx
+++ b/xmloff/source/style/fonthdl.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include "fonthdl.hxx"
#include <sax/tools/converter.hxx>
@@ -93,7 +97,7 @@ bool XMLFontFamilyNamePropHdl::importXML( const OUString& rStrImpValue, uno::Any
if( !sValue.isEmpty() )
sValue.append(';');
- sValue.appendCopy(rStrImpValue, nFirst, nLast-nFirst+1);
+ sValue.append(std::u16string_view(rStrImpValue).substr(nFirst, nLast-nFirst+1));
}
if( -1 != nPos )
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 7f85710cc1cf..be0f9de521df 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+#include <string_view>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/xml/AttributeData.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
@@ -937,7 +938,7 @@ void SvXMLExportPropertyMapper::_exportXML(
sPrefix = pNamespaceMap->GetPrefixByKey( nKey );
}
// In any case, the attribute name has to be adapted.
- sNameBuffer.append(sPrefix).append(":").appendCopy(*pAttribName, nColonPos+1 );
+ sNameBuffer.append(sPrefix).append(":").append(std::u16string_view(*pAttribName).substr(nColonPos+1) );
sAttribName = sNameBuffer.makeStringAndClear();
}