[Libreoffice-commits] .: 2 commits - binfilter/bf_sc binfilter/bf_sfx2 binfilter/bf_svtools binfilter/bf_svx binfilter/bf_sw

Caolán McNamara caolan at kemper.freedesktop.org
Sat Nov 19 13:12:01 PST 2011


 binfilter/bf_sc/source/core/tool/sc_editutil.cxx              |    8 +---
 binfilter/bf_sfx2/source/doc/sfx2_docfac.cxx                  |    7 ++-
 binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx |    3 -
 binfilter/bf_svtools/source/numbers/svt_zforfind.cxx          |    3 +
 binfilter/bf_svtools/source/numbers/svt_zformat.cxx           |   18 +++++-----
 binfilter/bf_svtools/source/svdde/svt_ddesvr.cxx              |    4 +-
 binfilter/bf_svx/source/form/svx_fmpage.cxx                   |    4 --
 binfilter/bf_sw/source/core/fields/sw_ddefld.cxx              |    5 +-
 binfilter/bf_sw/source/core/fields/sw_reffld.cxx              |   12 ++----
 binfilter/bf_sw/source/core/tox/sw_tox.cxx                    |    4 +-
 binfilter/bf_sw/source/ui/fldui/sw_fldmgr.cxx                 |    6 ++-
 11 files changed, 37 insertions(+), 37 deletions(-)

New commits:
commit 76849d6d3d1ef1e725eda5cfca8ef34b34e742a4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Nov 19 11:28:57 2011 +0000

    remove ENABLE_BYTESTRING_STREAM_OPERATORS

diff --git a/binfilter/bf_svx/source/form/svx_fmpage.cxx b/binfilter/bf_svx/source/form/svx_fmpage.cxx
index 19a90a5..3900df9 100644
--- a/binfilter/bf_svx/source/form/svx_fmpage.cxx
+++ b/binfilter/bf_svx/source/form/svx_fmpage.cxx
@@ -30,8 +30,6 @@
 #pragma hdrstop
 #endif
 
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-
 #include "fmpage.hxx"
 
 #include "fmmodel.hxx"
@@ -84,7 +82,7 @@ namespace binfilter {
 /*N*/       {
 /*N*/           SdrDownCompat aVCCompat2( rIn, STREAM_READ );
 /*N*/           ByteString aByteStringName;
-/*N*/           rIn >> aByteStringName;
+/*N*/           rIn.ReadByteString(aByteStringName);
 /*N*/           aPageName = String(aByteStringName, gsl_getSystemTextEncoding());
 /*N*/       }
 /*N*/   }
commit 9b3d4aaf4fd25ee4866930b46d828f6aaec00d84
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 18 21:05:45 2011 +0000

    remove [Byte]String::EraseAllChars

diff --git a/binfilter/bf_sc/source/core/tool/sc_editutil.cxx b/binfilter/bf_sc/source/core/tool/sc_editutil.cxx
index 294467d..355ee79 100644
--- a/binfilter/bf_sc/source/core/tool/sc_editutil.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_editutil.cxx
@@ -49,9 +49,7 @@
 #include <bf_svx/flditem.hxx>
 #include <bf_svtools/inethist.hxx>
 #include <bf_svtools/syslocale.hxx>
-#ifndef _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTS
-#endif
+#include <comphelper/string.hxx>
 
 #include "editutil.hxx"
 #include "docpool.hxx"
@@ -70,8 +68,8 @@ const sal_Char ScEditUtil::pCalcDelimiters[] = "=();+-*/^&<>";
 
 /*N*/ String ScEditUtil::ModifyDelimiters( const String& rOld )
 /*N*/ {
-/*N*/   String aRet = rOld;
-/*N*/   aRet.EraseAllChars( '_' );  // underscore is used in function argument names
+/*N*/   // underscore is used in function argument names
+/*N*/   String aRet = comphelper::string::remove(rOld, '_');
 /*N*/   aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( pCalcDelimiters ) );
 /*N*/   return aRet;
 /*N*/ }
diff --git a/binfilter/bf_sfx2/source/doc/sfx2_docfac.cxx b/binfilter/bf_sfx2/source/doc/sfx2_docfac.cxx
index 769e55a..5f7d262 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_docfac.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_docfac.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/registry/MergeConflictException.hpp>
 #include <com/sun/star/registry/XSimpleRegistry.hpp>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
 
 #include <bf_so3/embobj.hxx>
 
@@ -264,10 +265,10 @@ DECL_PTRARRAY( SfxViewFactoryArr_Impl, SfxViewFactory*, 2, 2 )
 /*N*/   /*SfxApplication *pApp =*/ SFX_APP();
 /*N*/
 /*N*/   // "swriter4" durch "swriter" ersetzen, zum Vergleichen uppercase verwenden
-/*N*/   WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() );
-/*N*/     for( sal_uInt16 n = GetObjectFactoryCount_Impl(); !pFactory && n--; )
+/*N*/   WildCard aSearchedFac( comphelper::string::remove(aFact, '4').toAsciiUpperCase() );
+/*N*/   for( sal_uInt16 n = GetObjectFactoryCount_Impl(); !pFactory && n--; )
 /*N*/   {
-/*N*/         pFactory = &GetObjectFactory_Impl( n );
+/*N*/       pFactory = &GetObjectFactory_Impl( n );
 /*N*/       String aCompareTo = String::CreateFromAscii( pFactory->GetShortName() );
 /*N*/       aCompareTo.ToUpperAscii();
 /*N*/       if( !aSearchedFac.Matches( aCompareTo ) )
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
index 6571ed7..e7bff47 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
@@ -1263,8 +1263,7 @@ void SgfFontLst::ReadList()
 
         for (i=0;i<Anz;i++)
         {
-            FID = aCfg.GetKeyName( i );
-            FID = FID.EraseAllChars(); // Leerzeichen weg
+            FID = comphelper::string::remove(aCfg.GetKeyName(i), ' ');
             Dsc = aCfg.ReadKey( i );
             if ( comphelper::string::isdigitAsciiString(FID) )
             {
diff --git a/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx b/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
index 880886c..a31abd6 100644
--- a/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
+++ b/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
@@ -33,6 +33,7 @@
 #include <float.h>
 #include <errno.h>
 
+#include <comphelper/string.hxx>
 #include <tools/date.hxx>
 #include <tools/debug.hxx>
 #include <rtl/math.hxx>
@@ -2047,7 +2048,7 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor(
         if ( !bDontDetectNegation && (nString == 0) && !bFirst && (nSign < 0)
                 && pFormat->IsNegativeRealNegative() )
         {   // simply negated twice? --1
-            aString.EraseAllChars( ' ' );
+            aString = comphelper::string::remove(aString, ' ');
             if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') )
             {
                 bFound = TRUE;
diff --git a/binfilter/bf_svtools/source/numbers/svt_zformat.cxx b/binfilter/bf_svtools/source/numbers/svt_zformat.cxx
index 6704c84..58431a6 100644
--- a/binfilter/bf_svtools/source/numbers/svt_zformat.cxx
+++ b/binfilter/bf_svtools/source/numbers/svt_zformat.cxx
@@ -34,6 +34,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#include <comphelper/string.hxx>
 #include <tools/debug.hxx>
 #include <i18npool/mslangid.hxx>
 #include <rtl/math.hxx>
@@ -1037,7 +1038,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                     case '>':
                     case '=':
                     {
-                        sSymbol.EraseAllChars('[');
+                        sSymbol = comphelper::string::remove(sSymbol, '[');
                         sSymbol += cToken;
                         cLetter = cToken;
                         eState = SsGetCon;
@@ -1061,7 +1062,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                     {
                         if ( rString.GetChar(nPos) == '-' )
                         {   // [$-xxx] locale
-                            sSymbol.EraseAllChars('[');
+                            sSymbol = comphelper::string::remove(sSymbol, '[');
                             eSymbolType = BRACKET_SYMBOLTYPE_LOCALE;
                             eState = SsGetPrefix;
                         }
@@ -1091,7 +1092,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                         sal_Unicode cDBNum = rString.GetChar( nPos-1+aDBNum.Len() );
                         if ( aUpperNatNum == aNatNum && 0 <= nNatNumNum && nNatNumNum <= 19 )
                         {
-                            sSymbol.EraseAllChars('[');
+                            sSymbol = comphelper::string::remove(sSymbol, '[');
                             sSymbol += rString.Copy( --nPos, aNatNum.Len()+1 );
                             nPos += aNatNum.Len()+1;
                             //! SymbolType is negative
@@ -1100,7 +1101,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                         }
                         else if ( aUpperDBNum == aDBNum && '1' <= cDBNum && cDBNum <= '9' )
                         {
-                            sSymbol.EraseAllChars('[');
+                            sSymbol = comphelper::string::remove(sSymbol, '[');
                             sSymbol += rString.Copy( --nPos, aDBNum.Len()+1 );
                             nPos += aDBNum.Len()+1;
                             //! SymbolType is negative
@@ -1118,7 +1119,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                         }
                         else
                         {
-                            sSymbol.EraseAllChars('[');
+                            sSymbol = comphelper::string::remove(sSymbol, '[');
                             sSymbol += cToken;
                             eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
                             eState = SsGetPrefix;
@@ -1158,14 +1159,14 @@ short SvNumberformat::ImpNextSymbol(String& rString,
                         }
                         else
                         {
-                            sSymbol.EraseAllChars('[');
+                            sSymbol = comphelper::string::remove(sSymbol, '[');
                             sSymbol += cToken;
                             eState = SsGetPrefix;
                         }
                     }
                     else
                     {
-                        sSymbol.EraseAllChars('[');
+                        sSymbol = comphelper::string::remove(sSymbol, '[');
                         sSymbol += cToken;
                         eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
                         eState = SsGetPrefix;
@@ -2088,7 +2089,8 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
                     }
                     ExpStr = sStr.Copy( nExpStart );    // part following the "E+"
                     sStr.Erase( nExPos );
-                    sStr.EraseAllChars('.');        // cut any decimal delimiter
+                    // cut any decimal delimiter
+                    sStr = comphelper::string::remove(sStr, '.');
                     if ( rInfo.nCntPre != 1 )       // rescale Exp
                     {
                         sal_Int32 nExp = ExpStr.ToInt32() * nExpSign;
diff --git a/binfilter/bf_svtools/source/svdde/svt_ddesvr.cxx b/binfilter/bf_svtools/source/svdde/svt_ddesvr.cxx
index a714c96..8dfa2c4 100644
--- a/binfilter/bf_svtools/source/svdde/svt_ddesvr.cxx
+++ b/binfilter/bf_svtools/source/svdde/svt_ddesvr.cxx
@@ -33,6 +33,7 @@
 #include "ddeimp.hxx"
 #include <bf_svtools/svdde.hxx>
 #include <bf_svtools/svarray.hxx>
+#include <comphelper/string.hxx>
 
 #include <tools/debug.hxx>
 
@@ -137,7 +138,8 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
                     while( STRING_NOTFOUND != n )
                     {
                         String s( sTopics.GetToken( 0, '\t', n ));
-                        s.EraseAllChars( '\n' ).EraseAllChars( '\r' );
+                        s = comphelper::string::remove(s, '\n');
+                        s = comphelper::string::remove(s, '\r');
                         if( !hText1 || s == reinterpret_cast<const sal_Unicode*>(chTopicBuf) )
                         {
                             DdeString aDStr( pInst->hDdeInstSvr, s );
diff --git a/binfilter/bf_sw/source/core/fields/sw_ddefld.cxx b/binfilter/bf_sw/source/core/fields/sw_ddefld.cxx
index d693bf3..5fc5697 100644
--- a/binfilter/bf_sw/source/core/fields/sw_ddefld.cxx
+++ b/binfilter/bf_sw/source/core/fields/sw_ddefld.cxx
@@ -32,9 +32,9 @@
 #endif
 
 #include <bf_svx/linkmgr.hxx>
+#include <comphelper/string.hxx>
 
 #include <horiornt.hxx>
-
 #include <doc.hxx>
 #include <osl/diagnose.h>
 #include <ddefld.hxx>
@@ -217,9 +217,8 @@ BOOL SwDDEFieldType::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMId
 /*N*/ String SwDDEField::Expand() const
 /*N*/ {
 /*N*/   xub_StrLen nPos;
-/*N*/   String aStr( ((SwDDEFieldType*)GetTyp())->GetExpansion() );
+/*N*/   String aStr(comphelper::string::remove(((SwDDEFieldType*)GetTyp())->GetExpansion(), '\r'));
 /*N*/
-/*N*/   aStr.EraseAllChars( '\r' );
 /*N*/   while( (nPos = aStr.Search( '\t' )) != STRING_NOTFOUND )
 /*?*/       aStr.SetChar( nPos, ' ' );
 /*N*/   while( (nPos = aStr.Search( '\n' )) != STRING_NOTFOUND )
diff --git a/binfilter/bf_sw/source/core/fields/sw_reffld.cxx b/binfilter/bf_sw/source/core/fields/sw_reffld.cxx
index 287365f..e8a398a 100644
--- a/binfilter/bf_sw/source/core/fields/sw_reffld.cxx
+++ b/binfilter/bf_sw/source/core/fields/sw_reffld.cxx
@@ -31,11 +31,9 @@
 #pragma hdrstop
 #endif
 
-#define _SVSTDARR_USHORTSSORT
-#define _SVSTDARR_USHORTS
-
 #include <com/sun/star/text/ReferenceFieldPart.hpp>
 #include <com/sun/star/text/ReferenceFieldSource.hpp>
+#include <comphelper/string.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <bf_svx/unolingu.hxx>
 
@@ -347,16 +345,16 @@ void SwGetRefField::SetSubType( USHORT n )
 /*N*/
 /*N*/               // alle Sonderzeichen entfernen (durch Blanks ersetzen):
 /*N*/               if( sTxt.Len() )
-/*N*/                 {
-/*N*/                     sTxt.EraseAllChars( 0xad );
-/*N*/                     for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
+/*N*/               {
+/*N*/                   sTxt = comphelper::string::remove(sTxt, 0xad);
+/*N*/                   for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
 /*N*/                   {
 /*N*/                       if( *p < 0x20 )
 /*N*/                           *p = 0x20;
 /*N*/                         else if(*p == 0x2011)
 /*N*/                           *p = '-';
 /*N*/                   }
-/*N*/                 }
+/*N*/               }
 /*N*/           }
 /*N*/       }
 /*N*/       break;
diff --git a/binfilter/bf_sw/source/core/tox/sw_tox.cxx b/binfilter/bf_sw/source/core/tox/sw_tox.cxx
index 49aa544..786c2ab 100644
--- a/binfilter/bf_sw/source/core/tox/sw_tox.cxx
+++ b/binfilter/bf_sw/source/core/tox/sw_tox.cxx
@@ -31,6 +31,7 @@
 #pragma hdrstop
 #endif
 
+#include <comphelper/string.hxx>
 #include <tools/resid.hxx>
 #include <txtatr.hxx>
 #include <ndtxt.hxx>
@@ -971,8 +972,7 @@ void SwForm::SetFirstTabPos( USHORT n )     //{ nFirstTabPos = n; }
 /*?*/       if( sText.Len() )
 /*?*/       {
 /*?*/           sRet += TOX_STYLE_DELIMITER;
-/*?*/           String sTmp( sText );
-/*?*/           sTmp.EraseAllChars( TOX_STYLE_DELIMITER );
+/*?*/           String sTmp( comphelper::string::remove(sText, TOX_STYLE_DELIMITER) );
 /*?*/           sRet += sTmp;
 /*?*/           sRet += TOX_STYLE_DELIMITER;
 /*?*/       }
diff --git a/binfilter/bf_sw/source/ui/fldui/sw_fldmgr.cxx b/binfilter/bf_sw/source/ui/fldui/sw_fldmgr.cxx
index 33bc29e..4b6bbcf 100644
--- a/binfilter/bf_sw/source/ui/fldui/sw_fldmgr.cxx
+++ b/binfilter/bf_sw/source/ui/fldui/sw_fldmgr.cxx
@@ -31,6 +31,8 @@
 #pragma hdrstop
 #endif
 
+#include <comphelper/string.hxx>
+
 #include <cmdid.h>
 #include <hintids.hxx>
 
@@ -259,8 +261,8 @@ String* SwFldMgr::pTime = 0;
 /*N*/   SwFieldType::pFldNames = new SvStringsDtor( (BYTE)coFldCnt, 2 );
 /*N*/   for( USHORT nIdx = 0; nIdx < coFldCnt; ++nIdx )
 /*N*/   {
-/*N*/       String* pTmp = new SW_RESSTR( coFldNms[ nIdx ] );
-/*N*/       pTmp->EraseAllChars('~');
+/*N*/       rtl::OUString sTmp(SW_RESSTR(coFldNms[nIdx]));
+/*N*/       String* pTmp = new String(comphelper::string::remove(sTmp, '~'));
 /*N*/       SwFieldType::pFldNames->Insert(pTmp, nIdx );
 /*N*/   }
 /*N*/ }


More information about the Libreoffice-commits mailing list