summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-11 17:00:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-12 08:32:59 +0100
commit9dd40c656feda2ccadb07d618a95b9ff63ab61ff (patch)
tree84b5e0e3bd48909413c074d52c4bc08a46cfabce /vcl/source
parent3e9ae4da947cd9c3f75b6e4942f2ba52337df075 (diff)
XubString->OUString
Change-Id: I04c7da143425a9d8cc4fae155ad45a469df953c1
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/edit.cxx6
-rw-r--r--vcl/source/control/group.cxx8
-rw-r--r--vcl/source/control/lstbox.cxx22
-rw-r--r--vcl/source/edit/textdoc.cxx15
-rw-r--r--vcl/source/edit/textdoc.hxx6
-rw-r--r--vcl/source/edit/texteng.cxx35
-rw-r--r--vcl/source/edit/textund2.hxx8
-rw-r--r--vcl/source/edit/textundo.cxx18
-rw-r--r--vcl/source/edit/textview.cxx6
-rw-r--r--vcl/source/edit/xtextedt.cxx14
-rw-r--r--vcl/source/gdi/print2.cxx22
-rw-r--r--vcl/source/window/cmdevt.cxx14
-rw-r--r--vcl/source/window/dlgctrl.cxx10
-rw-r--r--vcl/source/window/menu.cxx114
-rw-r--r--vcl/source/window/splitwin.cxx2
-rw-r--r--vcl/source/window/status.cxx14
-rw-r--r--vcl/source/window/toolbox.cxx8
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/winproc.cxx18
19 files changed, 169 insertions, 175 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index ffd256a8e729..fe5f8b363c7f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2227,8 +2227,8 @@ void Edit::Command( const CommandEvent& rCEvt )
maText.insert( mpIMEInfos->nPos, pData->GetText() );
if ( mpIMEInfos->bWasCursorOverwrite )
{
- sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen;
- sal_uInt16 nNewIMETextLen = pData->GetText().Len();
+ sal_Int32 nOldIMETextLen = mpIMEInfos->nLen;
+ sal_Int32 nNewIMETextLen = pData->GetText().getLength();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) )
{
@@ -2250,7 +2250,7 @@ void Edit::Command( const CommandEvent& rCEvt )
if ( pData->GetTextAttr() )
{
- mpIMEInfos->CopyAttribs( pData->GetTextAttr(), pData->GetText().Len() );
+ mpIMEInfos->CopyAttribs( pData->GetTextAttr(), pData->GetText().getLength() );
mpIMEInfos->bCursor = pData->IsCursorVisible();
}
else
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 5b345d6b8bdf..0e97fecc58e4 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -127,7 +127,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
long nTop;
long nTextOff;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- XubString aText( GetText() );
+ OUString aText( GetText() );
Rectangle aRect( rPos, rSize );
sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
@@ -153,7 +153,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
nDrawFlags |= WINDOW_DRAW_MONO;
}
- if ( !aText.Len() )
+ if (aText.isEmpty())
{
nTop = rPos.Y();
nTextOff = 0;
@@ -175,7 +175,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
else
pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- if ( !aText.Len() )
+ if (aText.isEmpty())
pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) );
else
{
@@ -193,7 +193,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if ( !bIsPrinter && !(nDrawFlags & WINDOW_DRAW_MONO) )
{
pDev->SetLineColor( rStyleSettings.GetLightColor() );
- if ( !aText.Len() )
+ if (aText.isEmpty())
pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( rPos.X()+rSize.Width()-3, nTop+1 ) );
else
{
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index f72b2a2a9dac..25d99146592f 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -431,11 +431,11 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
if ( IsDropDownBox() )
{
- XubString aText = GetSelectEntry();
- long nTextHeight = pDev->GetTextHeight();
- long nTextWidth = pDev->GetTextWidth( aText );
- long nOffX = 3*nOnePixel;
- long nOffY = (aSize.Height()-nTextHeight) / 2;
+ OUString aText = GetSelectEntry();
+ long nTextHeight = pDev->GetTextHeight();
+ long nTextWidth = pDev->GetTextWidth( aText );
+ long nOffX = 3*nOnePixel;
+ long nOffY = (aSize.Height()-nTextHeight) / 2;
// Clipping?
if ( (nOffY < 0) ||
@@ -1012,7 +1012,7 @@ void ListBox::SetNoSelection()
}
-sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
+sal_uInt16 ListBox::InsertEntry( const OUString& rStr, sal_uInt16 nPos )
{
sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
@@ -1030,7 +1030,7 @@ sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
}
-sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
+sal_uInt16 ListBox::InsertEntry( const OUString& rStr, const Image& rImage, sal_uInt16 nPos )
{
sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
@@ -1039,7 +1039,7 @@ sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal
}
-void ListBox::RemoveEntry( const XubString& rStr )
+void ListBox::RemoveEntry( const OUString& rStr )
{
RemoveEntry( GetEntryPos( rStr ) );
}
@@ -1060,7 +1060,7 @@ Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
}
-sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
+sal_uInt16 ListBox::GetEntryPos( const OUString& rStr ) const
{
sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -1078,7 +1078,7 @@ sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
}
-XubString ListBox::GetEntry( sal_uInt16 nPos ) const
+OUString ListBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
@@ -1127,7 +1127,7 @@ sal_Bool ListBox::IsEntryPosSelected( sal_uInt16 nPos ) const
}
-void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
+void ListBox::SelectEntry( const OUString& rStr, sal_Bool bSelect )
{
SelectEntryPos( GetEntryPos( rStr ), bSelect );
}
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index 5ef6cf13dec5..3a2d3499d297 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -458,7 +458,7 @@ void TextDoc::DestroyTextNodes()
maTextNodes.clear();
}
-String TextDoc::GetText( const sal_Unicode* pSep ) const
+OUString TextDoc::GetText( const sal_Unicode* pSep ) const
{
sal_uLong nLen = GetTextLen( pSep );
sal_uLong nNodes = maTextNodes.Count();
@@ -483,9 +483,10 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
return aASCIIText;
}
-XubString TextDoc::GetText( sal_uLong nPara ) const
+OUString TextDoc::GetText( sal_uLong nPara ) const
{
- XubString aText;
+ OUString aText;
+
TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0;
if ( pNode )
aText = pNode->GetText();
@@ -541,15 +542,15 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, sal_Unicode c )
return aPaM;
}
-TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr )
+TextPaM TextDoc::InsertText( const TextPaM& rPaM, const OUString& rStr )
{
- DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
- DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+ DBG_ASSERT( rStr.indexOf( 0x0A ) == -1, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+ DBG_ASSERT( rStr.indexOf( 0x0D ) == -1, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
pNode->InsertText( rPaM.GetIndex(), rStr );
- TextPaM aPaM( rPaM.GetPara(), rPaM.GetIndex()+rStr.Len() );
+ TextPaM aPaM( rPaM.GetPara(), rPaM.GetIndex()+rStr.getLength() );
return aPaM;
}
diff --git a/vcl/source/edit/textdoc.hxx b/vcl/source/edit/textdoc.hxx
index 85d94dedd6af..bced05ddf613 100644
--- a/vcl/source/edit/textdoc.hxx
+++ b/vcl/source/edit/textdoc.hxx
@@ -116,14 +116,14 @@ public:
TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars );
TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c );
- TextPaM InsertText( const TextPaM& rPaM, const String& rStr );
+ TextPaM InsertText( const TextPaM& rPaM, const OUString& rStr );
TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs );
TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight );
sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
- String GetText( const sal_Unicode* pSep ) const;
- String GetText( sal_uLong nPara ) const;
+ OUString GetText( const sal_Unicode* pSep ) const;
+ OUString GetText( sal_uLong nPara ) const;
void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; }
sal_uInt16 GetLeftMargin() const { return mnLeftMargin; }
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 14c864fab2bb..4974957f4b44 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -492,7 +492,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndo
{
// attributes have to be saved for UNDO before RemoveChars!
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
- XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
+ OUString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
// check if attributes are being deleted or changed
sal_uInt16 nStart = rPaM.GetIndex();
@@ -707,7 +707,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
// the text that needs to be checked is only the one
// before the current cursor position
- OUString aOldText( mpDoc->GetText( aPaM.GetPara() ).Copy(0, nTmpPos) );
+ OUString aOldText( mpDoc->GetText( aPaM.GetPara() ).copy(0, nTmpPos) );
OUString aNewText( aOldText );
if (aCTLOptions.IsCTLSequenceCheckingTypeAndReplace())
{
@@ -770,7 +770,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
}
-TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const OUString& rStr )
{
UndoActionStart();
@@ -781,40 +781,35 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
else
aPaM = rCurSel.GetEnd();
- XubString aText(convertLineEnd(rStr, LINEEND_LF));
+ OUString aText(convertLineEnd(rStr, LINEEND_LF));
- sal_uInt16 nStart = 0;
- while ( nStart < aText.Len() )
+ sal_Int32 nStart = 0;
+ while ( nStart < aText.getLength() )
{
- sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart );
- if ( nEnd == STRING_NOTFOUND )
- nEnd = aText.Len(); // do not dereference!
+ sal_Int32 nEnd = aText.indexOf( LINE_SEP, nStart );
+ if (nEnd == -1)
+ nEnd = aText.getLength(); // do not dereference!
// Start == End => empty line
if ( nEnd > nStart )
{
sal_uLong nL = aPaM.GetIndex();
nL += ( nEnd-nStart );
- if ( nL > STRING_MAXLEN )
- {
- sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN);
- nEnd = nEnd - nDiff;
- }
- XubString aLine( aText, nStart, nEnd-nStart );
+ OUString aLine(aText.copy(nStart, nEnd-nStart));
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo( new TextUndoInsertChars( this, aPaM, aLine ) );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( aPaM.GetPara() );
- pPortion->MarkInvalid( aPaM.GetIndex(), aLine.Len() );
- if ( aLine.Search( '\t' ) != STRING_NOTFOUND )
+ pPortion->MarkInvalid( aPaM.GetIndex(), aLine.getLength() );
+ if (aLine.indexOf( '\t' ) != -1)
pPortion->SetNotSimpleInvalid();
aPaM = mpDoc->InsertText( aPaM, aLine );
- ImpCharsInserted( aPaM.GetPara(), aPaM.GetIndex()-aLine.Len(), aLine.Len() );
+ ImpCharsInserted( aPaM.GetPara(), aPaM.GetIndex()-aLine.getLength(), aLine.getLength() );
}
- if ( nEnd < aText.Len() )
+ if ( nEnd < aText.getLength() )
aPaM = ImpInsertParaBreak( aPaM );
nStart = nEnd+1;
@@ -1352,7 +1347,7 @@ void TextEngine::UndoActionStart( sal_uInt16 nId )
if ( IsUndoEnabled() && !IsInUndo() )
{
String aComment;
- GetUndoManager().EnterListAction( aComment, XubString(), nId );
+ GetUndoManager().EnterListAction( aComment, OUString(), nId );
}
}
diff --git a/vcl/source/edit/textund2.hxx b/vcl/source/edit/textund2.hxx
index e8138056ab5c..0678e5923971 100644
--- a/vcl/source/edit/textund2.hxx
+++ b/vcl/source/edit/textund2.hxx
@@ -82,11 +82,11 @@ class TextUndoInsertChars : public TextUndo
{
private:
TextPaM maTextPaM;
- String maText;
+ OUString maText;
public:
TYPEINFO();
- TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
+ TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const OUString& rStr );
virtual void Undo();
virtual void Redo();
@@ -101,11 +101,11 @@ class TextUndoRemoveChars : public TextUndo
{
private:
TextPaM maTextPaM;
- String maText;
+ OUString maText;
public:
TYPEINFO();
- TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
+ TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const OUString& rStr );
virtual void Undo();
virtual void Redo();
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index 324306c5b480..0e218af8a108 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -224,7 +224,7 @@ void TextUndoConnectParas::Redo()
OUString TextUndoConnectParas::GetComment () const
{
- return ResId(STR_TEXTUNDO_CONNECTPARAS, *ImplGetResMgr());
+ return ResId(STR_TEXTUNDO_CONNECTPARAS, *ImplGetResMgr()).toString();
}
TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
@@ -255,7 +255,7 @@ OUString TextUndoSplitPara::GetComment () const
return ResId(STR_TEXTUNDO_SPLITPARA, *ImplGetResMgr());
}
-TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
+TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const OUString& rStr )
: TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
@@ -264,7 +264,7 @@ TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM
void TextUndoInsertChars::Undo()
{
TextSelection aSel( maTextPaM, maTextPaM );
- aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.Len();
+ aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.getLength();
TextPaM aPaM = GetTextEngine()->ImpDeleteText( aSel );
SetSelection( aPaM );
}
@@ -274,7 +274,7 @@ void TextUndoInsertChars::Redo()
TextSelection aSel( maTextPaM, maTextPaM );
GetTextEngine()->ImpInsertText( aSel, maText );
TextPaM aNewPaM( maTextPaM );
- aNewPaM.GetIndex() = aNewPaM.GetIndex() + maText.Len();
+ aNewPaM.GetIndex() = aNewPaM.GetIndex() + maText.getLength();
SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) );
}
@@ -288,7 +288,7 @@ bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() )
return false;
- if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() )
+ if ( ( maTextPaM.GetIndex() + maText.getLength() ) == pNext->maTextPaM.GetIndex() )
{
maText += pNext->maText;
return true;
@@ -301,10 +301,10 @@ OUString TextUndoInsertChars::GetComment () const
// multiple lines?
OUString sText(maText);
Shorten(sText);
- return OUString(ResId(STR_TEXTUNDO_INSERTCHARS, *ImplGetResMgr())).replaceAll("$1", sText);
+ return ResId(STR_TEXTUNDO_INSERTCHARS, *ImplGetResMgr()).toString().replaceAll("$1", sText);
}
-TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
+TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const OUString& rStr )
: TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
@@ -314,14 +314,14 @@ void TextUndoRemoveChars::Undo()
{
TextSelection aSel( maTextPaM, maTextPaM );
GetTextEngine()->ImpInsertText( aSel, maText );
- aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.Len();
+ aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.getLength();
SetSelection( aSel );
}
void TextUndoRemoveChars::Redo()
{
TextSelection aSel( maTextPaM, maTextPaM );
- aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.Len();
+ aSel.GetEnd().GetIndex() = aSel.GetEnd().GetIndex() + maText.getLength();
TextPaM aPaM = GetTextEngine()->ImpDeleteText( aSel );
SetSelection( aPaM );
}
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 1c6df893cb37..7a083b86e49a 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -950,8 +950,8 @@ void TextView::Command( const CommandEvent& rCEvt )
if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite )
{
- sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
- sal_uInt16 nNewIMETextLen = pData->GetText().Len();
+ sal_Int32 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_Int32 nNewIMETextLen = pData->GetText().getLength();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
@@ -981,7 +981,7 @@ void TextView::Command( const CommandEvent& rCEvt )
if ( pData->GetTextAttr() )
{
- mpImpl->mpTextEngine->mpIMEInfos->CopyAttribs( pData->GetTextAttr(), pData->GetText().Len() );
+ mpImpl->mpTextEngine->mpIMEInfos->CopyAttribs( pData->GetTextAttr(), pData->GetText().getLength() );
mpImpl->mpTextEngine->mpIMEInfos->bCursor = pData->IsCursorVisible();
}
else
diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx
index 3cc021f7a20a..c47dd1607aad 100644
--- a/vcl/source/edit/xtextedt.cxx
+++ b/vcl/source/edit/xtextedt.cxx
@@ -56,12 +56,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
sal_uInt16 nLevel = 1;
while ( nLevel && ( nPara < nParas ) )
{
- XubString aStr = GetText( nPara );
- while ( nCur < aStr.Len() )
+ OUString aStr = GetText( nPara );
+ while ( nCur < aStr.getLength() )
{
- if ( aStr.GetChar( nCur ) == nSC )
+ if ( aStr[nCur] == nSC )
nLevel++;
- else if ( aStr.GetChar( nCur ) == nEC )
+ else if ( aStr[nCur] == nEC )
{
nLevel--;
if ( !nLevel )
@@ -94,16 +94,16 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
{
if ( GetTextLen( nPara ) )
{
- XubString aStr = GetText( nPara );
+ OUString aStr = GetText( nPara );
while ( nCur )
{
- if ( aStr.GetChar( nCur ) == nSC )
+ if ( aStr[nCur] == nSC )
{
nLevel--;
if ( !nLevel )
break; // while nCur...
}
- else if ( aStr.GetChar( nCur ) == nEC )
+ else if ( aStr[nCur] == nEC )
nLevel++;
nCur--;
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index e513f168a317..71fd31981ffb 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -318,9 +318,8 @@ static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rO
case META_TEXT_ACTION:
{
const MetaTextAction& rTextAct = static_cast<const MetaTextAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
-
- if( aString.Len() )
+ const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
+ if (!aString.isEmpty())
bRet = true;
}
break;
@@ -328,9 +327,8 @@ static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rO
case META_TEXTARRAY_ACTION:
{
const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
-
- if( aString.Len() )
+ const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
+ if (!aString.isEmpty())
bRet = true;
}
break;
@@ -537,9 +535,9 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
case META_TEXT_ACTION:
{
const MetaTextAction& rTextAct = static_cast<const MetaTextAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
+ const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
- if( aString.Len() )
+ if (!aString.isEmpty())
{
const Point aPtLog( rTextAct.GetPoint() );
@@ -555,8 +553,8 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
case META_TEXTARRAY_ACTION:
{
const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- const long nLen = aString.Len();
+ const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
+ const sal_Int32 nLen = aString.getLength();
if( nLen )
{
@@ -581,8 +579,8 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction& rTextAct = static_cast<const MetaStretchTextAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- const long nLen = aString.Len();
+ const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
+ const sal_Int32 nLen = aString.getLength();
// #i16195# Literate copy from TextArray action, the
// semantics for the ImplLayout call are copied from the
diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx
index 1b1dd0187639..ef0591cf5a7d 100644
--- a/vcl/source/window/cmdevt.cxx
+++ b/vcl/source/window/cmdevt.cxx
@@ -22,7 +22,7 @@
#include <vcl/cmdevt.hxx>
-CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
+CommandExtTextInputData::CommandExtTextInputData( const OUString& rText,
const sal_uInt16* pTextAttr,
xub_StrLen nCursorPos,
sal_uInt16 nCursorFlags,
@@ -31,10 +31,10 @@ CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
sal_Bool bOnlyCursor ) :
maText( rText )
{
- if ( pTextAttr && maText.Len() )
+ if ( pTextAttr && !maText.isEmpty() )
{
- mpTextAttr = new sal_uInt16[maText.Len()];
- memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) );
+ mpTextAttr = new sal_uInt16[maText.getLength()];
+ memcpy( mpTextAttr, pTextAttr, maText.getLength()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
@@ -50,10 +50,10 @@ CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData& rData ) :
maText( rData.maText )
{
- if ( rData.mpTextAttr && maText.Len() )
+ if ( rData.mpTextAttr && !maText.isEmpty() )
{
- mpTextAttr = new sal_uInt16[maText.Len()];
- memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) );
+ mpTextAttr = new sal_uInt16[maText.getLength()];
+ memcpy( mpTextAttr, rData.mpTextAttr, maText.getLength()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index ad3dc48a2824..c62313089fe0 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -427,11 +427,11 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, sal_Uni
pWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_True );
while( bSearch && pWindow )
{
- const XubString aStr = pWindow->GetText();
- sal_uInt16 nPos = aStr.Search( '~' );
- while ( nPos != STRING_NOTFOUND )
+ const OUString aStr = pWindow->GetText();
+ sal_Int32 nPos = aStr.indexOf( '~' );
+ while (nPos != -1)
{
- cCompareChar = aStr.GetChar( nPos+1 );
+ cCompareChar = aStr[nPos+1];
cCompareChar = xCharClass->toUpper( OUString(cCompareChar), 0, 1, rLocale )[0];
if ( cCompareChar == cCharCode )
{
@@ -453,7 +453,7 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, sal_Uni
rIndex = i;
return pWindow;
}
- nPos = aStr.Search( '~', nPos+1 );
+ nPos = aStr.indexOf( '~', nPos+1 );
}
// #i93011# it would have made sense to have this really recursive
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 8d915154f77b..e544cc0bce80 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -113,11 +113,11 @@ struct MenuItemData
MenuItemBits nBits; // MenuItem-Bits
Menu* pSubMenu; // Pointer to SubMenu
Menu* pAutoSubMenu; // Pointer to SubMenu from Resource
- XubString aText; // Menu-Text
- XubString aHelpText; // Help-String
- XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
- XubString aCommandStr; // CommandString
- XubString aHelpCommandStr; // Help command string (to reference external help)
+ OUString aText; // Menu-Text
+ OUString aHelpText; // Help-String
+ OUString aTipHelpText; // TipHelp-String (eg, expanded filenames)
+ OUString aCommandStr; // CommandString
+ OUString aHelpCommandStr; // Help command string (to reference external help)
OString sIdent;
OString aHelpId; // Help-Id
sal_uLong nUserValue; // User value
@@ -130,15 +130,15 @@ struct MenuItemData
sal_Bool bMirrorMode;
long nItemImageAngle;
Size aSz; // only temporarily valid
- XubString aAccessibleName; // accessible name
- XubString aAccessibleDescription; // accessible description
+ OUString aAccessibleName; // accessible name
+ OUString aAccessibleDescription; // accessible description
SalMenuItem* pSalMenuItem; // access to native menu
MenuItemData() :
pSubMenu(NULL), pAutoSubMenu(NULL), nItemImageAngle(0), pSalMenuItem ( NULL )
{}
- MenuItemData( const XubString& rStr, const Image& rImage ) :
+ MenuItemData( const OUString& rStr, const Image& rImage ) :
pSubMenu(NULL),
pAutoSubMenu(NULL),
aText( rStr ),
@@ -181,7 +181,7 @@ public:
sal_uInt16 nId,
MenuItemType eType,
MenuItemBits nBits,
- const XubString& rStr,
+ const OUString& rStr,
const Image& rImage,
Menu* pMenu,
size_t nPos,
@@ -229,7 +229,7 @@ MenuItemData* MenuItemList::Insert(
sal_uInt16 nId,
MenuItemType eType,
MenuItemBits nBits,
- const XubString& rStr,
+ const OUString& rStr,
const Image& rImage,
Menu* pMenu,
size_t nPos,
@@ -292,7 +292,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos)
aSalMIData.eType = MENUITEM_SEPARATOR;
aSalMIData.nBits = 0;
aSalMIData.pMenu = NULL;
- aSalMIData.aText = XubString();
+ aSalMIData.aText = OUString();
aSalMIData.aImage = Image();
// Native-support: returns NULL if not supported
@@ -370,11 +370,11 @@ MenuItemData* MenuItemList::SearchItem(
MenuItemData* pData = maItemList[ rPos ];
if ( pData->bEnabled )
{
- sal_uInt16 n = pData->aText.Search( '~' );
- if ( n != STRING_NOTFOUND )
+ sal_Int32 n = pData->aText.indexOf('~');
+ if ( n != -1 )
{
KeyCode mnKeyCode;
- sal_Unicode mnUnicode = pData->aText.GetChar(n+1);
+ sal_Unicode mnUnicode = pData->aText[n+1];
Window* pDefWindow = ImplGetDefaultWindow();
if( ( pDefWindow
&& pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( mnUnicode,
@@ -430,15 +430,15 @@ size_t MenuItemList::GetItemCount( KeyCode aKeyCode ) const
MenuItemData* pData = maItemList[ --nPos ];
if ( pData->bEnabled )
{
- sal_uInt16 n = pData->aText.Search( '~' );
- if ( n != STRING_NOTFOUND )
+ sal_Int32 n = pData->aText.indexOf('~');
+ if (n != -1)
{
KeyCode mnKeyCode;
// if MapUnicodeToKeyCode fails or is unsupported we try the pure ascii mapping of the keycodes
// so we have working shortcuts when ascii mnemonics are used
Window* pDefWindow = ImplGetDefaultWindow();
if( ( pDefWindow
- && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( pData->aText.GetChar(n+1),
+ && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( pData->aText[n+1],
Application::GetSettings().GetUILanguageTag().getLanguageType(), mnKeyCode )
&& aKeyCode.GetCode() == mnKeyCode.GetCode()
)
@@ -769,7 +769,7 @@ static void ImplSetMenuItemData( MenuItemData* pData )
// convert data
if ( !pData->aImage )
pData->eType = MENUITEM_STRING;
- else if ( !pData->aText.Len() )
+ else if ( pData->aText.isEmpty() )
pData->eType = MENUITEM_IMAGE;
else
pData->eType = MENUITEM_STRINGIMAGE;
@@ -810,7 +810,7 @@ static bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nH
aPos = rHEvt.GetMousePosPixel();
Rectangle aRect( aPos, Size() );
- if( pMenu->GetHelpText( nId ).Len() )
+ if (!pMenu->GetHelpText(nId).isEmpty())
Help::ShowBalloon( pMenuWindow, aPos, pMenu->GetHelpText( nId ) );
else
{
@@ -1202,7 +1202,7 @@ void Menu::RemoveEventListener( const Link& rEventListener )
maEventListeners.removeListener( rEventListener );
}
-void Menu::InsertItem(sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits,
+void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nItemBits,
const OString &rIdent, sal_uInt16 nPos)
{
DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" );
@@ -1235,11 +1235,11 @@ void Menu::InsertItem(sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nI
void Menu::InsertItem(sal_uInt16 nItemId, const Image& rImage,
MenuItemBits nItemBits, const OString &rIdent, sal_uInt16 nPos)
{
- InsertItem(nItemId, ImplGetSVEmptyStr(), nItemBits, rIdent, nPos);
+ InsertItem(nItemId, OUString(), nItemBits, rIdent, nPos);
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem(sal_uInt16 nItemId, const XubString& rStr,
+void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr,
const Image& rImage, MenuItemBits nItemBits,
const OString &rIdent, sal_uInt16 nPos)
{
@@ -1292,7 +1292,7 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
if ( bSep )
InsertSeparator(OString(), nPos);
- String aHelpText;
+ OUString aHelpText;
if ( nObjMask & RSC_MENUITEM_HELPTEXT )
{
aHelpText = ReadStringRes();
@@ -1675,11 +1675,11 @@ KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
MenuItemData* pData = pItemList->GetData( nItemId );
if( pData )
{
- sal_uInt16 nPos = pData->aText.Search( '~' );
- if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 )
+ sal_Int32 nPos = pData->aText.indexOf( '~' );
+ if( nPos != -1 && nPos < pData->aText.getLength()-1 )
{
sal_uInt16 nCode = 0;
- sal_Unicode cAccel = pData->aText.GetChar( nPos+1 );
+ sal_Unicode cAccel = pData->aText[nPos+1];
if( cAccel >= 'a' && cAccel <= 'z' )
nCode = KEY_A + (cAccel-'a');
else if( cAccel >= 'A' && cAccel <= 'Z' )
@@ -1837,7 +1837,7 @@ void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
}
}
-void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetItemText( sal_uInt16 nItemId, const OUString& rStr )
{
size_t nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
@@ -1845,7 +1845,7 @@ void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
if ( !pData )
return;
- if ( !rStr.Equals( pData->aText ) )
+ if ( !rStr.equals( pData->aText ) )
{
pData->aText = rStr;
ImplSetMenuItemData( pData );
@@ -1866,15 +1866,15 @@ void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
}
}
-XubString Menu::GetItemText( sal_uInt16 nItemId ) const
+OUString Menu::GetItemText( sal_uInt16 nItemId ) const
{
size_t nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
return pData->aText;
- else
- return ImplGetSVEmptyStr();
+
+ return OUString();
}
void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
@@ -1987,7 +1987,7 @@ void Menu::SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand )
pData->aCommandStr = rCommand;
}
-const OUString Menu::GetItemCommand( sal_uInt16 nItemId ) const
+OUString Menu::GetItemCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1997,7 +1997,7 @@ const OUString Menu::GetItemCommand( sal_uInt16 nItemId ) const
return OUString();
}
-void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetHelpCommand( sal_uInt16 nItemId, const OUString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2005,17 +2005,17 @@ void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
pData->aHelpCommandStr = rStr;
}
-const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const
+OUString Menu::GetHelpCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->aHelpCommandStr;
- else
- return ImplGetSVEmptyStr();
+
+ return OUString();
}
-void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetHelpText( sal_uInt16 nItemId, const OUString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2023,38 +2023,38 @@ void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
pData->aHelpText = rStr;
}
-const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
+OUString Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
{
- if ( !pData->aHelpText.Len() &&
- (( !pData->aHelpId.isEmpty() ) || ( pData->aCommandStr.Len() )))
+ if ( pData->aHelpText.isEmpty() &&
+ (( !pData->aHelpId.isEmpty() ) || ( !pData->aCommandStr.isEmpty() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( pData->aCommandStr.Len() )
+ if (!pData->aCommandStr.isEmpty())
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && !pData->aHelpId.isEmpty() )
+ if( pData->aHelpText.isEmpty() && !pData->aHelpId.isEmpty() )
pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
return pData->aHelpText;
}
- else
- return ImplGetSVEmptyStr();
+
+ return OUString();
}
-const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const
+OUString Menu::GetHelpText( sal_uInt16 nItemId ) const
{
return ImplGetHelpText( nItemId );
}
-void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetTipHelpText( sal_uInt16 nItemId, const OUString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2062,14 +2062,14 @@ void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
pData->aTipHelpText = rStr;
}
-const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const
+OUString Menu::GetTipHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->aTipHelpText;
- else
- return ImplGetSVEmptyStr();
+
+ return OUString();
}
void Menu::SetHelpId( sal_uInt16 nItemId, const OString& rHelpId )
@@ -2841,7 +2841,7 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpaceX;
if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
{
- XubString aAccText = pData->aAccelKey.GetName();
+ OUString aAccText = pData->aAccelKey.GetName();
nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra;
}
if( !bIsMenuBar && pData->pSubMenu )
@@ -2857,14 +2857,14 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
// Accel
if ( !bLayout && !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
{
- XubString aAccText = pData->aAccelKey.GetName();
+ OUString aAccText = pData->aAccelKey.GetName();
aTmpPos.X() = aOutSz.Width() - pWin->GetTextWidth( aAccText );
aTmpPos.X() -= 4*nExtra;
aTmpPos.X() -= nOuterSpaceX;
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- pWin->DrawCtrlText( aTmpPos, aAccText, 0, aAccText.Len(), nTextStyle );
+ pWin->DrawCtrlText( aTmpPos, aAccText, 0, aAccText.getLength(), nTextStyle );
}
// SubMenu?
@@ -3193,26 +3193,26 @@ Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
return aRet;
}
-void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr )
{
size_t nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
- if ( pData && !rStr.Equals( pData->aAccessibleName ) )
+ if ( pData && !rStr.equals( pData->aAccessibleName ) )
{
pData->aAccessibleName = rStr;
ImplCallEventListeners( VCLEVENT_MENU_ACCESSIBLENAMECHANGED, nPos );
}
}
-XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
+OUString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->aAccessibleName;
- else
- return ImplGetSVEmptyStr();
+
+ return OUString();
}
void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 28f1780c3f00..232218957c61 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2698,7 +2698,7 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
aHelpRect.Bottom() = aPt.Y();
// Text ermitteln und anzeigen
- XubString aStr;
+ OUString aStr;
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
aStr = ResId( nHelpResId, *pResMgr ).toString();
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index b5bf08bfe8ae..07f13e5a6829 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -363,10 +363,10 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
if ( aTextRect.Right() > aTextRect.Left() )
{
// Position ermitteln
- XubString aStr = GetText();
- sal_uInt16 nPos = aStr.Search( '\n' );
- if ( nPos != STRING_NOTFOUND )
- aStr.Erase( nPos );
+ OUString aStr = GetText();
+ sal_Int32 nPos = aStr.indexOf('\n');
+ if (nPos != -1)
+ aStr = aStr.copy(0, nPos);
aTextRect.Bottom() = aTextRect.Top()+GetTextHeight()+1;
@@ -809,15 +809,15 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
{
- XubString aStr = GetHelpText( nItemId );
+ OUString aStr = GetHelpText( nItemId );
Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
return;
}
else if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
- XubString aStr = GetQuickHelpText( nItemId );
+ OUString aStr(GetQuickHelpText(nItemId));
// Show quickhelp if available
- if( aStr.Len() )
+ if (!aStr.isEmpty())
{
Help::ShowQuickHelp( this, aItemRect, aStr );
return;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index b825161a27ad..8e9889bb558d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4310,13 +4310,13 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
aTempRect.Bottom() = aPt.Y();
// get text and display it
- XubString aStr = GetQuickHelpText( nItemId );
- const XubString& rHelpStr = GetHelpText( nItemId );
- if ( !aStr.Len() )
+ OUString aStr = GetQuickHelpText( nItemId );
+ const OUString& rHelpStr = GetHelpText( nItemId );
+ if (aStr.isEmpty())
aStr = MnemonicGenerator::EraseAllMnemonicChars( GetItemText( nItemId ) );
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
{
- if ( rHelpStr.Len() )
+ if (!rHelpStr.isEmpty())
aStr = rHelpStr;
Help::ShowBalloon( this, aHelpPos, aTempRect, aStr );
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 28c157ea1f16..fe0cd52d5511 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4183,10 +4183,10 @@ void Window::ImplNewInputContext()
SalInputContext aNewContext;
const Font& rFont = rInputContext.GetFont();
- const XubString& rFontName = rFont.GetName();
+ const OUString& rFontName = rFont.GetName();
ImplFontEntry* pFontEntry = NULL;
aNewContext.mpFont = NULL;
- if ( rFontName.Len() )
+ if (!rFontName.isEmpty())
{
Size aSize = pFocusWin->ImplLogicToDevicePixel( rFont.GetSize() );
if ( !aSize.Height() )
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 8485971971f0..a5bc66171df3 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1223,7 +1223,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
// -----------------------------------------------------------------------
static long ImplHandleExtTextInput( Window* pWindow,
- const XubString& rText,
+ const OUString& rText,
const sal_uInt16* pTextAttr,
sal_uLong nCursorPos, sal_uInt16 nCursorFlags )
{
@@ -1266,12 +1266,12 @@ static long ImplHandleExtTextInput( Window* pWindow,
return 0;
// Test for changes
- sal_Bool bOnlyCursor = sal_False;
- xub_StrLen nMinLen = std::min( pWinData->mpExtOldText->getLength(), sal_Int32(rText.Len()) );
- xub_StrLen nDeltaStart = 0;
+ bool bOnlyCursor = false;
+ sal_Int32 nMinLen = std::min( pWinData->mpExtOldText->getLength(), rText.getLength() );
+ sal_Int32 nDeltaStart = 0;
while ( nDeltaStart < nMinLen )
{
- if ( (*pWinData->mpExtOldText)[nDeltaStart] != rText.GetChar( nDeltaStart ) )
+ if ( (*pWinData->mpExtOldText)[nDeltaStart] != rText[nDeltaStart] )
break;
nDeltaStart++;
}
@@ -1294,8 +1294,8 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
}
if ( (nDeltaStart >= nMinLen) &&
- (pWinData->mpExtOldText->getLength() == rText.Len()) )
- bOnlyCursor = sal_True;
+ (pWinData->mpExtOldText->getLength() == rText.getLength()) )
+ bOnlyCursor = true;
// Call Event and store the information
CommandExtTextInputData aData( rText, pTextAttr,
@@ -1310,8 +1310,8 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( pTextAttr )
{
- pWinData->mpExtOldAttrAry = new sal_uInt16[rText.Len()];
- memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( sal_uInt16 ) );
+ pWinData->mpExtOldAttrAry = new sal_uInt16[rText.getLength()];
+ memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.getLength()*sizeof( sal_uInt16 ) );
}
return !ImplCallCommand( pChild, COMMAND_EXTTEXTINPUT, &aData );
}