[Libreoffice-commits] .: 2 commits - binfilter/bf_sch binfilter/bf_sd binfilter/bf_starmath binfilter/bf_svtools binfilter/bf_sw binfilter/inc

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jan 23 03:37:47 PST 2012


 binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx        |    2 
 binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx        |    2 
 binfilter/bf_starmath/source/starmath_document.cxx          |    2 
 binfilter/bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx |   36 +++++-------
 binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx             |    2 
 binfilter/inc/bf_svtools/xbmread.hxx                        |    2 
 6 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 5cd8d9c84af6f1562252b62357c0413abd79dbb2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 14:35:24 2012 +0000

    mirror ReadLine changes to binfilter

diff --git a/binfilter/bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx b/binfilter/bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx
index 04ee230..1f8846f 100644
--- a/binfilter/bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/ixbm/svt_xbmread.cxx
@@ -103,13 +103,11 @@ void XBMReader::InitTable()
 
 // ------------------------------------------------------------------------
 
-ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
+rtl::OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                                  const char* pTok2, const char* pTok3 )
 {
-    ByteString  aRet;
-    long        nPos1;
-    long        nPos2;
-    long        nPos3;
+    rtl::OString aRet;
+    sal_Int32 nPos1, nPos2, nPos3;
 
     bStatus = FALSE;
 
@@ -120,7 +118,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
 
         if( pTok1 )
         {
-            if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
+            if( ( nPos1 = aRet.indexOf(pTok1) ) != -1 )
             {
                 bStatus = TRUE;
 
@@ -128,7 +126,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                 {
                     bStatus = FALSE;
 
-                    if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
+                    if( ( ( nPos2 = aRet.indexOf(pTok2) ) != -1 ) &&
                          ( nPos2 > nPos1 ) )
                     {
                         bStatus = TRUE;
@@ -137,7 +135,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                         {
                             bStatus = FALSE;
 
-                            if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
+                            if( ( ( nPos3 = aRet.indexOf(pTok3) ) != -1 ) && ( nPos3 > nPos2 ) )
                                 bStatus = TRUE;
                         }
                     }
@@ -203,7 +201,7 @@ long XBMReader::ParseDefine( const sal_Char* pDefine )
 
 BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
 {
-    ByteString      aLine;
+    rtl::OString    aLine;
     long            nRow = 0;
     long            nCol = 0;
     long            nBits = ( eFormat == XBM10 ) ? 16 : 8;
@@ -216,32 +214,32 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
     {
         if( bFirstLine )
         {
-            xub_StrLen nPos;
+            sal_Int32 nPos;
 
             // einfuehrende geschweifte Klammer loeschen
-            if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
-                aLine.Erase( 0, nPos + 1 );
+            if( (nPos = ( aLine = aLastLine ).indexOf('{') ) != -1 )
+                aLine = aLine.copy(nPos + 1);
 
             bFirstLine = FALSE;
         }
         else if( !pInStm->ReadLine( aLine ) )
             break;
 
-        if( aLine.Len() )
+        if( !aLine.isEmpty() )
         {
-            const USHORT nCount = aLine.GetTokenCount( ',' );
+            const sal_Int32 nCount = comphelper::string::getTokenCount(aLine, ',');
 
-            for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
+            for( sal_Int32 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
             {
-                const ByteString    aToken(comphelper::string::getToken(aLine, i, ',') );
-                const xub_StrLen nLen = aToken.Len();
+                const rtl::OString aToken(comphelper::string::getToken(aLine,i, ','));
+                const sal_Int32 nLen = aToken.getLength();
                 BOOL                bProcessed = FALSE;
 
                 nBit = nDigits = nValue = 0;
 
-                for( xub_StrLen n = 0UL; n < nLen; n++ )
+                for (sal_Int32 n = 0; n < nLen; ++n)
                 {
-                    const unsigned char cChar = aToken.GetChar( n );
+                    const unsigned char cChar = aToken[n];
                     const short         nTable = pHexTable[ cChar ];
 
                     if( isxdigit( cChar ) || !nTable )
diff --git a/binfilter/inc/bf_svtools/xbmread.hxx b/binfilter/inc/bf_svtools/xbmread.hxx
index 5a10826..6b281fa 100644
--- a/binfilter/inc/bf_svtools/xbmread.hxx
+++ b/binfilter/inc/bf_svtools/xbmread.hxx
@@ -74,7 +74,7 @@ class XBMReader : public GraphicReader
     BOOL                bStatus;
 
     void                InitTable();
-    ByteString          FindTokenLine( SvStream* pInStm, const char* pTok1,
+    rtl::OString        FindTokenLine( SvStream* pInStm, const char* pTok1,
                                        const char* pTok2 = NULL, const char* pTok3 = NULL );
     long                ParseDefine( const sal_Char* pDefine );
     BOOL                ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
commit e2acb9648ccf425a80d1b0e9a430aca03c1cbf65
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 07:29:50 2012 +0000

    adapt to sot ByteString->rtl::OString

diff --git a/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx b/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx
index 53efdf1..99d84de 100644
--- a/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx
+++ b/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx
@@ -505,7 +505,7 @@ using namespace ::com::sun::star;
 /*N*/                           // garbled with password?
 /*N*/                           if( ! bRet )
 /*N*/                           {
-/*?*/                               if( pStor->GetKey().Len() == 0 )
+/*?*/                               if( pStor->GetKey().isEmpty() )
 /*?*/                               {
 /*?*/                                   // no password set => cannot load
 /*?*/                                   SetError( ERRCODE_SFX_DOLOADFAILED );
diff --git a/binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx b/binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx
index cdad017..6b095ba 100644
--- a/binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx
+++ b/binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx
@@ -406,7 +406,7 @@ sal_Bool SdBINFilter::Import()
 
                     if( !( bRet = ( xDocStm->GetError() == 0 ) ) )
                     {
-                        if( pStore->GetKey().Len() == 0 )
+                        if( pStore->GetKey().isEmpty() )
                             mrDocShell.SetError( ERRCODE_SFX_DOLOADFAILED );  // no password? --> file defect
                         else
                             mrDocShell.SetError( ERRCODE_SFX_WRONGPASSWORD ); // wrong password
diff --git a/binfilter/bf_starmath/source/starmath_document.cxx b/binfilter/bf_starmath/source/starmath_document.cxx
index f603295..50de02a 100644
--- a/binfilter/bf_starmath/source/starmath_document.cxx
+++ b/binfilter/bf_starmath/source/starmath_document.cxx
@@ -603,7 +603,7 @@ BOOL SmDocShell::Load(SvStorage *pStor)
 /*N*/   if (!bRet)
 /*N*/   {
 /*N*/       // kein Passwort gesetzt --> Datei marode
-/*?*/       if (pStor->GetKey().Len() == 0)
+/*?*/       if (pStor->GetKey().isEmpty())
 /*?*/       {
 /*?*/           SetError(ERRCODE_SFX_DOLOADFAILED);
 /*?*/       }
diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx
index b7be46a..1ef2245 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx
@@ -1655,7 +1655,7 @@ void Sw3StringPool::LoadOld( SvStream& r )
 /*N*/ void Sw3IoImp::SetPasswd()
 /*N*/ {
 /*N*/   delete pCrypter; pCrypter = NULL;
-/*N*/   if( pRoot && pRoot->GetKey().Len() )
+/*N*/   if( pRoot && !pRoot->GetKey().isEmpty() )
 /*N*/   {
 /*?*/       pCrypter = new Crypter( pRoot->GetKey() );
 /*?*/       sal_Char buf[ 17 ];


More information about the Libreoffice-commits mailing list