[Libreoffice-commits] .: 7 commits - svl/inc svl/source tools/bootstrp tools/inc vcl/inc vcl/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Wed Jun 22 01:27:02 PDT 2011


 svl/inc/svl/inettype.hxx            |   36 ----------
 svl/inc/svl/svstdarr.hxx            |   20 ------
 svl/source/memtools/svarray.cxx     |   97 -----------------------------
 svl/source/misc/inettype.cxx        |  112 ---------------------------------
 tools/bootstrp/prj.cxx              |   16 ++--
 tools/bootstrp/rscdep.cxx           |    6 -
 tools/inc/bootstrp/prj.hxx          |    5 -
 vcl/inc/unx/saldisp.hxx             |    2 
 vcl/inc/vcl/strhelper.hxx           |    6 -
 vcl/inc/vcl/syswin.hxx              |    4 -
 vcl/source/window/syswin.cxx        |  120 ++++++++++++++++++------------------
 vcl/unx/generic/app/keysymnames.cxx |    6 -
 12 files changed, 84 insertions(+), 346 deletions(-)

New commits:
commit 08b0a50f583116793ae921d450bc1da471472571
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 22 00:49:30 2011 +0100

    ByteString->osl::OString[Buffer]

diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 726cc9d..53a5c54 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -231,8 +231,8 @@ public:
     const Size&     GetMaxOutputSizePixel() const;
     Size            GetResizeOutputSizePixel() const;
 
-    void            SetWindowState( const ByteString& rStr );
-    ByteString      GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const;
+    void            SetWindowState(const rtl::OString& rStr);
+    rtl::OString    GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const;
 
     void            SetMenuBar( MenuBar* pMenuBar );
     MenuBar*        GetMenuBar() const { return mpMenuBar; }
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index fc5f32d..237de56 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -39,6 +39,8 @@
 #include <vcl/taskpanelist.hxx>
 #include <vcl/unowrap.hxx>
 
+#include <rtl/strbuf.hxx>
+
 #include <salframe.hxx>
 #include <svdata.hxx>
 #include <brdwin.hxx>
@@ -498,16 +500,17 @@ Size SystemWindow::GetResizeOutputSizePixel() const
 
 // -----------------------------------------------------------------------
 
-static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr )
+static void ImplWindowStateFromStr(WindowStateData& rData,
+    const rtl::OString& rStr)
 {
     sal_uLong       nValidMask  = 0;
-    xub_StrLen  nIndex      = 0;
-    ByteString  aTokenStr;
+    sal_Int32 nIndex      = 0;
+    rtl::OString aTokenStr;
 
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetX( aTokenStr.ToInt32() );
+        rData.SetX(aTokenStr.toInt32());
         if( rData.GetX() > -16384 && rData.GetX() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_X;
         else
@@ -515,10 +518,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetX( 0 );
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetY( aTokenStr.ToInt32() );
+        rData.SetY(aTokenStr.toInt32());
         if( rData.GetY() > -16384 && rData.GetY() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_Y;
         else
@@ -526,10 +529,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetY( 0 );
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetWidth( aTokenStr.ToInt32() );
+        rData.SetWidth(aTokenStr.toInt32());
         if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_WIDTH;
         else
@@ -537,10 +540,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetWidth( 0 );
-    aTokenStr = rStr.GetToken( 0, ';', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ';', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetHeight( aTokenStr.ToInt32() );
+        rData.SetHeight(aTokenStr.toInt32());
         if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_HEIGHT;
         else
@@ -548,12 +551,12 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetHeight( 0 );
-    aTokenStr = rStr.GetToken( 0, ';', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ';', nIndex);
+    if (!aTokenStr.isEmpty())
     {
         // #94144# allow Minimize again, should be masked out when read from configuration
         // 91625 - ignore Minimize
-        sal_uLong nState = (sal_uLong)aTokenStr.ToInt32();
+        sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32();
         //nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
         rData.SetState( nState );
         nValidMask |= WINDOWSTATE_MASK_STATE;
@@ -562,10 +565,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
         rData.SetState( 0 );
     
     // read maximized pos/size
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetMaximizedX( aTokenStr.ToInt32() );
+        rData.SetMaximizedX(aTokenStr.toInt32());
         if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
         else
@@ -573,10 +576,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetMaximizedX( 0 );
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetMaximizedY( aTokenStr.ToInt32() );
+        rData.SetMaximizedY(aTokenStr.toInt32());
         if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
         else
@@ -584,10 +587,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetMaximizedY( 0 );
-    aTokenStr = rStr.GetToken( 0, ',', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ',', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetMaximizedWidth( aTokenStr.ToInt32() );
+        rData.SetMaximizedWidth(aTokenStr.toInt32());
         if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
         else
@@ -595,10 +598,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
     }
     else
         rData.SetMaximizedWidth( 0 );
-    aTokenStr = rStr.GetToken( 0, ';', nIndex );
-    if ( aTokenStr.Len() )
+    aTokenStr = rStr.getToken(0, ';', nIndex);
+    if (!aTokenStr.isEmpty())
     {
-        rData.SetMaximizedHeight( aTokenStr.ToInt32() );
+        rData.SetMaximizedHeight(aTokenStr.toInt32());
         if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
             nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
         else
@@ -613,45 +616,48 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
 
 // -----------------------------------------------------------------------
 
-static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr )
+static rtl::OString ImplWindowStateToStr(const WindowStateData& rData)
 {
     sal_uLong nValidMask = rData.GetMask();
     if ( !nValidMask )
-        return;
+        return rtl::OString();
+
+    rtl::OStringBuffer rStrBuf;
 
     if ( nValidMask & WINDOWSTATE_MASK_X )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetX() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(rData.GetX());
+    rStrBuf.append(',');
     if ( nValidMask & WINDOWSTATE_MASK_Y )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetY() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(rData.GetY());
+    rStrBuf.append(',');
     if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetWidth() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(static_cast<sal_Int32>(rData.GetWidth()));
+    rStrBuf.append(',');
     if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetHeight() ) );
-    rStr.Append( ';' );
+        rStrBuf.append(static_cast<sal_Int32>(rData.GetHeight()));
+    rStrBuf.append( ';' );
     if ( nValidMask & WINDOWSTATE_MASK_STATE )
     {
         // #94144# allow Minimize again, should be masked out when read from configuration
         // 91625 - ignore Minimize
-        sal_uLong nState = rData.GetState();
-        //nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
-        rStr.Append( ByteString::CreateFromInt32( (long)nState ) );
+        sal_uInt32 nState = rData.GetState();
+        rStrBuf.append(static_cast<sal_Int32>(nState));
     }
-    rStr.Append( ';' );
+    rStrBuf.append(';');
     if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedX() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(rData.GetMaximizedX());
+    rStrBuf.append(',');
     if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedY() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(rData.GetMaximizedY());
+    rStrBuf.append( ',' );
     if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedWidth() ) );
-    rStr.Append( ',' );
+        rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedWidth()));
+    rStrBuf.append(',');
     if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
-        rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedHeight() ) );
-    rStr.Append( ';' );
+        rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedHeight()));
+    rStrBuf.append(';');
+
+    return rStrBuf.makeStringAndClear();
 }
 
 // -----------------------------------------------------------------------
@@ -955,9 +961,9 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
 
 // -----------------------------------------------------------------------
 
-void SystemWindow::SetWindowState( const ByteString& rStr )
+void SystemWindow::SetWindowState(const rtl::OString& rStr)
 {
-    if ( !rStr.Len() )
+    if (rStr.isEmpty())
         return;
 
     WindowStateData aData;
@@ -967,15 +973,13 @@ void SystemWindow::SetWindowState( const ByteString& rStr )
 
 // -----------------------------------------------------------------------
 
-ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const
+rtl::OString SystemWindow::GetWindowState( sal_uLong nMask ) const
 {
     WindowStateData aData;
     aData.SetMask( nMask );
     GetWindowStateData( aData );
 
-    ByteString aStr;
-    ImplWindowStateToStr( aData, aStr );
-    return aStr;
+    return ImplWindowStateToStr(aData);
 }
 
 // -----------------------------------------------------------------------
commit 5715ca9dab0991c3770736b5dfa2ccedf713f48c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 22 00:00:52 2011 +0100

    ditch old string

diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 4f8c671..d6b64d2 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -372,7 +372,7 @@ protected:
     KeySym			nShiftKeySym_;		// first shift modifier
     KeySym			nCtrlKeySym_;		// first control modifier
     KeySym			nMod1KeySym_;		// first mod1 modifier
-    ByteString		m_aKeyboardName;
+    rtl::OString m_aKeyboardName;
 
     vcl_sal::WMAdaptor*	m_pWMAdaptor;
     DtIntegrator*       m_pDtIntegrator;
diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx
index 9e066ac..2176d0f 100644
--- a/vcl/unx/generic/app/keysymnames.cxx
+++ b/vcl/unx/generic/app/keysymnames.cxx
@@ -583,7 +583,7 @@ static const keyboard_layout type6_layout[] =
 
 const char* SalDisplay::GetKeyboardName( bool bRefresh )
 {
-    if( bRefresh || ! m_aKeyboardName.Len() )
+    if (bRefresh || m_aKeyboardName.isEmpty())
     {
 #if defined(SOLARIS)
         if( IsLocal() )
@@ -665,10 +665,10 @@ const char* SalDisplay::GetKeyboardName( bool bRefresh )
             }
         }
 #endif
-        if( ! m_aKeyboardName.Len() )
+        if (m_aKeyboardName.isEmpty())
             m_aKeyboardName = "<unknown keyboard>";
     }
-    return m_aKeyboardName.GetBuffer();
+    return m_aKeyboardName.getStr();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit aaa9875eb99acac15b6f1f644e2930884d73af50
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 21 23:53:45 2011 +0100

    simplify this now

diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index 9741bc2..69c33f7 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -63,7 +63,7 @@ inline double VCL_DLLPUBLIC StringToDouble( const String& rStr )
 
 inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr )
 {
-    return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0));
+    return rtl::math::stringToDouble(rStr, '.', static_cast<sal_Char>(0));
 }
 
 // fills a character buffer with the string representation of a double
commit 989e614daddad915bd42eaf9a78eefada7b69f29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 21 23:40:29 2011 +0100

    junk unused archaic pre-stl containers

diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index 2baa899..0d15e5a 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -93,31 +93,11 @@ SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
 #define _SVSTDARR_BYTESTRINGS_DECL
 #endif
 
-#ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL
-SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTESTRINGSDTOR_DECL
-#endif
-
-#ifndef _SVSTDARR_BYTESTRINGSSORT_DECL
-SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTESTRINGSSORT_DECL
-#endif
-
 #ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
 #define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
 #endif
 
-#ifndef _SVSTDARR_BYTESTRINGSISORT_DECL
-SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTESTRINGSISORT_DECL
-#endif
-
-#ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL
-SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL
-#endif
-
 typedef std::deque< xub_StrLen > SvXub_StrLens;
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index df66a87..9995498 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -71,12 +71,8 @@ SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr )
 SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr )
 
 SV_IMPL_PTRARR( SvByteStrings, ByteStringPtr )
-SV_IMPL_PTRARR( SvByteStringsDtor, ByteStringPtr )
-SV_IMPL_OP_PTRARR_SORT( SvByteStringsSort, ByteStringPtr )
 SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr )
 
-
-
 // ---------------- strings -------------------------------------
 
 // Array mit anderer Seek-Methode!
@@ -171,97 +167,4 @@ sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) co
     return sal_False;
 }
 
-// ---------------- bytestrings -------------------------------------
-
-// Array mit anderer Seek-Methode!
-_SV_IMPL_SORTAR_ALG( SvByteStringsISort, ByteStringPtr )
-void SvByteStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
-{
-    if( nL )
-    {
-        DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
-        for( sal_uInt16 n=nP; n < nP + nL; n++ )
-            delete *((ByteStringPtr*)pData+n);
-        SvPtrarr::Remove( nP, nL );
-    }
-}
-sal_Bool SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
-{
-    register sal_uInt16 nO  = SvByteStringsISort_SAR::Count(),
-            nM,
-            nU = 0;
-    if( nO > 0 )
-    {
-        nO--;
-        while( nU <= nO )
-        {
-            nM = nU + ( nO - nU ) / 2;
-            StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
-                        CompareIgnoreCaseToAscii( *(aE) );
-            if( COMPARE_EQUAL == eCmp )
-            {
-                if( pP ) *pP = nM;
-                return sal_True;
-            }
-            else if( COMPARE_LESS == eCmp )
-                nU = nM + 1;
-            else if( nM == 0 )
-            {
-                if( pP ) *pP = nU;
-                return sal_False;
-            }
-            else
-                nO = nM - 1;
-        }
-    }
-    if( pP ) *pP = nU;
-    return sal_False;
-}
-
-
-// Array mit anderer Seek-Methode!
-_SV_IMPL_SORTAR_ALG( SvByteStringsISortDtor, ByteStringPtr )
-void SvByteStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
-{
-    if( nL )
-    {
-        DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
-        for( sal_uInt16 n=nP; n < nP + nL; n++ )
-            delete *((ByteStringPtr*)pData+n);
-        SvPtrarr::Remove( nP, nL );
-    }
-}
-sal_Bool SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
-{
-    register sal_uInt16 nO  = SvByteStringsISortDtor_SAR::Count(),
-            nM,
-            nU = 0;
-    if( nO > 0 )
-    {
-        nO--;
-        while( nU <= nO )
-        {
-            nM = nU + ( nO - nU ) / 2;
-            StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
-                                    CompareIgnoreCaseToAscii( *(aE) );
-            if( COMPARE_EQUAL == eCmp )
-            {
-                if( pP ) *pP = nM;
-                return sal_True;
-            }
-            else if( COMPARE_LESS == eCmp )
-                nU = nM + 1;
-            else if( nM == 0 )
-            {
-                if( pP ) *pP = nU;
-                return sal_False;
-            }
-            else
-                nO = nM - 1;
-        }
-    }
-    if( pP ) *pP = nU;
-    return sal_False;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d492baf6bfab190fcc338deec15c0bf2eb73d38d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 21 23:26:13 2011 +0100

    remove unused appendUSASCIIParameter methods

diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index 467af3a..5a3f833 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -443,42 +443,6 @@ public:
     static bool parse(UniString const & rMediaType, UniString & rType,
                       UniString & rSubType,
                       INetContentTypeParameterList * pParameters = 0);
-
-    /** Append a parameter to the string representation of a MIME media type.
-
-        @param rMediaType  The string representation of a MIME media type.
-
-        @param rAttribute  The name of the parameter.  Must be a valid RFC
-        2045 token.
-
-        @param rValue  The value of the paramter.  Must only consist of US-
-        ASCII characters.
-
-        @return  The string representation of rMediaType with the new
-        parameter appended.  It is not checked whether a parameter with that
-        name already existed in rMediaType.
-     */
-    static ByteString appendUSASCIIParameter(ByteString const & rMediaType,
-                                             ByteString const & rAttribute,
-                                             ByteString const & rValue);
-
-    /** Append a parameter to the string representation of a MIME media type.
-
-        @param rMediaType  The string representation of a MIME media type.
-
-        @param rAttribute  The name of the parameter.  Must be a valid RFC
-        2045 token.
-
-        @param rValue  The value of the paramter.  Must only consist of US-
-        ASCII characters.
-
-        @return  The string representation of rMediaType with the new
-        parameter appended.  It is not checked whether a parameter with that
-        name already existed in rMediaType.
-     */
-    static UniString appendUSASCIIParameter(UniString const & rMediaType,
-                                            UniString const & rAttribute,
-                                            UniString const & rValue);
 };
 
 #endif // _INETTYPE_HXX
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 66c9361..32ff4f3 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -1237,116 +1237,4 @@ bool INetContentTypes::parse(UniString const & rMediaType,
     return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
 }
 
-//============================================================================
-// static
-ByteString INetContentTypes::appendUSASCIIParameter(ByteString const &
-                                                        rMediaType,
-                                                    ByteString const &
-                                                        rAttribute,
-                                                    ByteString const & rValue)
-{
-    ByteString aResult = rMediaType;
-    aResult.Append(RTL_CONSTASCII_STRINGPARAM("; "));
-    aResult += rAttribute;
-    aResult += '=';
-    bool bQuote = false;
-    for (xub_StrLen i = 0; i < rValue.Len(); ++i)
-    {
-        // When the value contains any ' characters, use a quoted string
-        // instead of a token, in order to avoid confusion with RFC 2231
-        // extensions:
-        sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
-        DBG_ASSERT(INetMIME::isUSASCII(nChar),
-                   "INetContentTypes::appendUSASCIIParameter(): Bad value");
-        if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
-        {
-            bQuote = true;
-            break;
-        }
-    }
-    if (bQuote)
-    {
-        aResult += '"';
-        for (xub_StrLen i = 0; i < rValue.Len(); ++i)
-        {
-            // Escape LF as well as CR to avoid confusion with line folding:
-            sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
-            DBG_ASSERT(INetMIME::isUSASCII(nChar),
-                       "INetContentTypes::appendUSASCIIParameter():"
-                           " Bad value");
-            switch (nChar)
-            {
-                case 0x0A: // LF
-                case 0x0D: // CR
-                case '"':
-                case '\\':
-                    aResult += '\\';
-                default:
-                    aResult += static_cast< char >(nChar);
-                    break;
-            }
-        }
-        aResult += '"';
-    }
-    else
-        aResult += rValue;
-    return aResult;
-}
-
-//============================================================================
-// static
-UniString INetContentTypes::appendUSASCIIParameter(UniString const &
-                                                       rMediaType,
-                                                   UniString const &
-                                                       rAttribute,
-                                                   UniString const & rValue)
-{
-    UniString aResult = rMediaType;
-    aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM("; "));
-    aResult += rAttribute;
-    aResult += '=';
-    bool bQuote = false;
-    for (xub_StrLen i = 0; i < rValue.Len(); ++i)
-    {
-        // When the value contains any ' characters, use a quoted string
-        // instead of a token, in order to avoid confusion with RFC 2231
-        // extensions:
-        sal_uInt32 nChar = rValue.GetChar(i);
-        DBG_ASSERT(INetMIME::isUSASCII(nChar),
-                   "INetContentTypes::appendUSASCIIParameter(): Bad value");
-        if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
-        {
-            bQuote = true;
-            break;
-        }
-    }
-    if (bQuote)
-    {
-        aResult += '"';
-        for (xub_StrLen i = 0; i < rValue.Len(); ++i)
-        {
-            // Escape LF as well as CR to avoid confusion with line folding:
-            sal_uInt32 nChar = rValue.GetChar(i);
-            DBG_ASSERT(INetMIME::isUSASCII(nChar),
-                       "INetContentTypes::appendUSASCIIParameter():"
-                           " Bad value");
-            switch (nChar)
-            {
-                case 0x0A: // LF
-                case 0x0D: // CR
-                case '"':
-                case '\\':
-                    aResult += '\\';
-                default:
-                    aResult += sal_Unicode(nChar);
-                    break;
-            }
-        }
-        aResult += '"';
-    }
-    else
-        aResult += rValue;
-    return aResult;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 39fa7f9cbc8f963f7cea52f250c068c07f0309b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 21 23:19:02 2011 +0100

    take advantage of default arguments

diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index bb6ff0a..9741bc2 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -58,14 +58,12 @@ ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect
 // parses the first double in the string; decimal is '.' only
 inline double VCL_DLLPUBLIC StringToDouble( const String& rStr )
 {
-    rtl_math_ConversionStatus eStatus;
-    return rtl::math::stringToDouble( rStr, sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL);
+    return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
 }
 
 inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr )
 {
-    rtl_math_ConversionStatus eStatus;
-    return rtl::math::stringToDouble( rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL);
+    return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0));
 }
 
 // fills a character buffer with the string representation of a double
commit 0aec6b719d3de604c50cf90e99edc7c19e514e54
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 21 23:04:05 2011 +0100

    ditch some old-style strings

diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index 41fed2f..b44592c 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -53,26 +53,26 @@ SimpleConfig::~SimpleConfig()
     aFileStream.Close ();
 }
 
-ByteString SimpleConfig::GetNext()
+rtl::OString SimpleConfig::getNext()
 {
-    if ( aStringBuffer =="" )
+    if (aStringBuffer == "")
       while ((aStringBuffer = GetNextLine()) == "\t") ; //solange bis != "\t"
-    if ( aStringBuffer =="" )
-        return ByteString();
+    if ( aStringBuffer == "" )
+        return rtl::OString();
 
-    ByteString aString = aStringBuffer.GetToken(0,'\t');
-    aStringBuffer.Erase(0, aString.Len()+1);
+    rtl::OString aString = aStringBuffer.GetToken(0,'\t');
+    aStringBuffer.Erase(0, aString.getLength()+1);
 
     aStringBuffer.EraseLeadingChars( '\t' );
 
     return aString;
 }
 
-ByteString	SimpleConfig::GetNextLine()
+rtl::OString SimpleConfig::GetNextLine()
 {
     aFileStream.ReadLine ( aTmpStr );
     if ( aTmpStr.Search( "#" ) == 0 )
-        return "\t";
+        return rtl::OString('\t');
     aTmpStr = aTmpStr.EraseLeadingChars();
     aTmpStr = aTmpStr.EraseTrailingChars();
     while ( aTmpStr.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND ) ;
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index 2dbc06f..6be9534 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -125,13 +125,13 @@ int main( int argc, char** argv )
         }
         if (aBuf[0] == '@' )
         {
-            ByteString aToken;
+            rtl::OString aToken;
             String aRespName( &aBuf[1], gsl_getSystemTextEncoding());
             SimpleConfig aConfig( aRespName );
-            while ( (aToken = aConfig.GetNext()) != "")
+            while ((aToken = aConfig.getNext()).getLength())
             {
                 char aBuf2[255];
-                (void) strcpy( aBuf2, aToken.GetBuffer());
+                strcpy( aBuf2, aToken.getStr());
                 if ( aBuf[0] == '-' && aBuf[1] == 'p' && aBuf[2] == '=' )
                 {
                     strcpy(pFileNamePrefix, &aBuf[3]);
diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx
index 2263e35..f4e19d4 100644
--- a/tools/inc/bootstrp/prj.hxx
+++ b/tools/inc/bootstrp/prj.hxx
@@ -31,6 +31,7 @@
 
 #include <tools/fsys.hxx>
 #include <tools/stream.hxx>
+#include <rtl/string.hxx>
 
 /*********************************************************************
 *
@@ -45,11 +46,11 @@ class SimpleConfig
     ByteString aTmpStr;
     ByteString aStringBuffer;
 
-    ByteString GetNextLine();
+    rtl::OString GetNextLine();
 public:
     SimpleConfig(const String& rSimpleConfigFileName);
     ~SimpleConfig();
-    ByteString GetNext();
+    rtl::OString getNext();
 };
 
 #endif


More information about the Libreoffice-commits mailing list