[Libreoffice-commits] .: 3 commits - svtools/inc svtools/source toolkit/source vcl/inc vcl/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jun 21 01:14:25 PDT 2011
svtools/inc/svtools/imapcirc.hxx | 2
svtools/inc/svtools/imapobj.hxx | 10 -
svtools/source/misc/imap.cxx | 2
svtools/source/misc/imap2.cxx | 287 ++++++-------------------------------
toolkit/source/awt/vclxwindows.cxx | 2
vcl/inc/vcl/field.hxx | 10 -
vcl/source/control/field2.cxx | 107 +++++++------
7 files changed, 117 insertions(+), 303 deletions(-)
New commits:
commit 305b14557cc63df3e008a4519c0fb9ad80099a2d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 23:06:57 2011 +0100
convert string
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index aaef670..c268fe4 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -111,7 +111,7 @@ public:
class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
{
private:
- ByteString maEditMask;
+ rtl::OString m_aEditMask;
XubString maFieldString;
XubString maLiteralMask;
sal_uInt16 mnFormatFlags;
@@ -122,7 +122,8 @@ protected:
PatternFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
+ SAL_DLLPRIVATE void ImplSetMask(const rtl::OString& rEditMask,
+ const XubString& rLiteralMask);
SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
@@ -131,9 +132,8 @@ public:
virtual void Reformat();
- void SetMask( const ByteString& rEditMask,
- const XubString& rLiteralMask );
- const ByteString& GetEditMask() const { return maEditMask; }
+ void SetMask(const rtl::OString& rEditMask, const XubString& rLiteralMask );
+ const rtl::OString& GetEditMask() const { return m_aEditMask; }
const XubString& GetLiteralMask() const { return maLiteralMask; }
void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 87c7789..ad01095 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -241,11 +241,11 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
// -----------------------------------------------------------------------
static XubString ImplPatternReformat( const XubString& rStr,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_uInt16 nFormatFlags )
{
- if ( !rEditMask.Len() )
+ if (rEditMask.isEmpty())
return rStr;
XubString aStr = rStr;
@@ -258,14 +258,14 @@ static XubString ImplPatternReformat( const XubString& rStr,
xub_StrLen i = 0;
xub_StrLen n;
- while ( i < rEditMask.Len() )
+ while ( i < rEditMask.getLength() )
{
if ( nStrIndex >= aStr.Len() )
break;
cChar = aStr.GetChar(nStrIndex);
cLiteral = rLiteralMask.GetChar(i);
- cMask = rEditMask.GetChar(i);
+ cMask = rEditMask[i];
// Aktuelle Position ein Literal
if ( cMask == EDITMASK_LITERAL )
@@ -281,11 +281,11 @@ static XubString ImplPatternReformat( const XubString& rStr,
// Dies ist dann der Fall, wenn es nicht in das Muster
// des naechsten nicht Literal-Zeichens passt
n = i+1;
- while ( n < rEditMask.Len() )
+ while ( n < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(n) != EDITMASK_LITERAL )
+ if ( rEditMask[n] != EDITMASK_LITERAL )
{
- if ( !ImplIsPatternChar( cChar, rEditMask.GetChar(n) ) )
+ if ( !ImplIsPatternChar( cChar, rEditMask[n] ) )
nStrIndex++;
break;
}
@@ -318,9 +318,9 @@ static XubString ImplPatternReformat( const XubString& rStr,
if ( nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS )
{
n = i;
- while ( n < rEditMask.Len() )
+ while ( n < rEditMask.getLength() )
{
- if ( rEditMask.GetChar( n ) == EDITMASK_LITERAL )
+ if ( rEditMask[n] == EDITMASK_LITERAL )
{
if ( ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar( n ) ) )
i = n+1;
@@ -346,7 +346,7 @@ static XubString ImplPatternReformat( const XubString& rStr,
// -----------------------------------------------------------------------
-static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask,
+static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask,
sal_uInt16 nCursorPos, sal_uInt16& rPos )
{
@@ -360,7 +360,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
{
while ( nMaxPos )
{
- if ( (rEditMask.GetChar(nMaxPos-1) != EDITMASK_LITERAL) &&
+ if ( (rEditMask[nMaxPos-1] != EDITMASK_LITERAL) &&
(rStr.GetChar(nMaxPos-1) != ' ') )
break;
nMaxPos--;
@@ -369,9 +369,9 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
// Wenn wir vor einem Literal stehen, dann solange weitersuchen,
// bis erste Stelle nach Literal
xub_StrLen nTempPos = nMaxPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos] != EDITMASK_LITERAL )
{
nMaxPos = nTempPos;
break;
@@ -390,7 +390,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
// -----------------------------------------------------------------------
static void ImplPatternProcessStrictModify( Edit* pEdit,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask )
{
@@ -403,14 +403,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
xub_StrLen nMaxLen = aText.Len();
while ( i < nMaxLen )
{
- if ( (rEditMask.GetChar( i ) != EDITMASK_LITERAL) &&
+ if ( (rEditMask[i] != EDITMASK_LITERAL) &&
(aText.GetChar( i ) != ' ') )
break;
i++;
}
// Alle Literalzeichen beibehalten
- while ( i && (rEditMask.GetChar( i ) == EDITMASK_LITERAL) )
+ while ( i && (rEditMask[i] == EDITMASK_LITERAL) )
i--;
aText.Erase( 0, i );
}
@@ -442,14 +442,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
// -----------------------------------------------------------------------
-static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nCursorPos )
+static xub_StrLen ImplPatternLeftPos(const rtl::OString& rEditMask, xub_StrLen nCursorPos)
{
// Vorheriges Zeichen suchen, was kein Literal ist
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
while ( nTempPos )
{
- if ( rEditMask.GetChar(nTempPos-1) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL )
{
nNewPos = nTempPos-1;
break;
@@ -461,16 +461,16 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC
// -----------------------------------------------------------------------
-static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask,
+static xub_StrLen ImplPatternRightPos( const XubString& rStr, const rtl::OString& rEditMask,
sal_uInt16 nFormatFlags, sal_Bool bSameMask,
xub_StrLen nCursorPos )
{
// Naechstes Zeichen suchen, was kein Literal ist
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL )
{
nNewPos = nTempPos+1;
break;
@@ -484,14 +484,14 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString&
// -----------------------------------------------------------------------
static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- const ByteString& rEditMask,
+ const rtl::OString& rEditMask,
const XubString& rLiteralMask,
sal_Bool bStrictFormat,
sal_uInt16 nFormatFlags,
sal_Bool bSameMask,
sal_Bool& rbInKeyInput )
{
- if ( !rEditMask.Len() || !bStrictFormat )
+ if ( rEditMask.isEmpty() || !bStrictFormat )
return sal_False;
Selection aOldSel = pEdit->GetSelection();
@@ -533,8 +533,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
// Home ist Position des ersten nicht literalen Zeichens
nNewPos = 0;
- while ( (nNewPos < rEditMask.Len()) &&
- (rEditMask.GetChar(nNewPos) == EDITMASK_LITERAL) )
+ while ( (nNewPos < rEditMask.getLength()) &&
+ (rEditMask[nNewPos] == EDITMASK_LITERAL) )
nNewPos++;
// Home sollte nicht nach rechts wandern
if ( nCursorPos < nNewPos )
@@ -548,9 +548,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else if ( nKeyCode == KEY_END )
{
// End ist die Position des letzten nicht literalen Zeichens
- nNewPos = rEditMask.Len();
+ nNewPos = rEditMask.getLength();
while ( nNewPos &&
- (rEditMask.GetChar(nNewPos-1) == EDITMASK_LITERAL) )
+ (rEditMask[nNewPos-1] == EDITMASK_LITERAL) )
nNewPos--;
// Hier nehmen wir Selectionsanfang als minimum, da falls durch
// Focus alles selektiert ist, ist eine kleine Position schon
@@ -601,7 +601,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( bSameMask )
{
- if ( rEditMask.GetChar( nNewPos ) != EDITMASK_LITERAL )
+ if ( rEditMask[nNewPos] != EDITMASK_LITERAL )
aStr.Erase( nNewPos, 1 );
}
else
@@ -647,9 +647,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aSel.Justify();
nNewPos = (xub_StrLen)aSel.Min();
- if ( nNewPos < rEditMask.Len() )
+ if ( nNewPos < rEditMask.getLength() )
{
- xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask.GetChar(nNewPos) );
+ xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask[nNewPos] );
if ( cPattChar )
cChar = cPattChar;
else
@@ -661,17 +661,17 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
// nicht dazu fuehren, das der Anwender dann da steht, wo
// er nicht stehen wollte.
if ( nNewPos &&
- (rEditMask.GetChar(nNewPos-1) != EDITMASK_LITERAL) &&
+ (rEditMask[nNewPos-1] != EDITMASK_LITERAL) &&
!aSel.Len() )
{
// Naechstes Zeichen suchen, was kein Literal ist
nTempPos = nNewPos;
- while ( nTempPos < rEditMask.Len() )
+ while ( nTempPos < rEditMask.getLength() )
{
- if ( rEditMask.GetChar(nTempPos) == EDITMASK_LITERAL )
+ if ( rEditMask[nTempPos] == EDITMASK_LITERAL )
{
// Gilt nur, wenn ein Literalzeichen vorhanden
- if ( (rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) &&
+ if ( (rEditMask[nTempPos+1] != EDITMASK_LITERAL ) &&
ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar(nTempPos) ) )
{
nTempPos++;
@@ -705,7 +705,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
while ( n && (n > nNewPos) )
{
if ( (aStr.GetChar( n-1 ) != ' ') &&
- ((n > rEditMask.Len()) || (rEditMask.GetChar(n-1) != EDITMASK_LITERAL)) )
+ ((n > rEditMask.getLength()) || (rEditMask[n-1] != EDITMASK_LITERAL)) )
break;
n--;
@@ -715,14 +715,14 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( aSel.Len() )
aStr.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
- if ( aStr.Len() < rEditMask.Len() )
+ if ( aStr.Len() < rEditMask.getLength() )
{
// String evtl. noch bis Cursor-Position erweitern
if ( aStr.Len() < nNewPos )
aStr += rLiteralMask.Copy( aStr.Len(), nNewPos-aStr.Len() );
if ( nNewPos < aStr.Len() )
aStr.Insert( cChar, nNewPos );
- else if ( nNewPos < rEditMask.Len() )
+ else if ( nNewPos < rEditMask.getLength() )
aStr += cChar;
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
}
@@ -740,7 +740,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( nNewPos < aStr.Len() )
aStr.SetChar( nNewPos, cChar );
- else if ( nNewPos < rEditMask.Len() )
+ else if ( nNewPos < rEditMask.getLength() )
aStr += cChar;
}
@@ -764,19 +764,19 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
// -----------------------------------------------------------------------
-void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
- const XubString& rLiteralMask )
+void PatternFormatter::ImplSetMask(const rtl::OString& rEditMask,
+ const XubString& rLiteralMask)
{
- maEditMask = rEditMask;
+ m_aEditMask = rEditMask;
maLiteralMask = rLiteralMask;
mbSameMask = sal_True;
- if ( maEditMask.Len() != maLiteralMask.Len() )
+ if ( m_aEditMask.getLength() != maLiteralMask.Len() )
{
- if ( maEditMask.Len() < maLiteralMask.Len() )
- maLiteralMask.Erase( maEditMask.Len() );
+ if ( m_aEditMask.getLength() < maLiteralMask.Len() )
+ maLiteralMask.Erase(m_aEditMask.getLength());
else
- maLiteralMask.Expand( maEditMask.Len(), ' ' );
+ maLiteralMask.Expand(m_aEditMask.getLength(), ' ');
}
// StrictModus erlaubt nur Input-Mode, wenn als Maske nur
@@ -785,9 +785,9 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
// nicht zugelassen sind
xub_StrLen i = 0;
sal_Char c = 0;
- while ( i < rEditMask.Len() )
+ while ( i < rEditMask.getLength() )
{
- sal_Char cTemp = rEditMask.GetChar( i );
+ sal_Char cTemp = rEditMask[i];
if ( cTemp != EDITMASK_LITERAL )
{
if ( (cTemp == EDITMASK_ALLCHAR) ||
@@ -830,7 +830,7 @@ PatternFormatter::PatternFormatter()
void PatternFormatter::ImplLoadRes( const ResId& rResId )
{
- ByteString aEditMask;
+ rtl::OString aEditMask;
XubString aLiteralMask;
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
@@ -841,7 +841,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId )
SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( PATTERNFORMATTER_EDITMASK & nMask )
- aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US );
+ {
+ aEditMask = rtl::OUStringToOString(pMgr->ReadString(),
+ RTL_TEXTENCODING_ASCII_US);
+ }
if ( PATTERNFORMATTER_LITTERALMASK & nMask )
aLiteralMask = pMgr->ReadString();
@@ -859,7 +862,7 @@ PatternFormatter::~PatternFormatter()
// -----------------------------------------------------------------------
-void PatternFormatter::SetMask( const ByteString& rEditMask,
+void PatternFormatter::SetMask( const rtl::OString& rEditMask,
const XubString& rLiteralMask )
{
ImplSetMask( rEditMask, rLiteralMask );
@@ -885,7 +888,7 @@ XubString PatternFormatter::GetString() const
if ( !GetField() )
return ImplGetSVEmptyStr();
else
- return ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags );
+ return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags );
}
// -----------------------------------------------------------------------
@@ -894,7 +897,7 @@ void PatternFormatter::Reformat()
{
if ( GetField() )
{
- ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) );
+ ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ) );
if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() )
GetField()->SetInsertMode( sal_False );
}
commit 1549a50063787f18eaad236bd5eac699a9ab4b09
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 22:46:12 2011 +0100
convert string
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 96c991b..60679ac 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -6470,7 +6470,7 @@ void VCLXPatternField::getMasks( ::rtl::OUString& EditMask, ::rtl::OUString& Lit
PatternField* pPatternField = (PatternField*) GetWindow();
if ( pPatternField )
{
- EditMask = String( pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US );
+ EditMask = rtl::OStringToOUString(pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US);
LiteralMask = pPatternField->GetLiteralMask();
}
}
commit f957ccba340b294d8d647b1dbef0b00c5a46dff4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 20 21:39:11 2011 +0100
ByteString->rtl::OStringBuffer
diff --git a/svtools/inc/svtools/imapcirc.hxx b/svtools/inc/svtools/imapcirc.hxx
index 994bf02..cb8a275 100644
--- a/svtools/inc/svtools/imapcirc.hxx
+++ b/svtools/inc/svtools/imapcirc.hxx
@@ -43,7 +43,7 @@ class Fraction;
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
{
Point aCenter;
- sal_uLong nRadius;
+ sal_Int32 nRadius;
void ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx
index daac9ee..025ac80 100644
--- a/svtools/inc/svtools/imapobj.hxx
+++ b/svtools/inc/svtools/imapobj.hxx
@@ -32,6 +32,7 @@
#include "svtools/svtdllapi.h"
#include <tools/string.hxx>
#include <svl/macitem.hxx>
+#include <rtl/strbuf.hxx>
class Point;
class Rectangle;
@@ -77,7 +78,6 @@ class SVT_DLLPUBLIC IMapObject
sal_Bool bActive;
protected:
-
sal_uInt16 nReadVersion;
// Binaer-Im-/Export
@@ -85,10 +85,10 @@ protected:
virtual void ReadIMapObject( SvStream& rIStm ) = 0;
// Hilfsmethoden
- void AppendCERNCoords( const Point& rPoint100, ByteString& rStr ) const;
- void AppendCERNURL( ByteString& rStr, const String& rBaseURL ) const;
- void AppendNCSACoords( const Point& rPoint100, ByteString& rStr ) const;
- void AppendNCSAURL( ByteString& rStr, const String& rBaseURL ) const;
+ void AppendCERNCoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendCERNURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const;
+ void AppendNCSACoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendNCSAURL(rtl::OStringBuffer&rBuf, const String& rBaseURL) const;
public:
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index e1b74ae..1117085 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -433,7 +433,7 @@ sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const
const Point aPoint( aCenter - rPoint );
sal_Bool bRet = sal_False;
- if ( (sal_uLong) sqrt( (double) aPoint.X() * aPoint.X() +
+ if ( (sal_Int32) sqrt( (double) aPoint.X() * aPoint.X() +
aPoint.Y() * aPoint.Y() ) <= nRadius )
{
bRet = sal_True;
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 070ef6d..8be37fd 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -48,209 +48,111 @@
#define NOTEOL(c) ((c)!='\0')
-
TYPEINIT0_AUTOFACTORY( ImageMap );
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
-void IMapObject::AppendCERNCoords( const Point& rPoint100, ByteString& rStr ) const
+void IMapObject::AppendCERNCoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const
{
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) );
- rStr += '(';
- rStr += ByteString::CreateFromInt32( aPixPt.X() );
- rStr += ',';
- rStr += ByteString::CreateFromInt32( aPixPt.Y() );
- rStr += ") ";
+ rBuf.append('(');
+ rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
+ rBuf.append(',');
+ rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
+ rBuf.append(RTL_CONSTASCII_STRINGPARAM(") "));
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
-void IMapObject::AppendNCSACoords( const Point& rPoint100, ByteString& rStr ) const
+void IMapObject::AppendNCSACoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const
{
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) );
- rStr += ByteString::CreateFromInt32( aPixPt.X() );
- rStr += ',';
- rStr += ByteString::CreateFromInt32( aPixPt.Y() );
- rStr += ' ';
+ rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
+ rBuf.append(',');
+ rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
+ rBuf.append(' ');
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
-void IMapObject::AppendCERNURL( ByteString& rStr, const String& rBaseURL ) const
+void IMapObject::AppendCERNURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const
{
- rStr += ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), gsl_getSystemTextEncoding() );
+ rBuf.append(rtl::OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), gsl_getSystemTextEncoding()));
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
-void IMapObject::AppendNCSAURL( ByteString& rStr, const String& rBaseURL ) const
+void IMapObject::AppendNCSAURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const
{
- rStr += ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), gsl_getSystemTextEncoding() );
- rStr += ' ';
+ rBuf.append(rtl::OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), gsl_getSystemTextEncoding()));
+ rBuf.append(' ');
}
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapRectangleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "rectangle " );
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rectangle "));
- AppendCERNCoords( aRect.TopLeft(), aStr );
- AppendCERNCoords( aRect.BottomRight(), aStr );
- AppendCERNURL( aStr, rBaseURL );
+ AppendCERNCoords(aStrBuf, aRect.TopLeft());
+ AppendCERNCoords(aStrBuf, aRect.BottomRight());
+ AppendCERNURL(aStrBuf, rBaseURL);
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapRectangleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "rect " );
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rect "));
- AppendNCSAURL( aStr, rBaseURL );
- AppendNCSACoords( aRect.TopLeft(), aStr );
- AppendNCSACoords( aRect.BottomRight(), aStr );
+ AppendNCSAURL(aStrBuf, rBaseURL);
+ AppendNCSACoords(aStrBuf, aRect.TopLeft());
+ AppendNCSACoords(aStrBuf, aRect.BottomRight());
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapCircleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "circle " );
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle "));
- AppendCERNCoords( aCenter, aStr );
- aStr += ByteString::CreateFromInt32(nRadius);
- aStr += ' ';
- AppendCERNURL( aStr, rBaseURL );
+ AppendCERNCoords(aStrBuf, aCenter);
+ aStrBuf.append(nRadius);
+ aStrBuf.append(' ');
+ AppendCERNURL(aStrBuf, rBaseURL);
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "circle " );
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle "));
- AppendNCSAURL( aStr, rBaseURL );
- AppendNCSACoords( aCenter, aStr );
- AppendNCSACoords( aCenter + Point( nRadius, 0 ), aStr );
+ AppendNCSAURL(aStrBuf, rBaseURL);
+ AppendNCSACoords(aStrBuf, aCenter);
+ AppendNCSACoords(aStrBuf, aCenter + Point(nRadius, 0));
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "polygon " );
- const sal_uInt16 nCount = aPoly.GetSize();
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("polygon "));
+ const sal_uInt16 nCount = aPoly.GetSize();
- for ( sal_uInt16 i = 0; i < nCount; i++ )
- AppendCERNCoords( aPoly[ i ], aStr );
+ for (sal_uInt16 i = 0; i < nCount; ++i)
+ AppendCERNCoords(aStrBuf, aPoly[i]);
- AppendCERNURL( aStr, rBaseURL );
+ AppendCERNURL(aStrBuf, rBaseURL);
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
- ByteString aStr( "poly " );
- const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 );
+ rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("poly "));
+ const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 );
- AppendNCSAURL( aStr, rBaseURL );
+ AppendNCSAURL(aStrBuf, rBaseURL);
- for ( sal_uInt16 i = 0; i < nCount; i++ )
- AppendNCSACoords( aPoly[ i ], aStr );
+ for (sal_uInt16 i = 0; i < nCount; ++i)
+ AppendNCSACoords(aStrBuf, aPoly[i]);
- rOStm.WriteLine( aStr );
+ rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const
{
switch( nFormat )
@@ -264,13 +166,6 @@ void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL
}
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
@@ -300,13 +195,6 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
}
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
@@ -336,13 +224,6 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
}
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL )
{
sal_uLong nRet = IMAP_ERR_FORMAT;
@@ -366,13 +247,6 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBas
return nRet;
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -386,13 +260,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
return IMAP_ERR_OK;
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL )
{
ByteString aStr( rLine );
@@ -451,13 +318,6 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL
}
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
Point ImageMap::ImpReadCERNCoords( const char** ppStr )
{
String aStrX;
@@ -498,13 +358,6 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr )
return aPt;
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
long ImageMap::ImpReadCERNRadius( const char** ppStr )
{
String aStr;
@@ -525,13 +378,6 @@ long ImageMap::ImpReadCERNRadius( const char** ppStr )
return aStr.ToInt32();
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
{
String aStr( String::CreateFromAscii( *ppStr ) );
@@ -544,13 +390,6 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
return INetURLObject::GetAbsURL( rBaseURL, aStr );
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -564,13 +403,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
return IMAP_ERR_OK;
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL )
{
ByteString aStr( rLine );
@@ -629,13 +461,6 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL
}
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
String ImageMap::ImpReadNCSAURL( const char** ppStr, const String& rBaseURL )
{
String aStr;
@@ -656,13 +481,6 @@ String ImageMap::ImpReadNCSAURL( const char** ppStr, const String& rBaseURL )
return INetURLObject::GetAbsURL( rBaseURL, aStr );
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
Point ImageMap::ImpReadNCSACoords( const char** ppStr )
{
String aStrX;
@@ -699,13 +517,6 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
return aPt;
}
-
-/******************************************************************************
-|*
-|*
-|*
-\******************************************************************************/
-
sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
{
sal_uLong nPos = rIStm.Tell();
More information about the Libreoffice-commits
mailing list