[Libreoffice-commits] .: binfilter/bf_basic binfilter/bf_forms binfilter/bf_goodies binfilter/bf_sc binfilter/bf_sd binfilter/bf_sfx2 binfilter/bf_so3 binfilter/bf_starmath binfilter/bf_svtools binfilter/bf_svx binfilter/bf_sw binfilter/bf_xmloff binfilter/filter binfilter/inc binfilter/prj

Caolán McNamara caolan at kemper.freedesktop.org
Fri Feb 10 03:09:48 PST 2012


 binfilter/bf_basic/source/inc/buffer.hxx                                |    2 
 binfilter/bf_basic/source/inc/scanner.hxx                               |    2 
 binfilter/bf_basic/source/sbx/sbxres.hxx                                |    2 
 binfilter/bf_forms/source/component/forms_DatabaseForm.cxx              |    1 
 binfilter/bf_forms/source/component/imgprod.hxx                         |    2 
 binfilter/bf_goodies/util/makefile.mk                                   |    1 
 binfilter/bf_sc/source/core/inc/scmatrix.hxx                            |    2 
 binfilter/bf_sc/source/core/tool/sc_compiler.cxx                        |    2 
 binfilter/bf_sc/source/core/tool/sc_interpr1.cxx                        |    4 
 binfilter/bf_sc/source/core/tool/sc_token.cxx                           |    8 
 binfilter/bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx     |    2 
 binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx                 |    3 
 binfilter/bf_sc/source/ui/docshell/sc_impex.cxx                         |    3 
 binfilter/bf_sc/source/ui/inc/asciiopt.hxx                              |    2 
 binfilter/bf_sc/source/ui/inc/formdata.hxx                              |    2 
 binfilter/bf_sc/source/ui/unoobj/sc_pageuno.cxx                         |    2 
 binfilter/bf_sd/source/core/sd_drawdoc4.cxx                             |    4 
 binfilter/bf_sfx2/source/appl/appimp.hxx                                |    2 
 binfilter/bf_sfx2/source/appl/sfx2_appcfg.cxx                           |    2 
 binfilter/bf_sfx2/source/config/cfgimpl.hxx                             |    2 
 binfilter/bf_sfx2/source/inc/appdata.hxx                                |    2 
 binfilter/bf_so3/inc/binddata.hxx                                       |    1 
 binfilter/bf_so3/source/copied/staticbaseurl.cxx                        |    2 
 binfilter/bf_so3/source/persist/persist.cxx                             |    6 
 binfilter/bf_so3/source/persist/svstor.cxx                              |    4 
 binfilter/bf_so3/source/persist/transbnd.cxx                            |    2 
 binfilter/bf_so3/source/persist/transprt.cxx                            |    2 
 binfilter/bf_so3/source/solink/impldde.hxx                              |    2 
 binfilter/bf_starmath/source/starmath_document.cxx                      |   16 
 binfilter/bf_starmath/source/starmath_mathml.cxx                        |    2 
 binfilter/bf_starmath/source/starmath_parse.cxx                         |    2 
 binfilter/bf_starmath/source/starmath_unodoc.cxx                        |    2 
 binfilter/bf_starmath/source/starmath_utility.cxx                       |    3 
 binfilter/bf_svtools/source/config/svt_addxmltostorageoptions.cxx       |    2 
 binfilter/bf_svtools/source/config/svt_itemholder1.cxx                  |    2 
 binfilter/bf_svtools/source/config/svt_syslocaleoptions.cxx             |    2 
 binfilter/bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx     |    2 
 binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx |    2 
 binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx  |    2 
 binfilter/bf_svtools/source/items/svt_aeitem.cxx                        |    2 
 binfilter/bf_svtools/source/items1/svt_cntwall.cxx                      |    2 
 binfilter/bf_svtools/source/items1/svt_sitem.cxx                        |    2 
 binfilter/bf_svtools/source/items1/svt_tfrmitem.cxx                     |    2 
 binfilter/bf_svtools/source/memtools/svt_svarray.cxx                    |    2 
 binfilter/bf_svtools/source/misc/impstrg.hxx                            |   56 
 binfilter/bf_svtools/source/misc/makefile.mk                            |    3 
 binfilter/bf_svtools/source/misc/svt_ctrltool.cxx                       |    2 
 binfilter/bf_svtools/source/misc/svt_ehdl.cxx                           |   16 
 binfilter/bf_svtools/source/misc/svt_ownlist.cxx                        |    2 
 binfilter/bf_svtools/source/misc/svt_templatefoldercache.cxx            |    2 
 binfilter/bf_svtools/source/misc/tl_strascii.cxx                        |  643 +++++
 binfilter/bf_svtools/source/misc/tl_strcvt.cxx                          |   78 
 binfilter/bf_svtools/source/misc/tl_strimp.cxx                          | 1255 ++++++++++
 binfilter/bf_svtools/source/misc/tl_strucvt.cxx                         |  177 +
 binfilter/bf_svtools/source/misc/tl_tstring.cxx                         |  218 +
 binfilter/bf_svtools/source/misc/tl_tustring.cxx                        |  619 ++++
 binfilter/bf_svtools/source/misc1/svt_PasswordHelper.cxx                |    2 
 binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx                   |    2 
 binfilter/bf_svtools/source/misc1/svt_inethist.cxx                      |    2 
 binfilter/bf_svtools/source/numbers/svt_zforlist.cxx                    |    2 
 binfilter/bf_svtools/source/numbers/svt_zformat.cxx                     |    2 
 binfilter/bf_svtools/source/numbers/zforscan.hxx                        |    2 
 binfilter/bf_svtools/source/svdde/ddeimp.hxx                            |    2 
 binfilter/bf_svtools/source/syslocale/svt_syslocale.cxx                 |    2 
 binfilter/bf_svtools/source/uno/svt_unoevent.cxx                        |    2 
 binfilter/bf_svx/source/editeng/svx_editobj.cxx                         |    2 
 binfilter/bf_svx/source/inc/fmpgeimp.hxx                                |    3 
 binfilter/bf_svx/source/inc/fmstatic.hxx                                |    2 
 binfilter/bf_svx/source/items/svx_bulitem.cxx                           |    2 
 binfilter/bf_svx/source/items/svx_numitem.cxx                           |    2 
 binfilter/bf_svx/source/svdraw/svx_svdattr.cxx                          |    8 
 binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx                         |    2 
 binfilter/bf_svx/source/svdraw/svx_svdpage.cxx                          |   12 
 binfilter/bf_sw/source/core/bastyp/sw_index.cxx                         |    2 
 binfilter/bf_sw/source/core/inc/docfunc.hxx                             |    2 
 binfilter/bf_sw/source/core/inc/drawfont.hxx                            |    2 
 binfilter/bf_sw/source/core/inc/mvsave.hxx                              |    2 
 binfilter/bf_sw/source/core/inc/noteurl.hxx                             |    2 
 binfilter/bf_sw/source/core/inc/pamtyp.hxx                              |    2 
 binfilter/bf_sw/source/core/inc/swcache.hxx                             |    2 
 binfilter/bf_sw/source/core/inc/swfont.hxx                              |   24 
 binfilter/bf_sw/source/core/inc/txtfrm.hxx                              |    2 
 binfilter/bf_sw/source/core/sw3io/sw3imp.hxx                            |    2 
 binfilter/bf_sw/source/core/sw3io/sw_crypter.cxx                        |    2 
 binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx                        |    2 
 binfilter/bf_sw/source/core/sw3io/sw_sw3field.cxx                       |    6 
 binfilter/bf_sw/source/core/sw3io/sw_sw3misc.cxx                        |    2 
 binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx                       |    4 
 binfilter/bf_sw/source/core/sw3io/sw_sw3num.cxx                         |    2 
 binfilter/bf_sw/source/core/swg/rdswg.hxx                               |    1 
 binfilter/bf_sw/source/core/swg/sw_rdnds.cxx                            |    2 
 binfilter/bf_sw/source/core/swg/sw_rdnum.cxx                            |    2 
 binfilter/bf_sw/source/core/text/guess.hxx                              |    2 
 binfilter/bf_sw/source/core/text/porlay.hxx                             |    2 
 binfilter/bf_sw/source/core/tox/sw_tox.cxx                              |    4 
 binfilter/bf_sw/source/core/tox/sw_toxhlp.cxx                           |    2 
 binfilter/bf_sw/source/filter/excel/excdocum.hxx                        |    2 
 binfilter/bf_sw/source/filter/inc/SwAppletImpl.hxx                      |    2 
 binfilter/bf_sw/source/filter/inc/fltbase.hxx                           |    2 
 binfilter/bf_sw/source/filter/inc/fltglbls.hxx                          |    2 
 binfilter/bf_sw/source/filter/sw6/sw6file.hxx                           |    2 
 binfilter/bf_sw/source/filter/sw6/sw6par.hxx                            |    2 
 binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx                         |    4 
 binfilter/bf_sw/source/ui/app/sw_swmodule.cxx                           |    6 
 binfilter/bf_sw/source/ui/inc/ccoll.hxx                                 |    2 
 binfilter/bf_sw/source/ui/inc/fldmgr.hxx                                |    2 
 binfilter/bf_sw/source/ui/inc/fontcfg.hxx                               |    2 
 binfilter/bf_sw/source/ui/inc/modcfg.hxx                                |    2 
 binfilter/bf_sw/source/ui/inc/swcont.hxx                                |    2 
 binfilter/bf_sw/source/ui/uno/sw_unodoc.cxx                             |    2 
 binfilter/bf_xmloff/source/core/xmloff_xmlerror.cxx                     |    2 
 binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx                     |    2 
 binfilter/bf_xmloff/source/draw/ximpstyl.hxx                            |    1 
 binfilter/bf_xmloff/source/draw/xmloff_propimp0.cxx                     |    2 
 binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx                     |    2 
 binfilter/bf_xmloff/source/style/xmloff_fonthdl.cxx                     |    2 
 binfilter/bf_xmloff/source/text/xmloff_txtimppr.cxx                     |    2 
 binfilter/filter/source/bf_migrate/makefile.mk                          |    1 
 binfilter/inc/bf_basic/basmgr.hxx                                       |    2 
 binfilter/inc/bf_basic/sbxvar.hxx                                       |    2 
 binfilter/inc/bf_goodies/graphicobject.hxx                              |    3 
 binfilter/inc/bf_sc/chartuno.hxx                                        |    2 
 binfilter/inc/bf_sc/collect.hxx                                         |    2 
 binfilter/inc/bf_sc/dpsave.hxx                                          |    2 
 binfilter/inc/bf_sc/dptabdat.hxx                                        |    2 
 binfilter/inc/bf_sc/dptabres.hxx                                        |    2 
 binfilter/inc/bf_sc/filter.hxx                                          |    2 
 binfilter/inc/bf_sc/global.hxx                                          |    1 
 binfilter/inc/bf_sc/rangeutl.hxx                                        |    2 
 binfilter/inc/bf_sc/servuno.hxx                                         |    3 
 binfilter/inc/bf_sc/sortparam.hxx                                       |    2 
 binfilter/inc/bf_sc/zforauto.hxx                                        |    2 
 binfilter/inc/bf_sch/chtmodel.hxx                                       |    2 
 binfilter/inc/bf_sch/memchrt.hxx                                        |    2 
 binfilter/inc/bf_sfx2/docfile.hxx                                       |    2 
 binfilter/inc/bf_sfx2/doctempl.hxx                                      |    2 
 binfilter/inc/bf_sfx2/event.hxx                                         |    2 
 binfilter/inc/bf_sfx2/frmdescr.hxx                                      |    2 
 binfilter/inc/bf_sfx2/progress.hxx                                      |    3 
 binfilter/inc/bf_sfx2/saveopt.hxx                                       |    2 
 binfilter/inc/bf_sfx2/shell.hxx                                         |    2 
 binfilter/inc/bf_sfx2/srchitem.hxx                                      |    2 
 binfilter/inc/bf_sfx2/timestamp.hxx                                     |    2 
 binfilter/inc/bf_so3/factory.hxx                                        |    2 
 binfilter/inc/bf_so3/linkmgr.hxx                                        |    2 
 binfilter/inc/bf_so3/linksrc.hxx                                        |    2 
 binfilter/inc/bf_so3/lnkbase.hxx                                        |    1 
 binfilter/inc/bf_so3/protocol.hxx                                       |    2 
 binfilter/inc/bf_so3/staticbaseurl.hxx                                  |    4 
 binfilter/inc/bf_so3/svstor.hxx                                         |    4 
 binfilter/inc/bf_so3/transbnd.hxx                                       |    2 
 binfilter/inc/bf_so3/transprt.hxx                                       |    2 
 binfilter/inc/bf_starmath/utility.hxx                                   |    4 
 binfilter/inc/bf_svtools/FilterConfigItem.hxx                           |    2 
 binfilter/inc/bf_svtools/PasswordHelper.hxx                             |    4 
 binfilter/inc/bf_svtools/adrparse.hxx                                   |    2 
 binfilter/inc/bf_svtools/cancel.hxx                                     |    2 
 binfilter/inc/bf_svtools/ctrltool.hxx                                   |    1 
 binfilter/inc/bf_svtools/ehdl.hxx                                       |    9 
 binfilter/inc/bf_svtools/frqitem.hxx                                    |    2 
 binfilter/inc/bf_svtools/helpopt.hxx                                    |    2 
 binfilter/inc/bf_svtools/imap.hxx                                       |    2 
 binfilter/inc/bf_svtools/imapobj.hxx                                    |    2 
 binfilter/inc/bf_svtools/inethist.hxx                                   |    2 
 binfilter/inc/bf_svtools/inetimg.hxx                                    |    2 
 binfilter/inc/bf_svtools/inettype.hxx                                   |    3 
 binfilter/inc/bf_svtools/itempool.hxx                                   |    2 
 binfilter/inc/bf_svtools/itemprop.hxx                                   |    2 
 binfilter/inc/bf_svtools/loginerr.hxx                                   |    2 
 binfilter/inc/bf_svtools/macitem.hxx                                    |    2 
 binfilter/inc/bf_svtools/nfkeytab.hxx                                   |    2 
 binfilter/inc/bf_svtools/optionsdlg.hxx                                 |    2 
 binfilter/inc/bf_svtools/pathoptions.hxx                                |    2 
 binfilter/inc/bf_svtools/poolitem.hxx                                   |    2 
 binfilter/inc/bf_svtools/style.hxx                                      |    2 
 binfilter/inc/bf_svtools/svdde.hxx                                      |    2 
 binfilter/inc/bf_svtools/svstdarr.hxx                                   |    2 
 binfilter/inc/bf_svtools/syslocaleoptions.hxx                           |    2 
 binfilter/inc/bf_svtools/testtool.hxx                                   |    2 
 binfilter/inc/bf_svtools/undo.hxx                                       |    2 
 binfilter/inc/bf_svtools/urihelper.hxx                                  |    2 
 binfilter/inc/bf_svtools/urlbmk.hxx                                     |    2 
 binfilter/inc/bf_svtools/urlfilter.hxx                                  |    2 
 binfilter/inc/bf_svtools/useroptions.hxx                                |    2 
 binfilter/inc/bf_svtools/zforfind.hxx                                   |    2 
 binfilter/inc/bf_svtools/zforlist.hxx                                   |    2 
 binfilter/inc/bf_svtools/zformat.hxx                                    |    2 
 binfilter/inc/bf_svx/cscoitem.hxx                                       |    2 
 binfilter/inc/bf_svx/editdata.hxx                                       |    2 
 binfilter/inc/bf_svx/editstat.hxx                                       |    2 
 binfilter/inc/bf_svx/fontitem.hxx                                       |    2 
 binfilter/inc/bf_svx/itemtype.hxx                                       |    2 
 binfilter/inc/bf_svx/numitem.hxx                                        |    2 
 binfilter/inc/bf_svx/outliner.hxx                                       |    2 
 binfilter/inc/bf_svx/outlobj.hxx                                        |    2 
 binfilter/inc/bf_svx/svdetc.hxx                                         |    2 
 binfilter/inc/bf_svx/svdglob.hxx                                        |    2 
 binfilter/inc/bf_svx/svdlayer.hxx                                       |    2 
 binfilter/inc/bf_svx/svdmark.hxx                                        |    2 
 binfilter/inc/bf_svx/svdmodel.hxx                                       |    2 
 binfilter/inc/bf_svx/svdobj.hxx                                         |    1 
 binfilter/inc/bf_svx/svdogrp.hxx                                        |    1 
 binfilter/inc/bf_svx/unolingu.hxx                                       |    2 
 binfilter/inc/bf_svx/xtable.hxx                                         |    2 
 binfilter/inc/bf_sw/SwStyleNameMapper.hxx                               |    2 
 binfilter/inc/bf_sw/cellfml.hxx                                         |    2 
 binfilter/inc/bf_sw/crsrsh.hxx                                          |    2 
 binfilter/inc/bf_sw/dbmgr.hxx                                           |    2 
 binfilter/inc/bf_sw/editsh.hxx                                          |    2 
 binfilter/inc/bf_sw/fldbas.hxx                                          |    2 
 binfilter/inc/bf_sw/ftninfo.hxx                                         |    2 
 binfilter/inc/bf_sw/numrule.hxx                                         |    2 
 binfilter/inc/bf_sw/pagedesc.hxx                                        |    2 
 binfilter/inc/bf_sw/redline.hxx                                         |    2 
 binfilter/inc/bf_sw/redlnaut.hxx                                        |    2 
 binfilter/inc/bf_sw/shellio.hxx                                         |    1 
 binfilter/inc/bf_sw/sortopt.hxx                                         |    2 
 binfilter/inc/bf_sw/swcalwrp.hxx                                        |    2 
 binfilter/inc/bf_sw/swgstr.hxx                                          |    2 
 binfilter/inc/bf_sw/swmodule.hxx                                        |    2 
 binfilter/inc/bf_sw/swtypes.hxx                                         |    4 
 binfilter/inc/bf_sw/unosett.hxx                                         |    2 
 binfilter/inc/bf_sw/unosrch.hxx                                         |    2 
 binfilter/inc/bf_sw/viewopt.hxx                                         |    2 
 binfilter/inc/bf_tools/string.hxx                                       |  582 ++++
 binfilter/inc/bf_xmloff/xmlkywd.hxx                                     |    2 
 binfilter/prj/build.lst                                                 |    2 
 227 files changed, 3900 insertions(+), 276 deletions(-)

New commits:
commit 479ad79f88bda4c2b5056cf895f29297cbe0b833
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 10 11:06:11 2012 +0000

    move [Uni|Byte]String into binfilter

diff --git a/binfilter/bf_basic/source/inc/buffer.hxx b/binfilter/bf_basic/source/inc/buffer.hxx
index 989d1b4..dc1a0c8 100644
--- a/binfilter/bf_basic/source/inc/buffer.hxx
+++ b/binfilter/bf_basic/source/inc/buffer.hxx
@@ -30,7 +30,7 @@
 #define _BUFFER_HXX
 
 #include <bf_svtools/bf_solar.h>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 namespace binfilter {
 
diff --git a/binfilter/bf_basic/source/inc/scanner.hxx b/binfilter/bf_basic/source/inc/scanner.hxx
index 30997cf..3fc3bfc 100644
--- a/binfilter/bf_basic/source/inc/scanner.hxx
+++ b/binfilter/bf_basic/source/inc/scanner.hxx
@@ -29,7 +29,7 @@
 #ifndef _SCANNER_HXX
 #define _SCANNER_HXX
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include "sberrors.hxx"
 
 namespace binfilter {
diff --git a/binfilter/bf_basic/source/sbx/sbxres.hxx b/binfilter/bf_basic/source/sbx/sbxres.hxx
index 25f0cab..68fa067 100644
--- a/binfilter/bf_basic/source/sbx/sbxres.hxx
+++ b/binfilter/bf_basic/source/sbx/sbxres.hxx
@@ -31,7 +31,7 @@
 
 #include <bf_svtools/bf_solar.h>
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 // Zur Zeit sind Ressources im SVTOOLS-Projekt nicht vorgesehen.
 // Da es sich um unkritische Ressourcen handelt (BASIC-Keywords),
diff --git a/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx b/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx
index 4f4a420..75284a0 100644
--- a/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx
+++ b/binfilter/bf_forms/source/component/forms_DatabaseForm.cxx
@@ -59,6 +59,7 @@
 #include "property.hrc"
 #include "services.hxx"
 
+#include <bf_tools/string.hxx>
 #include <tools/fsys.hxx>
 #include <tools/inetmsg.hxx>
 #include <tools/inetstrm.hxx>
diff --git a/binfilter/bf_forms/source/component/imgprod.hxx b/binfilter/bf_forms/source/component/imgprod.hxx
index b8daa47..9ed0740 100644
--- a/binfilter/bf_forms/source/component/imgprod.hxx
+++ b/binfilter/bf_forms/source/component/imgprod.hxx
@@ -30,7 +30,7 @@
 #define _PRODUCE_HXX
 
 #include <tools/link.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #include <com/sun/star/awt/ImageStatus.hpp>
 #include <com/sun/star/awt/XImageConsumer.hpp>
diff --git a/binfilter/bf_goodies/util/makefile.mk b/binfilter/bf_goodies/util/makefile.mk
index 0b87646..f81a837 100644
--- a/binfilter/bf_goodies/util/makefile.mk
+++ b/binfilter/bf_goodies/util/makefile.mk
@@ -60,6 +60,7 @@ DEF1DES		=Bf_Goodies
 DEFLIB1NAME	=bf_go
 
 SHL1STDLIBS= \
+            $(BFSVTOOLLIB) \
             $(SVTOOLLIB)		\
             $(TOOLSLIB)			\
             $(SALLIB)
diff --git a/binfilter/bf_sc/source/core/inc/scmatrix.hxx b/binfilter/bf_sc/source/core/inc/scmatrix.hxx
index 8b96277..10bb4cd 100644
--- a/binfilter/bf_sc/source/core/inc/scmatrix.hxx
+++ b/binfilter/bf_sc/source/core/inc/scmatrix.hxx
@@ -31,7 +31,7 @@
 
 #include "global.hxx"
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 class SvStream;
 namespace binfilter {
 
diff --git a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
index 3653762..1ebd8ec 100644
--- a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
@@ -174,7 +174,7 @@ namespace binfilter {
 /*N*/       aRes.SetRT(RSC_STRING);
 /*N*/       if (IsAvailableRes(aRes))
 /*N*/         {
-/*N*/             pSymbolTable[i] = aRes;
+/*N*/             pSymbolTable[i] = String(aRes);
 /*N*/             rHashMap.insert( ScOpCodeHashMap::value_type( pSymbolTable[i], (OpCode) i ) );
 /*N*/         }
 /*N*/   }
diff --git a/binfilter/bf_sc/source/core/tool/sc_interpr1.cxx b/binfilter/bf_sc/source/core/tool/sc_interpr1.cxx
index f8622b9..8cccb61 100644
--- a/binfilter/bf_sc/source/core/tool/sc_interpr1.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_interpr1.cxx
@@ -1797,7 +1797,7 @@ void ScInterpreter::ScCode()
 {
 //2do: make it full range unicode?
     const String& rStr = GetString();
-    PushInt( (sal_uChar) ByteString_ConvertFromUnicode( rStr.GetChar(0), osl_getThreadTextEncoding() ) );
+    PushInt( (sal_uChar) ByteString::ConvertFromUnicode( rStr.GetChar(0), osl_getThreadTextEncoding() ) );
 }
 
 
@@ -1810,7 +1810,7 @@ void ScInterpreter::ScChar()
     else
     {
         String aStr( '0' );
-        aStr.SetChar( 0, ByteString_ConvertToUnicode( (sal_Char) fVal, osl_getThreadTextEncoding() ) );
+        aStr.SetChar( 0, ByteString::ConvertToUnicode( (sal_Char) fVal, osl_getThreadTextEncoding() ) );
         PushString( aStr );
     }
 }
diff --git a/binfilter/bf_sc/source/core/tool/sc_token.cxx b/binfilter/bf_sc/source/core/tool/sc_token.cxx
index c7c1422..e5bd0ed 100644
--- a/binfilter/bf_sc/source/core/tool/sc_token.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_token.cxx
@@ -1348,7 +1348,7 @@ BOOL ScFAPToken::operator==( const ScToken& ) const
 /*?*/                       rStream.Read( c, nOp );
 /*?*/                   CharSet eSrc = rStream.GetStreamCharSet();
 /*?*/                   for ( BYTE j=0; j<nOp; j++ )
-/*?*/                       cStr[j] = ByteString_ConvertToUnicode( c[j], eSrc );
+/*?*/                       cStr[j] = ByteString::ConvertToUnicode( c[j], eSrc );
 /*?*/                   cStr[ nOp ] = 0;
 /*?*/                   break;
 /*N*/               }
@@ -1414,7 +1414,7 @@ BOOL ScFAPToken::operator==( const ScToken& ) const
 /*?*/               rStream.Read( c, nOp );
 /*?*/           CharSet eSrc = rStream.GetStreamCharSet();
 /*?*/           for ( BYTE j=1; j<nOp; j++ )
-/*?*/               cStr[j] = ByteString_ConvertToUnicode( c[j-1], eSrc );
+/*?*/               cStr[j] = ByteString::ConvertToUnicode( c[j-1], eSrc );
 /*?*/           cStr[ 0 ] = 0;      //! parameter count is what?!?
 /*?*/           cStr[ nOp ] = 0;
 /*?*/           break;
@@ -1461,7 +1461,7 @@ BOOL ScFAPToken::operator==( const ScToken& ) const
 /*N*/             //! parameter count is in cByte (cStr[0] little endian)
 /*N*/           CharSet eSrc = rStream.GetStreamCharSet();
 /*N*/           for ( BYTE j=1; j<n+1; j++ )
-/*N*/               cStr[j] = ByteString_ConvertToUnicode( c[j], eSrc );
+/*N*/               cStr[j] = ByteString::ConvertToUnicode( c[j], eSrc );
 /*N*/           cStr[ n+1 ] = 0;
 /*N*/           break;
 /*N*/       }
@@ -1473,7 +1473,7 @@ BOOL ScFAPToken::operator==( const ScToken& ) const
 /*N*/           cStr[ n ] = 0;
 /*N*/           CharSet eSrc = rStream.GetStreamCharSet();
 /*N*/           for ( BYTE j=0; j<n; j++ )
-/*N*/               cStr[j] = ByteString_ConvertToUnicode( c[j], eSrc );
+/*N*/               cStr[j] = ByteString::ConvertToUnicode( c[j], eSrc );
 /*N*/           cStr[ n ] = 0;
 /*N*/           break;
 /*N*/       }
diff --git a/binfilter/bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/binfilter/bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
index 68090d8..9b7401e 100644
--- a/binfilter/bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
+++ b/binfilter/bf_sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
@@ -37,10 +37,10 @@
 #include <rtl/ustrbuf.hxx>
 
 class DateTime;
-class String;
 
 namespace binfilter {
 
+class String;
 class ScChangeAction;
 class ScChangeTrack;
 class ScXMLExport;
diff --git a/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx b/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
index 81283f1..1a26319 100644
--- a/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
+++ b/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
@@ -31,10 +31,9 @@
 
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 
-class String;
-
 namespace binfilter {
 
+class String;
 class ScXMLExport;
 
 class ScXMLExportDDELinks
diff --git a/binfilter/bf_sc/source/ui/docshell/sc_impex.cxx b/binfilter/bf_sc/source/ui/docshell/sc_impex.cxx
index 3d6d3b4..0efa0f3 100644
--- a/binfilter/bf_sc/source/ui/docshell/sc_impex.cxx
+++ b/binfilter/bf_sc/source/ui/docshell/sc_impex.cxx
@@ -466,7 +466,8 @@ enum DoubledQuoteMode
 /*?*/           MsLangId::convertLanguageToLocale( LANGUAGE_ENGLISH_US ) );
 /*N*/   }
 /*N*/
-/*N*/   String aLine, aCell;
+/*N*/   String aCell;
+/*N*/   ::String aLine;
 /*N*/   USHORT i;
 /*N*/   USHORT nRow = nStartRow;
 /*N*/
diff --git a/binfilter/bf_sc/source/ui/inc/asciiopt.hxx b/binfilter/bf_sc/source/ui/inc/asciiopt.hxx
index 1beeb01..c3b7e41 100644
--- a/binfilter/bf_sc/source/ui/inc/asciiopt.hxx
+++ b/binfilter/bf_sc/source/ui/inc/asciiopt.hxx
@@ -31,7 +31,7 @@
 #ifndef SC_ASCIIOPT_HXX
 #define SC_ASCIIOPT_HXX
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <vcl/dialog.hxx>
 #include <vcl/button.hxx>
 #include <vcl/fixed.hxx>
diff --git a/binfilter/bf_sc/source/ui/inc/formdata.hxx b/binfilter/bf_sc/source/ui/inc/formdata.hxx
index 600514c..13649af 100644
--- a/binfilter/bf_sc/source/ui/inc/formdata.hxx
+++ b/binfilter/bf_sc/source/ui/inc/formdata.hxx
@@ -29,7 +29,7 @@
 #ifndef SC_FORMDATA_HXX
 #define SC_FORMDATA_HXX
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #include <tools/gen.hxx>
 namespace binfilter {
diff --git a/binfilter/bf_sc/source/ui/unoobj/sc_pageuno.cxx b/binfilter/bf_sc/source/ui/unoobj/sc_pageuno.cxx
index f08346a..37456b4 100644
--- a/binfilter/bf_sc/source/ui/unoobj/sc_pageuno.cxx
+++ b/binfilter/bf_sc/source/ui/unoobj/sc_pageuno.cxx
@@ -33,7 +33,7 @@
 #include "pageuno.hxx"
 #include "shapeuno.hxx"
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 namespace binfilter {
 
diff --git a/binfilter/bf_sd/source/core/sd_drawdoc4.cxx b/binfilter/bf_sd/source/core/sd_drawdoc4.cxx
index 2fca096..c91ab14 100644
--- a/binfilter/bf_sd/source/core/sd_drawdoc4.cxx
+++ b/binfilter/bf_sd/source/core/sd_drawdoc4.cxx
@@ -238,7 +238,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     aArrow[1]=Point(0,30);                      //    \    /
     aArrow[2]=Point(20,30);                        //     \  /
     aArrow[3]=Point(10,0);                        //      \/1,0
-    pISet->Put(XLineStartItem(SdResId(STR_POOLSHEET_ARROW),aArrow));
+    pISet->Put(XLineStartItem(ResId::toString(SdResId(STR_POOLSHEET_ARROW)),aArrow));
 
     pISet->Put(XLineStartWidthItem(700));
     pISet->Put(XLineEndWidthItem(300));
@@ -246,7 +246,7 @@ void SdDrawDocument::CreateLayoutTemplates()
 
     // ---- Objekt mit Schatten -------------------------------------------
 
-    aName = String(SdResId(STR_POOLSHEET_OBJWITHSHADOW));
+    aName = ResId::toString(SdResId(STR_POOLSHEET_OBJWITHSHADOW));
     pSheet = &(pLclStyleSheetPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
     pSheet->SetParent(aStdName);
     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHSHADOW );
diff --git a/binfilter/bf_sfx2/source/appl/appimp.hxx b/binfilter/bf_sfx2/source/appl/appimp.hxx
index c193a7b..82de2de 100644
--- a/binfilter/bf_sfx2/source/appl/appimp.hxx
+++ b/binfilter/bf_sfx2/source/appl/appimp.hxx
@@ -29,7 +29,7 @@
 #define _SFXAPPIMP_HXX
 
 #include <tools/time.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 class MenuBar;
 class BasicManager;
 class Timer;
diff --git a/binfilter/bf_sfx2/source/appl/sfx2_appcfg.cxx b/binfilter/bf_sfx2/source/appl/sfx2_appcfg.cxx
index b2ed398..3834035 100644
--- a/binfilter/bf_sfx2/source/appl/sfx2_appcfg.cxx
+++ b/binfilter/bf_sfx2/source/appl/sfx2_appcfg.cxx
@@ -39,7 +39,7 @@
 #include <vcl/sound.hxx>
 #include <vcl/msgbox.hxx>
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #include <bf_svtools/itempool.hxx>
 #include <bf_svtools/aeitem.hxx>
diff --git a/binfilter/bf_sfx2/source/config/cfgimpl.hxx b/binfilter/bf_sfx2/source/config/cfgimpl.hxx
index 4f95f98..e7aa124 100644
--- a/binfilter/bf_sfx2/source/config/cfgimpl.hxx
+++ b/binfilter/bf_sfx2/source/config/cfgimpl.hxx
@@ -28,7 +28,7 @@
 
 // include ---------------------------------------------------------------
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <bf_svtools/svarray.hxx>
 
 #include "cfgitem.hxx"
diff --git a/binfilter/bf_sfx2/source/inc/appdata.hxx b/binfilter/bf_sfx2/source/inc/appdata.hxx
index 380eaac..f57f253 100644
--- a/binfilter/bf_sfx2/source/inc/appdata.hxx
+++ b/binfilter/bf_sfx2/source/inc/appdata.hxx
@@ -31,7 +31,7 @@
 #include <tools/link.hxx>
 #include <bf_svtools/lstner.hxx>
 #include <vcl/timer.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include "rtl/ref.hxx"
 
 #include "bitset.hxx"
diff --git a/binfilter/bf_so3/inc/binddata.hxx b/binfilter/bf_so3/inc/binddata.hxx
index 2b061ae..21f2050 100644
--- a/binfilter/bf_so3/inc/binddata.hxx
+++ b/binfilter/bf_so3/inc/binddata.hxx
@@ -30,6 +30,7 @@
 #define _BINDDATA_HXX
 
 #include <bf_svtools/bf_solar.h>
+#include <bf_tools/string.hxx>
 #include <vector>
 
 namespace binfilter
diff --git a/binfilter/bf_so3/source/copied/staticbaseurl.cxx b/binfilter/bf_so3/source/copied/staticbaseurl.cxx
index 2cf97a6..2add396 100644
--- a/binfilter/bf_so3/source/copied/staticbaseurl.cxx
+++ b/binfilter/bf_so3/source/copied/staticbaseurl.cxx
@@ -40,7 +40,7 @@
 #include "rtl/ustring.hxx"
 #include "bf_svtools/urihelper.hxx"
 #include "tools/debug.hxx"
-#include "tools/string.hxx"
+#include "bf_tools/string.hxx"
 #include "tools/urlobj.hxx"
 #include "ucbhelper/content.hxx"
 
diff --git a/binfilter/bf_so3/source/persist/persist.cxx b/binfilter/bf_so3/source/persist/persist.cxx
index b0a4f32..351907e 100644
--- a/binfilter/bf_so3/source/persist/persist.cxx
+++ b/binfilter/bf_so3/source/persist/persist.cxx
@@ -294,9 +294,9 @@ void SvPersist::TestMemberObjRef()
             if( pEle->GetObj() )
             {
                 ByteString aTest( "\t\tpChildList[ " );
-                aTest += ByteString_CreateFromInt32( i );
+                aTest += ByteString::CreateFromInt32( i );
                 aTest += " ] == ";
-                aTest += ByteString_CreateFromInt32( (ULONG)pEle->GetObj() );
+                aTest += ByteString::CreateFromInt32( (ULONG)pEle->GetObj() );
                 OSL_TRACE( "%s", aTest.GetBuffer() );
             }
         }
@@ -304,7 +304,7 @@ void SvPersist::TestMemberObjRef()
     if( aStorage.Is() )
     {
         ByteString aTest( "\t\taStorage == " );
-        aTest += ByteString_CreateFromInt32( (ULONG)&aStorage );
+        aTest += ByteString::CreateFromInt32( (ULONG)&aStorage );
         OSL_TRACE( "%s", aTest.GetBuffer() );
     }
 }
diff --git a/binfilter/bf_so3/source/persist/svstor.cxx b/binfilter/bf_so3/source/persist/svstor.cxx
index 643861a..5fb79d4 100644
--- a/binfilter/bf_so3/source/persist/svstor.cxx
+++ b/binfilter/bf_so3/source/persist/svstor.cxx
@@ -257,7 +257,7 @@ BOOL SvStorage::IsStorageFile( const String & rFileName )
     return SotStorage::IsStorageFile( rFileName );
 }
 
-const String & SvStorage::GetName() const
+const ::String & SvStorage::GetName() const
 {
     return SotStorage::GetName();
 }
@@ -286,7 +286,7 @@ ULONG SvStorage::GetFormat()
     return SotStorage::GetFormat();
 }
 
-String SvStorage::GetUserName()
+::String SvStorage::GetUserName()
 {
     return SotStorage::GetUserName();
 }
diff --git a/binfilter/bf_so3/source/persist/transbnd.cxx b/binfilter/bf_so3/source/persist/transbnd.cxx
index 4204301..4ef0c72 100644
--- a/binfilter/bf_so3/source/persist/transbnd.cxx
+++ b/binfilter/bf_so3/source/persist/transbnd.cxx
@@ -47,7 +47,7 @@
 #include <tools/link.hxx>
 #include <tools/ref.hxx>
 #include <tools/stream.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <tools/urlobj.hxx>
 
 #include <vcl/svapp.hxx>
diff --git a/binfilter/bf_so3/source/persist/transprt.cxx b/binfilter/bf_so3/source/persist/transprt.cxx
index d96a556..5f09c41 100644
--- a/binfilter/bf_so3/source/persist/transprt.cxx
+++ b/binfilter/bf_so3/source/persist/transprt.cxx
@@ -73,7 +73,7 @@
 #include <tools/errinf.hxx>
 #include <tools/inetmsg.hxx>
 #include <tools/stream.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <tools/urlobj.hxx>
 #include <tools/wldcrd.hxx>
 
diff --git a/binfilter/bf_so3/source/solink/impldde.hxx b/binfilter/bf_so3/source/solink/impldde.hxx
index 3a9b714..e0bd80e 100644
--- a/binfilter/bf_so3/source/solink/impldde.hxx
+++ b/binfilter/bf_so3/source/solink/impldde.hxx
@@ -30,7 +30,7 @@
 
 #include <bf_so3/linksrc.hxx>
 #include <tools/link.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 namespace binfilter
 {
diff --git a/binfilter/bf_starmath/source/starmath_document.cxx b/binfilter/bf_starmath/source/starmath_document.cxx
index 50de02a..c75e09f 100644
--- a/binfilter/bf_starmath/source/starmath_document.cxx
+++ b/binfilter/bf_starmath/source/starmath_document.cxx
@@ -716,27 +716,27 @@ BOOL SmDocShell::Try2x (SvStorage *pStor,
 /*N*/       *pClassName     = SvGlobalName(BF_SO3_SM_CLASSID_30);
 /*N*/       *pFormat        = SOT_FORMATSTR_ID_STARMATH;
 /*N*/       pAppName->AssignAscii( RTL_CONSTASCII_STRINGPARAM("Smath 3.1"));
-/*N*/       *pFullTypeName  = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_31));
-/*N*/       *pShortTypeName = String(SmResId(RID_DOCUMENTSTR));
+/*N*/       *pFullTypeName  = ResId::toString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_31));
+/*N*/       *pShortTypeName = ResId::toString(SmResId(RID_DOCUMENTSTR));
 /*N*/   }
 /*N*/   else if (nFileFormat == SOFFICE_FILEFORMAT_40)
 /*N*/   {
 /*N*/       *pClassName     = SvGlobalName(BF_SO3_SM_CLASSID_40);
 /*N*/       *pFormat        = SOT_FORMATSTR_ID_STARMATH_40;
-/*N*/       *pFullTypeName  = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_40));
-/*N*/       *pShortTypeName = String(SmResId(RID_DOCUMENTSTR));
+/*N*/       *pFullTypeName  = ResId::toString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_40));
+/*N*/       *pShortTypeName = ResId::toString(SmResId(RID_DOCUMENTSTR));
 /*N*/   }
 /*N*/   else if (nFileFormat == SOFFICE_FILEFORMAT_50)
 /*N*/   {
 /*N*/       *pClassName     = SvGlobalName(BF_SO3_SM_CLASSID_50);
 /*N*/       *pFormat        = SOT_FORMATSTR_ID_STARMATH_50;
-/*N*/       *pFullTypeName  = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_50));
-/*N*/       *pShortTypeName = String(SmResId(RID_DOCUMENTSTR));
+/*N*/       *pFullTypeName  = ResId::toString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_50));
+/*N*/       *pShortTypeName = ResId::toString(SmResId(RID_DOCUMENTSTR));
 /*N*/   }
 /*N*/   else if (nFileFormat == SOFFICE_FILEFORMAT_60 )
 /*N*/   {
-/*N*/       *pFullTypeName  = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_60));
-/*N*/       *pShortTypeName = String(SmResId(RID_DOCUMENTSTR));
+/*N*/       *pFullTypeName  = ResId::toString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_60));
+/*N*/       *pShortTypeName = ResId::toString(SmResId(RID_DOCUMENTSTR));
 
             // for binfilter, we need the FormatIDs to be set. Not setting them
             // has always been an error (!)
diff --git a/binfilter/bf_starmath/source/starmath_mathml.cxx b/binfilter/bf_starmath/source/starmath_mathml.cxx
index dd64eb9..949f0a8 100644
--- a/binfilter/bf_starmath/source/starmath_mathml.cxx
+++ b/binfilter/bf_starmath/source/starmath_mathml.cxx
@@ -271,7 +271,7 @@ ULONG SmXMLWrapper::Import(SfxMedium &rMedium)
     sal_Int32 nProgressRange(nSteps);
     if (xStatusIndicator.is())
     {
-        xStatusIndicator->start(String(SmResId(STR_STATSTR_READING)),
+        xStatusIndicator->start(ResId::toString(SmResId(STR_STATSTR_READING)),
             nProgressRange);
     }
 
diff --git a/binfilter/bf_starmath/source/starmath_parse.cxx b/binfilter/bf_starmath/source/starmath_parse.cxx
index 971ec50..33df5b1 100644
--- a/binfilter/bf_starmath/source/starmath_parse.cxx
+++ b/binfilter/bf_starmath/source/starmath_parse.cxx
@@ -2325,7 +2325,7 @@ const sal_Int32 coNumContFlags =
 /*N*/       default:
 /*N*/           nRID = RID_ERR_UNKOWN;
 /*N*/   }
-/*N*/   pErrDesc->Text += SmResId(nRID);
+/*N*/   pErrDesc->Text += String(SmResId(nRID));
 /*N*/
 /*N*/   ErrDescList.push_back( pErrDesc );
 /*N*/ }
diff --git a/binfilter/bf_starmath/source/starmath_unodoc.cxx b/binfilter/bf_starmath/source/starmath_unodoc.cxx
index d254d32..f933ce0 100644
--- a/binfilter/bf_starmath/source/starmath_unodoc.cxx
+++ b/binfilter/bf_starmath/source/starmath_unodoc.cxx
@@ -28,7 +28,7 @@
 
 // System - Includes -----------------------------------------------------
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <bf_sfx2/docfac.hxx>
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/binfilter/bf_starmath/source/starmath_utility.cxx b/binfilter/bf_starmath/source/starmath_utility.cxx
index 80edb40..f9baae6 100644
--- a/binfilter/bf_starmath/source/starmath_utility.cxx
+++ b/binfilter/bf_starmath/source/starmath_utility.cxx
@@ -34,7 +34,6 @@
 #include <tools/stream.hxx>
 #include "starmath.hrc"
 #include "utility.hxx"
-#include <bf_tools/string.hxx>
 
 namespace binfilter {
 
@@ -197,7 +196,7 @@ int GetTextEncodingTabIndex( const String &rTxt, xub_StrLen nPos )
 /*?*/             {
 /*?*/                 DBG_ASSERT( 0 <= nCharVal  &&  nCharVal <= 256,
 /*?*/                         "character value out of range" );
-/*?*/                 sRepl = ByteString_ConvertToUnicode( nCharVal, nEnc );
+/*?*/                 sRepl = ByteString::ConvertToUnicode( nCharVal, nEnc );
 /*?*/             }
 /*?*/             DBG_ASSERT( sRepl.Len() || !nCharVal, "conversion failed" );
 /*?*/             nReplLen = nPostStart + nPostLen - nPreStart;
diff --git a/binfilter/bf_svtools/source/config/svt_addxmltostorageoptions.cxx b/binfilter/bf_svtools/source/config/svt_addxmltostorageoptions.cxx
index 3a52455..69523ad 100644
--- a/binfilter/bf_svtools/source/config/svt_addxmltostorageoptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_addxmltostorageoptions.cxx
@@ -36,7 +36,7 @@
 #include <unotools/configmgr.hxx>
 #include <unotools/configitem.hxx>
 #include <tools/debug.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 
diff --git a/binfilter/bf_svtools/source/config/svt_itemholder1.cxx b/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
index 01b6115..da9446d 100644
--- a/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
+++ b/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
@@ -56,7 +56,7 @@
 #include <bf_svtools/options3d.hxx>
 #include <bf_svtools/pathoptions.hxx>
 #include <bf_svtools/printwarningoptions.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <bf_svtools/optionsdlg.hxx>
 #include <bf_svtools/saveopt.hxx>
 #include <searchopt.hxx>
diff --git a/binfilter/bf_svtools/source/config/svt_syslocaleoptions.cxx b/binfilter/bf_svtools/source/config/svt_syslocaleoptions.cxx
index a7cfbf2..b79d1d3 100644
--- a/binfilter/bf_svtools/source/config/svt_syslocaleoptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_syslocaleoptions.cxx
@@ -32,7 +32,7 @@
 #include <listener.hxx>
 #include <bf_svtools/smplhint.hxx>
 #include <i18npool/mslangid.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/instance.hxx>
 #include <unotools/configmgr.hxx>
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx b/binfilter/bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx
index 04b80e5..2b036e9 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/FilterConfigCache.hxx
@@ -29,7 +29,7 @@
 #ifndef _FILTER_CONFIG_CACHE_HXX_
 #define _FILTER_CONFIG_CACHE_HXX_
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <rtl/ustring.hxx>
 #include "bf_svtools/svtdllapi.h"
 #include <com/sun/star/uno/Sequence.h>
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx
index 5e302d8..68eea6a 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigCache.cxx
@@ -29,7 +29,7 @@
 #include "FilterConfigCache.hxx"
 #include <bf_svtools/filter.hxx>
 #include <tools/debug.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <rtl/ustring.hxx>
 
 #include <com/sun/star/uno/Any.h>
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
index d4fb8a8..3b20fe6 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
@@ -26,7 +26,7 @@
  *
  ************************************************************************/
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <bf_svtools/FilterConfigItem.hxx>
 #include <tools/debug.hxx>
 #include <unotools/configmgr.hxx>
diff --git a/binfilter/bf_svtools/source/items/svt_aeitem.cxx b/binfilter/bf_svtools/source/items/svt_aeitem.cxx
index 5506650..7dafae3 100644
--- a/binfilter/bf_svtools/source/items/svt_aeitem.cxx
+++ b/binfilter/bf_svtools/source/items/svt_aeitem.cxx
@@ -26,7 +26,7 @@
  *
  ************************************************************************/
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #define _SVSTDARR_USHORTS
 #include <bf_svtools/svstdarr.hxx>
diff --git a/binfilter/bf_svtools/source/items1/svt_cntwall.cxx b/binfilter/bf_svtools/source/items1/svt_cntwall.cxx
index d7d5271..b094102 100644
--- a/binfilter/bf_svtools/source/items1/svt_cntwall.cxx
+++ b/binfilter/bf_svtools/source/items1/svt_cntwall.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <tools/debug.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <tools/stream.hxx>
 
 #include <tools/vcompat.hxx>
diff --git a/binfilter/bf_svtools/source/items1/svt_sitem.cxx b/binfilter/bf_svtools/source/items1/svt_sitem.cxx
index a538742..4113c65 100644
--- a/binfilter/bf_svtools/source/items1/svt_sitem.cxx
+++ b/binfilter/bf_svtools/source/items1/svt_sitem.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 // INCLUDE ---------------------------------------------------------------
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <tools/stream.hxx>
 
 #include <bf_svtools/poolitem.hxx>
diff --git a/binfilter/bf_svtools/source/items1/svt_tfrmitem.cxx b/binfilter/bf_svtools/source/items1/svt_tfrmitem.cxx
index 759570a..a8ddf54 100644
--- a/binfilter/bf_svtools/source/items1/svt_tfrmitem.cxx
+++ b/binfilter/bf_svtools/source/items1/svt_tfrmitem.cxx
@@ -30,7 +30,7 @@
 
 #include <tools/stream.hxx>
 #include <tools/debug.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #include <bf_svtools/tfrmitem.hxx>
 
diff --git a/binfilter/bf_svtools/source/memtools/svt_svarray.cxx b/binfilter/bf_svtools/source/memtools/svt_svarray.cxx
index d93ec66..dc6c885 100644
--- a/binfilter/bf_svtools/source/memtools/svt_svarray.cxx
+++ b/binfilter/bf_svtools/source/memtools/svt_svarray.cxx
@@ -56,7 +56,7 @@
 
 #include <bf_svtools/svstdarr.hxx>
 
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 
 #include <tools/debug.hxx>
 
diff --git a/binfilter/bf_svtools/source/misc/impstrg.hxx b/binfilter/bf_svtools/source/misc/impstrg.hxx
new file mode 100644
index 0000000..6b05672
--- /dev/null
+++ b/binfilter/bf_svtools/source/misc/impstrg.hxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _IMPSTRG_HXX
+#define _IMPSTRG_HXX
+
+#include <tools/tools.h>
+#include <bf_tools/string.hxx>
+
+namespace binfilter
+{
+
+// ------------------------------
+// - Debug-Methoden fuer String -
+// ------------------------------
+
+const char* DbgCheckByteString( const void* pString );
+const char* DbgCheckUniString( const void* pString );
+
+// -------------------------------
+// - Hilfsfunktionen fuer String -
+// -------------------------------
+
+xub_StrLen ImplStringLen( const sal_Char* pStr );
+xub_StrLen ImplStringLen( const sal_Unicode* pStr );
+
+}
+
+#endif // _IMPSTRG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_svtools/source/misc/makefile.mk b/binfilter/bf_svtools/source/misc/makefile.mk
index 62ce32e..f871304 100644
--- a/binfilter/bf_svtools/source/misc/makefile.mk
+++ b/binfilter/bf_svtools/source/misc/makefile.mk
@@ -58,7 +58,8 @@ SLOFILES=\
     $(SLO)$/svt_ownlist.obj             \
     $(SLO)$/svt_vcldata.obj             \
     $(SLO)$/svt_restrictedpaths.obj	\
-    $(SLO)$/tl_tstring.obj
+    $(SLO)$/tl_tstring.obj		\
+    $(SLO)$/tl_tustring.obj
 
 # --- Targets -------------------------------------------------------
 
diff --git a/binfilter/bf_svtools/source/misc/svt_ctrltool.cxx b/binfilter/bf_svtools/source/misc/svt_ctrltool.cxx
index 564001a..c1ac718 100644
--- a/binfilter/bf_svtools/source/misc/svt_ctrltool.cxx
+++ b/binfilter/bf_svtools/source/misc/svt_ctrltool.cxx
@@ -87,7 +87,7 @@ static StringCompare ImplCompareFontInfo( ImplFontListFontInfo* pInfo1,
     else if ( pInfo1->GetItalic() > pInfo2->GetItalic() )
         return COMPARE_GREATER;
 
-    return pInfo1->GetStyleName().CompareTo( pInfo2->GetStyleName() );
+    return static_cast<StringCompare>(pInfo1->GetStyleName().CompareTo( pInfo2->GetStyleName() ));
 }
 
 static void ImplMakeSearchString( XubString& rStr )
diff --git a/binfilter/bf_svtools/source/misc/svt_ehdl.cxx b/binfilter/bf_svtools/source/misc/svt_ehdl.cxx
index 5b14396..7dceeaf 100644
--- a/binfilter/bf_svtools/source/misc/svt_ehdl.cxx
+++ b/binfilter/bf_svtools/source/misc/svt_ehdl.cxx
@@ -49,8 +49,8 @@ namespace binfilter
 static USHORT aWndFunc(
     Window *pWin,            // Parent des Dialoges
     USHORT nFlags,
-    const String &rErr,      // Fehlertext
-    const String &rAction)   // Actiontext
+    const ::String &rErr,      // Fehlertext
+    const ::String &rAction)   // Actiontext
 
 /*  [Beschreibung]
 
@@ -183,7 +183,7 @@ SfxErrorHandler::~SfxErrorHandler()
 //-------------------------------------------------------------------------
 
 BOOL SfxErrorHandler::CreateString(
-    const ErrorInfo *pErr, String &rStr, USHORT& nFlags) const
+    const ErrorInfo *pErr, ::String &rStr, USHORT& nFlags) const
 
 /*  [Beschreibung]
 
@@ -323,7 +323,7 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
 //-------------------------------------------------------------------------
 
 BOOL SfxErrorHandler::GetMessageString(
-    ULONG lErrId, String &rStr, USHORT &nFlags) const
+    ULONG lErrId, ::String &rStr, USHORT &nFlags) const
 
 /*  [Beschreibung]
 
@@ -342,7 +342,7 @@ BOOL SfxErrorHandler::GetMessageString(
         USHORT nResFlags = aErrorString.GetFlags();
         if( nResFlags )
             nFlags=aErrorString.GetFlags();
-        rStr = aErrorString.GetString();
+        rStr = rtl::OUString(aErrorString.GetString());
         bRet = TRUE;
     }
 
@@ -353,7 +353,7 @@ BOOL SfxErrorHandler::GetMessageString(
 //-------------------------------------------------------------------------
 
 BOOL SfxErrorHandler::GetErrorString(
-    ULONG lErrId, String &rStr, USHORT &nFlags) const
+    ULONG lErrId, ::String &rStr, USHORT &nFlags) const
 
 /*  [Beschreibung]
     Erzeugt den Fehlerstring fuer den eigentlichen Fehler ohne
@@ -413,7 +413,7 @@ SfxErrorContext::SfxErrorContext(
 
 //-------------------------------------------------------------------------
 
-BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
+BOOL SfxErrorContext::GetString(ULONG nErrId, ::String &rStr)
 
 /*  [Beschreibung]
 
@@ -437,7 +437,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
         ErrorResource_Impl aTestEr( aResId, nCtxId );
         if ( aTestEr )
         {
-            rStr = ( (ResString)aTestEr ).GetString();
+            rStr = rtl::OUString(( (ResString)aTestEr ).GetString());
             rStr.SearchAndReplace( String::CreateFromAscii( "$(ARG1)" ), aArg1 );
             bRet = true;
         }
diff --git a/binfilter/bf_svtools/source/misc/svt_ownlist.cxx b/binfilter/bf_svtools/source/misc/svt_ownlist.cxx
index b4f6bf0..b57a9d1 100644
--- a/binfilter/bf_svtools/source/misc/svt_ownlist.cxx
+++ b/binfilter/bf_svtools/source/misc/svt_ownlist.cxx
@@ -29,7 +29,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <bf_svtools/bf_solar.h>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <com/sun/star/beans/PropertyValues.hpp>
 #include <bf_svtools/ownlist.hxx>
 
diff --git a/binfilter/bf_svtools/source/misc/svt_templatefoldercache.cxx b/binfilter/bf_svtools/source/misc/svt_templatefoldercache.cxx
index 4c2b5e0..c3a4d9f 100644
--- a/binfilter/bf_svtools/source/misc/svt_templatefoldercache.cxx
+++ b/binfilter/bf_svtools/source/misc/svt_templatefoldercache.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <tools/urlobj.hxx>
-#include <tools/string.hxx>
+#include <bf_tools/string.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/localfilehelper.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/binfilter/bf_svtools/source/misc/tl_strascii.cxx b/binfilter/bf_svtools/source/misc/tl_strascii.cxx
new file mode 100644
index 0000000..31efd2e
--- /dev/null
+++ b/binfilter/bf_svtools/source/misc/tl_strascii.cxx
@@ -0,0 +1,643 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+namespace binfilter
+{
+
+// =======================================================================
+
+#ifdef DBG_UTIL
+
+static sal_Bool ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen )
+{
+    while ( nLen && *pAsciiStr )
+    {
+        if ( ((unsigned char)*pAsciiStr) > 127 )
+            return sal_False;
+        ++pAsciiStr,
+        --nLen;
+    }
+
+    return sal_True;
+}
+
+#endif
+
+// =======================================================================
+
+static void ImplCopyAsciiStr( sal_Unicode* pDest, const sal_Char* pSrc,
+                              sal_Int32 nLen )
+{
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pSrc, nLen ),
+                "UniString::CopyAsciiStr() - pAsciiStr include characters > 127" );
+
+    while ( nLen )
+    {
+        *pDest = (unsigned char)*pSrc;
+        ++pDest,
+        ++pSrc,
+        --nLen;
+    }
+}
+
+// =======================================================================
+
+static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2 )
+{
+    sal_Int32 nRet;
+    while ( ((nRet = ((sal_Int32)*pStr1)-((sal_Int32)((unsigned char)*pStr2))) == 0) &&
+            *pStr2 )
+    {
+        ++pStr1,
+        ++pStr2;
+    }
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2,
+                                         xub_StrLen nCount )
+{
+    sal_Int32 nRet = 0;
+    while ( nCount &&
+            ((nRet = ((sal_Int32)*pStr1)-((sal_Int32)((unsigned char)*pStr2))) == 0) &&
+            *pStr2 )
+    {
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringCompareWithoutZeroAscii( const sal_Unicode* pStr1, const sal_Char* pStr2,
+                                                    xub_StrLen nCount )
+{
+    sal_Int32 nRet = 0;
+    while ( nCount &&
+            ((nRet = ((sal_Int32)*pStr1)-((sal_Int32)((unsigned char)*pStr2))) == 0) )
+    {
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringICompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2 )
+{
+    sal_Int32   nRet;
+    sal_Unicode c1;
+    sal_Char    c2;
+    do
+    {
+        // Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
+        c1 = *pStr1;
+        c2 = *pStr2;
+        if ( (c1 >= 65) && (c1 <= 90) )
+            c1 += 32;
+        if ( (c2 >= 65) && (c2 <= 90) )
+            c2 += 32;
+        nRet = ((sal_Int32)c1)-((sal_Int32)((unsigned char)c2));
+        if ( nRet != 0 )
+            break;
+
+        ++pStr1,
+        ++pStr2;
+    }
+    while ( c2 );
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringICompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2,
+                                          xub_StrLen nCount )
+{
+    sal_Int32   nRet = 0;
+    sal_Unicode c1;
+    sal_Char    c2;
+    do
+    {
+        if ( !nCount )
+            break;
+
+        // Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
+        c1 = *pStr1;
+        c2 = *pStr2;
+        if ( (c1 >= 65) && (c1 <= 90) )
+            c1 += 32;
+        if ( (c2 >= 65) && (c2 <= 90) )
+            c2 += 32;
+        nRet = ((sal_Int32)c1)-((sal_Int32)((unsigned char)c2));
+        if ( nRet != 0 )
+            break;
+
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+    while ( c2 );
+
+    return nRet;
+}
+
+// =======================================================================
+
+UniString UniString::CreateFromAscii( const sal_Char* pAsciiStr )
+{
+    DBG_ASSERT( pAsciiStr, "UniString::CreateFromAscii() - pAsciiStr is NULL" );
+
+    // Stringlaenge ermitteln
+    xub_StrLen nLen = ImplStringLen( pAsciiStr );
+
+    UniString aTempStr;
+    if ( nLen )
+    {
+        ImplCopyAsciiStr( aTempStr.AllocBuffer( nLen ), pAsciiStr, nLen );
+    }
+    return aTempStr;
+}
+
+// -----------------------------------------------------------------------
+
+UniString UniString::CreateFromAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
+{
+    DBG_ASSERT( pAsciiStr, "UniString::CreateFromAscii() - pAsciiStr is NULL" );
+
+    // Stringlaenge ermitteln
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pAsciiStr );
+
+    UniString aTempStr;
+
+    if ( nLen )
+    {
+        ImplCopyAsciiStr( aTempStr.AllocBuffer( nLen ), pAsciiStr, nLen );
+    }
+    return aTempStr;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::AssignAscii( const sal_Char* pAsciiStr )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" );
+
+    // Stringlaenge ermitteln
+    xub_StrLen nLen = ImplStringLen( pAsciiStr );
+
+    if ( !nLen )
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+    else
+    {
+        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
+        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
+            ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
+        else
+        {
+            // Alte Daten loeschen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+
+            // Daten initialisieren und String kopieren
+            mpData = ImplAllocData( nLen );
+            ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
+        }
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::AssignAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pAsciiStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nLen; ++i )
+        {
+            if ( !pAsciiStr[i] )
+            {
+                OSL_FAIL( "UniString::AssignAscii() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    if ( !nLen )
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+    else
+    {
+        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
+        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
+            ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
+        else
+        {
+            // Alte Daten loeschen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+
+            // Daten initialisieren und String kopieren
+            mpData = ImplAllocData( nLen );
+            ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
+        }
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::AppendAscii( const sal_Char* pAsciiStr )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::AppendAscii() - pAsciiStr is NULL" );
+
+    // Stringlaenge ermitteln
+    sal_Int32 nCopyLen = ImplStringLen( pAsciiStr );
+
+    // Ueberlauf abfangen
+    nCopyLen = ImplGetCopyLen( mpData->mnLen, nCopyLen );
+
+    // Ist es kein leerer String
+    if ( nCopyLen )
+    {
+        // Neue Datenstruktur und neuen String erzeugen
+        UniStringData* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, mpData->mnLen*sizeof( sal_Unicode ) );
+        ImplCopyAsciiStr( pNewData->maStr+mpData->mnLen, pAsciiStr, nCopyLen );
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::AppendAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::AppendAscii() - pAsciiStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pAsciiStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nLen; ++i )
+        {
+            if ( !pAsciiStr[i] )
+            {
+                OSL_FAIL( "UniString::AppendAscii() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    // Ueberlauf abfangen
+    sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen );
+
+    // Ist es kein leerer String
+    if ( nCopyLen )
+    {
+        // Neue Datenstruktur und neuen String erzeugen
+        UniStringData* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, mpData->mnLen*sizeof( sal_Unicode ) );
+        ImplCopyAsciiStr( pNewData->maStr+mpData->mnLen, pAsciiStr, nCopyLen );
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::InsertAscii( const char* pAsciiStr, xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::InsertAscii() - pAsciiStr is NULL" );
+
+    // Stringlaenge ermitteln
+    sal_Int32 nCopyLen = ImplStringLen( pAsciiStr );
+
+    // Ueberlauf abfangen
+    nCopyLen = ImplGetCopyLen( mpData->mnLen, nCopyLen );
+
+    // Ist der einzufuegende String ein Leerstring
+    if ( !nCopyLen )
+        return *this;
+
+    // Index groesser als Laenge
+    if ( nIndex > mpData->mnLen )
+        nIndex = static_cast< xub_StrLen >(mpData->mnLen);
+
+    // Neue Laenge ermitteln und neuen String anlegen
+    UniStringData* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
+
+    // String kopieren
+    memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( sal_Unicode ) );
+    ImplCopyAsciiStr( pNewData->maStr+nIndex, pAsciiStr, nCopyLen );
+    memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex,
+            (mpData->mnLen-nIndex)*sizeof( sal_Unicode ) );
+
+    // Alte Daten loeschen und Neue zuweisen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = pNewData;
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::ReplaceAscii( xub_StrLen nIndex, xub_StrLen nCount,
+                                    const sal_Char* pAsciiStr, xub_StrLen nStrLen )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( pAsciiStr, "UniString::ReplaceAscii() - pAsciiStr is NULL" );
+
+    // Wenn Index groessergleich Laenge ist, dann ist es ein Append
+    if ( nIndex >= mpData->mnLen )
+    {
+        AppendAscii( pAsciiStr, nStrLen );
+        return *this;
+    }
+
+    // Ist es eine Zuweisung
+    if ( (nIndex == 0) && (nCount >= mpData->mnLen) )
+    {
+        AssignAscii( pAsciiStr, nStrLen );
+        return *this;
+    }
+
+    // Reicht ein Erase
+    if ( nStrLen == STRING_LEN )
+        nStrLen = ImplStringLen( pAsciiStr );
+    if ( !nStrLen )
+        return Erase( nIndex, nCount );
+
+    // nCount darf nicht ueber das Stringende hinnausgehen
+    if ( nCount > mpData->mnLen - nIndex )
+        nCount = static_cast< xub_StrLen >(mpData->mnLen-nIndex);
+
+    // Reicht eine zeichenweise Zuweisung
+    if ( nCount == nStrLen )
+    {
+        ImplCopyData();
+        ImplCopyAsciiStr( mpData->maStr+nIndex, pAsciiStr, nStrLen );
+        return *this;
+    }
+
+    // Ueberlauf abfangen
+    sal_Int32 n = ImplGetCopyLen( mpData->mnLen-nCount, nStrLen );
+
+    // Neue Daten anlegen
+    STRINGDATA* pNewData = ImplAllocData( mpData->mnLen-nCount+n );
+
+    // String kopieren
+    memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
+    ImplCopyAsciiStr( pNewData->maStr+nIndex, pAsciiStr, n );
+    memcpy( pNewData->maStr+nIndex+n, mpData->maStr+nIndex+nCount,
+            (mpData->mnLen-nIndex-nCount+1)*sizeof( STRCODE ) );
+
+    // Alte Daten loeschen und Neue zuweisen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = pNewData;
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+StringCompare UniString::CompareToAscii( const sal_Char* pAsciiStr,
+                                         xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ),
+                "UniString::CompareToAscii() - pAsciiStr include characters > 127" );
+
+    // String vergleichen
+    sal_Int32 nCompare = ImplStringCompareAscii( mpData->maStr, pAsciiStr, nLen );
+
+    // Rueckgabewert anpassen
+    if ( nCompare == 0 )
+        return COMPARE_EQUAL;
+    else if ( nCompare < 0 )
+        return COMPARE_LESS;
+    else
+        return COMPARE_GREATER;
+}
+
+// -----------------------------------------------------------------------
+
+StringCompare UniString::CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
+                                                   xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ),
+                "UniString::CompareIgnoreCaseToAscii() - pAsciiStr include characters > 127" );
+
+    // String vergleichen
+    sal_Int32 nCompare = ImplStringICompareAscii( mpData->maStr, pAsciiStr, nLen );
+
+    // Rueckgabewert anpassen
+    if ( nCompare == 0 )
+        return COMPARE_EQUAL;
+    else if ( nCompare < 0 )
+        return COMPARE_LESS;
+    else
+        return COMPARE_GREATER;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
+                "UniString::EqualsAscii() - pAsciiStr include characters > 127" );
+
+    return (ImplStringCompareAscii( mpData->maStr, pAsciiStr ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
+                "UniString::EqualsIgnoreCaseAscii() - pAsciiStr include characters > 127" );
+
+    return (ImplStringICompareAscii( mpData->maStr, pAsciiStr ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr,
+                             xub_StrLen nIndex, xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ),
+                "UniString::EqualsAscii() - pAsciiStr include characters > 127" );
+
+    // Are there enough codes for comparing?
+    if ( nIndex > mpData->mnLen )
+        return (*pAsciiStr == 0);
+
+    return (ImplStringCompareAscii( mpData->maStr+nIndex, pAsciiStr, nLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
+                                       xub_StrLen nIndex, xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ),
+                "UniString::EqualsIgnoreCaseAscii() - pAsciiStr include characters > 127" );
+
+    // Are there enough codes for comparing?
+    if ( nIndex > mpData->mnLen )
+        return (*pAsciiStr == 0);
+
+    return (ImplStringICompareAscii( mpData->maStr+nIndex, pAsciiStr, nLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen UniString::SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex ) const
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
+                "UniString::SearchAscii() - pAsciiStr include characters > 127" );
+
+    sal_Int32 nLen = mpData->mnLen;
+    xub_StrLen nStrLen  = ImplStringLen( pAsciiStr );
+
+    // Falls die Laenge des uebergebenen Strings 0 ist oder der Index
+    // hinter dem String liegt, dann wurde der String nicht gefunden
+    if ( !nStrLen || (nIndex >= nLen) )
+        return STRING_NOTFOUND;
+
+    const sal_Unicode* pStr = mpData->maStr;
+    pStr += nIndex;
+
+    if ( nStrLen == 1 )
+    {
+        sal_Unicode cSearch = (unsigned char)*pAsciiStr;
+        while ( nIndex < nLen )
+        {
+            if ( *pStr == cSearch )
+                return nIndex;
+            ++pStr,
+            ++nIndex;
+        }
+    }
+    else
+    {
+        // Nur innerhalb des Strings suchen
+        while ( nLen - nIndex >= nStrLen )
+        {
+            // Stimmt der String ueberein
+            if ( ImplStringCompareWithoutZeroAscii( pStr, pAsciiStr, nStrLen ) == 0 )
+                return nIndex;
+            ++pStr,
+            ++nIndex;
+        }
+    }
+
+    return STRING_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen UniString::SearchAndReplaceAscii( const sal_Char* pAsciiStr, const UniString& rRepStr,
+                                             xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
+                "UniString::SearchAndReplaceAscii() - pAsciiStr include characters > 127" );
+
+    xub_StrLen nSPos = SearchAscii( pAsciiStr, nIndex );
+    if ( nSPos != STRING_NOTFOUND )
+        Replace( nSPos, ImplStringLen( pAsciiStr ), rRepStr );
+
+    return nSPos;
+}
+
+// -----------------------------------------------------------------------
+
+void UniString::SearchAndReplaceAllAscii( const sal_Char* pAsciiStr, const UniString& rRepStr )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
+                "UniString::SearchAndReplaceAllAscii() - pAsciiStr include characters > 127" );
+
+    xub_StrLen nCharLen = ImplStringLen( pAsciiStr );
+    xub_StrLen nSPos = SearchAscii( pAsciiStr, 0 );
+    while ( nSPos != STRING_NOTFOUND )
+    {
+        Replace( nSPos, nCharLen, rRepStr );
+        nSPos = nSPos + rRepStr.Len();
+        nSPos = SearchAscii( pAsciiStr, nSPos );
+    }
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_svtools/source/misc/tl_strcvt.cxx b/binfilter/bf_svtools/source/misc/tl_strcvt.cxx
new file mode 100644
index 0000000..1d52794
--- /dev/null
+++ b/binfilter/bf_svtools/source/misc/tl_strcvt.cxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+namespace binfilter
+{
+
+// =======================================================================
+
+ByteString::ByteString( const rtl::OString& rStr )
+    : mpData(NULL)
+{
+    DBG_CTOR( ByteString, DbgCheckByteString );
+
+    OSL_ENSURE(rStr.pData->length < STRING_MAXLEN,
+               "Overflowing rtl::OString -> ByteString cut to zero length");
+
+    if (rStr.pData->length < STRING_MAXLEN)
+    {
+        mpData = reinterpret_cast< ByteStringData * >(const_cast< rtl::OString & >(rStr).pData);
+        STRING_ACQUIRE((STRING_TYPE *)mpData);
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+}
+
+// -----------------------------------------------------------------------
+
+ByteString& ByteString::Assign( const rtl::OString& rStr )
+{
+    DBG_CHKTHIS( ByteString, DbgCheckByteString );
+
+    OSL_ENSURE(rStr.pData->length < STRING_MAXLEN,
+               "Overflowing rtl::OString -> ByteString cut to zero length");
+
+    if (rStr.pData->length < STRING_MAXLEN)
+    {
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = reinterpret_cast< ByteStringData * >(const_cast< rtl::OString & >(rStr).pData);
+        STRING_ACQUIRE((STRING_TYPE *)mpData);
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+
+    return *this;
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_svtools/source/misc/tl_strimp.cxx b/binfilter/bf_svtools/source/misc/tl_strimp.cxx
new file mode 100644
index 0000000..b0d7279
--- /dev/null
+++ b/binfilter/bf_svtools/source/misc/tl_strimp.cxx
@@ -0,0 +1,1255 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+namespace binfilter
+{
+
+static sal_Int32 ImplStringCompare( const STRCODE* pStr1, const STRCODE* pStr2,
+                                    xub_StrLen nCount )
+{
+    sal_Int32 nRet = 0;
+    while ( nCount &&
+            ((nRet = ((sal_Int32)((STRCODEU)*pStr1))-((sal_Int32)((STRCODEU)*pStr2))) == 0) &&
+            *pStr2 )
+    {
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringCompareWithoutZero( const STRCODE* pStr1, const STRCODE* pStr2,
+                                               sal_Int32 nCount )
+{
+    sal_Int32 nRet = 0;
+    while ( nCount &&
+            ((nRet = ((sal_Int32)((STRCODEU)*pStr1))-((sal_Int32)((STRCODEU)*pStr2))) == 0) )
+    {
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringICompare( const STRCODE* pStr1, const STRCODE* pStr2 )
+{
+    sal_Int32   nRet;
+    STRCODE     c1;
+    STRCODE     c2;
+    do
+    {
+        // Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
+        c1 = *pStr1;
+        c2 = *pStr2;
+        if ( (c1 >= 65) && (c1 <= 90) )
+            c1 += 32;
+        if ( (c2 >= 65) && (c2 <= 90) )
+            c2 += 32;
+        nRet = ((sal_Int32)((STRCODEU)c1))-((sal_Int32)((STRCODEU)c2));
+        if ( nRet != 0 )
+            break;
+
+        ++pStr1,
+        ++pStr2;
+    }
+    while ( c2 );
+
+    return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static sal_Int32 ImplStringICompareWithoutZero( const STRCODE* pStr1, const STRCODE* pStr2,
+                                                sal_Int32 nCount )
+{
+    sal_Int32   nRet = 0;
+    STRCODE     c1;
+    STRCODE     c2;
+    do
+    {
+        if ( !nCount )
+            break;
+
+        // Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
+        c1 = *pStr1;
+        c2 = *pStr2;
+        if ( (c1 >= 65) && (c1 <= 90) )
+            c1 += 32;
+        if ( (c2 >= 65) && (c2 <= 90) )
+            c2 += 32;
+        nRet = ((sal_Int32)((STRCODEU)c1))-((sal_Int32)((STRCODEU)c2));
+
+        ++pStr1,
+        ++pStr2,
+        --nCount;
+    }
+    while ( nRet == 0 );
+
+    return nRet;
+}
+
+// =======================================================================
+
+#ifdef DBG_UTIL
+const char* DBGCHECKSTRING( const void* pString )
+{
+    STRING* p = (STRING*)pString;
+
+    if ( p->GetBuffer()[p->Len()] != 0 )
+        return "String damaged: aStr[nLen] != 0";
+
+    return NULL;
+}
+#endif
+
+// =======================================================================
+
+static STRINGDATA* ImplAllocData( sal_Int32 nLen )
+{
+    // Dann kopiere die Daten
+    STRINGDATA* pData   = (STRINGDATA*)rtl_allocateMemory( sizeof(STRINGDATA)+(nLen*sizeof( STRCODE )) );
+    pData->mnRefCount   = 1;
+    pData->mnLen        = nLen;
+    pData->maStr[nLen]  = 0;
+    return pData;
+}
+
+// -----------------------------------------------------------------------
+
+static STRINGDATA* _ImplCopyData( STRINGDATA* pData )
+{
+    unsigned int    nSize       = sizeof(STRINGDATA)+(pData->mnLen*sizeof( STRCODE ));
+    STRINGDATA*     pNewData    = (STRINGDATA*)rtl_allocateMemory( nSize );
+    memcpy( pNewData, pData, nSize );
+    pNewData->mnRefCount = 1;
+    STRING_RELEASE((STRING_TYPE *)pData);
+    return pNewData;
+}
+
+// -----------------------------------------------------------------------
+
+inline void STRING::ImplCopyData()
+{
+    DBG_ASSERT( (mpData->mnRefCount != 0), "String::ImplCopyData() - RefCount == 0" );
+
+    // ist es ein referenzierter String, dann die Daten abkoppeln
+    if ( mpData->mnRefCount != 1 )
+        mpData = _ImplCopyData( mpData );
+}
+
+// -----------------------------------------------------------------------
+
+inline STRCODE* STRING::ImplCopyStringData( STRCODE* pStr )
+{
+    // Ist der Referenzzaehler groesser 0
+    if ( mpData->mnRefCount != 1 ) {
+        DBG_ASSERT( (pStr >= mpData->maStr) &&
+                    ((pStr-mpData->maStr) < mpData->mnLen),
+                    "ImplCopyStringData - pStr from other String-Instanz" );
+        unsigned int nIndex = (unsigned int)(pStr-mpData->maStr);
+        mpData = _ImplCopyData( mpData );
+        pStr = mpData->maStr + nIndex;
+    }
+    return pStr;
+}
+
+// -----------------------------------------------------------------------
+
+inline sal_Int32 ImplGetCopyLen( sal_Int32 nStrLen, sal_Int32 nCopyLen )
+{
+    OSL_ASSERT(nStrLen <= STRING_MAXLEN && nCopyLen <= STRING_MAXLEN);
+    if ( nCopyLen > STRING_MAXLEN-nStrLen )
+        nCopyLen = STRING_MAXLEN-nStrLen;
+    return nCopyLen;
+}
+
+// =======================================================================
+
+STRING::STRING()
+    : mpData(NULL)
+{
+    DBG_CTOR( STRING, DBGCHECKSTRING );
+
+    STRING_NEW((STRING_TYPE **)&mpData);
+}
+
+// -----------------------------------------------------------------------
+
+STRING::STRING( const STRING& rStr )
+{
+    DBG_CTOR( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Pointer auf die Daten des uebergebenen Strings setzen und
+    // Referenzzaehler erhoehen
+    STRING_ACQUIRE((STRING_TYPE *)rStr.mpData);
+    mpData = rStr.mpData;
+}
+
+// -----------------------------------------------------------------------
+
+STRING::STRING( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen )
+: mpData( NULL )
+{
+    DBG_CTOR( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Stringlaenge ermitteln
+    if ( nPos > rStr.mpData->mnLen )
+        nLen = 0;
+    else
+    {
+        // Laenge korrigieren, wenn noetig
+        sal_Int32 nMaxLen = rStr.mpData->mnLen-nPos;
+        if ( nLen > nMaxLen )
+            nLen = static_cast< xub_StrLen >(nMaxLen);
+    }
+
+    // Ist es kein leerer String
+    if ( nLen )
+    {
+        // Reicht ein einfaches erhoehen des Referenzcounters
+        if ( (nPos == 0) && (nLen == rStr.mpData->mnLen) )
+        {
+            STRING_ACQUIRE((STRING_TYPE *)rStr.mpData);
+            mpData = rStr.mpData;
+        }
+        else
+        {
+            // Verwaltungsdaten anlegen und String kopieren
+            mpData = ImplAllocData( nLen );
+            memcpy( mpData->maStr, rStr.mpData->maStr+nPos, nLen*sizeof( STRCODE ) );
+        }
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+}
+
+// -----------------------------------------------------------------------
+
+STRING::STRING( const STRCODE* pCharStr )
+    : mpData(NULL)
+{
+    DBG_CTOR( STRING, DBGCHECKSTRING );
+
+    // Stringlaenge ermitteln
+    // Bei diesem Ctor darf NULL uebergeben werden
+    xub_StrLen nLen;
+    if ( pCharStr )
+        nLen = ImplStringLen( pCharStr );
+    else
+        nLen = 0;
+
+    // Ist es kein leerer String
+    if ( nLen )
+    {
+        // Verwaltungsdaten anlegen und String kopieren
+        mpData = ImplAllocData( nLen );
+        memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+}
+
+// -----------------------------------------------------------------------
+
+STRING::STRING( const STRCODE* pCharStr, xub_StrLen nLen )
+: mpData(NULL)
+{
+    DBG_CTOR( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::String() - pCharStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pCharStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nLen; i++ )
+        {
+            if ( !pCharStr[i] )
+            {
+                OSL_FAIL( "String::String() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    // Ist es kein leerer String
+    if ( nLen )
+    {
+        // Verwaltungsdaten anlegen und String kopieren
+        mpData = ImplAllocData( nLen );
+        memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+}
+
+// -----------------------------------------------------------------------
+
+STRING::~STRING()
+{
+    DBG_DTOR( STRING, DBGCHECKSTRING );
+
+    // Daten loeschen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Assign( const STRING& rStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    STRING_ACQUIRE((STRING_TYPE *)rStr.mpData);
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = rStr.mpData;
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Assign( const STRCODE* pCharStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::Assign() - pCharStr is NULL" );
+
+    // Stringlaenge ermitteln
+    xub_StrLen nLen = ImplStringLen( pCharStr );
+
+    if ( !nLen )
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+    else
+    {
+        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
+        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        else
+        {
+            // Alte Daten loeschen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+
+            // Daten initialisieren und String kopieren
+            mpData = ImplAllocData( nLen );
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        }
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Assign( const STRCODE* pCharStr, xub_StrLen nLen )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::Assign() - pCharStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pCharStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nLen; i++ )
+        {
+            if ( !pCharStr[i] )
+            {
+                OSL_FAIL( "String::Assign() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    if ( !nLen )
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+    else
+    {
+        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
+        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        else
+        {
+            // Alte Daten loeschen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+
+            // Daten initialisieren und String kopieren
+            mpData = ImplAllocData( nLen );
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        }
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Assign( STRCODE c )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( c, "String::Assign() - c is 0" );
+
+    // Verwaltungsdaten anlegen und initialisieren
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = ImplAllocData( 1 );
+    mpData->maStr[0] = c;
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Append( const STRING& rStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Wenn String leer, dann reicht eine Zuweisung
+    sal_Int32 nLen = mpData->mnLen;
+    if ( !nLen )
+    {
+        STRING_ACQUIRE((STRING_TYPE *)rStr.mpData);
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = rStr.mpData;
+    }
+    else
+    {
+        // Ueberlauf abfangen
+        sal_Int32 nCopyLen = ImplGetCopyLen( nLen, rStr.mpData->mnLen );
+
+        // Ist der uebergebene String kein Leerstring
+        if ( nCopyLen )
+        {
+            // Neue Datenstruktur und neuen String erzeugen
+            STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen );
+
+            // String kopieren
+            memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) );
+            memcpy( pNewData->maStr+nLen, rStr.mpData->maStr, nCopyLen*sizeof( STRCODE ) );
+
+            // Alte Daten loeschen und Neue zuweisen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+            mpData = pNewData;
+        }
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Append( const STRCODE* pCharStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" );
+
+    // Stringlaenge ermitteln
+    sal_Int32 nLen = mpData->mnLen;
+    sal_Int32 nCopyLen = ImplStringLen( pCharStr );
+
+    // Ueberlauf abfangen
+    nCopyLen = ImplGetCopyLen( nLen, nCopyLen );
+
+    // Ist es kein leerer String
+    if ( nCopyLen )
+    {
+        // Neue Datenstruktur und neuen String erzeugen
+        STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) );
+        memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) );
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Append( const STRCODE* pCharStr, xub_StrLen nCharLen )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" );
+
+    if ( nCharLen == STRING_LEN )
+        nCharLen = ImplStringLen( pCharStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nCharLen; i++ )
+        {
+            if ( !pCharStr[i] )
+            {
+                OSL_FAIL( "String::Append() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    // Ueberlauf abfangen
+    sal_Int32 nLen = mpData->mnLen;
+    sal_Int32 nCopyLen = ImplGetCopyLen( nLen, nCharLen );
+
+    // Ist es kein leerer String
+    if ( nCopyLen )
+    {
+        // Neue Datenstruktur und neuen String erzeugen
+        STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) );
+        memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) );
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Append( STRCODE c )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    // kein 0-Character und maximale Stringlaenge nicht ueberschreiten
+    sal_Int32 nLen = mpData->mnLen;
+    if ( c && (nLen < STRING_MAXLEN) )
+    {
+        // Neue Datenstruktur und neuen String erzeugen
+        STRINGDATA* pNewData = ImplAllocData( nLen+1 );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) );
+        pNewData->maStr[nLen] = c;
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+void STRING::SetChar( xub_StrLen nIndex, STRCODE c )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( nIndex < mpData->mnLen, "String::SetChar() - nIndex > String.Len()" );
+
+    // Daten kopieren, wenn noetig und Character zuweisen
+    ImplCopyData();
+    mpData->maStr[nIndex] = c;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Ueberlauf abfangen
+    sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, rStr.mpData->mnLen );
+
+    // Ist der einzufuegende String ein Leerstring
+    if ( !nCopyLen )
+        return *this;
+
+    // Index groesser als Laenge
+    if ( nIndex > mpData->mnLen )
+        nIndex = static_cast< xub_StrLen >(mpData->mnLen);
+
+    // Neue Laenge ermitteln und neuen String anlegen
+    STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
+
+    // String kopieren
+    memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
+    memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr, nCopyLen*sizeof( STRCODE ) );
+    memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex,
+            (mpData->mnLen-nIndex)*sizeof( STRCODE ) );
+
+    // Alte Daten loeschen und Neue zuweisen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = pNewData;
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    // Ist es kein 0-Character
+    if ( !c || (mpData->mnLen == STRING_MAXLEN) )
+        return *this;
+
+    // Index groesser als Laenge
+    if ( nIndex > mpData->mnLen )
+        nIndex = static_cast< xub_StrLen >(mpData->mnLen);
+
+    // Neue Laenge ermitteln und neuen String anlegen
+    STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+1 );
+
+    // String kopieren
+    memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
+    pNewData->maStr[nIndex] = c;
+    memcpy( pNewData->maStr+nIndex+1, mpData->maStr+nIndex,
+            (mpData->mnLen-nIndex)*sizeof( STRCODE ) );
+
+    // Alte Daten loeschen und Neue zuweisen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = pNewData;
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Replace( xub_StrLen nIndex, xub_StrLen nCount, const STRING& rStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Wenn Index groessergleich Laenge ist, dann ist es ein Append
+    if ( nIndex >= mpData->mnLen )
+    {
+        Append( rStr );
+        return *this;
+    }
+
+    // Ist es eine Zuweisung
+    if ( (nIndex == 0) && (nCount >= mpData->mnLen) )
+    {
+        Assign( rStr );
+        return *this;
+    }
+
+    // Reicht ein Erase
+    sal_Int32 nStrLen = rStr.mpData->mnLen;
+    if ( !nStrLen )
+        return Erase( nIndex, nCount );
+
+    // nCount darf nicht ueber das Stringende hinnausgehen
+    if ( nCount > mpData->mnLen - nIndex )
+        nCount = static_cast< xub_StrLen >(mpData->mnLen-nIndex);
+
+    // Reicht ein Insert
+    if ( !nCount )
+        return Insert( rStr, nIndex );
+
+    // Reicht eine zeichenweise Zuweisung
+    if ( nCount == nStrLen )
+    {
+        ImplCopyData();
+        memcpy( mpData->maStr+nIndex, rStr.mpData->maStr, nCount*sizeof( STRCODE ) );
+        return *this;
+    }
+
+    // Ueberlauf abfangen
+    nStrLen = ImplGetCopyLen( mpData->mnLen-nCount, nStrLen );
+
+    // Neue Daten anlegen
+    STRINGDATA* pNewData = ImplAllocData( mpData->mnLen-nCount+nStrLen );
+
+    // String kopieren
+    memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
+    memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr, nStrLen*sizeof( STRCODE ) );
+    memcpy( pNewData->maStr+nIndex+nStrLen, mpData->maStr+nIndex+nCount,
+            (mpData->mnLen-nIndex-nCount+1)*sizeof( STRCODE ) );
+
+    // Alte Daten loeschen und Neue zuweisen
+    STRING_RELEASE((STRING_TYPE *)mpData);
+    mpData = pNewData;
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::Erase( xub_StrLen nIndex, xub_StrLen nCount )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    // Ist der Index ausserhalb des Strings oder ist nCount == 0
+    if ( (nIndex >= mpData->mnLen) || !nCount )
+        return *this;
+
+    // nCount darf nicht ueber das Stringende hinnausgehen
+    if ( nCount > mpData->mnLen - nIndex )
+        nCount = static_cast< xub_StrLen >(mpData->mnLen-nIndex);
+
+    // Ist das Ergebnis kein Leerstring
+    if ( mpData->mnLen - nCount )
+    {
+        // Neue Daten anlegen
+        STRINGDATA* pNewData = ImplAllocData( mpData->mnLen-nCount );
+
+        // String kopieren
+        memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
+        memcpy( pNewData->maStr+nIndex, mpData->maStr+nIndex+nCount,
+                (mpData->mnLen-nIndex-nCount+1)*sizeof( STRCODE ) );
+
+        // Alte Daten loeschen und Neue zuweisen
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = pNewData;
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::ToLowerAscii()
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    sal_Int32 nIndex = 0;
+    sal_Int32 nLen = mpData->mnLen;
+    STRCODE*    pStr = mpData->maStr;
+    while ( nIndex < nLen )
+    {
+        // Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
+        if ( (*pStr >= 65) && (*pStr <= 90) )
+        {
+            // Daten kopieren, wenn noetig
+            pStr = ImplCopyStringData( pStr );
+            *pStr += 32;
+        }
+
+        ++pStr,
+        ++nIndex;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::ToUpperAscii()
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    sal_Int32 nIndex = 0;
+    sal_Int32 nLen = mpData->mnLen;
+    STRCODE*    pStr = mpData->maStr;
+    while ( nIndex < nLen )
+    {
+        // Ist das Zeichen zwischen 'a' und 'z' dann umwandeln
+        if ( (*pStr >= 97) && (*pStr <= 122) )
+        {
+            // Daten kopieren, wenn noetig
+            pStr = ImplCopyStringData( pStr );
+            *pStr -= 32;
+        }
+
+        ++pStr,
+        ++nIndex;
+    }
+
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Auf Gleichheit der Pointer testen
+    if ( mpData == rStr.mpData )
+        return COMPARE_EQUAL;
+
+    // Maximale Laenge ermitteln
+    if ( mpData->mnLen < nLen )
+        nLen = static_cast< xub_StrLen >(mpData->mnLen+1);
+    if ( rStr.mpData->mnLen < nLen )
+        nLen = static_cast< xub_StrLen >(rStr.mpData->mnLen+1);
+
+    // String vergleichen
+    sal_Int32 nCompare = ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, nLen );
+
+    // Rueckgabewert anpassen
+    if ( nCompare == 0 )
+        return COMPARE_EQUAL;
+    else if ( nCompare < 0 )
+        return COMPARE_LESS;
+    else
+        return COMPARE_GREATER;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool STRING::Equals( const STRING& rStr ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Sind die Daten gleich
+    if ( mpData == rStr.mpData )
+        return sal_True;
+
+    // Gleiche Laenge
+    if ( mpData->mnLen != rStr.mpData->mnLen )
+        return sal_False;
+
+    // String vergleichen
+    return (ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Sind die Daten gleich
+    if ( mpData == rStr.mpData )
+        return sal_True;
+
+    // Gleiche Laenge
+    if ( mpData->mnLen != rStr.mpData->mnLen )
+        return sal_False;
+
+    // String vergleichen
+    return (ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    return (ImplStringICompare( mpData->maStr, pCharStr ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Are there enough codes for comparing?
+    if ( nIndex > mpData->mnLen )
+        return (rStr.mpData->mnLen == 0);
+    sal_Int32 nMaxLen = mpData->mnLen-nIndex;
+    if ( nMaxLen < nLen )
+    {
+        if ( rStr.mpData->mnLen != nMaxLen )
+            return sal_False;
+        nLen = static_cast< xub_StrLen >(nMaxLen);
+    }
+
+    // String vergleichen
+    return (ImplStringCompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    // Are there enough codes for comparing?
+    if ( nIndex > mpData->mnLen )
+        return (*pCharStr == 0);
+
+    return (ImplStringCompare( mpData->maStr+nIndex, pCharStr, nLen ) == 0);
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::Match( const STRING& rStr ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    // Ist dieser String leer
+    if ( !mpData->mnLen )
+        return STRING_MATCH;
+
+    // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
+    const STRCODE*  pStr1 = mpData->maStr;
+    const STRCODE*  pStr2 = rStr.mpData->maStr;
+    xub_StrLen      i = 0;
+    while ( i < mpData->mnLen )
+    {
+        // Stimmt das Zeichen nicht ueberein, dann abbrechen
+        if ( *pStr1 != *pStr2 )
+            return i;
+        ++pStr1,
+        ++pStr2,
+        ++i;
+    }
+
+    return STRING_MATCH;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::Search( STRCODE c, xub_StrLen nIndex ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    sal_Int32       nLen = mpData->mnLen;
+    const STRCODE*  pStr = mpData->maStr;
+    pStr += nIndex;
+    while ( nIndex < nLen )
+    {
+        if ( *pStr == c )
+            return nIndex;
+        ++pStr,
+        ++nIndex;
+    }
+
+    return STRING_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::Search( const STRING& rStr, xub_StrLen nIndex ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    sal_Int32 nLen = mpData->mnLen;
+    sal_Int32 nStrLen = rStr.mpData->mnLen;
+
+    // Falls die Laenge des uebergebenen Strings 0 ist oder der Index
+    // hinter dem String liegt, dann wurde der String nicht gefunden
+    if ( !nStrLen || (nIndex >= nLen) )
+        return STRING_NOTFOUND;
+
+    const STRCODE* pStr1 = mpData->maStr;
+    pStr1 += nIndex;
+
+    if ( nStrLen == 1 )
+    {
+        STRCODE cSearch = rStr.mpData->maStr[0];
+        while ( nIndex < nLen )
+        {
+            if ( *pStr1 == cSearch )
+                return nIndex;
+            ++pStr1,
+            ++nIndex;
+        }
+    }
+    else
+    {
+        const STRCODE* pStr2 = rStr.mpData->maStr;
+
+        // Nur innerhalb des Strings suchen
+        while ( nLen - nIndex >= nStrLen )
+        {
+            // Stimmt der String ueberein
+            if ( ImplStringCompareWithoutZero( pStr1, pStr2, nStrLen ) == 0 )
+                return nIndex;
+            ++pStr1,
+            ++nIndex;
+        }
+    }
+
+    return STRING_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::Search( const STRCODE* pCharStr, xub_StrLen nIndex ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    sal_Int32 nLen = mpData->mnLen;
+    xub_StrLen nStrLen  = ImplStringLen( pCharStr );
+
+    // Falls die Laenge des uebergebenen Strings 0 ist oder der Index
+    // hinter dem String liegt, dann wurde der String nicht gefunden
+    if ( !nStrLen || (nIndex >= nLen) )
+        return STRING_NOTFOUND;
+
+    const STRCODE* pStr = mpData->maStr;
+    pStr += nIndex;
+
+    if ( nStrLen == 1 )
+    {
+        STRCODE cSearch = *pCharStr;
+        while ( nIndex < nLen )
+        {
+            if ( *pStr == cSearch )
+                return nIndex;
+            ++pStr,
+            ++nIndex;
+        }
+    }
+    else
+    {
+        // Nur innerhalb des Strings suchen
+        while ( nLen - nIndex >= nStrLen )
+        {
+            // Stimmt der String ueberein
+            if ( ImplStringCompareWithoutZero( pStr, pCharStr, nStrLen ) == 0 )
+                return nIndex;
+            ++pStr,
+            ++nIndex;
+        }
+    }
+
+    return STRING_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::SearchBackward( STRCODE c, xub_StrLen nIndex ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    if ( nIndex > mpData->mnLen )
+        nIndex = (xub_StrLen)mpData->mnLen;
+
+    const STRCODE* pStr = mpData->maStr;
+    pStr += nIndex;
+
+    while ( nIndex )
+    {
+        nIndex--;
+        pStr--;
+        if ( *pStr == c )
+            return nIndex;
+    }
+
+    return STRING_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::SearchAndReplace( const STRING& rStr, const STRING& rRepStr,
+                                     xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rRepStr, STRING, DBGCHECKSTRING );
+
+    xub_StrLen nSPos = Search( rStr, nIndex );
+    if ( nSPos != STRING_NOTFOUND )
+        Replace( nSPos, rStr.Len(), rRepStr );
+
+    return nSPos;
+}
+
+// -----------------------------------------------------------------------
+
+void STRING::SearchAndReplaceAll( STRCODE c, STRCODE cRep )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    sal_Int32       nLen    = mpData->mnLen;
+    const STRCODE*  pStr    = mpData->maStr;
+    sal_Int32       nIndex  = 0;
+    while ( nIndex < nLen )
+    {
+        if ( *pStr == c )
+        {
+            ImplCopyData();
+            mpData->maStr[nIndex] = cRep;
+        }
+        ++pStr,
+        ++nIndex;
+    }
+}
+
+// -----------------------------------------------------------------------
+
+void STRING::SearchAndReplaceAll( const STRING& rStr, const STRING& rRepStr )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rRepStr, STRING, DBGCHECKSTRING );
+
+    xub_StrLen nSPos = Search( rStr, 0 );
+    while ( nSPos != STRING_NOTFOUND )
+    {
+        Replace( nSPos, rStr.Len(), rRepStr );
+        nSPos = nSPos + rRepStr.Len();
+        nSPos = Search( rStr, nSPos );
+    }
+}
+
+// -----------------------------------------------------------------------
+
+xub_StrLen STRING::GetTokenCount( STRCODE cTok ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    // Leerer String: TokenCount per Definition 0
+    if ( !mpData->mnLen )
+        return 0;
+
+    xub_StrLen      nTokCount       = 1;
+    sal_Int32       nLen            = mpData->mnLen;
+    const STRCODE*  pStr            = mpData->maStr;
+    sal_Int32       nIndex          = 0;
+    while ( nIndex < nLen )
+    {
+        // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+        if ( *pStr == cTok )
+            ++nTokCount;
+        ++pStr,
+        ++nIndex;
+    }
+
+    return nTokCount;
+}
+
+// -----------------------------------------------------------------------
+
+void STRING::SetToken( xub_StrLen nToken, STRCODE cTok, const STRING& rStr,
+                       xub_StrLen nIndex )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
+
+    const STRCODE*  pStr            = mpData->maStr;
+    xub_StrLen      nLen            = (xub_StrLen)mpData->mnLen;
+    xub_StrLen      nTok            = 0;
+    xub_StrLen      nFirstChar      = nIndex;
+    xub_StrLen      i               = nFirstChar;
+
+    // Bestimme die Token-Position und Laenge
+    pStr += i;
+    while ( i < nLen )
+    {
+        // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+        if ( *pStr == cTok )
+        {
+            ++nTok;
+
+            if ( nTok == nToken )
+                nFirstChar = i+1;
+            else
+            {
+                if ( nTok > nToken )
+                    break;
+            }
+        }
+
+        ++pStr,
+        ++i;
+    }
+
+    if ( nTok >= nToken )
+        Replace( nFirstChar, i-nFirstChar, rStr );
+}
+
+// -----------------------------------------------------------------------
+
+STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, xub_StrLen& rIndex ) const
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+    const STRCODE*  pStr            = mpData->maStr;
+    xub_StrLen      nLen            = (xub_StrLen)mpData->mnLen;
+    xub_StrLen      nTok            = 0;
+    xub_StrLen      nFirstChar      = rIndex;
+    xub_StrLen      i               = nFirstChar;
+
+    // Bestimme die Token-Position und Laenge
+    pStr += i;
+    while ( i < nLen )
+    {
+        // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+        if ( *pStr == cTok )
+        {
+            ++nTok;
+
+            if ( nTok == nToken )
+                nFirstChar = i+1;
+            else
+            {
+                if ( nTok > nToken )
+                    break;
+            }
+        }
+
+        ++pStr,
+        ++i;
+    }
+
+    if ( nTok >= nToken )
+    {
+        if ( i < nLen )
+            rIndex = i+1;
+        else
+            rIndex = STRING_NOTFOUND;
+        return Copy( nFirstChar, i-nFirstChar );
+    }
+    else
+    {
+        rIndex = STRING_NOTFOUND;
+        return STRING();
+    }
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_svtools/source/misc/tl_strucvt.cxx b/binfilter/bf_svtools/source/misc/tl_strucvt.cxx
new file mode 100644
index 0000000..d5bc082
--- /dev/null
+++ b/binfilter/bf_svtools/source/misc/tl_strucvt.cxx
@@ -0,0 +1,177 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+namespace binfilter
+{
+
+// =======================================================================
+
+void UniString::InitStringRes( const char* pUTF8Str, sal_Int32 nLen )
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+    OSL_ENSURE(nLen <= STRING_MAXLEN, "Overflowing UniString");
+
+    mpData = NULL;
+    rtl_string2UString( (rtl_uString **)(&mpData),
+                        pUTF8Str, nLen,
+                        RTL_TEXTENCODING_UTF8,
+                        RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |
+                        RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
+                        RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT );
+}
+
+// =======================================================================
+
+UniString::UniString( const ByteString& rByteStr, rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+    DBG_CHKOBJ( &rByteStr, ByteString, DbgCheckByteString );
+
+    mpData = NULL;
+    rtl_string2UString( (rtl_uString **)(&mpData),
+                        rByteStr.mpData->maStr, rByteStr.mpData->mnLen,
+                        eTextEncoding, nCvtFlags );
+}
+
+// -----------------------------------------------------------------------
+
+UniString::UniString( const ByteString& rByteStr, xub_StrLen nPos, xub_StrLen nLen,
+                      rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+    DBG_CHKOBJ( &rByteStr, ByteString, DbgCheckByteString );
+
+    // Stringlaenge ermitteln
+    if ( nPos > rByteStr.mpData->mnLen )
+        nLen = 0;
+    else
+    {
+        // Laenge korrigieren, wenn noetig
+        sal_Int32 nMaxLen = rByteStr.mpData->mnLen-nPos;
+        if ( nLen > nMaxLen )
+            nLen = static_cast< xub_StrLen >(nMaxLen);
+    }
+
+    mpData = NULL;
+    rtl_string2UString( (rtl_uString **)(&mpData),
+                        rByteStr.mpData->maStr+nPos, nLen,
+                        eTextEncoding, nCvtFlags );
+}
+
+// -----------------------------------------------------------------------
+
+UniString::UniString( const char* pByteStr,
+                      rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+    DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" );
+
+    mpData = NULL;
+    rtl_string2UString( (rtl_uString **)(&mpData),
+                        pByteStr, ImplStringLen( pByteStr ),
+                        eTextEncoding, nCvtFlags );
+}
+
+// -----------------------------------------------------------------------
+
+UniString::UniString( const char* pByteStr, xub_StrLen nLen,
+                      rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+    DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pByteStr );
+
+    mpData = NULL;
+    rtl_string2UString( (rtl_uString **)(&mpData),
+                        pByteStr, nLen,
+                        eTextEncoding, nCvtFlags );
+}
+
+// =======================================================================
+
+UniString::UniString( const rtl::OUString& rStr )
+    : mpData(NULL)
+{
+    DBG_CTOR( UniString, DbgCheckUniString );
+
+    OSL_ENSURE(rStr.pData->length < STRING_MAXLEN,
+               "Overflowing rtl::OUString -> UniString cut to zero length");
+
+
+    if (rStr.pData->length < STRING_MAXLEN)
+    {
+        mpData = reinterpret_cast< UniStringData * >(const_cast< rtl::OUString & >(rStr).pData);
+        STRING_ACQUIRE((STRING_TYPE *)mpData);
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+}
+
+// -----------------------------------------------------------------------
+
+UniString& UniString::Assign( const rtl::OUString& rStr )
+{
+    DBG_CHKTHIS( UniString, DbgCheckUniString );
+
+    OSL_ENSURE(rStr.pData->length < STRING_MAXLEN,
+               "Overflowing rtl::OUString -> UniString cut to zero length");
+
+
+    if (rStr.pData->length < STRING_MAXLEN)
+    {
+        STRING_RELEASE((STRING_TYPE *)mpData);
+        mpData = reinterpret_cast< UniStringData * >(const_cast< rtl::OUString & >(rStr).pData);
+        STRING_ACQUIRE((STRING_TYPE *)mpData);
+    }
+    else
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+
+    return *this;
+}
+
+UniString UniString::intern() const
+{

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list