[Libreoffice-commits] .: Branch 'refs/remotes/origin/master' - 37 commits - automation/source basctl/source basic/source comphelper/inc comphelper/source configure.in connectivity/inc connectivity/source cui/source dbaccess/source distro-configs/LibreOfficeDragonFly.conf editeng/inc editeng/source formula/Library_forui.mk formula/source i18npool/inc i18npool/source idl/inc idl/source l10ntools/inc l10ntools/source linguistic/source linguistic/workben offapi/com offapi/UnoApi_offapi.mk rsc/source scp2/source sc/source sfx2/source solenv/bin starmath/inc starmath/source svl/inc svl/source svtools/bmpmaker svtools/source svtools/workben svx/inc svx/source sw/source tools/inc tools/Package_inc.mk tools/source unotools/inc unotools/source unusedcode.easy vcl/aqua vcl/inc vcl/source writerfilter/source
August Sodora
augsod at freedesktop.org
Sat Nov 19 21:49:40 PST 2011
automation/source/server/statemnt.cxx | 3
automation/source/simplecm/simplecm.cxx | 6
basctl/source/basicide/brkdlg.cxx | 5
basic/source/app/app.cxx | 7
basic/source/app/status.cxx | 3
basic/source/comp/scanner.cxx | 39
basic/source/inc/scanner.hxx | 2
basic/source/runtime/methods.cxx | 23
basic/source/runtime/methods1.cxx | 32
comphelper/inc/comphelper/oslfile2streamwrap.hxx | 2
comphelper/source/streaming/oslfile2streamwrap.cxx | 27
configure.in | 2
connectivity/inc/connectivity/sqlnode.hxx | 2
connectivity/inc/connectivity/sqlparse.hxx | 5
connectivity/source/drivers/flat/ETable.cxx | 10
connectivity/source/parse/sqlbison.y | 3
connectivity/source/parse/sqlnode.cxx | 2
cui/source/options/optdict.cxx | 5
cui/source/options/optgdlg.cxx | 3
cui/source/options/optgenrl.cxx | 5
cui/source/options/optlingu.cxx | 1
dbaccess/source/ui/querydesign/QTableWindow.cxx | 5
distro-configs/LibreOfficeDragonFly.conf | 2
editeng/inc/editeng/editview.hxx | 1
editeng/inc/pch/precompiled_editeng.hxx | 1
editeng/source/editeng/editeng.cxx | 6
editeng/source/editeng/editview.cxx | 9
formula/Library_forui.mk | 1
formula/source/ui/dlg/formula.cxx | 3
i18npool/inc/calendarImpl.hxx | 16
i18npool/inc/calendar_gregorian.hxx | 8
i18npool/inc/localedata.hxx | 25
i18npool/source/calendar/calendarImpl.cxx | 55
i18npool/source/calendar/calendar_gregorian.cxx | 63 +
i18npool/source/localedata/LocaleNode.cxx | 198 ++-
i18npool/source/localedata/Makefile | 3
i18npool/source/localedata/data/locale.dtd | 32
i18npool/source/localedata/localedata.cxx | 1195 +++++++++++----------
idl/inc/database.hxx | 33
idl/inc/lex.hxx | 4
idl/source/cmptools/lex.cxx | 4
idl/source/objects/types.cxx | 12
idl/source/prj/database.cxx | 22
l10ntools/inc/export.hxx | 14
l10ntools/inc/xmlparse.hxx | 5
l10ntools/source/export.cxx | 168 +-
l10ntools/source/xrmmerge.cxx | 58 -
linguistic/source/spelldta.cxx | 5
linguistic/workben/makefile.mk | 1
linguistic/workben/sprophelp.cxx | 76 -
linguistic/workben/sprophelp.hxx | 38
linguistic/workben/sspellimp.cxx | 58 -
linguistic/workben/sspellimp.hxx | 4
offapi/UnoApi_offapi.mk | 4
offapi/com/sun/star/i18n/Calendar2.idl | 92 +
offapi/com/sun/star/i18n/CalendarDisplayCode.idl | 96 +
offapi/com/sun/star/i18n/CalendarDisplayIndex.idl | 23
offapi/com/sun/star/i18n/CalendarItem2.idl | 63 +
offapi/com/sun/star/i18n/LocaleCalendar.idl | 2
offapi/com/sun/star/i18n/LocaleData.idl | 2
offapi/com/sun/star/i18n/XCalendar.idl | 14
offapi/com/sun/star/i18n/XCalendar3.idl | 84 +
offapi/com/sun/star/i18n/XLocaleData.idl | 6
offapi/com/sun/star/i18n/XLocaleData3.idl | 65 +
rsc/source/rsc/rsc.cxx | 2
sc/source/core/tool/editutil.cxx | 5
sc/source/core/tool/userlist.cxx | 4
sc/source/ui/docshell/docsh8.cxx | 5
sc/source/ui/docshell/impex.cxx | 2
sc/source/ui/miscdlgs/acredlin.cxx | 16
scp2/source/python/module_python.ulf | 2
sfx2/source/dialog/filedlghelper.cxx | 23
sfx2/source/dialog/filedlgimpl.hxx | 2
sfx2/source/dialog/filtergrouping.cxx | 4
sfx2/source/dialog/mailmodel.cxx | 19
sfx2/source/dialog/newstyle.cxx | 4
sfx2/source/doc/objxtor.cxx | 4
solenv/bin/create-ids | 7
starmath/inc/symbol.hxx | 1
starmath/source/dialog.cxx | 4
starmath/source/math_pch.cxx | 1
starmath/source/view.cxx | 5
svl/inc/svl/zformat.hxx | 9
svl/source/numbers/zforfind.cxx | 52
svl/source/numbers/zforfind.hxx | 2
svl/source/numbers/zformat.cxx | 71 +
svl/source/svdde/ddesvr.cxx | 4
svtools/bmpmaker/bmpcore.cxx | 2
svtools/source/control/calendar.cxx | 7
svtools/source/control/ctrltool.cxx | 3
svtools/source/filter/sgvtext.cxx | 3
svtools/source/filter/wmf/winmtf.hxx | 1
svtools/source/graphic/grfmgr.cxx | 6
svtools/source/misc/imap2.cxx | 4
svtools/source/svhtml/parhtml.cxx | 5
svtools/workben/svdem.cxx | 4
svx/inc/pch/precompiled_svx.hxx | 1
svx/inc/svx/galtheme.hxx | 2
svx/source/form/fmpage.cxx | 1
svx/source/gallery2/gallery1.cxx | 37
svx/source/gallery2/galobj.cxx | 37
svx/source/gallery2/galtheme.cxx | 27
svx/source/svdraw/svdundo.cxx | 5
svx/source/tbxctrls/layctrl.cxx | 5
sw/source/core/crsr/crstrvl.cxx | 3
sw/source/core/crsr/findtxt.cxx | 6
sw/source/core/doc/acmplwrd.cxx | 5
sw/source/core/doc/doc.cxx | 3
sw/source/core/edit/editsh.cxx | 3
sw/source/core/edit/edlingu.cxx | 6
sw/source/core/fields/ddefld.cxx | 5
sw/source/core/fields/ddetbl.cxx | 5
sw/source/core/fields/reffld.cxx | 3
sw/source/core/tox/tox.cxx | 4
sw/source/filter/ascii/ascatr.cxx | 3
sw/source/filter/html/htmlfly.cxx | 6
sw/source/filter/html/htmlform.cxx | 5
sw/source/filter/html/htmlgrin.cxx | 4
sw/source/filter/html/swhtml.cxx | 17
sw/source/filter/html/wrthtml.cxx | 4
sw/source/filter/ww8/wrtw8nds.cxx | 6
sw/source/filter/ww8/wrtww8.cxx | 4
sw/source/filter/ww8/ww8graf.cxx | 7
sw/source/filter/ww8/ww8par5.cxx | 6
sw/source/filter/ww8/ww8scan.cxx | 3
sw/source/ui/app/appenv.cxx | 5
sw/source/ui/cctrl/actctrl.cxx | 3
sw/source/ui/dbui/mmaddressblockpage.cxx | 3
sw/source/ui/docvw/edtwin.cxx | 2
sw/source/ui/docvw/edtwin2.cxx | 3
sw/source/ui/fldui/inpdlg.cxx | 4
sw/source/ui/misc/bookmark.cxx | 7
sw/source/ui/ribbar/workctrl.cxx | 4
sw/source/ui/table/instable.cxx | 4
sw/source/ui/uiview/view2.cxx | 9
sw/source/ui/utlui/swrenamexnameddlg.cxx | 3
sw/source/ui/vba/vbafield.cxx | 5
tools/Package_inc.mk | 1
tools/inc/tools/dynary.hxx | 105 -
tools/inc/tools/inetmime.hxx | 120 --
tools/inc/tools/stream.hxx | 6
tools/inc/tools/string.hxx | 3
tools/source/inet/inetmime.cxx | 43
tools/source/stream/stream.cxx | 1
tools/source/string/strimp.cxx | 43
unotools/inc/unotools/bootstrap.hxx | 3
unotools/inc/unotools/calendarwrapper.hxx | 19
unotools/inc/unotools/localedatawrapper.hxx | 15
unotools/source/config/bootstrap.cxx | 17
unotools/source/i18n/calendarwrapper.cxx | 81 -
unotools/source/i18n/localedatawrapper.cxx | 58 -
unusedcode.easy | 8
vcl/aqua/source/window/salmenu.cxx | 10
vcl/inc/vcl/tabctrl.hxx | 4
vcl/source/app/svdata.cxx | 9
vcl/source/control/edit.cxx | 11
vcl/source/control/field.cxx | 8
vcl/source/control/tabctrl.cxx | 25
writerfilter/source/rtftok/rtfsdrimport.hxx | 2
159 files changed, 2220 insertions(+), 1693 deletions(-)
New commits:
commit 63d29ac431f492595486512ba413454baf636b65
Author: Eike Rathke <erack at redhat.com>
Date: Sun Nov 20 03:14:34 2011 +0100
hopefully gb_Executable_EXT_for_build does it
diff --git a/i18npool/source/localedata/Makefile b/i18npool/source/localedata/Makefile
index 246385c..5b899f0 100755
--- a/i18npool/source/localedata/Makefile
+++ b/i18npool/source/localedata/Makefile
@@ -37,7 +37,7 @@ localedata_%.cxx : localedata_%_invis.cxx
sed 's/\(^.*get[^;]*$$\)/SAL_DLLPUBLIC_EXPORT \1/' $< > $@
localedata_%_invis.cxx : $(realpath $(SRC_ROOT)/i18npool/source/localedata/data)/%.xml saxparser.rdb \
- $(OUTDIR_FOR_BUILD)/bin/saxparser$(gb_Executable_EXT)
+ $(OUTDIR_FOR_BUILD)/bin/saxparser$(gb_Executable_EXT_for_build)
ifeq ($(OS_FOR_BUILD),WNT)
$(gb_Helper_execute)saxparser $* `cygpath -m $<` $@ \
$(my_file)`cygpath -m $(WORKDIR)/CustomTarget/i18npool/source/localedata/saxparser.rdb` `cygpath -m $(OUTDIR)/bin/types.rdb` \
commit ef23848eb252e65e0f83250512547ce684e6d4eb
Author: Eike Rathke <erack at redhat.com>
Date: Sun Nov 20 01:04:54 2011 +0100
change OUTDIR to OUTDIR_FOR_BUILD for cross-compilation
diff --git a/i18npool/source/localedata/Makefile b/i18npool/source/localedata/Makefile
index d279269..246385c 100755
--- a/i18npool/source/localedata/Makefile
+++ b/i18npool/source/localedata/Makefile
@@ -37,7 +37,7 @@ localedata_%.cxx : localedata_%_invis.cxx
sed 's/\(^.*get[^;]*$$\)/SAL_DLLPUBLIC_EXPORT \1/' $< > $@
localedata_%_invis.cxx : $(realpath $(SRC_ROOT)/i18npool/source/localedata/data)/%.xml saxparser.rdb \
- $(OUTDIR)/bin/saxparser$(gb_Executable_EXT)
+ $(OUTDIR_FOR_BUILD)/bin/saxparser$(gb_Executable_EXT)
ifeq ($(OS_FOR_BUILD),WNT)
$(gb_Helper_execute)saxparser $* `cygpath -m $<` $@ \
$(my_file)`cygpath -m $(WORKDIR)/CustomTarget/i18npool/source/localedata/saxparser.rdb` `cygpath -m $(OUTDIR)/bin/types.rdb` \
commit b338e513f77d469f9ba252220db164cf3cb5bcea
Author: Andras Timar <atimar at suse.com>
Date: Sat Nov 19 22:42:24 2011 +0100
change URL pointing to openoffice.org domain - fdo#39734
diff --git a/scp2/source/python/module_python.ulf b/scp2/source/python/module_python.ulf
index 2303dcd..400c25e 100644
--- a/scp2/source/python/module_python.ulf
+++ b/scp2/source/python/module_python.ulf
@@ -29,4 +29,4 @@
en-US = "Python-UNO Bridge"
[STR_DESC_MODULE_OPTIONAL_PYTHON]
-en-US = "Adds the ability to automate %PRODUCTNAME with the python scripting language. See http://udk.openoffice.org/python/python-bridge.html for a complete documentation."
+en-US = "Adds the ability to automate %PRODUCTNAME with the Python scripting language. See https://wiki.documentfoundation.org/Development/PyUno for a complete documentation."
commit 2bad94e6b578980b2274a4d9497cc0938adfde0c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Nov 19 21:02:35 2011 +0000
ByteString->rtl::OString
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 445e54b..f3ebecf 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -32,6 +32,7 @@
#include <module.hxx>
#include <hash.hxx>
#include <lex.hxx>
+#include <rtl/string.hxx>
#include <tools/pstm.hxx>
#ifdef IDL_COMPILER
@@ -45,7 +46,7 @@ class SvCommand;
class SvIdlError
{
- ByteString aText;
+ rtl::OString aText;
public:
sal_uInt32 nLine, nColumn;
@@ -53,8 +54,8 @@ public:
SvIdlError( sal_uInt32 nL, sal_uInt32 nC )
: nLine(nL), nColumn(nC) {}
- const ByteString & GetText() const { return aText; }
- void SetText( const ByteString & rT ) { aText = rT; }
+ const rtl::OString& GetText() const { return aText; }
+ void SetText( const rtl::OString& rT ) { aText = rT; }
sal_Bool IsError() const { return nLine != 0; }
void Clear() { nLine = nColumn = 0; }
SvIdlError & operator = ( const SvIdlError & rRef )
@@ -91,11 +92,11 @@ protected:
SvMetaObjectMemberStack aContextStack;
String aPath;
SvIdlError aError;
- void WriteReset()
- {
- aUsedTypes.Clear();
- aIFaceName.Erase();
- }
+ void WriteReset()
+ {
+ aUsedTypes.Clear();
+ aIFaceName = rtl::OString();
+ }
#endif
public:
explicit SvIdlDataBase( const SvCommand& rCmd );
@@ -110,11 +111,11 @@ public:
SvMetaTypeMemberList & GetTypeList();
SvMetaClassMemberList & GetClassList() { return aClassList; }
SvMetaModuleMemberList & GetModuleList() { return aModuleList; }
- SvMetaModule * GetModule( const ByteString & rName );
+ SvMetaModule * GetModule( const rtl::OString& rName );
// list of used types while writing
SvMetaTypeMemberList aUsedTypes;
- ByteString aIFaceName;
+ rtl::OString aIFaceName;
SvNumberIdentifier aStructSlotId;
#ifdef IDL_COMPILER
@@ -130,12 +131,12 @@ public:
SvMetaObjectMemberStack & GetStack() { return aContextStack; }
void Write(const rtl::OString& rText);
- void WriteError( const ByteString & rErrWrn,
- const ByteString & rFileName,
+ void WriteError(const rtl::OString& rErrWrn,
+ const rtl::OString& rFileName,
const rtl::OString& rErrorText,
sal_uLong nRow = 0, sal_uLong nColumn = 0 ) const;
void WriteError( SvTokenStream & rInStm );
- void SetError( const ByteString & rError, SvToken * pTok );
+ void SetError( const rtl::OString& rError, SvToken * pTok );
void Push( SvMetaObject * pObj );
sal_Bool Pop( sal_Bool bOk, SvTokenStream & rInStm, sal_uInt32 nTokPos )
{
@@ -147,11 +148,11 @@ public:
return bOk;
}
sal_uInt32 GetUniqueId() { return ++nUniqueId; }
- sal_Bool FindId( const ByteString & rIdName, sal_uLong * pVal );
- sal_Bool InsertId( const ByteString & rIdName, sal_uLong nVal );
+ sal_Bool FindId( const rtl::OString& rIdName, sal_uLong * pVal );
+ sal_Bool InsertId( const rtl::OString& rIdName, sal_uLong nVal );
sal_Bool ReadIdFile( const String & rFileName );
- SvMetaType * FindType( const ByteString & rName );
+ SvMetaType * FindType( const rtl::OString& rName );
static SvMetaType * FindType( const SvMetaType *, SvMetaTypeMemberList & );
SvMetaType * ReadKnownType( SvTokenStream & rInStm );
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index 293c4d6..3b51dd8 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -134,8 +134,8 @@ class SvTokenStream
int nBufPos;
int c; // next character
sal_uInt16 nTabSize; // length of tabulator
- ByteString aStrTrue;
- ByteString aStrFalse;
+ rtl::OString aStrTrue;
+ rtl::OString aStrFalse;
sal_uLong nMaxPos;
SvFileStream * pInStream;
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx
index 582170e..0ab7494 100644
--- a/idl/source/cmptools/lex.cxx
+++ b/idl/source/cmptools/lex.cxx
@@ -99,8 +99,8 @@ SvToken & SvToken::operator = ( const SvToken & rObj )
void SvTokenStream::InitCtor()
{
- aStrTrue = "TRUE";
- aStrFalse = "FALSE";
+ aStrTrue = rtl::OString(RTL_CONSTASCII_STRINGPARAM("TRUE"));
+ aStrFalse = rtl::OString(RTL_CONSTASCII_STRINGPARAM("FALSE"));
nLine = nColumn = 0;
nBufPos = 0;
nTabSize = 4;
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index c6d980f..abc3675 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -470,7 +470,7 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
<< rtl::OString::valueOf(static_cast<sal_Int32>(MakeSlotValue(rBase, IsVariable()))).getStr();
rOutStm << ',' << endl;
WriteTab( rOutStm, 3 );
- rOutStm << " h" << rBase.aIFaceName.GetBuffer() << " , ";
+ rOutStm << " h" << rBase.aIFaceName.getStr() << " , ";
ByteString aParserStr;
if( pBaseType->GetType() == TYPE_METHOD || bSet )
@@ -625,9 +625,9 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
// allocation
WriteTab( rOutStm, nTab );
rOutStm << "void ";
- rOutStm << rBase.aIFaceName.GetBuffer()
+ rOutStm << rBase.aIFaceName.getStr()
<< "Set" << name.GetBuffer() << "( " << C_PREF
- << "Object h" << rBase.aIFaceName.GetBuffer() << ", " << endl;
+ << "Object h" << rBase.aIFaceName.getStr() << ", " << endl;
WriteTab( rOutStm, nTab+1 );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
rOutStm << ' ' << name.GetBuffer() << " )";
@@ -641,9 +641,9 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteTab( rOutStm, nTab );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
rOutStm << ' ';
- rOutStm << rBase.aIFaceName.GetBuffer()
+ rOutStm << rBase.aIFaceName.getStr()
<< "Get" << name.GetBuffer() << "( " << C_PREF
- << "Object h" << rBase.aIFaceName.GetBuffer() << " )";
+ << "Object h" << rBase.aIFaceName.getStr() << " )";
if( nT == WRITE_C_HEADER )
rOutStm << ';' << endl << endl;
else
@@ -1536,7 +1536,7 @@ void SvMetaType::WriteMethodArgs
rOutStm << '(';
if( nT == WRITE_C_HEADER || nT == WRITE_C_SOURCE )
{
- rOutStm << ' ' << C_PREF << "Object h" << rBase.aIFaceName.GetBuffer();
+ rOutStm << ' ' << C_PREF << "Object h" << rBase.aIFaceName.getStr();
if( GetAttrCount() )
rOutStm << ',';
else
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index c0bf3c2..5655180 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -87,10 +87,10 @@ SvMetaTypeMemberList & SvIdlDataBase::GetTypeList()
return aTypeList;
}
-SvMetaModule * SvIdlDataBase::GetModule( const ByteString & rName )
+SvMetaModule * SvIdlDataBase::GetModule( const rtl::OString& rName )
{
for( sal_uLong n = 0; n < aModuleList.Count(); n++ )
- if( aModuleList.GetObject( n )->GetName() == rName )
+ if( aModuleList.GetObject( n )->GetName().Equals(rName) )
return aModuleList.GetObject( n );
return NULL;
}
@@ -169,7 +169,7 @@ void SvIdlDataBase::Save( SvStream & rStm, sal_uInt32 nFlags )
aPStm << nUniqueId;
}
-void SvIdlDataBase::SetError( const ByteString & rError, SvToken * pTok )
+void SvIdlDataBase::SetError( const rtl::OString& rError, SvToken * pTok )
{
if( pTok->GetLine() > 10000 )
aError.SetText( "hgchcg" );
@@ -188,7 +188,7 @@ void SvIdlDataBase::Push( SvMetaObject * pObj )
}
#ifdef IDL_COMPILER
-sal_Bool SvIdlDataBase::FindId( const ByteString & rIdName, sal_uLong * pVal )
+sal_Bool SvIdlDataBase::FindId( const rtl::OString& rIdName, sal_uLong * pVal )
{
if( pIdTable )
{
@@ -202,7 +202,7 @@ sal_Bool SvIdlDataBase::FindId( const ByteString & rIdName, sal_uLong * pVal )
return sal_False;
}
-sal_Bool SvIdlDataBase::InsertId( const ByteString & rIdName, sal_uLong nVal )
+sal_Bool SvIdlDataBase::InsertId( const rtl::OString& rIdName, sal_uLong nVal )
{
if( !pIdTable )
pIdTable = new SvStringHashTable( 20003 );
@@ -364,10 +364,10 @@ SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType,
return pType;
}
-SvMetaType * SvIdlDataBase::FindType( const ByteString & rName )
+SvMetaType * SvIdlDataBase::FindType( const rtl::OString& rName )
{
SvMetaType * pType = aTypeList.First();
- while( pType && rName != pType->GetName() )
+ while( pType && !rName.equals(pType->GetName()) )
pType = aTypeList.Next();
return pType;
}
@@ -544,14 +544,14 @@ void SvIdlDataBase::Write(const rtl::OString& rText)
fprintf( stdout, "%s", rText.getStr() );
}
-void SvIdlDataBase::WriteError( const ByteString & rErrWrn,
- const ByteString & rFileName,
+void SvIdlDataBase::WriteError( const rtl::OString& rErrWrn,
+ const rtl::OString& rFileName,
const rtl::OString& rErrorText,
sal_uLong nRow, sal_uLong nColumn ) const
{
// error treatment
fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n",
- rFileName.GetBuffer(), rErrWrn.GetBuffer(), nRow, nColumn );
+ rFileName.getStr(), rErrWrn.getStr(), nRow, nColumn );
if( !rErrorText.isEmpty() )
{ // error set
@@ -577,7 +577,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
{ // error set
// search error token
// error text
- if( aError.GetText().Len() )
+ if( aError.GetText().getLength() )
{
aErrorText.append(RTL_CONSTASCII_STRINGPARAM("may be <"));
aErrorText.append(aError.GetText());
commit 1777dfacf2c94873f0f0119bbe9d8fc2464df154
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Nov 19 20:29:23 2011 +0000
clocaledata is a char array, so can use RTL_CONSTASCII_foo
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 9b87de6..66a5b93 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1535,21 +1535,21 @@ sal_Bool OutlineNumbering::hasElements( ) throw(RuntimeException)
OUString SAL_CALL
LocaleData::getImplementationName() throw( RuntimeException )
{
- return OUString::createFromAscii(clocaledata);
+ return OUString(RTL_CONSTASCII_USTRINGPARAM(clocaledata));
}
sal_Bool SAL_CALL
LocaleData::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
- return !rServiceName.compareToAscii(clocaledata);
+ return rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(clocaledata));
}
Sequence< OUString > SAL_CALL
LocaleData::getSupportedServiceNames() throw( RuntimeException )
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii(clocaledata);
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(clocaledata));
return aRet;
}
commit 445065d1131deda6cc56b2dddf0bbb07253e55f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Nov 19 14:58:12 2011 +0000
ByteString->rtl::OString[Buffer]
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx
index 4a3abe5..6259c20 100644
--- a/tools/inc/tools/inetmime.hxx
+++ b/tools/inc/tools/inetmime.hxx
@@ -32,8 +32,9 @@
#include "tools/toolsdllapi.h"
#include <rtl/alloc.h>
-#include <rtl/string.h>
-#include "rtl/tencinfo.h"
+#include <rtl/string.hxx>
+#include <rtl/strbuf.hxx>
+#include <rtl/tencinfo.h>
#include <tools/debug.hxx>
#include <tools/errcode.hxx>
#include <tools/string.hxx>
@@ -404,19 +405,6 @@ public:
const sal_Unicode * pEnd1,
const sal_Char * pString2);
- /** Check two US-ASCII strings for equality, ignoring case.
-
- @param rString1 The first string.
-
- @param sString2 Points to the start of the null terminated second
- string, must not be null.
-
- @return True if the two strings are equal, ignoring the case of US-
- ASCII alphabetic characters (US-ASCII 'A'--'Z' and 'a'--'z').
- */
- static inline bool equalIgnoreCase(const ByteString & rString1,
- const sal_Char * pString2);
-
static inline bool startsWithLineBreak(const sal_Char * pBegin,
const sal_Char * pEnd);
@@ -536,7 +524,7 @@ public:
sal_uInt32 & rCharacter);
static UniString decodeHeaderFieldBody(HeaderFieldType eType,
- const ByteString & rBody);
+ const rtl::OString& rBody);
// #i70651#: Prevent warnings on Mac OS X.
#ifdef MACOSX
@@ -712,14 +700,6 @@ inline sal_uInt32 INetMIME::toUTF32(sal_Unicode cHighSurrogate,
}
// static
-inline bool INetMIME::equalIgnoreCase(const ByteString & rString1,
- const sal_Char * pString2)
-{
- return equalIgnoreCase(rString1.GetBuffer(),
- rString1.GetBuffer() + rString1.Len(), pString2);
-}
-
-// static
inline bool INetMIME::startsWithLineBreak(const sal_Char * pBegin,
const sal_Char * pEnd)
{
@@ -973,14 +953,18 @@ public:
/** Write a sequence of octets.
- @param rOctets A ByteString, interpreted as a sequence of octets.
+ @param rOctets A rtl::OString, interpreted as a sequence of octets.
@param nBegin The offset of the first character to write.
@param nEnd The offset past the last character to write.
*/
- inline void write(const ByteString & rString, xub_StrLen nBegin,
- xub_StrLen nEnd);
+ void write(const rtl::OString& rOctets, xub_StrLen nBegin,
+ xub_StrLen nEnd)
+ {
+ writeSequence(rOctets.getStr() + nBegin, rOctets.getStr() + nEnd);
+ m_nColumn += nEnd - nBegin;
+ }
/** Write a single octet.
@@ -1002,11 +986,16 @@ public:
/** Write a sequence of octets.
- @param rOctets A ByteString, interpreted as a sequence of octets.
+ @param rOctets A rtl::OString, interpreted as a sequence of octets.
@return This instance.
*/
- inline INetMIMEOutputSink & operator <<(const ByteString & rOctets);
+ INetMIMEOutputSink & operator <<(const rtl::OString& rOctets)
+ {
+ writeSequence(rOctets.getStr(), rOctets.getStr() + rOctets.getLength());
+ m_nColumn += rOctets.getLength();
+ return *this;
+ }
/** Call a manipulator function.
@@ -1052,13 +1041,6 @@ inline void INetMIMEOutputSink::write(const sal_Unicode * pBegin,
m_nColumn += pEnd - pBegin;
}
-inline void INetMIMEOutputSink::write(const ByteString & rOctets,
- xub_StrLen nBegin, xub_StrLen nEnd)
-{
- writeSequence(rOctets.GetBuffer() + nBegin, rOctets.GetBuffer() + nEnd);
- m_nColumn += nEnd - nBegin;
-}
-
inline INetMIMEOutputSink & INetMIMEOutputSink::operator <<(sal_Char nOctet)
{
writeSequence(&nOctet, &nOctet + 1);
@@ -1073,14 +1055,6 @@ inline INetMIMEOutputSink & INetMIMEOutputSink::operator <<(const sal_Char *
return *this;
}
-inline INetMIMEOutputSink & INetMIMEOutputSink::operator <<(const ByteString &
- rOctets)
-{
- writeSequence(rOctets.GetBuffer(), rOctets.GetBuffer() + rOctets.Len());
- m_nColumn += rOctets.Len();
- return *this;
-}
-
// static
inline INetMIMEOutputSink & INetMIMEOutputSink::endl(INetMIMEOutputSink &
rSink)
@@ -1101,8 +1075,7 @@ inline void INetMIME::writeEscapeSequence(INetMIMEOutputSink & rSink,
//============================================================================
class INetMIMEStringOutputSink: public INetMIMEOutputSink
{
- ByteString m_aBuffer;
- bool m_bOverflow;
+ rtl::OStringBuffer m_aBuffer;
using INetMIMEOutputSink::writeSequence;
@@ -1113,21 +1086,16 @@ public:
inline INetMIMEStringOutputSink(sal_uInt32 nColumn = 0,
sal_uInt32 nLineLengthLimit
= INetMIME::SOFT_LINE_LENGTH_LIMIT):
- INetMIMEOutputSink(nColumn, nLineLengthLimit), m_bOverflow(false) {}
+ INetMIMEOutputSink(nColumn, nLineLengthLimit) {}
virtual ErrCode getError() const;
- inline ByteString takeBuffer();
+ rtl::OString takeBuffer()
+ {
+ return m_aBuffer.makeStringAndClear();
+ }
};
-inline ByteString INetMIMEStringOutputSink::takeBuffer()
-{
- ByteString aTheBuffer = m_aBuffer;
- m_aBuffer.Erase();
- m_bOverflow = false;
- return aTheBuffer;
-}
-
//============================================================================
class INetMIMEEncodedWordOutputSink
{
@@ -1240,17 +1208,17 @@ struct INetContentTypeParameter
will only be one item for the complete parameter, with the attribute
name lacking any section suffix.
*/
- const ByteString m_sAttribute;
+ const rtl::OString m_sAttribute;
/** The optional character set specification (see RFC 2231), in US-ASCII
encoding and converted to lower case.
*/
- const ByteString m_sCharset;
+ const rtl::OString m_sCharset;
/** The optional language specification (see RFC 2231), in US-ASCII
encoding and converted to lower case.
*/
- const ByteString m_sLanguage;
+ const rtl::OString m_sLanguage;
/** The attribute value. If the value is a quoted-string, it is
'unpacked.' If a character set is specified, and the value can be
@@ -1277,29 +1245,18 @@ struct INetContentTypeParameter
*/
const bool m_bConverted;
- inline INetContentTypeParameter(const ByteString & rTheAttribute,
- const ByteString & rTheCharset,
- const ByteString & rTheLanguage,
- const UniString & rTheValue,
- bool bTheConverted);
+ INetContentTypeParameter(const rtl::OString& rTheAttribute,
+ const rtl::OString& rTheCharset, const rtl::OString& rTheLanguage,
+ const UniString & rTheValue, bool bTheConverted)
+ : m_sAttribute(rTheAttribute)
+ , m_sCharset(rTheCharset)
+ , m_sLanguage(rTheLanguage)
+ , m_sValue(rTheValue)
+ , m_bConverted(bTheConverted)
+ {
+ }
};
-inline INetContentTypeParameter::INetContentTypeParameter(const ByteString &
- rTheAttribute,
- const ByteString &
- rTheCharset,
- const ByteString &
- rTheLanguage,
- const UniString &
- rTheValue,
- bool bTheConverted):
- m_sAttribute(rTheAttribute),
- m_sCharset(rTheCharset),
- m_sLanguage(rTheLanguage),
- m_sValue(rTheValue),
- m_bConverted(bTheConverted)
-{}
-
//============================================================================
class TOOLS_DLLPUBLIC INetContentTypeParameterList
{
@@ -1322,8 +1279,7 @@ public:
return &(maEntries[nIndex]);
}
- const INetContentTypeParameter * find(const ByteString & rAttribute)
- const;
+ const INetContentTypeParameter * find(const rtl::OString& rAttribute) const;
private:
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index f54952e..e6b8db1 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -2763,7 +2763,7 @@ bool INetMIME::translateUTF8Char(const sal_Char *& rBegin,
//============================================================================
// static
UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
- const ByteString & rBody)
+ const rtl::OString& rBody)
{
// Due to a bug in INetCoreRFC822MessageStream::ConvertTo7Bit(), old
// versions of StarOffice send mails with header fields where encoded
@@ -2785,8 +2785,8 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
//
// base64 = ALPHA / DIGIT / "+" / "/"
- const sal_Char * pBegin = rBody.GetBuffer();
- const sal_Char * pEnd = pBegin + rBody.Len();
+ const sal_Char * pBegin = rBody.getStr();
+ const sal_Char * pEnd = pBegin + rBody.getLength();
UniString sDecoded;
const sal_Char * pCopyBegin = pBegin;
@@ -2984,11 +2984,9 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
bDone = true;
break;
}
- sText.append(rBody.Copy(
- static_cast< xub_StrLen >(
- pEncodedTextCopyBegin - pBegin),
- static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin)));
+ sText.append(rBody.copy(
+ (pEncodedTextCopyBegin - pBegin),
+ (q - 1 - pEncodedTextCopyBegin)));
sText.append(sal_Char(nDigit1 << 4 | nDigit2));
q += 2;
pEncodedTextCopyBegin = q;
@@ -2997,22 +2995,18 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
case '?':
if (q - pEncodedTextBegin > 1)
- sText.append(rBody.Copy(
- static_cast< xub_StrLen >(
- pEncodedTextCopyBegin - pBegin),
- static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin)));
+ sText.append(rBody.copy(
+ (pEncodedTextCopyBegin - pBegin),
+ (q - 1 - pEncodedTextCopyBegin)));
else
bEncodedWord = false;
bDone = true;
break;
case '_':
- sText.append(rBody.Copy(
- static_cast< xub_StrLen >(
- pEncodedTextCopyBegin - pBegin),
- static_cast< xub_StrLen >(
- q - 1 - pEncodedTextCopyBegin)));
+ sText.append(rBody.copy(
+ (pEncodedTextCopyBegin - pBegin),
+ (q - 1 - pEncodedTextCopyBegin)));
sText.append(' ');
pEncodedTextCopyBegin = q;
break;
@@ -3284,20 +3278,17 @@ void INetMIMEOutputSink::writeLineEnd()
void INetMIMEStringOutputSink::writeSequence(const sal_Char * pBegin,
const sal_Char * pEnd)
{
- DBG_ASSERT(pBegin && pBegin <= pEnd,
+ OSL_ENSURE(pBegin && pBegin <= pEnd,
"INetMIMEStringOutputSink::writeSequence(): Bad sequence");
- m_bOverflow = m_bOverflow
- || pEnd - pBegin > STRING_MAXLEN - m_aBuffer.Len();
- if (!m_bOverflow)
- m_aBuffer.Append(pBegin, static_cast< xub_StrLen >(pEnd - pBegin));
+ m_aBuffer.append(pBegin, pEnd - pBegin);
}
//============================================================================
// virtual
ErrCode INetMIMEStringOutputSink::getError() const
{
- return m_bOverflow ? ERRCODE_IO_OUTOFMEMORY : ERRCODE_NONE;
+ return ERRCODE_NONE;
}
//============================================================================
@@ -4171,12 +4162,12 @@ void INetContentTypeParameterList::Clear()
//============================================================================
const INetContentTypeParameter *
-INetContentTypeParameterList::find(const ByteString & rAttribute) const
+INetContentTypeParameterList::find(const rtl::OString& rAttribute) const
{
boost::ptr_vector<INetContentTypeParameter>::const_iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter)
{
- if (iter->m_sAttribute.EqualsIgnoreCaseAscii(rAttribute))
+ if (iter->m_sAttribute.equalsIgnoreAsciiCase(rAttribute))
return &(*iter);
}
commit 4e7fff380a0b7cec8cc4bf5b4e43a6e91c97db6a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Nov 19 11:28:50 2011 +0000
remove ENABLE_BYTESTRING_STREAM_OPERATORS
diff --git a/automation/source/simplecm/simplecm.cxx b/automation/source/simplecm/simplecm.cxx
index 2cc5b93..b5087f2 100644
--- a/automation/source/simplecm/simplecm.cxx
+++ b/automation/source/simplecm/simplecm.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_automation.hxx"
-
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <tools/solar.h>
#include <automation/simplecm.hxx>
#include <osl/diagnose.h>
@@ -286,7 +284,7 @@ void SimpleCommunicationLinkViaSocket::SetApplication( const ByteString& aApp )
{
CommunicationLink::SetApplication( aApp );
SvStream* pData = GetBestCommunicationStream();
- *pData << aApp;
+ pData->WriteByteString(aApp);
SendHandshake( CH_SetApplication, pData );
delete pData;
}
@@ -458,7 +456,7 @@ void CommunicationManager::CallDataReceived( CommunicationLink* pCL )
case CH_SetApplication:
{
ByteString aApplication;
- *pData >> aApplication;
+ pData->ReadByteString(aApplication);
pCL->CommunicationLink::SetApplication( aApplication );
#if OSL_DEBUG_LEVEL > 1
debug_printf( "Setting Application to " );
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 6cf4953..75db02e 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -33,9 +33,8 @@
#include <expat.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
-#include "tools/string.hxx"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-#include "tools/stream.hxx"
+#include <tools/string.hxx>
+#include <tools/stream.hxx>
#include "export.hxx"
#include "xmlutil.hxx"
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 9e55109..04e192f 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
#include <algorithm>
#include <tools/vcompat.hxx>
@@ -1139,7 +1137,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
if( bLink )
{
- rIStm >> aLink;
+ rIStm.ReadByteString(aLink);
rGraphicObj.SetLink( UniString( aLink, RTL_TEXTENCODING_UTF8 ) );
}
else
@@ -1158,7 +1156,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
if( bLink )
- rOStm << rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
+ rOStm.WriteByteString(rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8));
return rOStm;
}
diff --git a/svx/inc/svx/galtheme.hxx b/svx/inc/svx/galtheme.hxx
index 2dc845d..2bfdddf 100644
--- a/svx/inc/svx/galtheme.hxx
+++ b/svx/inc/svx/galtheme.hxx
@@ -31,8 +31,6 @@
#include "svx/svxdllapi.h"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <vcl/salctype.hxx>
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 75b27ed..3a99d49 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -30,7 +30,6 @@
#include "precompiled_svx.hxx"
#include <sal/macros.h>
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <svx/fmpage.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 165936c..50d398a 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
#include <tools/vcompat.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -44,8 +42,6 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
// --------------
// - Namespaces -
// --------------
@@ -138,13 +134,16 @@ void GalleryThemeEntry::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName )
SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry )
{
- ByteString aDummy;
+ rOut.WriteByteString(ByteString(rEntry.aThemeName, RTL_TEXTENCODING_UTF8));
- rOut << ByteString( rEntry.aThemeName, RTL_TEXTENCODING_UTF8 ) <<
- ByteString( rEntry.aUIName, RTL_TEXTENCODING_UTF8 ) <<
- ByteString( String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8 ) <<
- ByteString( rEntry.aImportName, RTL_TEXTENCODING_UTF8 ) <<
- aDummy;
+ rOut.WriteByteString(ByteString(rEntry.aUIName, RTL_TEXTENCODING_UTF8));
+
+ rOut.WriteByteString(ByteString(String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8));
+
+ rOut.WriteByteString(ByteString(rEntry.aImportName, RTL_TEXTENCODING_UTF8));
+
+ ByteString aDummy;
+ rOut.WriteByteString(aDummy);
return rOut;
}
@@ -155,11 +154,19 @@ SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry )
{
ByteString aTmpStr;
- rIn >> aTmpStr; rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
- rIn >> aTmpStr; rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
- rIn >> aTmpStr; rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) );
- rIn >> aTmpStr; rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
- rIn >> aTmpStr;
+ rIn.ReadByteString(aTmpStr);
+ rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+ rIn.ReadByteString(aTmpStr);
+ rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+ rIn.ReadByteString(aTmpStr);
+ rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) );
+
+ rIn.ReadByteString(aTmpStr);
+ rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+ rIn.ReadByteString(aTmpStr);
return rIn;
}
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 928e060..2ec6083 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
@@ -172,14 +170,13 @@ void SgaObject::WriteData( SvStream& rOut, const String& rDestDir ) const
String aURLWithoutDestDir = String(aURL.GetMainURL( INetURLObject::NO_DECODE ));
aURLWithoutDestDir.SearchAndReplace(rDestDir, String());
- rOut << ByteString( aURLWithoutDestDir, RTL_TEXTENCODING_UTF8 );
+ rOut.WriteByteString(ByteString(aURLWithoutDestDir, RTL_TEXTENCODING_UTF8));
}
// ------------------------------------------------------------------------
void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion )
{
- ByteString aTmpStr;
sal_uInt32 nTmp32;
sal_uInt16 nTmp16;
@@ -190,7 +187,9 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion )
else
rIn >> aThumbMtf;
- rIn >> aTmpStr; aURL = INetURLObject( String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
+ ByteString aTmpStr;
+ rIn.ReadByteString(aTmpStr);
+ aURL = INetURLObject(rtl::OStringToOUString(aTmpStr,RTL_TEXTENCODING_UTF8));
}
// ------------------------------------------------------------------------
@@ -293,28 +292,29 @@ void SgaObjectBmp::Init( const Graphic& rGraphic, const INetURLObject& rURL )
void SgaObjectBmp::WriteData( SvStream& rOut, const String& rDestDir ) const
{
- String aDummyStr;
- char aDummy[ 10 ];
-
// Version setzen
SgaObject::WriteData( rOut, rDestDir );
+ char aDummy[ 10 ];
rOut.Write( aDummy, 10 );
- rOut << ByteString( aDummyStr, RTL_TEXTENCODING_UTF8 ) << ByteString( aTitle, RTL_TEXTENCODING_UTF8 );
+ String aDummyStr;
+ rOut.WriteByteString(rtl::OUStringToOString(aDummyStr, RTL_TEXTENCODING_UTF8));
+ rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
}
// ------------------------------------------------------------------------
void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
{
- ByteString aTmpStr;
SgaObject::ReadData( rIn, rReadVersion );
rIn.SeekRel( 10 ); // 16, 16, 32, 16
- rIn >> aTmpStr; // dummy
+ ByteString aTmpStr;
+ rIn.ReadByteString(aTmpStr); // dummy
if( rReadVersion >= 5 )
{
- rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 );
+ rIn.ReadByteString(aTmpStr);
+ aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
}
}
@@ -381,7 +381,8 @@ Bitmap SgaObjectSound::GetThumbBmp() const
void SgaObjectSound::WriteData( SvStream& rOut, const String& rDestDir ) const
{
SgaObject::WriteData( rOut, rDestDir );
- rOut << (sal_uInt16) eSoundType << ByteString( aTitle, RTL_TEXTENCODING_UTF8 );
+ rOut << (sal_uInt16) eSoundType;
+ rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
}
// ------------------------------------------------------------------------
@@ -392,14 +393,15 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
if( rReadVersion >= 5 )
{
- ByteString aTmpStr;
sal_uInt16 nTmp16;
rIn >> nTmp16; eSoundType = (GalSoundType) nTmp16;
if( rReadVersion >= 6 )
{
- rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 );
+ ByteString aTmpStr;
+ rIn.ReadByteString(aTmpStr);
+ aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
}
}
}
@@ -591,7 +593,7 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r
void SgaObjectSvDraw::WriteData( SvStream& rOut, const String& rDestDir ) const
{
SgaObject::WriteData( rOut, rDestDir );
- rOut << ByteString( aTitle, RTL_TEXTENCODING_UTF8 );
+ rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
}
// ------------------------------------------------------------------------
@@ -603,7 +605,8 @@ void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
if( rReadVersion >= 5 )
{
ByteString aTmpStr;
- rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 );
+ rIn.ReadByteString(aTmpStr);
+ aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
}
}
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 2926a81..791a2a9 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
#include <tools/urlobj.hxx>
#include <tools/vcompat.hxx>
#include <unotools/streamwrap.hxx>
@@ -736,9 +734,10 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa
if( nVersion <= 0x00ff )
{
sal_uInt32 nThemeId = 0;
- ByteString aTmpStr;
- *pIStm >> aTmpStr; aThemeName = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 );
+ ByteString aTmpStr;
+ pIStm->ReadByteString(aTmpStr);
+ aThemeName = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
// Charakterkonvertierung durchfuehren
if( nVersion >= 0x0004 )
@@ -1363,7 +1362,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
sal_Bool bRel;
rOStm << (sal_uInt16) 0x0004;
- rOStm << ByteString( GetRealName(), RTL_TEXTENCODING_UTF8 );
+ rOStm.WriteByteString(rtl::OUStringToOString(GetRealName(), RTL_TEXTENCODING_UTF8));
rOStm << nCount << (sal_uInt16) gsl_getSystemTextEncoding();
for( sal_uInt32 i = 0; i < nCount; i++ )
@@ -1402,7 +1401,9 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
}
aPath.SearchAndReplace(m_aDestDir, String());
- rOStm << bRel << ByteString( aPath, RTL_TEXTENCODING_UTF8 ) << pObj->nOffset << (sal_uInt16) pObj->eObjKind;
+ rOStm << bRel;
+ rOStm.WriteByteString(rtl::OUStringToOString(aPath, RTL_TEXTENCODING_UTF8));
+ rOStm << pObj->nOffset << (sal_uInt16) pObj->eObjKind;
}
// neuerdings wird ein 512-Byte-Reservepuffer gechrieben;
@@ -1436,12 +1437,14 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
{
sal_uInt32 nCount;
sal_uInt16 nVersion;
- ByteString aTmpStr;
String aThemeName;
rtl_TextEncoding nTextEncoding;
aImportName = String();
- rIStm >> nVersion >> aTmpStr >> nCount;
+ rIStm >> nVersion;
+ ByteString aTmpStr;
+ rIStm.ReadByteString(aTmpStr);
+ rIStm >> nCount;
if( nVersion >= 0x0004 )
{
@@ -1452,7 +1455,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
else
nTextEncoding = RTL_TEXTENCODING_UTF8;
- aThemeName = String( aTmpStr.GetBuffer(), nTextEncoding );
+ aThemeName = rtl::OStringToOUString(aTmpStr, nTextEncoding);
if( nCount <= ( 1L << 14 ) )
{
@@ -1480,10 +1483,12 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
String aPath;
sal_uInt16 nTemp;
- rIStm >> bRel >> aTempFileName >> pObj->nOffset;
+ rIStm >> bRel;
+ rIStm.ReadByteString(aTempFileName);
+ rIStm >> pObj->nOffset;
rIStm >> nTemp; pObj->eObjKind = (SgaObjKind) nTemp;
- aFileName = String( aTempFileName.GetBuffer(), gsl_getSystemTextEncoding() );
+ aFileName = rtl::OStringToOUString(aTempFileName, gsl_getSystemTextEncoding());
if( bRel )
{
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 28e96ae..c320bc2 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -346,9 +346,6 @@ public:
SvStream& operator>>( unsigned char& rChar );
SvStream& operator>>( float& rFloat );
SvStream& operator>>( double& rDouble );
-#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
- SvStream& operator>>( ByteString& rString ) { return ReadByteString(rString); }
-#endif
#ifdef ENABLE_STRING_STREAM_OPERATORS
SvStream& operator>>( UniString& rString ) { return ReadByteString(rString); }
#endif
@@ -367,9 +364,6 @@ public:
SvStream& operator<<( const double& rDouble );
SvStream& operator<<( const char* pBuf );
SvStream& operator<<( const unsigned char* pBuf );
-#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
- SvStream& operator<<( const ByteString& rString ) { return WriteByteString( rString ); }
-#endif
#ifdef ENABLE_STRING_STREAM_OPERATORS
SvStream& operator<<( const UniString& rString ) { return WriteByteString(rString); }
#endif
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 2b9295b4..fb955d1 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -52,7 +52,6 @@ c >>= 4; \
c |= nSwapTmp;
#include <tools/debug.hxx>
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <tools/stream.hxx>
#include <osl/thread.h>
#include <algorithm>
commit bb997c001982dc36ef393fbc76ace65dd12b461d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 18 21:18:18 2011 +0000
implEnsureURLExtension just returns the first argument, remove it
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index b5dfe5c..f8b9058 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1344,14 +1344,6 @@ void FileDialogHelper_Impl::implStartExecute()
}
// ------------------------------------------------------------------------
-String FileDialogHelper_Impl::implEnsureURLExtension(const String& sURL,
- const String& /*sExtension*/)
-{
- return sURL;
-
-}
-
-// ------------------------------------------------------------------------
void lcl_saveLastURLs(SvStringsDtor*& rpURLList ,
::comphelper::SequenceAsVector< ::rtl::OUString >& lLastURLs )
{
@@ -1386,7 +1378,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
::sal_Int32 nFiles = lFiles.getLength();
for (::sal_Int32 i = 0; i < nFiles; i++)
{
- String* pURL = new String(implEnsureURLExtension(lFiles[i], sExtension));
+ String* pURL = new String(lFiles[i]);
rpURLList->Insert( pURL, rpURLList->Count() );
}
}
@@ -1400,7 +1392,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
if ( nFiles == 1 )
{
rpURLList = new SvStringsDtor;
- String* pURL = new String(implEnsureURLExtension(lFiles[0], sExtension));
+ String* pURL = new String(lFiles[0]);
rpURLList->Insert( pURL, 0 );
}
else
@@ -1418,7 +1410,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
else
aPath.setName( lFiles[i] );
- String* pURL = new String(implEnsureURLExtension(aPath.GetMainURL( INetURLObject::NO_DECODE ), sExtension) );
+ String* pURL = new String(aPath.GetMainURL( INetURLObject::NO_DECODE ) );
rpURLList->Insert( pURL, rpURLList->Count() );
}
}
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 0a76cb1..6b6b66d 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -159,8 +159,6 @@ namespace sfx2
void implGetAndCacheFiles( const ::com::sun::star::uno::Reference< XInterface >& xPicker ,
SvStringsDtor*& rpURLList,
const SfxFilter* pFilter );
- String implEnsureURLExtension(const String& sURL ,
- const String& sExtension);
DECL_LINK( TimeOutHdl_Impl, Timer* );
DECL_LINK( HandleEvent, FileDialogHelper* );
commit ca02d728082a86780d68ede7b9d565128dbc0434
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 18 21:03:31 2011 +0000
remove [Byte]String::EraseAllChars
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index a5e032f..882351e 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <comphelper/uieventslogger.hxx>
#include <tools/wintypes.hxx>
@@ -817,7 +818,7 @@ void StatementCommand::WriteControlData( Window *pBase, sal_uLong nConf, sal_Boo
case WINDOW_BUTTONDIALOG:
case WINDOW_MENUBARWINDOW:
- aName = pBase->GetText().EraseAllChars('~');
+ aName = comphelper::string::remove(pBase->GetText(), '~');
break;
case WINDOW_EDIT:
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index 0c066a2..cb26ae3 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -39,20 +39,21 @@
#include <basidesh.hxx>
#include <basidesh.hrc>
#include <iderdll.hxx>
+#include <comphelper/string.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
// FIXME Why does BreakPointDialog allow only sal_uInt16 for break-point line
// numbers, whereas BreakPoint supports sal_uLong?
-bool lcl_ParseText( String aText, size_t& rLineNr )
+bool lcl_ParseText( const String &rText, size_t& rLineNr )
{
// aText should look like "# n" where
// n > 0 && n < std::numeric_limits< sal_uInt16 >::max().
// All spaces are ignored, so there can even be spaces within the
// number n. (Maybe it would be better to ignore all whitespace instead
// of just spaces.)
- aText.EraseAllChars(' ');
+ String aText = comphelper::string::remove(rText, ' ');
sal_Unicode cFirst = aText.GetChar(0);
if (cFirst != '#' && !(cFirst >= '0' && cFirst <= '9'))
return false;
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 9eb83c8..72f3ab0 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -1028,11 +1028,13 @@ sal_Bool BasicFrame::CompileAll()
}
// Setup menu
-#define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1).EraseAllChars( '~' )
+#define MENU2FILENAME( Name ) comphelper::string::remove(Name.Copy(Name.SearchAscii(" ")+1), '~')
+
#define LRUNr( nNr ) \
rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("LRU")) \
.append(static_cast<sal_Int32>(nNr)) \
.makeStringAndClear()
+
String FILENAME2MENU( sal_uInt16 nNr, String aName )
{
String aRet;
@@ -1536,8 +1538,7 @@ long BasicFrame::Command( short nID, sal_Bool bChecked )
{
MenuBar* pMenu = GetMenuBar();
PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW );
- String aName = pWinMenu->GetItemText( nID );
- aName.EraseAllChars( L'~' );
+ rtl::OUString aName = comphelper::string::remove(pWinMenu->GetItemText(nID), '~');
AppWin* pWin = FindWin( aName );
if ( pWin )
pWin->ToTop();
diff --git a/basic/source/app/status.cxx b/basic/source/app/status.cxx
index b50aeee..7cfde2d 100644
--- a/basic/source/app/status.cxx
+++ b/basic/source/app/status.cxx
@@ -34,6 +34,7 @@
#include "appwin.hxx"
#include "status.hxx"
+#include <comphelper/string.hxx>
#include <vcl/decoview.hxx>
StatusLine::StatusLine( BasicFrame* p )
@@ -82,7 +83,7 @@ IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB )
nFirstWinPos += pTTB->GetItemPos( pTTB->GetCurItemId() ) / 2;
- AppWin* pWin = pFrame->FindWin( pWinMenu->GetItemText( pWinMenu->GetItemId( nFirstWinPos ) ).EraseAllChars( L'~' ) );
+ AppWin* pWin = pFrame->FindWin(comphelper::string::remove(pWinMenu->GetItemText(pWinMenu->GetItemId(nFirstWinPos)), '~'));
if ( pWin )
{
pWin->Minimize( sal_False );
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2123d94..c676388 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -48,6 +48,7 @@
#include <tools/wldcrd.hxx>
#include <i18npool/lang.h>
#include <rtl/string.hxx>
+#include <rtl/strbuf.hxx>
#include "runtime.hxx"
#include "sbunoobj.hxx"
@@ -81,6 +82,8 @@ using namespace com::sun::star::io;
using namespace com::sun::star::script;
using namespace com::sun::star::frame;
+#include <comphelper/string.hxx>
+
#include "stdobj.hxx"
#include <basic/sbstdobj.hxx>
#include "rtlproto.hxx"
@@ -124,10 +127,22 @@ Reference< XModel > getDocumentModel( StarBASIC* );
static void FilterWhiteSpace( String& rStr )
{
- rStr.EraseAllChars( ' ' );
- rStr.EraseAllChars( '\t' );
- rStr.EraseAllChars( '\n' );
- rStr.EraseAllChars( '\r' );
+ if (!rStr.Len())
+ return;
+
+ rtl::OUStringBuffer aRet(rStr);
+
+ for (xub_StrLen i = 0; i < rStr.Len(); ++i)
+ {
+ sal_Unicode cChar = rStr.GetChar(i);
+ if ((cChar != ' ') && (cChar != '\t') &&
+ (cChar != '\n') && (cChar != '\r'))
+ {
+ aRet.append(cChar);
+ }
+ }
+
+ rStr = aRet.makeStringAndClear();
}
static long GetDayDiff( const Date& rDate )
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 584838a..eb69a84 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -39,18 +39,19 @@
#include "flat/EColumns.hxx"
#include <osl/thread.h>
#include <tools/config.hxx>
-#include <comphelper/sequence.hxx>
#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <comphelper/extract.hxx>
#include <comphelper/numbers.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/types.hxx>
#include "flat/EDriver.hxx"
#include <com/sun/star/util/NumberFormat.hpp>
#include <unotools/configmgr.hxx>
#include <i18npool/mslangid.hxx>
#include "connectivity/dbconversion.hxx"
-#include <comphelper/types.hxx>
#include "file/quotedstring.hxx"
#include <unotools/syslocale.hxx>
#include <rtl/logfile.hxx>
@@ -713,9 +714,10 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
} // if ( DataType::INTEGER != nType )
else
{
- aStrConverted = aStr;
if ( cThousandDelimiter )
- aStrConverted.EraseAllChars(cThousandDelimiter);
+ aStrConverted = comphelper::string::remove(aStr, cThousandDelimiter);
+ else
+ aStrConverted = aStr;
}
const double nVal = ::rtl::math::stringToDouble(aStrConverted,'.',',',NULL,NULL);
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index a859963..6c91c3e 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -34,6 +34,7 @@
#include <svl/eitem.hxx>
#include <com/sun/star/frame/XStorable.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <unotools/intlwrapper.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
@@ -68,11 +69,9 @@ static String getNormDicEntry_Impl( const String &rText )
{
String aTmp( rText );
aTmp.EraseTrailingChars( '.' );
- aTmp.EraseAllChars( '=' );
- return aTmp;
+ return comphelper::string::remove(aTmp, '=');
}
-
// Compare Dictionary Entry result
enum CDE_RESULT { CDE_EQUAL, CDE_SIMILAR, CDE_DIFFERENT };
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 3d2fdb4..8978dc1 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -52,6 +52,7 @@
#include <svtools/accessibilityoptions.hxx>
#include <unotools/configitem.hxx>
#include <sfx2/objsh.hxx>
+#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
#include <svl/ctloptions.hxx>
#include <svtools/langtab.hxx>
@@ -775,7 +776,7 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
String sLabel(aAAPointLimitLabel.GetText());
aMnemonicGenerator.RegisterMnemonic( sLabel );
aMnemonicGenerator.CreateMnemonic( sLabel );
- sLabel.EraseAllChars('~');
+ sLabel = comphelper::string::remove(sLabel, '~');
sal_Int32 nLabelWidth = aAAPointLimitLabel.GetTextWidth( sLabel );
nLabelWidth += 3; // small gap
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 75fbb39..9300bed 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -27,6 +27,7 @@
************************************************************************/
// include ---------------------------------------------------------------
+#include <comphelper/string.hxx>
#include <tools/shl.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
@@ -217,8 +218,8 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe
sName = sText;
else
sName = sText.GetToken( nIndex, '/' );
- sName.EraseAllChars( '(' );
- sName.EraseAllChars( ')' );
+ sName = comphelper::string::remove(sName, '(');
+ sName = comphelper::string::remove(sName, ')');
if ( sName.Len() > 0 )
(*pCurrent)->SetAccessibleName( sName );
}
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx
index e20ca59..93b3df5 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx
@@ -47,8 +47,9 @@
#include <com/sun/star/sdbcx/KeyType.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include "TableFieldInfo.hxx"
-#include <comphelper/uno3.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/uno3.hxx>
#include "UITools.hxx"
@@ -117,7 +118,7 @@ sal_Bool OQueryTableWindow::Init()
}
- sAliasName = String(sAliasName).EraseAllChars('"');
+ sAliasName = comphelper::string::remove(sAliasName, '"');
SetAliasName(sAliasName);
// SetAliasName reicht das als WinName weiter, dadurch benutzt es die Basisklasse
// reset the title
diff --git a/formula/Library_forui.mk b/formula/Library_forui.mk
index 83fea2e..89716f3 100644
--- a/formula/Library_forui.mk
+++ b/formula/Library_forui.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_Library_add_api,forui,\
))
$(eval $(call gb_Library_add_linked_libs,forui,\
+ comphelper \
cppu \
cppuhelper \
for \
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 3b7c2ec..03673d6 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -72,6 +72,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <boost/bind.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <map>
#define TOKEN_OPEN 0
@@ -640,7 +641,7 @@ sal_Bool FormulaDlg_Impl::CalcStruct( const String& rStrExp)
aString.Erase((xub_StrLen)(nLength-1));
}
- aString.EraseAllChars('\n');
+ aString = comphelper::string::remove(aString, '\n');
String aStrResult;
if ( CalcValue(aString, aStrResult ) )
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 94d5925..ae6c21e 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -29,6 +29,8 @@
#ifndef _EXPORT_HXX
#define _EXPORT_HXX
+#include <comphelper/string.hxx>
+
#ifndef L10NTOOLS_DIRECTORY_HXX
#define L10NTOOLS_DIRECTORY_HXX
#include <l10ntools/directory.hxx>
@@ -218,9 +220,10 @@ public:
pPairedList( NULL ),
sPForm( rPF )
{
- sGId.EraseAllChars( '\r' );
- sPForm.EraseAllChars( '\r' );
+ sGId = comphelper::string::remove(sGId, '\r');
+ sPForm = comphelper::string::remove(sPForm, '\r');
};
+
ResData( const ByteString &rPF, const ByteString &rGId , const ByteString &rFilename )
:
nChildIndex( 0 ),
@@ -246,13 +249,10 @@ public:
pFilterList( NULL ),
pPairedList( NULL ),
sPForm( rPF )
-
{
- sGId.EraseAllChars( '\r' );
- sPForm.EraseAllChars( '\r' );
+ sGId = comphelper::string::remove(sGId, '\r');
+ sPForm = comphelper::string::remove(sPForm, '\r');
};
-
-
};
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 6922df9..7ad52f6 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -510,13 +510,14 @@ int Export::Execute( int nToken, const char * pToken )
ByteString sOrig( sToken );
sal_Bool bWriteToMerged = bMergeMode;
- if ( nToken == CONDITION ) {
- ByteString sTestToken( pToken );
- sTestToken.EraseAllChars( '\t' );
- sTestToken.EraseAllChars( ' ' );
- if (( !bReadOver ) && ( sTestToken.Search( "#ifndef__RSC_PARSER" ) == 0 ))
+ if ( nToken == CONDITION )
+ {
+ rtl::OString sTestToken(pToken);
+ sTestToken = comphelper::string::remove(sTestToken, '\t');
+ sTestToken = comphelper::string::remove(sTestToken, ' ');
+ if (( !bReadOver ) && ( comphelper::string::indexOfL(sTestToken, RTL_CONSTASCII_STRINGPARAM("#ifndef__RSC_PARSER")) == 0 ))
bReadOver = sal_True;
- else if (( bReadOver ) && ( sTestToken.Search( "#endif" ) == 0 ))
+ else if (( bReadOver ) && ( comphelper::string::indexOfL(sTestToken, RTL_CONSTASCII_STRINGPARAM("#endif")) == 0 ))
bReadOver = sal_False;
}
if ((( nToken < FILTER_LEVEL ) || ( bReadOver )) &&
@@ -638,16 +639,17 @@ int Export::Execute( int nToken, const char * pToken )
pResData = new ResData( sActPForm, FullId() , sFilename );
aResStack.push_back( pResData );
ByteString sBackup( sToken );
- sToken.EraseAllChars( '\n' );
- sToken.EraseAllChars( '\r' );
- sToken.EraseAllChars( '{' );
+ sToken = comphelper::string::remove(sToken, '\n');
+ sToken = comphelper::string::remove(sToken, '\r');
+ sToken = comphelper::string::remove(sToken, '{');
while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
sToken.EraseTrailingChars( ' ' );
ByteString sT = getToken(sToken, 0, ' ');
pResData->sResTyp = sT.ToLowerAscii();
ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 ));
ByteString sCondition;
- if ( sId.Search( "#" ) != STRING_NOTFOUND ) {
+ if ( sId.Search( "#" ) != STRING_NOTFOUND )
+ {
// between ResTyp, Id and paranthes is a precomp. condition
sCondition = "#";
sCondition += ByteString(getToken(sId, 1, '#'));
@@ -655,7 +657,7 @@ int Export::Execute( int nToken, const char * pToken )
}
sId = getToken(sId, 0, '/');
CleanValue( sId );
- sId = sId.EraseAllChars( '\t' );
+ sId = comphelper::string::remove(sId, '\t');
pResData->SetId( sId, ID_LEVEL_IDENTIFIER );
if ( sCondition.Len())
{
@@ -676,12 +678,12 @@ int Export::Execute( int nToken, const char * pToken )
pResData = new ResData( sActPForm, FullId() , sFilename );
aResStack.push_back( pResData );
- sToken.EraseAllChars( '\n' );
- sToken.EraseAllChars( '\r' );
- sToken.EraseAllChars( '{' );
- sToken.EraseAllChars( '\t' );
- sToken.EraseAllChars( ' ' );
- sToken.EraseAllChars( '\\' );
+ sToken = comphelper::string::remove(sToken, '\n');
+ sToken = comphelper::string::remove(sToken, '\r');
+ sToken = comphelper::string::remove(sToken, '{');
+ sToken = comphelper::string::remove(sToken, '\t');
+ sToken = comphelper::string::remove(sToken, ' ');
+ sToken = comphelper::string::remove(sToken, '\\');
pResData->sResTyp = sToken.ToLowerAscii();
}
break;
@@ -736,36 +738,44 @@ int Export::Execute( int nToken, const char * pToken )
}
}
break;
- case ASSIGNMENT: {
+ case ASSIGNMENT:
+ {
bDontWriteOutput = sal_False;
// interpret different types of assignement
- ByteString sKey = getToken(sToken, 0, '=');
- sKey.EraseAllChars( ' ' );
- sKey.EraseAllChars( '\t' );
+ rtl::OString sKey = getToken(sToken, 0, '=');
+ sKey = comphelper::string::remove(sKey, ' ');
+ sKey = comphelper::string::remove(sKey, '\t');
ByteString sValue = getToken(sToken, 1, '=');
CleanValue( sValue );
- if ( sKey.ToUpperAscii() == "IDENTIFIER" ) {
- ByteString sId( sValue.EraseAllChars( '\t' ));
- pResData->SetId( sId.EraseAllChars( ' ' ), ID_LEVEL_IDENTIFIER );
+ sKey = sKey.toAsciiUpperCase();
+ if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("IDENTIFIER")))
+ {
+ ByteString sId(comphelper::string::remove(sValue, '\t'));
+ sId = comphelper::string::remove(sId, ' ');
+ pResData->SetId(sId, ID_LEVEL_IDENTIFIER);
}
- else if ( sKey == "HELPID" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HELPID")))
+ {
pResData->sHelpId = sValue;
}
- else if ( sKey == "STRINGLIST" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_STRING;
m_sListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
- else if ( sKey == "FILTERLIST" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("FILTERLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_FILTER;
m_sListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
- else if ( sKey == "UIENTRIES" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UIENTRIES")))
+ {
pResData->bList = sal_True;
nList = LIST_UIENTRIES;
m_sListLang = SOURCE_LANGUAGE;
@@ -780,26 +790,29 @@ int Export::Execute( int nToken, const char * pToken )
}
break;
case UIENTRIES:
- case LISTASSIGNMENT: {
+ case LISTASSIGNMENT:
+ {
bDontWriteOutput = sal_False;
- ByteString sTmpToken( sToken);
- sTmpToken.EraseAllChars(' ');
+ ByteString sTmpToken(comphelper::string::remove(sToken, ' '));
sal_uInt16 nPos = 0;
nPos = sTmpToken.ToLowerAscii().Search("[en-us]=");
if( nPos != STRING_NOTFOUND ) {
- ByteString sKey = sTmpToken.Copy( 0 , nPos );
- sKey.EraseAllChars( ' ' );
- sKey.EraseAllChars( '\t' );
+ rtl::OString sKey = sTmpToken.Copy( 0 , nPos );
+ sKey = comphelper::string::remove(sKey, ' ');
+ sKey = comphelper::string::remove(sKey, '\t');
ByteString sValue = getToken(sToken, 1, '=');
CleanValue( sValue );
- if ( sKey.ToUpperAscii() == "STRINGLIST" ) {
+ sKey = sKey.toAsciiUpperCase();
+ if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_STRING;
m_sListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
- else if ( sKey == "FILTERLIST" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("FILTERLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_FILTER;
m_sListLang = SOURCE_LANGUAGE;
@@ -807,22 +820,24 @@ int Export::Execute( int nToken, const char * pToken )
nListLevel = 0;
}
// PairedList
- else if ( sKey == "PAIREDLIST" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("PAIREDLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_PAIRED;
m_sListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
-
- else if ( sKey == "ITEMLIST" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("ITEMLIST")))
+ {
pResData->bList = sal_True;
nList = LIST_ITEM;
m_sListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
- else if ( sKey == "UIENTRIES" ) {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UIENTRIES")))
+ {
pResData->bList = sal_True;
nList = LIST_UIENTRIES;
m_sListLang = SOURCE_LANGUAGE;
@@ -830,20 +845,22 @@ int Export::Execute( int nToken, const char * pToken )
nListLevel = 0;
}
}
- else {
+ else
+ {
// new res. is a String- or FilterList
- ByteString sKey = getToken(sToken, 0, '[');
- sKey.EraseAllChars( ' ' );
- sKey.EraseAllChars( '\t' );
- if ( sKey.ToUpperAscii() == "STRINGLIST" )
+ rtl::OString sKey = getToken(sToken, 0, '[');
+ sKey = comphelper::string::remove(sKey, ' ');
+ sKey = comphelper::string::remove(sKey, '\t');
+ sKey = sKey.toAsciiUpperCase();
+ if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST")))
nList = LIST_STRING;
- else if ( sKey == "FILTERLIST" )
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("FILTERLIST")))
nList = LIST_FILTER;
- else if ( sKey == "PAIREDLIST" )
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("PAIREDLIST")))
nList = LIST_PAIRED; // abcd
- else if ( sKey == "ITEMLIST" )
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("ITEMLIST")))
nList = LIST_ITEM;
- else if ( sKey == "UIENTRIES" )
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UIENTRIES")))
nList = LIST_UIENTRIES;
if ( nList ) {
ByteString sLang = getToken(getToken(sToken, 1, '['), 0, ']');
@@ -877,13 +894,14 @@ int Export::Execute( int nToken, const char * pToken )
case LONGTEXTLINE:
case TEXTLINE:
bDontWriteOutput = sal_False;
- if ( nLevel ) {
+ if ( nLevel )
+ {
CutComment( sToken );
// this is a text line!!!
- ByteString sKey = getToken(getToken(sToken, 0, '='), 0, '[');
- sKey.EraseAllChars( ' ' );
- sKey.EraseAllChars( '\t' );
+ rtl::OString sKey = getToken(getToken(sToken, 0, '='), 0, '[');
+ sKey = comphelper::string::remove(sKey, ' ');
+ sKey = comphelper::string::remove(sKey, '\t');
ByteString sText( GetText( sToken, nToken ));
ByteString sLang;
if ( getToken(sToken, 0, '=').indexOf('[') != -1 )
@@ -893,12 +911,14 @@ int Export::Execute( int nToken, const char * pToken )
}
rtl::OString sLangIndex = sLang;
ByteString sOrigKey = sKey;
- if ( sText.Len() && sLang.Len() ) {
- if (( sKey.ToUpperAscii() == "TEXT" ) ||
- ( sKey == "MESSAGE" ) ||
- ( sKey == "CUSTOMUNITTEXT" ) ||
- ( sKey == "SLOTNAME" ) ||
- ( sKey == "UINAME" ))
+ if ( sText.Len() && sLang.Len() )
+ {
+ sKey = sKey.toAsciiUpperCase();
+ if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("TEXT")) ||
+ sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("MESSAGE")) ||
+ sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("CUSTOMUNITTEXT")) ||
+ sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("SLOTNAME")) ||
+ sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UINAME")))
{
SetChildWithText();
if ( Export::isSourceLanguage( sLangIndex ) )
@@ -997,22 +1017,19 @@ int Export::Execute( int nToken, const char * pToken )
bDontWriteOutput = sal_False;
// this is a AppfontMapping, so look if its a definition
// of field size
- ByteString sKey = getToken(sToken, 0, '=');
- sKey.EraseAllChars( ' ' );
- sKey.EraseAllChars( '\t' );
+ rtl::OString sKey = getToken(sToken, 0, '=');
+ sKey = comphelper::string::remove(sKey, ' ');
+ sKey = comphelper::string::remove(sKey, '\t');
rtl::OString sMapping = getToken(sToken, 1, '=');
sMapping = getToken(sMapping, 1, '(');
sMapping = getToken(sMapping, 0, ')');
sMapping = replace(sMapping, rtl::OString(' '), rtl::OString());
sMapping = replace(sMapping, rtl::OString('\t'), rtl::OString());
- if ( sKey.ToUpperAscii() == "SIZE" )
- {
+ sKey = sKey.toAsciiUpperCase();
+ if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("SIZE")))
pResData->nWidth = ( sal_uInt16 ) getToken(sMapping, 0, ',').toInt32();
- }
- else if ( sKey == "POSSIZE" )
- {
+ else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("POSSIZE")))
pResData->nWidth = ( sal_uInt16 ) getToken(sMapping, 2, ',').toInt32();
- }
}
break;
case RSCDEFINELEND:
@@ -1492,13 +1509,15 @@ ByteString Export::GetText( const ByteString &rSource, int nToken )
#define TXT_STATE_MACRO 0x002
{
ByteString sReturn;
- switch ( nToken ) {
+ switch ( nToken )
+ {
case TEXTLINE:
- case LONGTEXTLINE: {
+ case LONGTEXTLINE:
+ {
ByteString sTmp( rSource.Copy( rSource.Search( "=" )));
CleanValue( sTmp );
- sTmp.EraseAllChars( '\n' );
- sTmp.EraseAllChars( '\r' );
+ sTmp = comphelper::string::remove(sTmp, '\n');
+ sTmp = comphelper::string::remove(sTmp, '\r');
while ( sTmp.SearchAndReplace( "\\\\\"", "-=<[BSlashBSlashHKom]>=-\"" )
!= STRING_NOTFOUND ) {};
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 957ecc2..166d355 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_l10ntools.hxx"
+#include <comphelper/string.hxx>
#include <stdio.h>
#include <tools/string.hxx>
#include <tools/fsys.hxx>
@@ -582,37 +583,40 @@ void XRMResExport::EndOfText(
(void) rOpenTag; // FIXME
(void) rCloseTag; // FIXME
- if ( pResData && pOutputStream ) {
+ if ( pResData && pOutputStream )
+ {
ByteString sTimeStamp( Export::GetTimeStamp());
ByteString sCur;
- for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+ for( unsigned int n = 0; n < aLanguages.size(); n++ )
+ {
sCur = aLanguages[ n ];
- ByteString sAct = pResData->sText[ sCur ];
- sAct.EraseAllChars( 0x0A );
-
- ByteString sOutput( sPrj ); sOutput += "\t";
- sOutput += sPath;
- sOutput += "\t0\t";
- sOutput += sResourceType;
- sOutput += "\t";
- sOutput += pResData->sId;
- // USE LID AS GID OR MERGE DON'T WORK
- //sOutput += pResData->sGId;
- sOutput += "\t";
- sOutput += pResData->sId;
- sOutput += "\t\t\t0\t";
- sOutput += sCur;
- sOutput += "\t";
-
- sOutput += sAct; sOutput += "\t\t\t\t";
- sOutput += sTimeStamp;
-
- sal_Char cSearch = 0x00;
- sOutput.SearchAndReplaceAll( cSearch, '_' );
- if( sAct.Len() > 1 )
- pOutputStream->WriteLine( sOutput );
- }
+ rtl::OString sAct = pResData->sText[ sCur ];
+ sAct = comphelper::string::remove(sAct, 0x0A);
+
+ ByteString sOutput( sPrj ); sOutput += "\t";
+ sOutput += sPath;
+ sOutput += "\t0\t";
+ sOutput += sResourceType;
+ sOutput += "\t";
+ sOutput += pResData->sId;
+ // USE LID AS GID OR MERGE DON'T WORK
+ //sOutput += pResData->sGId;
+ sOutput += "\t";
+ sOutput += pResData->sId;
+ sOutput += "\t\t\t0\t";
+ sOutput += sCur;
+ sOutput += "\t";
+
+ sOutput += sAct;
+ sOutput += "\t\t\t\t";
+ sOutput += sTimeStamp;
+
+ sal_Char cSearch = 0x00;
+ sOutput.SearchAndReplaceAll( cSearch, '_' );
+ if( sAct.getLength() > 1 )
+ pOutputStream->WriteLine( sOutput );
+ }
}
delete pResData;
pResData = NULL;
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index 681f2ad..7c8ba79 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -29,9 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_linguistic.hxx"
#include <com/sun/star/uno/Reference.h>
-
#include <com/sun/star/linguistic2/SpellFailure.hpp>
#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
+#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
@@ -107,9 +107,8 @@ void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage,
String aEntryTxt;
if (pEntries[k].is())
{
- aEntryTxt = pEntries[k]->getDictionaryWord();
// remove characters used to determine hyphenation positions
- aEntryTxt.EraseAllChars( '=' );
+ aEntryTxt = comphelper::string::remove(pEntries[k]->getDictionaryWord(), '=');
}
if (aEntryTxt.Len() > 0 && LevDistance( rText, aEntryTxt ) <= 2)
rDicListProps.push_back( aEntryTxt );
diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk
index 6c04929..9df85c7 100755
--- a/linguistic/workben/makefile.mk
+++ b/linguistic/workben/makefile.mk
@@ -75,6 +75,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS= \
+ $(COMPHELPERLIB) \
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(TOOLSLIB) \
diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index d051bd3..bf0c8a0 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -30,10 +30,10 @@
#include "precompiled_linguistic.hxx"
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
-
#include <com/sun/star/linguistic2/SpellFailure.hpp>
-#include <cppuhelper/factory.hxx> // helper for factories
#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <comphelper/string.hxx>
+#include <cppuhelper/factory.hxx> // helper for factories
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
@@ -242,8 +242,8 @@ Reference< XSpellAlternatives >
aAlt2( aTmp );
aAlt1.SearchAndReplaceAll( (sal_Unicode) 'x', (sal_Unicode) 'u');
aAlt1.SearchAndReplaceAll( (sal_Unicode) 'X', (sal_Unicode) 'U');
- aAlt2.EraseAllChars( (sal_Unicode) 'x' );
- aAlt2.EraseAllChars( (sal_Unicode) 'X' );
+ aAlt2 = comphelper::string::remove(aAlt2, 'x');
+ aAlt2 = comphelper::string::remove(aAlt2, 'X');
pStr[0] = aAlt1;
pStr[1] = aAlt2;
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 24fac69..b9969de 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -1198,7 +1198,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
aLine.EraseLeadingChars( ' ' );
aLine.EraseLeadingChars( '\t' );
- aLine.EraseAllChars( ';' );
+ aLine = comphelper::string::remove(aLine, ';');
if (comphelper::string::isdigitAsciiString(aLine))
{
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index fd517a3..41e7c27 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -36,6 +36,7 @@
// INCLUDE ---------------------------------------------------------------
#include "scitems.hxx"
+#include <comphelper/string.hxx>
#include <editeng/eeitem.hxx>
#include <svx/algitem.hxx>
@@ -72,8 +73,8 @@ const sal_Char ScEditUtil::pCalcDelimiters[] = "=()+-*/^&<>";
String ScEditUtil::ModifyDelimiters( const String& rOld )
{
- String aRet = rOld;
- aRet.EraseAllChars( '_' ); // underscore is used in function argument names
+ // underscore is used in function argument names
+ String aRet = comphelper::string::remove(rOld, '_');
aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( pCalcDelimiters ) );
aRet.Append(ScCompiler::GetNativeSymbol(ocSep)); // argument separator is localized.
return aRet;
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 733e069..bb98052 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -37,10 +37,11 @@
#include <tools/urlobj.hxx>
#include <svl/converter.hxx>
#include <svl/zforlist.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/sharedunocomponent.hxx>
-#include <comphelper/processfactory.hxx>
#include <svx/txenctab.hxx>
#include <svx/dbcharsethelper.hxx>
@@ -539,7 +540,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
if ( nToken > 1 )
{
aFieldName = aString.GetToken( 0, ',' );
- aString.EraseAllChars( ' ' );
+ aString = comphelper::string::remove(aString, ' ');
switch ( aString.GetToken( 1, ',' ).GetChar(0) )
{
case 'L' :
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 69585be..756c512 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <comphelper/string.hxx>
#include <svl/undo.hxx>
#include <unotools/textsearch.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -339,8 +340,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
String aString;
String aDesc;
- String aComment=pScChangeAction->GetComment();
- aComment.EraseAllChars('\n');
+ String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
if(eType==SC_CAT_CONTENT)
{
@@ -465,8 +465,8 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(
bIsGenerated = true;
}
- String aComment=pScChangeAction->GetComment();
- aComment.EraseAllChars('\n');
+ String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
+
if(aDesc.Len()>0)
{
aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
@@ -637,8 +637,8 @@ SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(
aString+='\t';
}
- String aComment=pScChangeAction->GetComment();
- aComment.EraseAllChars('\n');
+ String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
+
if(aDesc.Len()>0)
{
aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
@@ -747,8 +747,8 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionConte
aString+='\t';
aString+='\t';
}
- String aComment=pScChangeAction->GetComment();
- aComment.EraseAllChars('\n');
+
+ String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
if(aDesc.Len()>0)
{
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index e298de1..b5dfe5c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -56,9 +56,10 @@
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <comphelper/processfactory.hxx>
-#include <comphelper/types.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/stillreadwriteinteraction.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/types.hxx>
#include <tools/urlobj.hxx>
#include <vcl/help.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -1368,12 +1369,12 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
{
rpURLList = NULL;
- String sExtension;
+ rtl::OUString sExtension;
if (pFilter)
{
sExtension = pFilter->GetDefaultExtension ();
- sExtension.EraseAllChars( '*' );
- sExtension.EraseAllChars( '.' );
+ sExtension = comphelper::string::remove(sExtension, '*');
+ sExtension = comphelper::string::remove(sExtension, '.');
}
// a) the new way (optional!)
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index 43fd007..b7d3871 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -1263,8 +1263,10 @@ namespace sfx2
{
String sExt = _rExtension;
if ( !_bForOpen )
+ {
// show '*' in extensions only when opening a document
- sExt.EraseAllChars( '*' );
+ sExt = comphelper::string::remove(sExt, '*');
+ }
sRet += sOpenBracket;
sRet += sExt;
sRet += sCloseBracket;
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index d662371..42da4b8 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -73,12 +73,13 @@
#include <ucbhelper/content.hxx>
#include <tools/urlobj.hxx>
#include <unotools/useroptions.hxx>
-#include <comphelper/processfactory.hxx>
#include <comphelper/extract.hxx>
-#include <comphelper/storagehelper.hxx>
-#include <comphelper/sequenceasvector.hxx>
-#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/sequenceasvector.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <comphelper/string.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
#include <cppuhelper/implbase1.hxx>
@@ -992,15 +993,15 @@ sal_Bool CreateFromAddress_Impl( String& rFrom )
}
rFrom += TRIM( aName );
// remove illegal characters
- rFrom.EraseAllChars( '<' );
- rFrom.EraseAllChars( '>' );
- rFrom.EraseAllChars( '@' );
+ rFrom = comphelper::string::remove(rFrom, '<');
+ rFrom = comphelper::string::remove(rFrom, '>');
+ rFrom = comphelper::string::remove(rFrom, '@');
}
String aEmailName = aUserCFG.GetEmail();
// remove illegal characters
- aEmailName.EraseAllChars( '<' );
- aEmailName.EraseAllChars( '>' );
+ aEmailName = comphelper::string::remove(aEmailName, '<');
+ aEmailName = comphelper::string::remove(aEmailName, '>');
if ( aEmailName.Len() )
{
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index 0984e8c..3cadcdf 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -30,6 +30,8 @@
#include "precompiled_sfx2.hxx"
// INCLUDE ---------------------------------------------------------------
+#include <comphelper/string.hxx>
+
#include <svl/style.hxx>
#include <sfx2/newstyle.hxx>
@@ -65,7 +67,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
IMPL_LINK_INLINE_START( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox )
{
- aOKBtn.Enable( pBox->GetText().EraseAllChars().Len() > 0 );
+ aOKBtn.Enable( comphelper::string::remove(pBox->GetText(), ' ').getLength() > 0 );
return 0;
}
IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox )
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 990eb6e..b03948b 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -65,6 +65,7 @@
#include <svtools/ehdl.hxx>
#include <unotools/printwarningoptions.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/script/DocumentDialogLibraryContainer.hpp>
@@ -984,7 +985,8 @@ String SfxObjectShell::GetServiceNameFromFactory( const String& rFact )
aFact.Erase( nPos, aFact.Len() );
aParam.Erase(0,1);
}
- aFact.EraseAllChars('4').ToLowerAscii();
+ aFact = comphelper::string::remove(aFact, '4');
+ aFact.ToLowerAscii();
// HACK: sometimes a real document service name is given here instead of
// a factory short name. Set return value directly to this service name as fallback
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 0daecc2..e9eced8 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -32,6 +32,7 @@
#define SMDLL 1
#include "tools/rcid.h"
+#include <comphelper/string.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -2267,8 +2268,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
#endif
// 'Normalisieren' des SymbolNamens (ohne Leerzeichen)
- XubString aNormName (rSymbolName);
- aNormName.EraseAllChars(' ');
+ XubString aNormName(comphelper::string::remove(rSymbolName, ' '));
// und evtl Abweichungen in der Eingabe beseitigen
rComboBox.SetText(aNormName);
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index a77a32a..4d3ea9c 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -41,6 +41,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/string.hxx>
#include <rtl/logfile.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
@@ -1101,7 +1102,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M
for (sal_uInt16 i = 0; i < nLines; i++)
{
aLine = rText.GetToken(i, '\n');
- aLine.EraseAllChars('\r');
+ aLine = comphelper::string::remove(aLine, '\r');
aLine.EraseLeadingChars('\n');
aLine.EraseTrailingChars('\n');
@@ -1192,7 +1193,7 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const
for (sal_uInt16 i = 0; i < nLines; i++)
{
aLine = rText.GetToken(i, '\n');
- aLine.EraseAllChars('\r');
+ aLine = comphelper::string::remove(aLine, '\r');
aLine.EraseLeadingChars('\n');
aLine.EraseTrailingChars('\n');
aSize = GetTextLineSize(rDevice, aLine);
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index bb249be..3fa6908 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <float.h>
#include <errno.h>
+#include <comphelper/string.hxx>
#include <tools/date.hxx>
#include <tools/debug.hxx>
#include <rtl/math.hxx>
@@ -2073,7 +2074,7 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
return false;
const ::utl::TransliterationWrapper* pTransliteration = pFormatter->GetTransliteration();
const String* pStr;
- String aString( rString );
+ rtl::OUString aString( rString );
bool bFound = false;
bool bFirst = true;
bool bContinue = true;
@@ -2100,7 +2101,7 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
if ( !bFound && bFirst && nPos )
{ // try remaining substring
bFirst = false;
- aString.Erase( 0, nPos );
+ aString = aString.copy(nPos);
bContinue = true;
}
} while ( bContinue );
@@ -2110,8 +2111,8 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
if ( !bDontDetectNegation && (nString == 0) && !bFirst && (nSign < 0)
&& pFormat->IsNegativeRealNegative() )
{ // simply negated twice? --1
- aString.EraseAllChars( ' ' );
- if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') )
+ aString = comphelper::string::remove(aString, ' ');
+ if ( (aString.getLength() == 1) && (aString[0] == '-') )
{
bFound = true;
nStringScanSign = -1;
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index a56abdc..c4315d3 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -33,6 +33,7 @@
#include <float.h>
#include <errno.h>
#include <stdlib.h>
+#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <osl/diagnose.h>
#include <i18npool/mslangid.hxx>
@@ -1358,7 +1359,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
case '>':
case '=':
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
cLetter = cToken;
eState = SsGetCon;
@@ -1382,7 +1383,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
{
if ( rString.GetChar(nPos) == '-' )
{ // [$-xxx] locale
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
eSymbolType = BRACKET_SYMBOLTYPE_LOCALE;
eState = SsGetPrefix;
}
@@ -1412,7 +1413,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
sal_Unicode cDBNum = rString.GetChar( nPos-1+aDBNum.Len() );
if ( aUpperNatNum == aNatNum && 0 <= nNatNumNum && nNatNumNum <= 19 )
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += rString.Copy( --nPos, aNatNum.Len()+1 );
nPos += aNatNum.Len()+1;
//! SymbolType is negative
@@ -1421,7 +1422,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else if ( aUpperDBNum == aDBNum && '1' <= cDBNum && cDBNum <= '9' )
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += rString.Copy( --nPos, aDBNum.Len()+1 );
nPos += aDBNum.Len()+1;
//! SymbolType is negative
@@ -1439,7 +1440,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
eState = SsGetPrefix;
@@ -1479,14 +1480,14 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eState = SsGetPrefix;
}
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
eState = SsGetPrefix;
@@ -2674,7 +2675,8 @@ bool SvNumberformat::GetOutputString(double fNumber,
}
ExpStr = sStr.Copy( nExpStart ); // part following the "E+"
sStr.Erase( nExPos );
- sStr.EraseAllChars('.'); // cut any decimal delimiter
+ // cut any decimal delimiter
+ sStr = comphelper::string::remove(sStr, '.');
if ( rInfo.nCntPre != 1 ) // rescale Exp
{
sal_Int32 nExp = ExpStr.ToInt32() * nExpSign;
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 7e114c3..80bfb2e 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -32,6 +32,7 @@
#define UNICODE
#include "ddeimp.hxx"
#include <algorithm>
+#include <comphelper/string.hxx>
#include <svl/svdde.hxx>
#include <svl/svarray.hxx>
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list