diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-01-11 11:21:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-01-11 13:55:14 +0100 |
commit | 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch) | |
tree | bc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /sw | |
parent | a0210c5c5e8fd47b55567a8b18788d57d2b7decb (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 'sw')
-rw-r--r-- | sw/source/core/access/accportions.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.cxx | 6 |
6 files changed, 32 insertions, 11 deletions
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 3cb904eaa634..a5cac3f6f6b6 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include "accportions.hxx" #include <rtl/ustring.hxx> #include <com/sun/star/i18n/Boundary.hpp> @@ -125,7 +129,7 @@ void SwAccessiblePortionData::Text(TextFrameIndex const nLength, m_aPortionAttrs.push_back( nAttr ); // update buffer + nViewPosition - m_aBuffer.appendCopy(m_pTextFrame->GetText(), sal_Int32(m_nViewPosition), sal_Int32(nLength)); + m_aBuffer.append(std::u16string_view(m_pTextFrame->GetText()).substr(sal_Int32(m_nViewPosition), sal_Int32(nLength))); m_nViewPosition += nLength; } diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 982abef78a34..0ba681813caa 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -23,6 +23,7 @@ #include <cfloat> #include <climits> #include <memory> +#include <string_view> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <cstdlib> @@ -758,8 +759,8 @@ SwCalcOper SwCalc::GetToken() // ignore the ] if ('\\' == m_sCommand[nFndPos-1]) { - m_aVarName.appendCopy(m_sCommand, nSttPos, - nFndPos - nSttPos - 1 ); + m_aVarName.append(std::u16string_view(m_sCommand).substr(nSttPos, + nFndPos - nSttPos - 1) ); nSttPos = ++nFndPos; } else @@ -770,8 +771,8 @@ SwCalcOper SwCalc::GetToken() if( nFndPos != -1 ) { if( nSttPos != nFndPos ) - m_aVarName.appendCopy(m_sCommand, nSttPos, - nFndPos - nSttPos ); + m_aVarName.append(std::u16string_view(m_sCommand).substr(nSttPos, + nFndPos - nSttPos) ); aRes.EndPos = nFndPos + 1; m_eCurrOper = CALC_NAME; } diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 0d888149e6d0..f188f65f5791 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <tools/gen.hxx> #include <hintids.hxx> #include <editeng/protitem.hxx> @@ -1026,7 +1030,7 @@ OUString SwPaM::GetText() const ? End()->nContent.GetIndex() : aTmpStr.getLength(); - aResult.appendCopy(aTmpStr, nStart, nEnd-nStart); + aResult.append(std::u16string_view(aTmpStr).substr(nStart, nEnd-nStart)); } else { diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index e5971f552bfb..bb0aad922518 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <float.h> #include <hintids.hxx> #include <hints.hxx> @@ -640,12 +644,12 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTa if (nStt<0 || nEnd<0 ) { // set the rest and finish - aStr.appendCopy(m_sFormula, nFormula); + aStr.append(std::u16string_view(m_sFormula).substr(nFormula)); break; } // write beginning - aStr.appendCopy(m_sFormula, nFormula, nStt - nFormula); + aStr.append(std::u16string_view(m_sFormula).substr(nFormula, nStt - nFormula)); if (fnFormula) { diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index f948d0de950b..c66465ab953b 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <hintids.hxx> #include <o3tl/make_unique.hxx> #include <svl/whiter.hxx> @@ -92,7 +96,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, if (pStart->nContent != nLastEnd) // not 0 so we eliminate adjacent deletes { extents.emplace_back(pNode, nLastEnd, pStart->nContent.GetIndex()); - mergedText.appendCopy(pNode->GetText(), nLastEnd, pStart->nContent.GetIndex() - nLastEnd); + mergedText.append(std::u16string_view(pNode->GetText()).substr(nLastEnd, pStart->nContent.GetIndex() - nLastEnd)); } if (&pEnd->nNode.GetNode() != pNode) { @@ -213,7 +217,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, if (nLastEnd != pNode->Len()) { extents.emplace_back(pNode, nLastEnd, pNode->Len()); - mergedText.appendCopy(pNode->GetText(), nLastEnd, pNode->Len() - nLastEnd); + mergedText.append(std::u16string_view(pNode->GetText()).substr(nLastEnd, pNode->Len() - nLastEnd)); } if (extents.empty()) // there was no text anywhere { diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index d20f484c1b6e..5d12115e023c 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <comphelper/classids.hxx> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/XLinkageSupport.hpp> @@ -367,7 +371,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( if( aBuffer.isEmpty() ) { aBuffer.append( '\'' ); - aBuffer.appendCopy( sRange, 0, i ); + aBuffer.append( std::u16string_view(sRange).substr(0, i) ); } if( '\'' == c || '\\' == c ) aBuffer.append( '\\' ); |