Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2011
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/11/2011/1
replace (Xub)String with OUString in vcl
Change-Id: I0a44bab196ae239d3bdea75fd2b657bdfa4ecf31
---
M cui/source/dialogs/hangulhanjadlg.cxx
M extensions/source/propctrlr/usercontrol.cxx
M svtools/inc/svtools/ctrlbox.hxx
M svtools/source/control/ctrlbox.cxx
M vcl/inc/svdata.hxx
M vcl/inc/textlayout.hxx
M vcl/inc/vcl/button.hxx
M vcl/inc/vcl/controllayout.hxx
M vcl/inc/vcl/ctrl.hxx
M vcl/inc/vcl/field.hxx
M vcl/inc/vcl/outdev.hxx
M vcl/source/control/button.cxx
M vcl/source/control/ctrl.cxx
M vcl/source/control/edit.cxx
M vcl/source/control/field.cxx
M vcl/source/control/field2.cxx
M vcl/source/control/fixed.cxx
M vcl/source/control/group.cxx
M vcl/source/control/ilstbox.cxx
M vcl/source/control/tabctrl.cxx
M vcl/source/gdi/outdev3.cxx
M vcl/source/gdi/textlayout.cxx
M vcl/source/window/menu.cxx
M vcl/source/window/toolbox.cxx
24 files changed, 160 insertions(+), 159 deletions(-)
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index cc4fde8..0c623d3 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -118,7 +118,7 @@
{
bool bLayoutOnly = NULL != _pLayoutData;
MetricVector* pTextMetrics = bLayoutOnly ? &_pLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayoutOnly ? &_pLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayoutOnly ? &_pLayoutData->m_aDisplayText : NULL;
Size aPlaygroundSize( _rRect.GetSize() );
diff --git a/extensions/source/propctrlr/usercontrol.cxx
b/extensions/source/propctrlr/usercontrol.cxx
index 7f23e6a..24964ad 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -337,13 +337,13 @@
IMPL_LINK( OTimeDurationControl, OnCustomConvert, MetricField*, /*pField*/ )
{
long nMultiplier = 1;
- if ( getTypedControlWindow()->GetCurUnitText().EqualsIgnoreCaseAscii( "ms" ) )
+ if ( getTypedControlWindow()->GetCurUnitText().equalsIgnoreAsciiCase( "ms" ) )
nMultiplier = 1;
- if ( getTypedControlWindow()->GetCurUnitText().EqualsIgnoreCaseAscii( "s" ) )
+ if ( getTypedControlWindow()->GetCurUnitText().equalsIgnoreAsciiCase( "s" ) )
nMultiplier = 1000;
- else if ( getTypedControlWindow()->GetCurUnitText().EqualsIgnoreCaseAscii( "m" ) )
+ else if ( getTypedControlWindow()->GetCurUnitText().equalsIgnoreAsciiCase( "m" ) )
nMultiplier = 1000 * 60;
- else if ( getTypedControlWindow()->GetCurUnitText().EqualsIgnoreCaseAscii( "h" ) )
+ else if ( getTypedControlWindow()->GetCurUnitText().equalsIgnoreAsciiCase( "h" ) )
nMultiplier = 1000 * 60 * 60;
getTypedControlWindow()->SetValue( getTypedControlWindow()->GetLastValue() * nMultiplier );
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index 6b83e9f..0a8e566 100644
--- a/svtools/inc/svtools/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -512,7 +512,7 @@
#endif
protected:
- virtual XubString CreateFieldText( sal_Int64 nValue ) const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
public:
FontSizeBox( Window* pParent, WinBits nWinStyle = 0 );
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 09cf09f..0b6d591 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1954,11 +1954,11 @@
// -----------------------------------------------------------------------
-XubString FontSizeBox::CreateFieldText( sal_Int64 nValue ) const
+OUString FontSizeBox::CreateFieldText( sal_Int64 nValue ) const
{
- XubString sRet( MetricBox::CreateFieldText( nValue ) );
- if ( bRelativeMode && bPtRelative && (0 <= nValue) && sRet.Len() )
- sRet.Insert( '+', 0 );
+ OUString sRet( MetricBox::CreateFieldText( nValue ) );
+ if ( bRelativeMode && bPtRelative && (0 <= nValue) && !sRet.isEmpty() )
+ sRet = "+" + sRet;
return sRet;
}
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index bca3ea7..b4b59b5 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -223,7 +223,7 @@
// - ImplSVCtrlData -
// ------------------
-typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
+typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList;
struct ImplSVCtrlData
{
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index d20ea5f..5e95eab 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -42,7 +42,7 @@
public:
virtual long GetTextWidth( const XubString& _rText, xub_StrLen _nStartIndex,
xub_StrLen _nLength ) const = 0;
virtual void DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex, xub_StrLen _nLength,
- MetricVector* _pVector, String* _pDisplayText ) = 0;
+ MetricVector* _pVector, OUString* _pDisplayText ) = 0;
virtual bool GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray,
xub_StrLen _nStartIndex, xub_StrLen _nLength ) const = 0;
virtual xub_StrLen GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen
_nStartIndex, xub_StrLen _nLength ) const = 0;
virtual bool DecomposeTextRectAction() const = 0;
@@ -78,7 +78,7 @@
xub_StrLen _nStartIndex,
xub_StrLen _nLength,
MetricVector* _pVector,
- String* _pDisplayText
+ OUString* _pDisplayText
);
virtual bool GetCaretPositions(
const XubString& _rText,
@@ -113,7 +113,7 @@
Rectangle DrawText( const Rectangle& _rRect,
const XubString& _rText, sal_uInt16 _nStyle = 0,
- MetricVector* _pVector = NULL, String* _pDisplayText = NULL );
+ MetricVector* _pVector = NULL, OUString* _pDisplayText = NULL );
private:
ControlTextRenderer(); // never
implemented
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 03ba3d6..349f9cc 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -49,7 +49,7 @@
public:
SAL_DLLPRIVATE sal_uInt16 ImplGetButtonState() const;
SAL_DLLPRIVATE sal_uInt16& ImplGetButtonState();
- SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
sal_uLong nDrawFlags );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( OUString& rText, WinBits nWinStyle,
sal_uLong nDrawFlags );
SAL_DLLPRIVATE void ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size&
rSize,
sal_Bool bLayout, sal_uLong nImageSep, sal_uLong
nDrawFlags,
sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL,
bool bAddImageSep = false );
diff --git a/vcl/inc/vcl/controllayout.hxx b/vcl/inc/vcl/controllayout.hxx
index 7961208..5d1d133 100644
--- a/vcl/inc/vcl/controllayout.hxx
+++ b/vcl/inc/vcl/controllayout.hxx
@@ -35,7 +35,7 @@
// contains the string really displayed
// there must be exactly one bounding rectangle in m_aUnicodeBoundRects
// for every character in m_aDisplayText
- String m_aDisplayText;
+ OUString m_aDisplayText;
// the bounding rectangle of every character
// where one character may consist of many glyphs
std::vector< Rectangle > m_aUnicodeBoundRects;
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 03ddcdc..390f416 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -91,8 +91,8 @@
directly at the target device, or taking the reference device into account) when returning.
*/
void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
- const XubString& _rStr, sal_uInt16 _nStyle,
- MetricVector* _pVector, String* _pDisplayText ) const;
+ const OUString& _rStr, sal_uInt16 _nStyle,
+ MetricVector* _pVector, OUString* _pDisplayText ) const;
virtual const Font&
GetCanonicalFont( const StyleSettings& _rStyle ) const;
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index c37b306..0f47d5f 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -170,7 +170,7 @@
void FieldLast();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE sal_Bool ImplNumericReformat( const XubString& rStr, double& rValue,
XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplNumericReformat( const OUString& rStr, double& rValue, OUString&
rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSelection = NULL
);
@@ -204,7 +204,7 @@
void SetUserValue( sal_Int64 nNewValue );
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue() const;
- virtual XubString CreateFieldText( sal_Int64 nValue ) const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
sal_Bool IsValueModified() const;
sal_Int64 GetCorrectedValue() const { return mnCorrectedValue; }
@@ -222,8 +222,8 @@
SAL_DLLPRIVATE void ImplInit();
protected:
- XubString maCustomUnitText;
- XubString maCurUnitText;
+ OUString maCustomUnitText;
+ OUString maCurUnitText;
sal_Int64 mnBaseValue;
FieldUnit meUnit;
Link maCustomConvertLink;
@@ -232,7 +232,7 @@
MetricFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE sal_Bool ImplMetricReformat( const XubString& rStr, double& rValue,
XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplMetricReformat( const OUString& rStr, double& rValue,
OUString& rOutStr );
public:
~MetricFormatter();
@@ -243,8 +243,8 @@
virtual void SetUnit( FieldUnit meUnit );
FieldUnit GetUnit() const { return meUnit; }
void SetCustomUnitText( const XubString& rStr );
- const XubString& GetCustomUnitText() const { return maCustomUnitText; }
- const XubString& GetCurUnitText() const { return maCurUnitText; }
+ const OUString& GetCustomUnitText() const { return maCustomUnitText; }
+ const OUString& GetCurUnitText() const { return maCurUnitText; }
using NumericFormatter::SetMax;
void SetMax( sal_Int64 nNewMax, FieldUnit eInUnit );
@@ -263,7 +263,7 @@
void SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit );
virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
virtual sal_Int64 GetValue() const;
- virtual XubString CreateFieldText( sal_Int64 nValue ) const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
using NumericFormatter::GetCorrectedValue;
sal_Int64 GetCorrectedValue( FieldUnit eOutUnit ) const;
@@ -283,7 +283,7 @@
protected:
CurrencyFormatter();
- SAL_DLLPRIVATE sal_Bool ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr );
public:
~CurrencyFormatter();
@@ -294,7 +294,7 @@
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue() const;
- virtual XubString CreateFieldText( sal_Int64 nValue ) const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
};
@@ -324,12 +324,12 @@
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
- SAL_DLLPRIVATE sal_Bool ImplDateReformat( const XubString& rStr, XubString& rOutStr,
+ SAL_DLLPRIVATE sal_Bool ImplDateReformat( const OUString& rStr, OUString& rOutStr,
const AllSettings& rSettings );
SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
Selection* pNewSelection = NULL );
- SAL_DLLPRIVATE XubString ImplGetDateAsText( const Date& rDate,
- const AllSettings& rSettings ) const;
+ SAL_DLLPRIVATE OUString ImplGetDateAsText( const Date& rDate,
+ const AllSettings& rSettings ) const;
SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
CalendarWrapper& GetCalendarWrapper() const;
@@ -419,7 +419,7 @@
TimeFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const OUString& rStr, OUString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( const Time& rTime );
SAL_DLLPRIVATE void ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection = NULL
);
SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index ce1e7ec..0eba3a1 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -394,7 +394,7 @@
static
SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
const String& rOrigStr, sal_uInt16 nStyle,
- MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout& _rLayout );
+ MetricVector* pVector, OUString* pDisplayText,
::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout,
FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
@@ -575,7 +575,7 @@
void DrawText( const Point& rStartPt, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- MetricVector* pVector = NULL, String* pDisplayText = NULL );
+ MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
long GetTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN ) const;
/// Height where any character of the current font fits; in logic coordinates.
@@ -615,7 +615,7 @@
GDIMetaFile& rMtf );
void DrawText( const Rectangle& rRect,
const XubString& rStr, sal_uInt16 nStyle = 0,
- MetricVector* pVector = NULL, String* pDisplayText = NULL,
+ MetricVector* pVector = NULL, OUString* pDisplayText = NULL,
::vcl::ITextLayout* _pTextLayout = NULL );
Rectangle GetTextRect( const Rectangle& rRect,
const XubString& rStr, sal_uInt16 nStyle =
TEXT_DRAW_WORDBREAK,
@@ -625,7 +625,7 @@
sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector*
pVector = NULL, String* pDisplayText = NULL );
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector*
pVector = NULL, OUString* pDisplayText = NULL );
long GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN,
sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e2f8b76..a925ded 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -224,7 +224,7 @@
// -----------------------------------------------------------------------
-sal_uInt16 Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
+sal_uInt16 Button::ImplGetTextStyle( OUString& rText, WinBits nWinStyle,
sal_uLong nDrawFlags )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -260,9 +260,9 @@
sal_uInt16 nTextStyle, Rectangle *pSymbolRect,
bool bAddImageSep )
{
- XubString aText( GetText() );
+ OUString aText( GetText() );
sal_Bool bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
- sal_Bool bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
+ sal_Bool bDrawText = !aText.isEmpty() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT
);
sal_Bool bHasSymbol = pSymbolRect ? sal_True : sal_False;
// No text and no image => nothing to do => return
@@ -272,7 +272,7 @@
WinBits nWinStyle = GetStyle();
Rectangle aOutRect( rPos, rSize );
MetricVector *pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
- String *pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ OUString *pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
ImageAlign eImageAlign = mpButtonData->meImageAlign;
Size aImageSize = mpButtonData->maImage.GetSizePixel();
@@ -815,9 +815,9 @@
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aInRect = rRect;
Color aColor;
- XubString aText = PushButton::GetText(); // PushButton:: wegen MoreButton
- sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
- sal_uInt16 nStyle;
+ OUString aText = PushButton::GetText(); // PushButton:: because of MoreButton
+ sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
+ sal_uInt16 nStyle;
if( aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top() )
aInRect.SetEmpty();
@@ -851,7 +851,7 @@
{
long nSeparatorX = 0;
Rectangle aSymbolRect = aInRect;
- if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
+ if ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
// calculate symbol size
long nSymbolSize = pDev->GetTextHeight() / 2 + 1;
@@ -2136,10 +2136,10 @@
Rectangle& rMouseRect, bool bLayout )
{
WinBits nWinStyle = GetStyle();
- XubString aText( GetText() );
+ OUString aText( GetText() );
Rectangle aRect( rPos, rSize );
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects
: NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText
: NULL;
+ OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText
: NULL;
pDev->Push( PUSH_CLIPREGION );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
@@ -2147,7 +2147,7 @@
// no image radio button
if ( !maImage )
{
- if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
+ if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
@@ -2224,14 +2224,14 @@
}
else
{
- sal_Bool bTopImage = (nWinStyle & WB_TOP) != 0;
+ sal_Bool bTopImage = (nWinStyle & WB_TOP) != 0;
Size aImageSize = maImage.GetSizePixel();
Rectangle aImageRect( rPos, rSize );
long nTextHeight = pDev->GetTextHeight();
long nTextWidth = pDev->GetCtrlTextWidth( aText );
// calculate position and sizes
- if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
+ if ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
Size aTmpSize( (aImageSize.Width()+8), (aImageSize.Height()+8) );
if ( bTopImage )
@@ -3041,8 +3041,8 @@
nMaxWidth -= aSize.Width();
- XubString aText = GetText();
- if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
+ OUString aText = GetText();
+ if ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
// subtract what will be added later
nMaxWidth-=2;
@@ -3235,13 +3235,13 @@
Rectangle& rMouseRect, bool bLayout )
{
WinBits nWinStyle = GetStyle();
- XubString aText( GetText() );
+ OUString aText( GetText() );
pDev->Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
long nLineY = rPos.Y() + (rSize.Height()-1)/2;
- if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
+ if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
@@ -3949,8 +3949,8 @@
Size aSize = ImplGetCheckImageSize();
nMaxWidth -= aSize.Width();
- XubString aText = GetText();
- if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
+ OUString aText = GetText();
+ if ( !aText.isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
// subtract what will be added later
nMaxWidth-=2;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 845aba8..c5de9ca 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -187,7 +187,7 @@
long ControlLayoutData::GetLineCount() const
{
long nLines = m_aLineIndices.size();
- if( nLines == 0 && m_aDisplayText.Len() )
+ if( nLines == 0 && !m_aDisplayText.isEmpty() )
nLines = 1;
return nLines;
}
@@ -205,14 +205,14 @@
if( nLine+1 < nDisplayLines )
aPair.B() = m_aLineIndices[nLine+1]-1;
else
- aPair.B() = m_aDisplayText.Len()-1;
+ aPair.B() = m_aDisplayText.getLength()-1;
}
- else if( nLine == 0 && nDisplayLines == 0 && m_aDisplayText.Len() )
+ else if( nLine == 0 && nDisplayLines == 0 && !m_aDisplayText.isEmpty() )
{
// special case for single line controls so the implementations
// in that case do not have to fill in the line indices
aPair.A() = 0;
- aPair.B() = m_aDisplayText.Len()-1;
+ aPair.B() = m_aDisplayText.getLength()-1;
}
return aPair;
}
@@ -231,7 +231,7 @@
long ControlLayoutData::ToRelativeLineIndex( long nIndex ) const
{
// is the index sensible at all ?
- if( nIndex >= 0 && nIndex < m_aDisplayText.Len() )
+ if( nIndex >= 0 && nIndex < m_aDisplayText.getLength() )
{
int nDisplayLines = m_aLineIndices.size();
// if only 1 line exists, then absolute and relative index are
@@ -334,11 +334,11 @@
{
if( !rSubControl.HasLayoutData() )
rSubControl.FillLayoutData();
- if( !rSubControl.HasLayoutData() ||
!rSubControl.mpControlData->mpLayoutData->m_aDisplayText.Len() )
+ if( !rSubControl.HasLayoutData() ||
rSubControl.mpControlData->mpLayoutData->m_aDisplayText.isEmpty() )
return;
- long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.Len();
- mpControlData->mpLayoutData->m_aDisplayText.Append(
rSubControl.mpControlData->mpLayoutData->m_aDisplayText );
+ long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.getLength();
+ mpControlData->mpLayoutData->m_aDisplayText +=
rSubControl.mpControlData->mpLayoutData->m_aDisplayText;
int nLines = rSubControl.mpControlData->mpLayoutData->m_aLineIndices.size();
int n;
mpControlData->mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
@@ -520,8 +520,8 @@
// -----------------------------------------------------------------
-void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const
XubString& _rStr,
- sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
+void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const OUString&
_rStr,
+ sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText ) const
{
#ifdef FS_DEBUG
if ( !_pVector )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 80ed748..69ac949 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -562,7 +562,7 @@
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
MetricVector* pVector = &mpControlData->mpLayoutData->m_aUnicodeBoundRects;
- String* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
+ OUString* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
DrawText( aPos, aText, nStart, nEnd - nStart, pVector, pDisplayText );
@@ -1992,7 +1992,7 @@
}
}
- XubString aText = ImplGetText();
+ OUString aText = ImplGetText();
long nTextHeight = pDev->GetTextHeight();
long nTextWidth = pDev->GetTextWidth( aText );
long nOnePixel = GetDrawPixel( pDev, 1 );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 387acea..e632b4a 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -89,29 +89,29 @@
// -----------------------------------------------------------------------
-static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
+static sal_Bool ImplNumericGetValue( const OUString& rStr, double& rValue,
sal_uInt16 nDecDigits, const LocaleDataWrapper&
rLocaleDataWrappper,
sal_Bool bCurrency = sal_False )
{
- XubString aStr = rStr;
- XubString aStr1;
+ OUString aStr = rStr;
+ OUString aStr1;
rtl::OUStringBuffer aStr2;
sal_Bool bNegative = sal_False;
- xub_StrLen nDecPos;
+ sal_Int32 nDecPos;
// react on empty string
- if ( !rStr.Len() )
+ if ( rStr.isEmpty() )
return sal_False;
// remove leading and trailing spaces
- aStr = string::strip(aStr, ' ');
+ aStr = aStr.trim();
// find position of decimal point
- nDecPos = aStr.Search( rLocaleDataWrappper.getNumDecimalSep() );
- if ( nDecPos != STRING_NOTFOUND )
+ nDecPos = aStr.indexOf( rLocaleDataWrappper.getNumDecimalSep() );
+ if ( nDecPos >= 0)
{
- aStr1 = aStr.Copy( 0, nDecPos );
- aStr2.append(aStr.Copy(nDecPos+1));
+ aStr1 = aStr.copy( 0, nDecPos );
+ aStr2.append(aStr.getStr()+nDecPos+1);
}
else
aStr1 = aStr;
@@ -119,32 +119,32 @@
// negative?
if ( bCurrency )
{
- if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
+ if ( aStr.startsWith("(") && aStr.endsWith(")") )
bNegative = sal_True;
if ( !bNegative )
{
- for (xub_StrLen i=0; i < aStr.Len(); i++ )
+ for (sal_Int32 i=0; i < aStr.getLength(); i++ )
{
- if ( (aStr.GetChar( i ) >= '0') && (aStr.GetChar( i ) <= '9') )
+ if ( (aStr[i] >= '0') && (aStr[i] <= '9') )
break;
- else if ( aStr.GetChar( i ) == '-' )
+ else if ( aStr[i] == '-' )
{
bNegative = sal_True;
break;
}
}
}
- if ( !bNegative && bCurrency && aStr.Len() )
+ if ( !bNegative && bCurrency && !aStr.isEmpty() )
{
sal_uInt16 nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
- if ( (nFormat == 3) || (nFormat == 6) ||
- (nFormat == 7) || (nFormat == 10) )
+ if ( (nFormat == 3) || (nFormat == 6) || // $1- || 1-$
+ (nFormat == 7) || (nFormat == 10) ) // 1$- || 1 $-
{
- for (xub_StrLen i = (xub_StrLen)(aStr.Len()-1); i > 0; i++ )
+ for (sal_Int32 i = aStr.getLength()-1; i > 0; i++ )
{
- if ( (aStr.GetChar( i ) >= '0') && (aStr.GetChar( i ) <= '9') )
+ if ( (aStr[i] >= '0') && (aStr[i] <= '9') )
break;
- else if ( aStr.GetChar( i ) == '-' )
+ else if ( aStr[i] == '-' )
{
bNegative = sal_True;
break;
@@ -155,18 +155,20 @@
}
else
{
- if ( aStr1.GetChar( 0 ) == '-' )
+ if ( aStr1.startsWith("-"))
bNegative = sal_True;
}
// remove all unwanted charaters
- for (xub_StrLen i=0; i < aStr1.Len(); )
+ OUStringBuffer tmpStr(aStr1);
+ for (sal_Int32 i=0; i < tmpStr.getLength(); )
{
- if ( (aStr1.GetChar( i ) >= '0') && (aStr1.GetChar( i ) <= '9') )
+ if ( (tmpStr[i] >= '0') && (tmpStr[i] <= '9') )
i++;
else
- aStr1.Erase( i, 1 );
+ tmpStr.remove( i, 1 );
}
+ aStr1 = tmpStr.makeStringAndClear();
for (sal_Int32 i=0; i < aStr2.getLength(); )
{
if ((aStr2[i] >= '0') && (aStr2[i] <= '9'))
@@ -175,13 +177,13 @@
aStr2.remove(i, 1);
}
- if ( !aStr1.Len() && !aStr2.getLength() )
+ if ( aStr1.isEmpty() && !aStr2.getLength() )
return sal_False;
- if ( !aStr1.Len() )
- aStr1.Insert( '0' );
+ if ( aStr1.isEmpty() )
+ aStr1 = "0";
if ( bNegative )
- aStr1.Insert( '-', 0 );
+ aStr1 = "-" + aStr1;
// prune and round fraction
bool bRound = false;
@@ -430,8 +432,8 @@
// -----------------------------------------------------------------------
-sal_Bool NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
- XubString& rOutStr )
+sal_Bool NumericFormatter::ImplNumericReformat( const OUString& rStr, double& rValue,
+ OUString& rOutStr )
{
if ( !ImplNumericGetValue( rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
return sal_True;
@@ -596,9 +598,9 @@
// -----------------------------------------------------------------------
-XubString NumericFormatter::CreateFieldText( sal_Int64 nValue ) const
+OUString NumericFormatter::CreateFieldText( sal_Int64 nValue ) const
{
- return ImplGetLocaleDataWrapper().getNum( nValue, GetDecimalDigits(), IsUseThousandSep(),
IsShowTrailingZeros() );
+ return OUString(ImplGetLocaleDataWrapper().getNum( nValue, GetDecimalDigits(),
IsUseThousandSep(), IsShowTrailingZeros() ));
}
// -----------------------------------------------------------------------
@@ -691,7 +693,7 @@
if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
return;
- XubString aStr;
+ OUString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
sal_Bool bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
@@ -699,7 +701,7 @@
if ( !bOK )
return;
- if ( aStr.Len() )
+ if ( !aStr.isEmpty() )
ImplSetText( aStr );
else
SetValue( mnLastValue );
@@ -1055,7 +1057,7 @@
void NumericBox::ReformatAll()
{
double nValue;
- XubString aStr;
+ OUString aStr;
SetUpdateMode( sal_False );
sal_uInt16 nEntryCount = GetEntryCount();
for ( sal_uInt16 i=0; i < nEntryCount; i++ )
@@ -1108,7 +1110,7 @@
// #104355# support localized mesaurements
-static const String& ImplMetricToString( FieldUnit rUnit )
+static const OUString ImplMetricToString( FieldUnit rUnit )
{
FieldUnitStringList* pList = ImplGetFieldUnits();
if( pList )
@@ -1121,7 +1123,7 @@
}
}
- return String::EmptyString();
+ return OUString();
}
static FieldUnit ImplStringToMetric(const rtl::OUString &rMetricString)
@@ -1130,11 +1132,11 @@
if( pList )
{
// return FieldUnit
- rtl::OUString aStr(rMetricString.toAsciiLowerCase());
+ OUString aStr(rMetricString.toAsciiLowerCase());
aStr = string::remove(aStr, ' ');
for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
{
- if ( it->first.Equals( aStr ) )
+ if ( it->first == aStr )
return it->second;
}
}
@@ -1437,7 +1439,7 @@
// -----------------------------------------------------------------------
-sal_Bool MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString&
rOutStr )
+sal_Bool MetricFormatter::ImplMetricReformat( const OUString& rStr, double& rValue, OUString&
rOutStr )
{
if ( !ImplMetricGetValue( rStr, rValue, mnBaseValue, GetDecimalDigits(),
ImplGetLocaleDataWrapper(), meUnit ) )
return sal_True;
@@ -1540,9 +1542,9 @@
// -----------------------------------------------------------------------
-XubString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
+OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
{
- XubString aStr = NumericFormatter::CreateFieldText( nValue );
+ OUString aStr = NumericFormatter::CreateFieldText( nValue );
if( meUnit == FUNIT_CUSTOM )
aStr += maCustomUnitText;
@@ -1659,11 +1661,11 @@
if ( !GetField() )
return;
- XubString aText = GetField()->GetText();
+ OUString aText = GetField()->GetText();
if ( meUnit == FUNIT_CUSTOM )
maCurUnitText = ImplMetricGetUnitText( aText );
- XubString aStr;
+ OUString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
sal_Bool bOK = ImplMetricReformat( aText, nTemp, aStr );
@@ -1672,7 +1674,7 @@
if ( !bOK )
return;
- if ( aStr.Len() )
+ if ( !aStr.isEmpty() )
{
ImplSetText( aStr );
if ( meUnit == FUNIT_CUSTOM )
@@ -1680,7 +1682,7 @@
}
else
SetValue( mnLastValue );
- maCurUnitText.Erase();
+ maCurUnitText = OUString();
}
// -----------------------------------------------------------------------
@@ -1998,7 +2000,7 @@
void MetricBox::ReformatAll()
{
double nValue;
- XubString aStr;
+ OUString aStr;
SetUpdateMode( sal_False );
sal_uInt16 nEntryCount = GetEntryCount();
for ( sal_uInt16 i=0; i < nEntryCount; i++ )
@@ -2089,8 +2091,7 @@
// -----------------------------------------------------------------------
-sal_Bool CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
- XubString& rOutStr )
+sal_Bool CurrencyFormatter::ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr )
{
double nValue;
if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(),
sal_True ) )
@@ -2159,7 +2160,7 @@
// -----------------------------------------------------------------------
-XubString CurrencyFormatter::CreateFieldText( sal_Int64 nValue ) const
+OUString CurrencyFormatter::CreateFieldText( sal_Int64 nValue ) const
{
return ImplGetLocaleDataWrapper().getCurr( nValue, GetDecimalDigits(), GetCurrencySymbol(),
IsUseThousandSep() );
}
@@ -2192,12 +2193,12 @@
if ( !GetField() )
return;
- XubString aStr;
+ OUString aStr;
sal_Bool bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
- if ( aStr.Len() )
+ if ( !aStr.isEmpty() )
{
ImplSetText( aStr );
// caution: precision loss in double cast
@@ -2385,7 +2386,7 @@
void CurrencyBox::ReformatAll()
{
- XubString aStr;
+ OUString aStr;
SetUpdateMode( sal_False );
sal_uInt16 nEntryCount = GetEntryCount();
for ( sal_uInt16 i=0; i < nEntryCount; i++ )
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index c56a42a..6374b69 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1189,7 +1189,7 @@
// -----------------------------------------------------------------------
-sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const
AllSettings& rSettings )
+sal_Bool DateFormatter::ImplDateReformat( const OUString& rStr, OUString& rOutStr, const
AllSettings& rSettings )
{
Date aDate( 0, 0, 0 );
if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(),
GetCalendarWrapper(), GetFieldSettings() ) )
@@ -1220,8 +1220,8 @@
// -----------------------------------------------------------------------
-XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
- const AllSettings& ) const
+OUString DateFormatter::ImplGetDateAsText( const Date& rDate,
+ const AllSettings& ) const
{
sal_Bool bShowCentury = sal_False;
switch ( GetExtDateFormat() )
@@ -1840,12 +1840,12 @@
if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
return;
- XubString aStr;
+ OUString aStr;
sal_Bool bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
if( !bOK )
return;
- if ( aStr.Len() )
+ if ( !aStr.isEmpty() )
{
ImplSetText( aStr );
ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(sal_True),
ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
@@ -2139,7 +2139,7 @@
void DateBox::ReformatAll()
{
- XubString aStr;
+ OUString aStr;
SetUpdateMode( sal_False );
sal_uInt16 nEntryCount = GetEntryCount();
for ( sal_uInt16 i=0; i < nEntryCount; i++ )
@@ -2422,7 +2422,7 @@
// -----------------------------------------------------------------------
-sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
+sal_Bool TimeFormatter::ImplTimeReformat( const OUString& rStr, OUString& rOutStr )
{
Time aTime( 0, 0, 0 );
if ( !ImplTimeGetValue( rStr, aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
@@ -2458,11 +2458,11 @@
sal_uLong n = aTempTime.GetHour() * 3600L;
n += aTempTime.GetMin() * 60L;
n += aTempTime.GetSec();
- rOutStr = String::CreateFromInt32( n );
+ rOutStr = OUString::number( n );
rOutStr += ImplGetLocaleDataWrapper().getTime100SecSep();
if ( aTempTime.Get100Sec() < 10 )
- rOutStr += '0';
- rOutStr += String::CreateFromInt32( aTempTime.Get100Sec() );
+ rOutStr += "0";
+ rOutStr += OUString::number( aTempTime.Get100Sec() );
}
else if ( mbDuration )
rOutStr = ImplGetLocaleDataWrapper().getDuration( aTempTime, bSecond, b100Sec );
@@ -2832,12 +2832,12 @@
if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
return;
- XubString aStr;
+ OUString aStr;
sal_Bool bOK = ImplTimeReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
- if ( aStr.Len() )
+ if ( !aStr.isEmpty() )
{
ImplSetText( aStr );
ImplTimeGetValue( aStr, maLastTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper()
);
@@ -3126,7 +3126,7 @@
void TimeBox::ReformatAll()
{
- XubString aStr;
+ OUString aStr;
SetUpdateMode( sal_False );
sal_uInt16 nEntryCount = GetEntryCount();
for ( sal_uInt16 i=0; i < nEntryCount; i++ )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index ca7b2e8..3c5346d 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -264,7 +264,7 @@
nTextStyle |= TEXT_DRAW_MONO;
if( bFillLayout )
- mpControlData->mpLayoutData->m_aDisplayText = String();
+ mpControlData->mpLayoutData->m_aDisplayText = OUString();
Rectangle aRect( Rectangle( aPos, rSize ) );
DrawControlText( *pDev, aRect, aText, nTextStyle,
@@ -599,7 +599,7 @@
String aText = GetText();
WinBits nWinStyle = GetStyle();
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects
: NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText
: NULL;
+ OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText
: NULL;
DecorationView aDecoView( this );
if ( !aText.Len() )
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 999ccfe..5b345d6 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -207,7 +207,7 @@
}
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DrawControlText( *pDev, aRect, aText, nTextStyle, pVector, pDisplayText );
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index f070206..2425147 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1866,7 +1866,7 @@
if( bDrawText )
{
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects :
NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
XubString aStr( mpEntryList->GetEntryText( nPos ) );
if ( aStr.Len() )
{
@@ -1886,7 +1886,7 @@
}
if( bLayout )
- mpControlData->mpLayoutData->m_aLineIndices.push_back(
mpControlData->mpLayoutData->m_aDisplayText.Len() );
+ mpControlData->mpLayoutData->m_aLineIndices.push_back(
mpControlData->mpLayoutData->m_aDisplayText.getLength() );
// pb: #106948# explicit mirroring for calc
if ( mbMirroring )
@@ -2942,7 +2942,7 @@
}
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects :
NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DrawText( aTextRect, maString, nTextStyle, pVector, pDisplayText );
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 02ac533..28c81af 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -880,7 +880,7 @@
if( bLayout )
{
int nLine = mpControlData->mpLayoutData->m_aLineIndices.size();
- mpControlData->mpLayoutData->m_aLineIndices.push_back(
mpControlData->mpLayoutData->m_aDisplayText.Len() );
+ mpControlData->mpLayoutData->m_aLineIndices.push_back(
mpControlData->mpLayoutData->m_aDisplayText.getLength() );
mpTabCtrlData->maLayoutPageIdToLine[ (int)pItem->mnId ] = nLine;
mpTabCtrlData->maLayoutLineToPageId[ nLine ] = (int)pItem->mnId;
mpTabCtrlData->maTabRectangles.push_back( aRect );
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e5d22a3..741ddbb 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5645,7 +5645,7 @@
void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- MetricVector* pVector, String* pDisplayText
+ MetricVector* pVector, OUString* pDisplayText
)
{
if( mpOutDevData && mpOutDevData->mpRecordLayout )
@@ -5671,7 +5671,7 @@
aClip.Intersect( Rectangle( Point(), GetOutputSize() ) );
if( mpOutDevData && mpOutDevData->mpRecordLayout )
{
- mpOutDevData->mpRecordLayout->m_aLineIndices.push_back(
mpOutDevData->mpRecordLayout->m_aDisplayText.Len() );
+ mpOutDevData->mpRecordLayout->m_aLineIndices.push_back(
mpOutDevData->mpRecordLayout->m_aDisplayText.getLength() );
aClip.Intersect( mpOutDevData->maRecordRect );
}
if( ! aClip.IsNull() )
@@ -5698,7 +5698,7 @@
{
pVector->push_back( *it );
if( pDisplayText )
- pDisplayText->Append( rStr.GetChar( nIndex ) );
+ *pDisplayText += OUString(rStr.GetChar( nIndex ));
bInserted = true;
}
}
@@ -5707,7 +5707,7 @@
{
GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, *pVector );
if( pDisplayText )
- pDisplayText->Append( rStr.Copy( nIndex, nLen ) );
+ *pDisplayText += rStr.Copy( nIndex, nLen );
}
}
@@ -6453,7 +6453,7 @@
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
const String& rOrigStr, sal_uInt16 nStyle,
- MetricVector* pVector, String* pDisplayText,
+ MetricVector* pVector, OUString* pDisplayText,
::vcl::ITextLayout& _rLayout )
{
Color aOldTextColor;
@@ -6761,7 +6761,7 @@
// -----------------------------------------------------------------------
void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle,
- MetricVector* pVector, String* pDisplayText,
+ MetricVector* pVector, OUString* pDisplayText,
::vcl::ITextLayout* _pTextLayout )
{
if( mpOutDevData && mpOutDevData->mpRecordLayout )
@@ -7087,7 +7087,7 @@
void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- sal_uInt16 nStyle, MetricVector* pVector, String* pDisplayText )
+ sal_uInt16 nStyle, MetricVector* pVector, OUString* pDisplayText )
{
OSL_TRACE( "OutputDevice::DrawCtrlText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index d6d5b03..81dc881 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -57,7 +57,7 @@
//--------------------------------------------------------------------
void DefaultTextLayout::DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex,
- xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText )
+ xub_StrLen _nLength, MetricVector* _pVector, OUString* _pDisplayText )
{
m_rTargetDevice.DrawText( _rStartPoint, _rText, _nStartIndex, _nLength, _pVector,
_pDisplayText );
}
@@ -92,7 +92,7 @@
// ITextLayout
virtual long GetTextWidth( const XubString& rStr, xub_StrLen nIndex, xub_StrLen
nLen ) const;
- virtual void DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText );
+ virtual void DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, OUString* _pDisplayText );
virtual bool GetCaretPositions( const XubString& _rText, sal_Int32* _pCaretXArray,
xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
virtual xub_StrLen GetTextBreak( const XubString& _rText, long _nMaxTextWidth, xub_StrLen
_nStartIndex, xub_StrLen _nLength ) const;
virtual bool DecomposeTextRectAction() const;
@@ -100,7 +100,7 @@
public:
// equivalents to the respective OutputDevice methods, which take the reference device
into account
long GetTextArray( const XubString& _rText, sal_Int32* _pDXAry, xub_StrLen
_nStartIndex, xub_StrLen _nLength ) const;
- Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16
_nStyle, MetricVector* _pVector, String* _pDisplayText );
+ Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16
_nStyle, MetricVector* _pVector, OUString* _pDisplayText );
protected:
void onBeginDrawText()
@@ -230,7 +230,7 @@
}
//--------------------------------------------------------------------
- void ReferenceDeviceTextLayout::DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, String* _pDisplayText )
+ void ReferenceDeviceTextLayout::DrawText( const Point& _rStartPoint, const XubString& _rText,
xub_StrLen _nStartIndex, xub_StrLen _nLength, MetricVector* _pVector, OUString* _pDisplayText )
{
if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
return;
@@ -242,7 +242,7 @@
::std::copy(
aGlyphBounds.begin(), aGlyphBounds.end(),
::std::insert_iterator< MetricVector > ( *_pVector, _pVector->end() ) );
- _pDisplayText->Append( _rText.Copy( _nStartIndex, _nLength ) );
+ *_pDisplayText += _rText.Copy( _nStartIndex, _nLength );
return;
}
@@ -284,7 +284,7 @@
}
//--------------------------------------------------------------------
- Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString&
_rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText )
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString&
_rText, sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText )
{
if ( !_rText.Len() )
return Rectangle();
@@ -351,7 +351,7 @@
//--------------------------------------------------------------------
Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText,
sal_uInt16 _nStyle,
- MetricVector* _pVector, String* _pDisplayText )
+ MetricVector* _pVector, OUString* _pDisplayText )
{
return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a163041..64974dc 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2808,10 +2808,10 @@
if ( pData->bIsTemporary )
nStyle |= TEXT_DRAW_DISABLE;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
if( bLayout )
{
- mpLayoutData->m_aLineIndices.push_back( mpLayoutData->m_aDisplayText.Len()
);
+ mpLayoutData->m_aLineIndices.push_back(
mpLayoutData->m_aDisplayText.getLength() );
mpLayoutData->m_aLineItemIds.push_back( pData->nId );
mpLayoutData->m_aLineItemPositions.push_back( n );
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 69585dc..2e7bddf 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3016,7 +3016,7 @@
ImplToolItem* pItem = &mpData->m_aItems[nPos];
MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
+ OUString* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
if(!pItem->mbEnabled)
nHighlight = 0;
@@ -3116,7 +3116,7 @@
bClip = sal_False;
if( bLayout )
{
- mpData->m_pLayoutData->m_aLineIndices.push_back(
mpData->m_pLayoutData->m_aDisplayText.Len() );
+ mpData->m_pLayoutData->m_aLineIndices.push_back(
mpData->m_pLayoutData->m_aDisplayText.getLength() );
mpData->m_pLayoutData->m_aLineItemIds.push_back( pItem->mnId );
mpData->m_pLayoutData->m_aLineItemPositions.push_back( nPos );
}
@@ -3284,7 +3284,7 @@
nTextStyle |= TEXT_DRAW_DISABLE;
if( bLayout )
{
- mpData->m_pLayoutData->m_aLineIndices.push_back(
mpData->m_pLayoutData->m_aDisplayText.Len() );
+ mpData->m_pLayoutData->m_aLineIndices.push_back(
mpData->m_pLayoutData->m_aDisplayText.getLength() );
mpData->m_pLayoutData->m_aLineItemIds.push_back( pItem->mnId );
mpData->m_pLayoutData->m_aLineItemPositions.push_back( nPos );
}
--
To view, visit https://gerrit.libreoffice.org/2011
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a44bab196ae239d3bdea75fd2b657bdfa4ecf31
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christina Roßmanith <ChrRossmanith@web.de>
Context
- [PATCH] replace (Xub)String with OUString in vcl · via Code Review
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.