[Libreoffice-commits] .: 8 commits - l10ntools/source tools/bootstrp tools/inc tools/source tools/workben vcl/inc vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jun 14 07:20:57 PDT 2011
l10ntools/source/export2.cxx | 2
l10ntools/source/helpmerge.cxx | 2
tools/bootstrp/prj.cxx | 83 +---------------------------------------
tools/inc/bootstrp/prj.hxx | 18 +++-----
tools/inc/tools/isofallback.hxx | 4 -
tools/inc/tools/stream.hxx | 3 -
tools/source/rc/isofallback.cxx | 25 ++++++------
tools/source/stream/stream.cxx | 41 +++----------------
tools/workben/mempooltest.cxx | 3 +
vcl/inc/unx/sm.hxx | 7 +--
vcl/unx/generic/app/sm.cxx | 50 +++++++++++++-----------
vcl/unx/gtk/window/gtkframe.cxx | 8 +--
12 files changed, 76 insertions(+), 170 deletions(-)
New commits:
commit 0a427cdbe0137900c692d8924f36ed5c96087a7f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 14:50:23 2011 +0100
oops
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 12f5561..8723ac2 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -583,7 +583,7 @@ const rtl::OString& SessionManagerClient::getPreviousSessionID()
static rtl::OString aPrevId;
int nCommands = osl_getCommandArgCount();
- for (int i = 0; i < nCommands; --i)
+ for (int i = 0; i < nCommands; ++i)
{
::rtl::OUString aArg;
osl_getCommandArg( i, &aArg.pData );
commit f04c512f0c642f728e211becfc8825b4f8d014b9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 14:27:34 2011 +0100
getSessionID returns an OString
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index d495553..253e91a 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1261,12 +1261,12 @@ void GtkSalFrame::SetDefaultSize()
static void initClientId()
{
static bool bOnce = false;
- if( ! bOnce )
+ if (!bOnce)
{
bOnce = true;
- const ByteString& rID = SessionManagerClient::getSessionID();
- if( rID.Len() > 0 )
- gdk_set_sm_client_id(rID.GetBuffer());
+ const rtl::OString& rID = SessionManagerClient::getSessionID();
+ if (!rID.isEmpty())
+ gdk_set_sm_client_id(rID.getStr());
}
}
commit 5a99eb9d9a8e07bf0504208b1a9d06b3cc9ca61a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 13:58:39 2011 +0100
ByteString -> rtl::OString
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 8ca0c65..809bd5d 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -447,7 +447,7 @@ void Export::InitForcedLanguages( bool bMergeMode ){
ByteString Export::GetFallbackLanguage( const ByteString nLanguage )
/*****************************************************************************/
{
- ByteString sFallback=nLanguage;
+ rtl::OString sFallback=nLanguage;
GetIsoFallback( sFallback );
return sFallback;
}
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 0bf8324..7136502 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -57,7 +57,7 @@ void HelpParser::FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in
XMLElement* pTmp2 = NULL;
sCur = sLangIdx_in;
- ByteString sFallback( sCur );
+ rtl::OString sFallback( sCur );
GetIsoFallback( sFallback );
if( (rElem_out.find( sFallback ) != rElem_out.end()) && rElem_out[ sFallback ] != NULL ){
pTmp2 = rElem_out[ sFallback ];
diff --git a/tools/inc/tools/isofallback.hxx b/tools/inc/tools/isofallback.hxx
index c014e3d..a9794aa 100644
--- a/tools/inc/tools/isofallback.hxx
+++ b/tools/inc/tools/isofallback.hxx
@@ -29,11 +29,11 @@
#ifndef _ISOFALLBACK_HXX
#define _ISOFALLBACK_HXX
-#include <tools/string.hxx>
+#include <rtl/string.hxx>
#include "tools/toolsdllapi.h"
// Return true if valid fallback found
-TOOLS_DLLPUBLIC sal_Bool GetIsoFallback( ByteString& rLanguage );
+TOOLS_DLLPUBLIC bool GetIsoFallback(rtl::OString& rLanguage);
#endif //_ISOFALLBACK_HXX
diff --git a/tools/source/rc/isofallback.cxx b/tools/source/rc/isofallback.cxx
index 0d072d1..173f1b4 100644
--- a/tools/source/rc/isofallback.cxx
+++ b/tools/source/rc/isofallback.cxx
@@ -34,35 +34,38 @@
// -----------------------------------------------------------------------
// Return true if valid fallback found
-sal_Bool GetIsoFallback( ByteString& rLanguage )
+bool GetIsoFallback(rtl::OString& rLanguage)
{
- rLanguage.EraseLeadingAndTrailingChars();
- if( rLanguage.Len() ){
- xub_StrLen nSepPos = rLanguage.Search( '-' );
- if ( nSepPos == STRING_NOTFOUND ){
- if ( rLanguage.Equals("en"))
+ rLanguage = rLanguage.trim();
+ if (!rLanguage.isEmpty())
+ {
+ sal_Int32 nSepPos = rLanguage.indexOf('-');
+ if (nSepPos == -1)
+ {
+ if (rLanguage == rtl::OString(RTL_CONSTASCII_STRINGPARAM("en")))
{
// en -> ""
- rLanguage.Erase();
+ rLanguage = rtl::OString();
return false;
}
else
{
// de -> en-US ;
- rLanguage = ByteString("en-US");
+ rLanguage = rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"));
return true;
}
}
- else if( !( nSepPos == 1 && ( rLanguage.GetChar(0) == 'x' || rLanguage.GetChar(0) == 'X' ) ) )
+ else if( !(nSepPos == 1 && (rLanguage.toChar() == 'x' || rLanguage.toChar() == 'X')) )
{
// de-CH -> de ;
// try erase from -
- rLanguage = rLanguage.GetToken( 0, '-');
+ sal_Int32 nIndex = 0;
+ rLanguage = rLanguage.getToken(0, '-', nIndex);
return true;
}
}
// "" -> ""; x-no-translate -> ""
- rLanguage.Erase();
+ rLanguage = rtl::OString();
return false;
}
commit ef258f2bd822049f4c175e4c76dbd7a42e857770
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 13:25:48 2011 +0100
ByteString -> osl::OString/OStringBuffer
diff --git a/vcl/inc/unx/sm.hxx b/vcl/inc/unx/sm.hxx
index 5e5200d..5614138 100644
--- a/vcl/inc/unx/sm.hxx
+++ b/vcl/inc/unx/sm.hxx
@@ -28,6 +28,7 @@
#ifndef _VCL_SM_HXX
#define _VCL_SM_HXX
+#include <rtl/string.hxx>
#include "tools/link.hxx"
#include "unx/salunx.h"
#include <X11/SM/SMlib.h>
@@ -37,7 +38,7 @@
class SessionManagerClient
{
static SmcConn aSmcConnection;
- static ByteString aClientID;
+ static rtl::OString m_aClientID;
static bool bDocSaveDone;
static void SaveYourselfProc( SmcConn connection,
@@ -55,7 +56,7 @@ class SessionManagerClient
static void InteractProc( SmcConn connection,
SmPointer clientData );
- static const ByteString& getPreviousSessionID();
+ static const rtl::OString& getPreviousSessionID();
DECL_STATIC_LINK( SessionManagerClient, ShutDownHdl, void* );
DECL_STATIC_LINK( SessionManagerClient, ShutDownCancelHdl, void* );
@@ -71,7 +72,7 @@ public:
static void interactionDone( bool bCancelShutdown );
static rtl::OUString getExecName();
- static VCLPLUG_GEN_PUBLIC const ByteString& getSessionID();
+ static VCLPLUG_GEN_PUBLIC const rtl::OString& getSessionID();
};
class SalFrame;
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 4783483..12f5561 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -35,6 +35,8 @@
#include <stdio.h>
+#include <rtl/strbuf.hxx>
+
#include <osl/process.h>
#include <osl/security.h>
#include <osl/conditn.h>
@@ -177,7 +179,7 @@ public:
SmcConn SessionManagerClient::aSmcConnection = NULL;
-ByteString SessionManagerClient::aClientID;
+rtl::OString SessionManagerClient::m_aClientID;
sal_Bool ICEConnectionObserver::bIsWatching = sal_False;
struct pollfd* ICEConnectionObserver::pFilehandles = NULL;
IceConn* ICEConnectionObserver::pConnections = NULL;
@@ -238,13 +240,14 @@ static void BuildSmPropertyList()
pSmProps[ 2 ].vals = new SmPropValue[3];
pSmProps[ 2 ].vals[0].length = aExec.getLength()+1;
pSmProps[ 2 ].vals[0].value = strdup( aExec.getStr() );
- ByteString aRestartOption( "-session=" );
- aRestartOption.Append( SessionManagerClient::getSessionID() );
- pSmProps[ 2 ].vals[1].length = aRestartOption.Len()+1;
- pSmProps[ 2 ].vals[1].value = strdup( aRestartOption.GetBuffer() );
- ByteString aRestartOptionNoLogo( "-nologo" );
- pSmProps[ 2 ].vals[2].length = aRestartOptionNoLogo.Len()+1;
- pSmProps[ 2 ].vals[2].value = strdup( aRestartOptionNoLogo.GetBuffer() );
+ rtl::OStringBuffer aRestartOption;
+ aRestartOption.append(RTL_CONSTASCII_STRINGPARAM("-session="));
+ aRestartOption.append(SessionManagerClient::getSessionID());
+ pSmProps[ 2 ].vals[1].length = aRestartOption.getLength()+1;
+ pSmProps[ 2 ].vals[1].value = strdup(aRestartOption.getStr());
+ rtl::OString aRestartOptionNoLogo(RTL_CONSTASCII_STRINGPARAM("-nologo"));
+ pSmProps[ 2 ].vals[2].length = aRestartOptionNoLogo.getLength()+1;
+ pSmProps[ 2 ].vals[2].value = strdup(aRestartOptionNoLogo.getStr());
rtl::OUString aUserName;
rtl::OString aUser;
@@ -466,7 +469,7 @@ void SessionManagerClient::open()
ICEConnectionObserver::lock();
char* pClientID = NULL;
- const ByteString& rPrevId( getPreviousSessionID() );
+ const rtl::OString& rPrevId(getPreviousSessionID());
aCallbacks.save_yourself.callback = SaveYourselfProc;
aCallbacks.save_yourself.client_data = NULL;
@@ -485,7 +488,7 @@ void SessionManagerClient::open()
SmcSaveCompleteProcMask |
SmcShutdownCancelledProcMask ,
&aCallbacks,
- rPrevId.Len() ? const_cast<char*>(rPrevId.GetBuffer()) : NULL,
+ rPrevId.getLength() ? const_cast<char*>(rPrevId.getStr()) : NULL,
&pClientID,
sizeof( aErrBuf ),
aErrBuf );
@@ -493,13 +496,13 @@ void SessionManagerClient::open()
SMprintf( "SmcOpenConnection failed: %s\n", aErrBuf );
else
SMprintf( "SmcOpenConnection succeeded, client ID is \"%s\"\n", pClientID );
- aClientID = ByteString( pClientID );
+ m_aClientID = rtl::OString(pClientID);
free( pClientID );
pClientID = NULL;
ICEConnectionObserver::unlock();
SalDisplay* pDisp = GetX11SalData()->GetDisplay();
- if( pDisp->GetDrawable( pDisp->GetDefaultScreenNumber() ) && aClientID.Len() )
+ if( pDisp->GetDrawable(pDisp->GetDefaultScreenNumber()) && !m_aClientID.isEmpty() )
{
XChangeProperty( pDisp->GetDisplay(),
pDisp->GetDrawable( pDisp->GetDefaultScreenNumber() ),
@@ -507,8 +510,8 @@ void SessionManagerClient::open()
XA_STRING,
8,
PropModeReplace,
- (unsigned char*)aClientID.GetBuffer(),
- aClientID.Len()
+ (unsigned char*)m_aClientID.getStr(),
+ m_aClientID.getLength()
);
}
}
@@ -517,9 +520,9 @@ void SessionManagerClient::open()
#endif
}
-const ByteString& SessionManagerClient::getSessionID()
+const rtl::OString& SessionManagerClient::getSessionID()
{
- return aClientID;
+ return m_aClientID;
}
void SessionManagerClient::close()
@@ -575,22 +578,25 @@ rtl::OUString SessionManagerClient::getExecName()
}
-const ByteString& SessionManagerClient::getPreviousSessionID()
+const rtl::OString& SessionManagerClient::getPreviousSessionID()
{
- static ByteString aPrevId;
+ static rtl::OString aPrevId;
int nCommands = osl_getCommandArgCount();
- for( int i = 0; i < nCommands; i++ )
+ for (int i = 0; i < nCommands; --i)
{
::rtl::OUString aArg;
osl_getCommandArg( i, &aArg.pData );
- if( aArg.compareToAscii( "-session=", 9 ) == 0 )
+ if(aArg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-session=")))
{
- aPrevId = ByteString( ::rtl::OUStringToOString( aArg.copy( 9 ), osl_getThreadTextEncoding() ) );
+ aPrevId = rtl::OUStringToOString(
+ aArg.copy(RTL_CONSTASCII_LENGTH("-session=")),
+ osl_getThreadTextEncoding());
break;
}
}
- SMprintf( "previous ID = \"%s\"\n", aPrevId.GetBuffer() );
+
+ SMprintf( "previous ID = \"%s\"\n", aPrevId.getStr() );
return aPrevId;
}
commit 04f7543c0e5695b3d9f705a685b29d873b7e5373
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 12:23:42 2011 +0100
remove unused methods and variables
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index 7bf0062..41fed2f 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -43,49 +43,24 @@
#define PATH_DELIMETER '/'
#endif
-//Link Star::aDBNotFoundHdl;
-
-//
-// class SimpleConfig
-//
-
-/*****************************************************************************/
-SimpleConfig::SimpleConfig( String aSimpleConfigFileName )
-/*****************************************************************************/
+SimpleConfig::SimpleConfig(const String &rSimpleConfigFileName)
{
- nLine = 0;
- aFileName = aSimpleConfigFileName;
- aFileStream.Open ( aFileName, STREAM_READ );
+ aFileStream.Open(rSimpleConfigFileName, STREAM_READ);
}
-/*****************************************************************************/
-SimpleConfig::SimpleConfig( DirEntry& rDirEntry )
-/*****************************************************************************/
-{
- nLine = 0;
- aFileName = rDirEntry.GetFull();
- aFileStream.Open ( aFileName, STREAM_READ );
-}
-
-/*****************************************************************************/
SimpleConfig::~SimpleConfig()
-/*****************************************************************************/
{
aFileStream.Close ();
}
-/*****************************************************************************/
ByteString SimpleConfig::GetNext()
-/*****************************************************************************/
{
- ByteString aString;
-
if ( aStringBuffer =="" )
while ((aStringBuffer = GetNextLine()) == "\t") ; //solange bis != "\t"
if ( aStringBuffer =="" )
return ByteString();
- aString = aStringBuffer.GetToken(0,'\t');
+ ByteString aString = aStringBuffer.GetToken(0,'\t');
aStringBuffer.Erase(0, aString.Len()+1);
aStringBuffer.EraseLeadingChars( '\t' );
@@ -93,13 +68,8 @@ ByteString SimpleConfig::GetNext()
return aString;
}
-/*****************************************************************************/
ByteString SimpleConfig::GetNextLine()
-/*****************************************************************************/
{
- ByteString aSecStr;
- nLine++;
-
aFileStream.ReadLine ( aTmpStr );
if ( aTmpStr.Search( "#" ) == 0 )
return "\t";
@@ -108,7 +78,6 @@ ByteString SimpleConfig::GetNextLine()
while ( aTmpStr.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND ) ;
int nLength = aTmpStr.Len();
sal_Bool bFound = sal_False;
- ByteString aEraseString;
for ( sal_uInt16 i = 0; i<= nLength; i++)
{
if ( aTmpStr.GetChar( i ) == 0x20 && !bFound )
diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx
index 44472e1..2263e35 100644
--- a/tools/inc/bootstrp/prj.hxx
+++ b/tools/inc/bootstrp/prj.hxx
@@ -41,18 +41,15 @@
class SimpleConfig
{
- long nLine;
- String aFileName;
- SvFileStream aFileStream;
- ByteString aTmpStr;
- ByteString aStringBuffer;
+ SvFileStream aFileStream;
+ ByteString aTmpStr;
+ ByteString aStringBuffer;
- ByteString GetNextLine();
+ ByteString GetNextLine();
public:
- SimpleConfig(String aSimpleConfigFileName);
- SimpleConfig(DirEntry& rDirEntry);
- ~SimpleConfig();
- ByteString GetNext();
+ SimpleConfig(const String& rSimpleConfigFileName);
+ ~SimpleConfig();
+ ByteString GetNext();
};
#endif
commit b766ddbd1794dd07c89aca046f8f38d7c18b6f49
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 12:07:00 2011 +0100
remove GetCleanedNextLine
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index fb6f0d5..7bf0062 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -117,48 +117,4 @@ ByteString SimpleConfig::GetNextLine()
return aTmpStr;
}
-/*****************************************************************************/
-ByteString SimpleConfig::GetCleanedNextLine( sal_Bool bReadComments )
-/*****************************************************************************/
-{
-
- aFileStream.ReadLine ( aTmpStr );
- if ( aTmpStr.Search( "#" ) == 0 )
- {
- if (bReadComments )
- return aTmpStr;
- else
- while ( aTmpStr.Search( "#" ) == 0 )
- {
- aFileStream.ReadLine ( aTmpStr );
- }
- }
-
- aTmpStr = aTmpStr.EraseLeadingChars();
- aTmpStr = aTmpStr.EraseTrailingChars();
- int nLength = aTmpStr.Len();
- ByteString aEraseString;
- sal_Bool bFirstTab = sal_True;
- for ( sal_uInt16 i = 0; i<= nLength; i++)
- {
- if ( aTmpStr.GetChar( i ) == 0x20 )
- aTmpStr.SetChar( i, 0x09 );
-
- if ( aTmpStr.GetChar( i ) == 0x09 )
- {
- if ( bFirstTab )
- bFirstTab = sal_False;
- else
- {
- aTmpStr.SetChar( i, 0x20 );
- }
- }
- else
- bFirstTab = sal_True;
-
- }
- aTmpStr.EraseAllChars(' ');
- return aTmpStr;
-
-}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx
index d4dab7d..44472e1 100644
--- a/tools/inc/bootstrp/prj.hxx
+++ b/tools/inc/bootstrp/prj.hxx
@@ -53,7 +53,6 @@ public:
SimpleConfig(DirEntry& rDirEntry);
~SimpleConfig();
ByteString GetNext();
- ByteString GetCleanedNextLine( sal_Bool bReadComments = sal_False );
};
#endif
diff --git a/tools/workben/mempooltest.cxx b/tools/workben/mempooltest.cxx
index bf00343..e99e217 100644
--- a/tools/workben/mempooltest.cxx
+++ b/tools/workben/mempooltest.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "tools/mempool.hxx"
struct MempoolTest
@@ -16,3 +17,5 @@ int main()
delete p;
return 1;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 022cd01c492c9140f636000744b713975b68c3d4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 11:58:53 2011 +0100
can shrink these buffers to minimum required
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index e4a2577..1316c6c 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1938,7 +1938,7 @@ void SvStream::RefreshBuffer()
SvStream& SvStream::WriteNumber(sal_Int32 nInt32)
{
- char buffer[256+12];
+ char buffer[12];
sal_Size nLen = sprintf(buffer, "%"SAL_PRIdINT32, nInt32);
Write(buffer, nLen);
return *this;
@@ -1946,7 +1946,7 @@ SvStream& SvStream::WriteNumber(sal_Int32 nInt32)
SvStream& SvStream::WriteNumber(sal_uInt32 nUInt32)
{
- char buffer[256+12];
+ char buffer[11];
sal_Size nLen = sprintf(buffer, "%"SAL_PRIuUINT32, nUInt32);
Write(buffer, nLen);
return *this;
commit 884ad4868645884bcb28d05c41f8cdf7bcfdd68b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 11:49:35 2011 +0100
and now we can remove FormatString
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 4c60756..6f6a3be 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -269,13 +269,10 @@ private:
rtl::OString m_aCryptMaskKey; // aCryptMaskKey.getLength != 0 -> Verschluesselung
unsigned char nCryptMask;
- ByteString aFormatString;
-
// Userdata
long nVersion; // for external use
// Hilfsmethoden
- void CreateFormatString();
TOOLS_DLLPRIVATE void ImpInit();
SvStream ( const SvStream& rStream ); // not implemented
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 8af9660..e4a2577 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -459,7 +459,6 @@ void SvStream::ImpInit()
nBufFree = 0;
eStreamMode = 0;
- CreateFormatString();
nVersion = 0;
@@ -1937,43 +1936,19 @@ void SvStream::RefreshBuffer()
eIOMode = STREAM_IO_DONTKNOW;
}
-
-/*************************************************************************
-|*
-|* Stream::CreateFormatString()
-|*
-|* Beschreibung Baut Formatstring zusammen
-|*
-*************************************************************************/
-
-void SvStream::CreateFormatString()
-{
- aFormatString = '%';
-}
-
-/*************************************************************************
-|*
-|* Stream::WriteNumber()
-|*
-*************************************************************************/
-
-SvStream& SvStream::WriteNumber( sal_Int32 nInt32 )
+SvStream& SvStream::WriteNumber(sal_Int32 nInt32)
{
char buffer[256+12];
- ByteString aFStr( aFormatString);
- aFStr += SAL_PRIdINT32;
- sal_Size nLen = sprintf(buffer, aFStr.GetBuffer(), nInt32);
- Write( buffer, nLen );
+ sal_Size nLen = sprintf(buffer, "%"SAL_PRIdINT32, nInt32);
+ Write(buffer, nLen);
return *this;
}
-SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 )
+SvStream& SvStream::WriteNumber(sal_uInt32 nUInt32)
{
char buffer[256+12];
- ByteString aFStr( aFormatString);
- aFStr += SAL_PRIuUINT32;
- sal_Size nLen = sprintf(buffer, aFStr.GetBuffer(), nUInt32);
- Write( buffer, nLen );
+ sal_Size nLen = sprintf(buffer, "%"SAL_PRIuUINT32, nUInt32);
+ Write(buffer, nLen);
return *this;
}
More information about the Libreoffice-commits
mailing list