1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <rtl/strbuf.hxx>
11 #include <rtl/string.hxx>
12 #include <rtl/ustrbuf.hxx>
13 #include <rtl/ustring.hxx>
15 // ---------------------------------------------------------------
16 // replacing OUStringBuffer.append sequences to OUString+
21 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
28 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
30 v
.append("xxx").append("aaaa");
32 void f3(OString class_name
)
34 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
35 OStringBuffer
sig_buf(5 + class_name
.getLength());
36 sig_buf
.append("(I)L");
37 //sig_buf.append( class_name.replace( '.', '/' ) );
39 OString
sig(sig_buf
.makeStringAndClear());
42 void f4(sal_Unicode
const* pPathBegin
)
44 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
46 v
.append(pPathBegin
, 12);
49 void f5(OUStringBuffer
& input
)
51 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
52 OUStringBuffer
v(input
);
57 OStringBuffer m_descriptorStart
;
58 OString m_descriptorEnd
;
61 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
62 OStringBuffer
buf(m_descriptorStart
);
63 buf
.append(m_descriptorEnd
);
64 return buf
.makeStringAndClear();
73 // no warning expected
79 void appendTo(OUStringBuffer
&);
82 // no warning expected
89 // no warning expected
96 // no warning expected
103 // no warning expected
104 OUStringBuffer
noel1("xxx");
106 noel1
.append("ffff").append("aaa");
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */