diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-04 15:29:16 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-05 08:55:12 +0200 |
commit | ef84ce9cec9fff75868433a862db8571440a10b4 (patch) | |
tree | cc1616889a3ea818654103be4b0d8f740df1edc9 /svx | |
parent | 55a15541a17e5c9b49039b0db31473ab81c2456b (diff) |
convert svx/source/dialog/*.cxx from String to OUString
Change-Id: Icba1afdaf0d6ec16d2d09788ed3346160cb7564d
Diffstat (limited to 'svx')
24 files changed, 193 insertions, 198 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 15f83ee6c6f3..ea97d6cdd67e 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -575,7 +575,7 @@ void SvxBmpMask::SetColorList( const XColorListRef &pList ) { if ( pList.is() && ( pList != pColLst ) ) { - const String aTransp(BMP_RESID(RID_SVXDLG_BMPMASK_STR_TRANSP).toString()); + const OUString aTransp(BMP_RESID(RID_SVXDLG_BMPMASK_STR_TRANSP).toString()); pColLst = pList; @@ -1210,23 +1210,23 @@ void SvxBmpMask::ApplyStyle() */ void SvxBmpMask::SetAccessibleNames (void) { - String sSourceColor(BMP_RESID(RID_SVXDLG_BMPMASK_STR_SOURCECOLOR).toString()); - String sSourceColorN; + OUString sSourceColor(BMP_RESID(RID_SVXDLG_BMPMASK_STR_SOURCECOLOR).toString()); + OUString sSourceColorN; sSourceColorN = sSourceColor; - sSourceColorN.AppendAscii (" 1"); + sSourceColorN += " 1"; aCbx1.SetAccessibleName (sSourceColorN); sSourceColorN = sSourceColor; - sSourceColorN.AppendAscii (" 2"); + sSourceColorN += " 2"; aCbx2.SetAccessibleName (sSourceColorN); sSourceColorN = sSourceColor; - sSourceColorN.AppendAscii (" 3"); + sSourceColorN += " 3"; aCbx3.SetAccessibleName (sSourceColorN); sSourceColorN = sSourceColor; - sSourceColorN.AppendAscii (" 4"); + sSourceColorN += " 4"; aCbx4.SetAccessibleName (sSourceColorN); } diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index d594ee026770..d0fcd9ec4fba 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -557,15 +557,15 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx ) IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) { - String aStr; + OUString aStr; const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; - aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) ); - aStr.Append( OUString(" / ") ); - aStr.Append( GetUnitString( rMousePos.Y(), eFieldUnit, cSep ) ); + aStr = GetUnitString( rMousePos.X(), eFieldUnit, cSep ); + aStr += " / "; + aStr += GetUnitString( rMousePos.Y(), eFieldUnit, cSep ); aStbStatus.SetItemText( 2, aStr ); @@ -574,15 +574,15 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd ) { - String aStr; + OUString aStr; const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; - aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) ); - aStr.Append( OUString(" x ") ); - aStr.Append( GetUnitString( rSize.Height(), eFieldUnit, cSep ) ); + aStr = GetUnitString( rSize.Width(), eFieldUnit, cSep ); + aStr += " x "; + aStr += GetUnitString( rSize.Height(), eFieldUnit, cSep ); aStbStatus.SetItemText( 3, aStr ); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 4f1cbf621323..24fc2ce54f5a 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -400,7 +400,7 @@ void SvxShowCharSet::DrawChars_Impl( int n1, int n2 ) OUStringBuffer buf; buf.appendUtf32( maFontCharMap.GetCharFromIndex( i ) ); - String aCharStr(buf.makeStringAndClear()); + OUString aCharStr(buf.makeStringAndClear()); int nTextWidth = GetTextWidth(aCharStr); int tx = x + (nX - nTextWidth + 1) / 2; int ty = y + (nY - nTextHeight + 1) / 2; diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index f719403643b2..e08d15ca40bf 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -252,7 +252,7 @@ void CompressGraphicsDialog::Compress(SvStream& aStream) aFilterData[ 2 ].Name = "Quality"; aFilterData[ 2 ].Value <<= (sal_Int32) m_pQualityMF->GetValue(); - String aGraphicFormatName = m_pLosslessRB->IsChecked() ? String( "png" ) : String( "jpg" ); + OUString aGraphicFormatName = m_pLosslessRB->IsChecked() ? OUString( "png" ) : OUString( "jpg" ); sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName( aGraphicFormatName ); rFilter.ExportGraphic( aScaledGraphic, OUString( "none" ), aStream, nFilterFormat, &aFilterData ); diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index deb674022307..a6f0600bc9c1 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -73,7 +73,7 @@ void ContourWindow::SetPolyPolygon( const PolyPolygon& rPolyPoly ) SfxItemSet aSet( pModel->GetItemPool() ); aSet.Put( XFillStyleItem( XFILL_SOLID ) ); - aSet.Put( XFillColorItem( String(), TRANSCOL ) ); + aSet.Put( XFillColorItem( "", TRANSCOL ) ); aSet.Put( XFillTransparenceItem( 50 ) ); pPathObj->SetMergedItemSetAndBroadcast(aSet); @@ -120,7 +120,7 @@ void ContourWindow::InitSdrModel() SfxItemSet aSet( pModel->GetItemPool() ); - aSet.Put( XFillColorItem( String(), TRANSCOL ) ); + aSet.Put( XFillColorItem( "", TRANSCOL ) ); aSet.Put( XFillTransparenceItem( 50 ) ); pView->SetAttributes( aSet ); pView->SetFrameDragSingles( sal_True ); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index d02fd971d1ee..42e4e6f43d4e 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -386,7 +386,7 @@ void DialControl::SetNoRotation() mpImpl->mbNoRot = true; InvalidateControl(); if( mpImpl->mpLinkField ) - mpImpl->mpLinkField->SetText( String() ); + mpImpl->mpLinkField->SetText( "" ); } } diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index d8429e737e13..a9dc9d52a06a 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -137,7 +137,7 @@ void Svx3DPreviewControl::Construct() 0, 0 ); aSet.Put( XLineStyleItem( XLINE_NONE ) ); aSet.Put( XFillStyleItem( XFILL_SOLID ) ); - aSet.Put( XFillColorItem( String(), Color( COL_WHITE ) ) ); + aSet.Put( XFillColorItem( "", Color( COL_WHITE ) ) ); mpScene->SetMergedItemSet(aSet); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index b6f32be7c205..a79e2d95ce00 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -493,12 +493,12 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a // append as new one // TODO think about mmatching Module name to a corresponding icon - String sURL = aNew.OrgURL; - if (!sURL.Len()) + OUString sURL = aNew.OrgURL; + if (sURL.isEmpty()) sURL = aNew.FactoryURL; - if (!sURL.Len()) + if (sURL.isEmpty()) sURL = aNew.TempURL; - if (!sURL.Len()) + if (sURL.isEmpty()) sURL = aNew.TemplateURL; INetURLObject aURL(sURL); aNew.StandardImage = SvFileInformationManager::GetFileImage(aURL, false); @@ -1002,8 +1002,8 @@ RecoveryDialog::RecoveryDialog(Window* pParent, { const TURLInfo& rInfo = *pIt; - String sName( rInfo.DisplayName ); - sName += '\t'; + OUString sName( rInfo.DisplayName ); + sName += "\t"; sName += impl_getStatusString( rInfo ); SvTreeListEntry* pEntry = m_aFileListLB.InsertEntry(sName, rInfo.StandardImage, rInfo.StandardImage); pEntry->SetUserData((void*)&rInfo); @@ -1105,7 +1105,7 @@ short RecoveryDialog::execute() // a user selected directrory. short nRet = DLG_RET_UNKNOWN; BrokenRecoveryDialog* pBrokenRecoveryDialog = new BrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted); - String sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default dir + OUString sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default dir if (pBrokenRecoveryDialog->isExecutionNeeded()) { nRet = pBrokenRecoveryDialog->Execute(); @@ -1174,7 +1174,7 @@ short RecoveryDialog::execute() // we have to remove all recovery/session data anyway! short nRet = DLG_RET_UNKNOWN; BrokenRecoveryDialog* pBrokenRecoveryDialog = new BrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted); - String sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default save location + OUString sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default save location // dialog itself checks if there is a need to copy files for this mode. // It uses the information m_bWasRecoveryStarted doing so. @@ -1271,8 +1271,8 @@ void RecoveryDialog::updateItems() if ( !pInfo ) continue; - String sStatus = impl_getStatusString( *pInfo ); - if ( sStatus.Len() > 0 ) + OUString sStatus = impl_getStatusString( *pInfo ); + if ( !sStatus.isEmpty() ) m_aFileListLB.SetEntryText( sStatus, pEntry, 1 ); } @@ -1451,7 +1451,7 @@ OUString BrokenRecoveryDialog::getSaveDirURL() //=============================================== IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl) { - String sPhysicalPath = comphelper::string::strip(m_aSaveDirED.GetText(), ' '); + OUString sPhysicalPath = comphelper::string::strip(m_aSaveDirED.GetText(), ' '); OUString sURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPhysicalPath, sURL ); m_sSavePath = sURL; @@ -1719,10 +1719,10 @@ void BrokenRecoveryDialog::impl_askForSavePath() void ErrorRepSendDialog::initControls() { // if the text is too short for two lines, insert a newline - String sText = maDocTypeFT.GetText(); + OUString sText = maDocTypeFT.GetText(); if ( maDocTypeFT.GetCtrlTextWidth( sText ) <= maDocTypeFT.GetSizePixel().Width() ) { - sText.Insert( '\n', 0 ); + sText = "\n" + sText; maDocTypeFT.SetText( sText ); } @@ -1956,9 +1956,9 @@ void BrokenRecoveryDialog::impl_askForSavePath() return aURL; } - static String LoadCrashFile( const OUString &rURL ) + static OUString LoadCrashFile( const OUString &rURL ) { - String aFileContent; + OUString aFileContent; ::osl::File aFile( rURL ); printf( "Loading %s:", OString( rURL.getStr(), rURL.getLength(), osl_getThreadTextEncoding() ).getStr() ); @@ -2006,16 +2006,16 @@ void BrokenRecoveryDialog::impl_askForSavePath() mnMinHeight = ( maContentML.GetSizePixel().Height() / 2 ); - String aPreview = LoadCrashFile( GetPreviewURL() ); + OUString aPreview = LoadCrashFile( GetPreviewURL() ); ErrorRepSendDialog *pMainDlg = (ErrorRepSendDialog *)_pParent; - String aSeparator = OUString( "\r\n\r\n================\r\n\r\n" ); + OUString aSeparator( "\r\n\r\n================\r\n\r\n" ); - String aContent = pMainDlg->GetDocType(); - if ( aContent.Len() > 0 ) + OUString aContent = pMainDlg->GetDocType(); + if ( !aContent.isEmpty() ) aContent += aSeparator; aContent += pMainDlg->GetUsing(); - if ( aContent.Len() > 0 ) + if ( !aContent.isEmpty() ) aContent += aSeparator; aContent += aPreview; diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 8a90881b5c7a..c19acdbdc89b 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -143,8 +143,8 @@ class FontPrevWin_Impl std::vector<sal_uInt16> aScriptType; SvxFont aCJKFont; SvxFont aCTLFont; - String aText; - String aScriptText; + OUString aText; + OUString aScriptText; Color* pColor; Color* pBackColor; long nAscent; @@ -229,7 +229,7 @@ inline bool FontPrevWin_Impl::Is100PercentFontWidthValid() const */ void FontPrevWin_Impl::CheckScript() { - assert(aText.Len()); // must have a preview text here! + assert(!aText.isEmpty()); // must have a preview text here! if (aText == aScriptText) { return; // already initialized @@ -251,7 +251,7 @@ void FontPrevWin_Impl::CheckScript() if( com::sun::star::i18n::ScriptType::WEAK == nScript ) { nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript ); - if( nChg < aText.Len() ) + if( nChg < aText.getLength() ) nScript = xBreak->getScriptType( aText, nChg ); else nScript = com::sun::star::i18n::ScriptType::LATIN; @@ -260,11 +260,11 @@ void FontPrevWin_Impl::CheckScript() do { nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript ); - if (nChg < aText.Len() && nChg > 0 && + if (nChg < aText.getLength() && nChg > 0 && (com::sun::star::i18n::ScriptType::WEAK == xBreak->getScriptType(aText, nChg - 1))) { - int8_t nType = u_charType(aText.GetChar(nChg) ); + int8_t nType = u_charType(aText[nChg] ); if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK || nType == U_COMBINING_SPACING_MARK ) { @@ -282,7 +282,7 @@ void FontPrevWin_Impl::CheckScript() aScriptType.push_back( nScript ); aTextWidth.push_back( 0 ); - if( nChg < aText.Len() ) + if( nChg < aText.getLength() ) nScript = xBreak->getScriptType( aText, nChg ); else break; @@ -314,7 +314,7 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter } else { - nEnd = aText.Len(); + nEnd = aText.getLength(); nScript = com::sun::star::i18n::ScriptType::LATIN; } long nTxtWidth = 0; @@ -346,7 +346,7 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter calcFontHeightAnyAscent(pWin,rFont,nHeight,nAscent); } - if( nEnd < aText.Len() && nIdx < nCnt ) + if( nEnd < aText.getLength() && nIdx < nCnt ) { nStart = nEnd; nEnd = aScriptChg[ nIdx ]; @@ -396,7 +396,7 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter, } else { - nEnd = aText.Len(); + nEnd = aText.getLength(); nScript = com::sun::star::i18n::ScriptType::LATIN; } do @@ -407,7 +407,7 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter, rFnt.DrawPrev( pWin, _pPrinter, rPt, aText, nStart, nEnd - nStart ); rPt.X() += aTextWidth[ nIdx++ ]; - if( nEnd < aText.Len() && nIdx < nCnt ) + if( nEnd < aText.getLength() && nIdx < nCnt ) { nStart = nEnd; nEnd = aScriptChg[ nIdx ]; @@ -669,7 +669,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& ) { pImpl->aText = pSh->GetSelectionText(); pImpl->bGetSelection = true; - pImpl->bSelection = pImpl->aText.Len() != 0; + pImpl->bSelection = !pImpl->aText.isEmpty(); } @@ -685,42 +685,41 @@ void SvxFontPrevWindow::Paint( const Rectangle& ) if (pImpl->m_bCJKEnabled) { - if (pImpl->aText.Len()) - pImpl->aText.AppendAscii(" "); + if (!pImpl->aText.isEmpty()) + pImpl->aText += " "; pImpl->aText += makeRepresentativeTextForFont(ASIAN, rCJKFont); } if (pImpl->m_bCTLEnabled) { - if (pImpl->aText.Len()) - pImpl->aText.AppendAscii(" "); + if (!pImpl->aText.isEmpty()) + pImpl->aText += " "; pImpl->aText += makeRepresentativeTextForFont(COMPLEX, rCTLFont); } } - if ( !pImpl->aText.Len() ) + if ( pImpl->aText.isEmpty() ) pImpl->aText = GetText(); - if (!pImpl->aText.Len()) + if (pImpl->aText.isEmpty()) { // fdo#58427: still no text? let's try that one... pImpl->aText = makeRepresentativeTextForFont(LATIN, rFont); } // remove line feeds and carriage returns from string bool bNotEmpty = false; - for ( xub_StrLen i = 0; i < pImpl->aText.Len(); ++i ) + for ( sal_Int32 i = 0; i < pImpl->aText.getLength(); ++i ) { - if ( 0xa == pImpl->aText.GetChar( i ) || - 0xd == pImpl->aText.GetChar( i ) ) - pImpl->aText.SetChar( i, ' ' ); + if ( 0xa == pImpl->aText[i] || 0xd == pImpl->aText[i] ) + pImpl->aText = pImpl->aText.replaceAt( i, 1, " " ); else bNotEmpty = true; } if ( !bNotEmpty ) pImpl->aText = GetText(); - if ( pImpl->aText.Len() > (TEXT_WIDTH-1) ) - pImpl->aText.Erase( pImpl->aText.Search( sal_Unicode( ' ' ), TEXT_WIDTH ) ); + if ( pImpl->aText.getLength() > (TEXT_WIDTH-1) ) + pImpl->aText = pImpl->aText.replaceAt( pImpl->aText.indexOf(" ", TEXT_WIDTH), 1, "" ); } // calculate text width scaling diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index a778744c6355..2a64e7a8a0c0 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -106,7 +106,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFontListBox(Window *pPar return new SvxFontListBox(pParent, nWinStyle); } -void SvxFontListBox::InsertFontEntry( const String& rString, const Font& rFont, const Color* pColor ) +void SvxFontListBox::InsertFontEntry( const OUString& rString, const Font& rFont, const Color* pColor ) { mbUseFont = true; // InitEntry() will use maEntryFont maEntryFont = rFont; // font to use in InitEntry() over InsertEntry() diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index d3773ae587d0..1183bad6cfd1 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -770,8 +770,7 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl) IMPL_LINK_NOARG(SvxFontWorkDialog, ColorSelectHdl_Impl) { - XFormTextShadowColorItem aItem( (const String &) String(), - (const Color &) aShadowColorLB.GetSelectEntryColor() ); + XFormTextShadowColorItem aItem( "", aShadowColorLB.GetSelectEntryColor() ); GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_SHDWCOLOR, SFX_CALLMODE_RECORD, &aItem, 0L ); return 0; } diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index dbf7fcacbbcc..8c1b46ffd9ea 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -472,7 +472,7 @@ void SvxIMapDlg::DoOpen() com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); ImageMap aLoadIMap; - const String aFilter( IMAP_ALL_FILTER ); + const OUString aFilter( IMAP_ALL_FILTER ); aDlg.AddFilter( aFilter, IMAP_ALL_TYPE ); aDlg.AddFilter( IMAP_CERN_FILTER, IMAP_CERN_TYPE ); @@ -490,7 +490,7 @@ void SvxIMapDlg::DoOpen() if( pIStm ) { - aLoadIMap.Read( *pIStm, IMAP_FORMAT_DETECT, String() ); + aLoadIMap.Read( *pIStm, IMAP_FORMAT_DETECT, "" ); if( pIStm->GetError() ) { @@ -512,9 +512,9 @@ sal_Bool SvxIMapDlg::DoSave() ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - const String aBinFilter( IMAP_BINARY_FILTER ); - const String aCERNFilter( IMAP_CERN_FILTER ); - const String aNCSAFilter( IMAP_NCSA_FILTER ); + const OUString aBinFilter( IMAP_BINARY_FILTER ); + const OUString aCERNFilter( IMAP_CERN_FILTER ); + const OUString aNCSAFilter( IMAP_NCSA_FILTER ); SdrModel* pModel = pIMapWnd->GetSdrModel(); const sal_Bool bChanged = pModel->IsChanged(); sal_Bool bRet = false; @@ -528,9 +528,9 @@ sal_Bool SvxIMapDlg::DoSave() if( aDlg.Execute() == ERRCODE_NONE ) { - const String aFilter( aDlg.GetCurrentFilter() ); - String aExt; - sal_uIntPtr nFormat; + const OUString aFilter( aDlg.GetCurrentFilter() ); + OUString aExt; + sal_uIntPtr nFormat; if ( aFilter == aBinFilter ) { @@ -566,7 +566,7 @@ sal_Bool SvxIMapDlg::DoSave() SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC ); if( pOStm ) { - pIMapWnd->GetImageMap().Write( *pOStm, nFormat, String() ); + pIMapWnd->GetImageMap().Write( *pOStm, nFormat, "" ); if( pOStm->GetError() ) ErrorHandler::HandleError( ERRCODE_IO_GENERAL ); @@ -583,7 +583,7 @@ sal_Bool SvxIMapDlg::DoSave() IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) { - String aStr; + OUString aStr; const NotifyInfo& rInfo = pWnd->GetInfo(); if ( rInfo.bNewObj ) @@ -615,8 +615,8 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) maFtTarget.Disable(); maCbbTarget.Disable(); - maURLBox.SetText( String() ); - aEdtText.SetText( String() ); + maURLBox.SetText( "" ); + aEdtText.SetText( "" ); } else { @@ -694,13 +694,13 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLModifyHdl) IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl) { - NotifyInfo aNewInfo; - const String aURLText( maURLBox.GetText() ); - const String aTargetText( maCbbTarget.GetText() ); + NotifyInfo aNewInfo; + const OUString aURLText( maURLBox.GetText() ); + const OUString aTargetText( maCbbTarget.GetText() ); - if ( aURLText.Len() ) + if ( !aURLText.isEmpty() ) { - String aBase = GetBindings().GetDispatcher()->GetFrame()->GetObjectShell()->GetMedium()->GetBaseURL(); + OUString aBase = GetBindings().GetDispatcher()->GetFrame()->GetObjectShell()->GetMedium()->GetBaseURL(); aNewInfo.aMarkURL = ::URIHelper::SmartRel2Abs( INetURLObject(aBase), aURLText, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ); @@ -710,7 +710,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl) aNewInfo.aMarkAltText = aEdtText.GetText(); - if ( !aTargetText.Len() ) + if ( aTargetText.isEmpty() ) aNewInfo.aMarkTarget = SELF_TARGET; else aNewInfo.aMarkTarget = aTargetText; diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 76235e0f3adc..f583be678e1e 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -248,17 +248,17 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) SfxItemSet aSet( pModel->GetItemPool() ); aSet.Put( XFillStyleItem( XFILL_SOLID ) ); - aSet.Put( XFillColorItem( String(), TRANSCOL ) ); + aSet.Put( XFillColorItem( "", TRANSCOL ) ); if ( !pIMapObj->IsActive() ) { aSet.Put( XFillTransparenceItem( 100 ) ); - aSet.Put( XLineColorItem( String(), Color( COL_RED ) ) ); + aSet.Put( XLineColorItem( "", Color( COL_RED ) ) ); } else { aSet.Put( XFillTransparenceItem( 50 ) ); - aSet.Put( XLineColorItem( String(), Color( COL_BLACK ) ) ); + aSet.Put( XLineColorItem( "", Color( COL_BLACK ) ) ); } pSdrObj->SetMergedItemSetAndBroadcast(aSet); @@ -276,7 +276,7 @@ void IMapWindow::InitSdrModel() SfxItemSet aSet( pModel->GetItemPool() ); - aSet.Put( XFillColorItem( String(), TRANSCOL ) ); + aSet.Put( XFillColorItem( "", TRANSCOL ) ); aSet.Put( XFillTransparenceItem( 50 ) ); pView->SetAttributes( aSet ); pView->SetFrameDragSingles( sal_True ); @@ -289,8 +289,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) case( OBJ_RECT ): { SdrRectObj* pRectObj = (SdrRectObj*) &rObj; - IMapRectangleObject* pObj = new IMapRectangleObject( pRectObj->GetLogicRect(), - String(), String(), String(), String(), String(), sal_True, sal_False ); + IMapRectangleObject* pObj = new IMapRectangleObject( pRectObj->GetLogicRect(), "", "", "", "", "", sal_True, sal_False ); pRectObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } @@ -303,7 +302,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L)); delete pPathObj; - IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), String(), String(), String(), String(), String(), sal_True, sal_False ); + IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), "", "", "", "", "", sal_True, sal_False ); pObj->SetExtraEllipse( aPoly.GetBoundRect() ); pCircObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } @@ -320,7 +319,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) if ( rXPolyPoly.count() ) { Polygon aPoly(rXPolyPoly.getB2DPolygon(0L)); - IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, String(), String(), String(), String(), String(), sal_True, sal_False ); + IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, "", "", "", "", "", sal_True, sal_False ); pPathObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } } @@ -337,12 +336,12 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) if ( pUserData ) { - String aURL; - String aAltText; - String aDesc; - String aTarget; + OUString aURL; + OUString aAltText; + OUString aDesc; + OUString aTarget; IMapObjectPtr pIMapObj = pUserData->GetObject(); - sal_Bool bActive = sal_True; + sal_Bool bActive = sal_True; if ( pIMapObj.get() ) { @@ -358,7 +357,7 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) case( OBJ_RECT ): { pUserData->ReplaceObject( IMapObjectPtr(new IMapRectangleObject( ( (const SdrRectObj&) rObj ).GetLogicRect(), - aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False ) ) ); + aURL, aAltText, aDesc, aTarget, "", bActive, sal_False ) ) ); } break; @@ -368,7 +367,7 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( sal_False, sal_False ); Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L)); - IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False ); + IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, sal_False ); pObj->SetExtraEllipse( aPoly.GetBoundRect() ); // was only created by us temporarily @@ -388,7 +387,7 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) if ( rXPolyPoly.count() ) { Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0L)); - IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False ); + IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, sal_False ); pUserData->ReplaceObject( IMapObjectPtr(pObj) ); } } @@ -518,7 +517,7 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt ) if( IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) ) { - const String aString; + const OUString aString; INetBookmark aBookMark( aString, aString ); SdrObject* pSdrObj = GetHitSdrObj( rEvt.maPosPixel ); @@ -550,9 +549,9 @@ void IMapWindow::RequestHelp( const HelpEvent& rHEvt ) if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj, pPageView ) ) { const IMapObject* pIMapObj = GetIMapObj( pSdrObj ); - String aStr; + OUString aStr; - if ( pIMapObj && ( aStr = pIMapObj->GetURL() ).Len() ) + if ( pIMapObj && !( aStr = pIMapObj->GetURL() ).isEmpty() ) { Rectangle aLogicPix( LogicToPixel( Rectangle( Point(), GetGraphicSize() ) ) ); Rectangle aScreenRect( OutputToScreenPixel( aLogicPix.TopLeft() ), @@ -579,17 +578,17 @@ void IMapWindow::SetCurrentObjState( sal_Bool bActive ) GetIMapObj( pObj )->SetActive( bActive ); - aSet.Put( XFillColorItem( String(), TRANSCOL ) ); + aSet.Put( XFillColorItem( "", TRANSCOL ) ); if ( !bActive ) { aSet.Put( XFillTransparenceItem( 100 ) ); - aSet.Put( XLineColorItem( String(), Color( COL_RED ) ) ); + aSet.Put( XLineColorItem( "", Color( COL_RED ) ) ); } else { aSet.Put( XFillTransparenceItem( 50 ) ); - aSet.Put( XLineColorItem( String(), Color( COL_BLACK ) ) ); + aSet.Put( XLineColorItem( "", Color( COL_BLACK ) ) ); } pView->SetAttributes( aSet, sal_False ); @@ -616,7 +615,7 @@ void IMapWindow::UpdateInfo( sal_Bool bNewObj ) } else { - aInfo.aMarkURL = aInfo.aMarkAltText = aInfo.aMarkTarget = String(); + aInfo.aMarkURL = aInfo.aMarkAltText = aInfo.aMarkTarget = ""; aInfo.bOneMarked = sal_False; aInfo.bActivated = sal_False; } @@ -634,8 +633,8 @@ void IMapWindow::DoMacroAssign() SfxItemSet aSet( *pIMapPool, SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); - aNamesItem.AddEvent( OUString("MouseOver"), String(), SFX_EVENT_MOUSEOVER_OBJECT ); - aNamesItem.AddEvent( OUString("MouseOut"), String(), SFX_EVENT_MOUSEOUT_OBJECT ); + aNamesItem.AddEvent( "MouseOver", "", SFX_EVENT_MOUSEOVER_OBJECT ); + aNamesItem.AddEvent( "MouseOut", "", SFX_EVENT_MOUSEOUT_OBJECT ); aSet.Put( aNamesItem ); SvxMacroItem aMacroItem(SID_ATTR_MACROITEM); @@ -673,9 +672,9 @@ void IMapWindow::DoPropertyDialog() DBG_ASSERT(aDlg, "Dialogdiet fail!"); if ( aDlg->Execute() == RET_OK ) { - const String aURLText( aDlg->GetURL() ); + const OUString aURLText( aDlg->GetURL() ); - if ( aURLText.Len() ) + if ( !aURLText.isEmpty() ) { INetURLObject aObj( aURLText, INET_PROT_FILE ); DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL" ); diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index bba9ac20932c..e24bb8073d4c 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -149,7 +149,7 @@ void SvxLanguageBox::Init() m_pLangTable = new SvtLanguageTable; m_aNotCheckedImage = Image( SVX_RES( RID_SVXIMG_NOTCHECKED ) ); m_aCheckedImage = Image( SVX_RES( RID_SVXIMG_CHECKED ) ); - m_aAllString = String( SVX_RESSTR( RID_SVXSTR_LANGUAGE_ALL ) ); + m_aAllString = SVX_RESSTR( RID_SVXSTR_LANGUAGE_ALL ); m_nLangList = LANG_LIST_EMPTY; m_bHasLangNone = sal_False; m_bLangNoneIsLangAll = sal_False; @@ -343,7 +343,7 @@ sal_uInt16 SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, sal return nAt; } - String aStrEntry = m_pLangTable->GetString( nLang ); + OUString aStrEntry = m_pLangTable->GetString( nLang ); if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll) aStrEntry = m_aAllString; @@ -351,12 +351,12 @@ sal_uInt16 SvxLanguageBox::ImplInsertLanguage( const LanguageType nLangType, sal if (nRealLang == LANGUAGE_SYSTEM) { nRealLang = MsLangId::resolveSystemLanguageByScriptType(nRealLang, nType); - aStrEntry.AppendAscii(" - "); - aStrEntry.Append(m_pLangTable->GetString( nRealLang )); + aStrEntry += " - "; + aStrEntry += m_pLangTable->GetString( nRealLang ); } else if (nRealLang == LANGUAGE_USER_SYSTEM_CONFIG) { nRealLang = MsLangId::getSystemLanguage(); - aStrEntry.AppendAscii(" - "); - aStrEntry.Append(m_pLangTable->GetString( nRealLang )); + aStrEntry += " - "; + aStrEntry += m_pLangTable->GetString( nRealLang ); } aStrEntry = ApplyLreOrRleEmbedding( aStrEntry ); @@ -414,7 +414,7 @@ sal_uInt16 SvxLanguageBox::InsertLanguage( const LanguageType nLangType, return nAt; } - String aStrEntry = m_pLangTable->GetString( nLang ); + OUString aStrEntry = m_pLangTable->GetString( nLang ); if (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll) aStrEntry = m_aAllString; diff --git a/svx/source/dialog/linkwarn.cxx b/svx/source/dialog/linkwarn.cxx index 560f298bb0a2..e15d7952d267 100644 --- a/svx/source/dialog/linkwarn.cxx +++ b/svx/source/dialog/linkwarn.cxx @@ -40,8 +40,8 @@ SvxLinkWarningDialog::SvxLinkWarningDialog( Window* pParent, const OUString& _rF m_aQueryImage.SetImage( QueryBox::GetStandardImage() ); // replace filename - String sInfoText = m_aInfoText.GetText(); - sInfoText.SearchAndReplaceAll(OUString("%FILENAME"), _rFileName); + OUString sInfoText = m_aInfoText.GetText(); + sInfoText = sInfoText.replaceAll("%FILENAME", _rFileName); m_aInfoText.SetText( sInfoText ); // load state of "warning on" checkbox from misc options diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 055d9b94e506..a08f8fed1650 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -267,10 +267,10 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s Size aDrawSize( 0, aRect.GetHeight() / 6); aFont.SetSize(aDrawSize); SetFont(aFont); - String sText(OUString("ABC")); + OUString sText("ABC"); Point aMove(1, GetTextHeight()); sal_Unicode cArrow = 0x2193; - long nAWidth = GetTextWidth(OUString(sText.GetChar(0))); + long nAWidth = GetTextWidth(sText.copy(0,1)); switch(pImpl->nFrameDirection) { case FRMDIR_HORI_LEFT_TOP: @@ -297,10 +297,10 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s aMove.X() = 0; break; } - sText.Append(cArrow); - for(sal_uInt16 i = 0; i < sText.Len(); i++) + sText += OUString(cArrow); + for(sal_uInt16 i = 0; i < sText.getLength(); i++) { - OUString sDraw(sText.GetChar(i)); + OUString sDraw(sText.copy(0,1)); long nHDiff = 0; long nCharWidth = GetTextWidth(sDraw); bool bHorizontal = 0 == aMove.Y(); diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx index 349cffa40f77..2e80408f2753 100644 --- a/svx/source/dialog/passwd.cxx +++ b/svx/source/dialog/passwd.cxx @@ -31,7 +31,7 @@ IMPL_LINK_NOARG(SvxPasswordDialog, ButtonHdl) { bool bOK = true; short nRet = RET_OK; - String aEmpty; + OUString aEmpty; if ( aNewPasswdED.GetText() != aRepeatPasswdED.GetText() ) { @@ -62,10 +62,10 @@ IMPL_LINK_NOARG(SvxPasswordDialog, EditModifyHdl) { if ( !bEmpty ) { - String aPasswd = comphelper::string::strip(aRepeatPasswdED.GetText(), ' '); - if ( !aPasswd.Len() && aOKBtn.IsEnabled() ) + OUString aPasswd = comphelper::string::strip(aRepeatPasswdED.GetText(), ' '); + if ( aPasswd.isEmpty() && aOKBtn.IsEnabled() ) aOKBtn.Disable(); - else if ( aPasswd.Len() && !aOKBtn.IsEnabled() ) + else if ( !aPasswd.isEmpty() && !aOKBtn.IsEnabled() ) aOKBtn.Enable(); } else if ( !aOKBtn.IsEnabled() ) diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index f5cc4aaac98d..213808126d0b 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -75,29 +75,29 @@ SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) const plugin::PluginDescription* pDescription = aSeq.getConstArray(); sal_Int32 nAnzahlPlugins = rPluginManager->getPluginDescriptions().getLength(); - std::list< String > aPlugNames; - std::list< String > aPlugExtensions; - std::list< String >::iterator j; - std::list< String >::iterator k; - std::list< String >::const_iterator end; + std::list< OUString > aPlugNames; + std::list< OUString > aPlugExtensions; + std::list< OUString >::iterator j; + std::list< OUString >::iterator k; + std::list< OUString >::const_iterator end; for ( int i = 0; i < nAnzahlPlugins; i++ ) { - String aStrPlugMIMEType( pDescription[i].Mimetype ); - String aStrPlugName( pDescription[i].Description ); - String aStrPlugExtension( pDescription[i].Extension ); + OUString aStrPlugMIMEType( pDescription[i].Mimetype ); + OUString aStrPlugName( pDescription[i].Description ); + OUString aStrPlugExtension( pDescription[i].Extension ); - aStrPlugMIMEType.ToLowerAscii(); - aStrPlugExtension.ToLowerAscii(); + aStrPlugMIMEType = aStrPlugMIMEType.toAsciiLowerCase(); + aStrPlugExtension = aStrPlugExtension.toAsciiLowerCase(); - if ( ( nKind == SID_INSERT_SOUND && aStrPlugMIMEType.SearchAscii ( sAudio ) == 0 ) || - ( nKind == SID_INSERT_VIDEO && aStrPlugMIMEType.SearchAscii ( sVideo ) == 0 ) ) + if ( ( nKind == SID_INSERT_SOUND && aStrPlugMIMEType.indexOf( sAudio ) == 0 ) || + ( nKind == SID_INSERT_VIDEO && aStrPlugMIMEType.indexOf( sVideo ) == 0 ) ) { // extension already in the filterlist of the filedlg ? bool bAlreadyExist = false; for ( j = aPlugExtensions.begin(), end = aPlugExtensions.end(); j != end && !bAlreadyExist; ++j ) { - bAlreadyExist = (j->Search( aStrPlugExtension ) != STRING_NOTFOUND ); + bAlreadyExist = (j->indexOf( aStrPlugExtension ) != -1 ); } if ( !bAlreadyExist ) @@ -110,14 +110,15 @@ SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) end = aPlugNames.end(); j != end && nfound != 0; ) { - if ( ( nfound = j->Search( aStrPlugName ) ) == 0 ) + if ( ( nfound = j->indexOf( aStrPlugName ) ) == 0 ) { - if ( aStrPlugExtension.Len() > 0 ) - aStrPlugExtension.Insert( sal_Unicode( ';' ) ); - aStrPlugExtension.Insert( *k ); + if ( !aStrPlugExtension.isEmpty() ) + aStrPlugExtension += ";"; + aStrPlugExtension += *k; // remove old entry, increment (iterators are invalid thereafter, thus the postincrement) - aPlugNames.erase(j++); aPlugExtensions.erase(k++); + aPlugNames.erase(j++); + aPlugExtensions.erase(k++); // update end iterator (which may be invalid, too!) end = aPlugNames.end(); @@ -130,9 +131,9 @@ SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) } // build filterdescription - aStrPlugName.AppendAscii( " (" ); - aStrPlugName.Append( aStrPlugExtension ); - aStrPlugName.AppendAscii( ")" ); + aStrPlugName += " ("; + aStrPlugName += aStrPlugExtension; + aStrPlugName += ")"; // use a own description for the video-formate avi, mov and mpeg // the descriptions of these MIME-types are not very meaningful @@ -142,13 +143,13 @@ SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) const sal_Char sMPE[] = "*.mpe"; const sal_Char sMPEG[] = "*.mpeg"; - if ( aStrPlugExtension.EqualsIgnoreCaseAscii( sAVI ) ) + if ( aStrPlugExtension.equalsIgnoreAsciiCase( sAVI ) ) aStrPlugName = SVX_RESSTR( STR_INSERT_VIDEO_EXTFILTER_AVI ); - else if ( aStrPlugExtension.EqualsIgnoreCaseAscii( sMOV ) ) + else if ( aStrPlugExtension.equalsIgnoreAsciiCase( sMOV ) ) aStrPlugName = SVX_RESSTR( STR_INSERT_VIDEO_EXTFILTER_MOV ); - else if ( aStrPlugExtension.SearchAscii( sMPG ) != STRING_NOTFOUND || - aStrPlugExtension.SearchAscii( sMPE ) != STRING_NOTFOUND || - aStrPlugExtension.SearchAscii( sMPEG ) != STRING_NOTFOUND ) + else if ( aStrPlugExtension.indexOf( sMPG ) != -1 || + aStrPlugExtension.indexOf( sMPE ) != -1 || + aStrPlugExtension.indexOf( sMPEG ) != -1 ) aStrPlugName = SVX_RESSTR(STR_INSERT_VIDEO_EXTFILTER_MPEG); aPlugNames.push_back( aStrPlugName ); @@ -167,8 +168,8 @@ SvxPluginFileDlg::SvxPluginFileDlg (Window *, sal_uInt16 nKind ) } // add the All-Filter - String aAllFilter( ResId( STR_EXTFILTER_ALL, DIALOG_MGR() ).toString() ); - maFileDlg.AddFilter(aAllFilter, OUString("*.*")); + OUString aAllFilter( ResId( STR_EXTFILTER_ALL, DIALOG_MGR() ).toString() ); + maFileDlg.AddFilter(aAllFilter, "*.*"); // and activate him maFileDlg.SetCurrentFilter( aAllFilter ); diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx index 10da9a3f32f2..a073598e2d14 100644 --- a/svx/source/dialog/relfld.cxx +++ b/svx/source/dialog/relfld.cxx @@ -46,12 +46,12 @@ void SvxRelativeField::Modify() if ( bRelativeMode ) { - String aStr = GetText(); + OUString aStr = GetText(); sal_Bool bNewMode = bRelative; if ( bRelative ) { - const sal_Unicode* pStr = aStr.GetBuffer(); + const sal_Unicode* pStr = aStr.getStr(); while ( *pStr ) { @@ -66,9 +66,7 @@ void SvxRelativeField::Modify() } else { - xub_StrLen nPos = aStr.Search( sal_Unicode( '%' ) ); - - if ( nPos != STRING_NOTFOUND ) + if ( aStr.indexOf( "%" ) != -1 ) bNewMode = sal_True; } @@ -96,7 +94,7 @@ void SvxRelativeField::EnableRelativeMode( sal_uInt16 nMin, void SvxRelativeField::SetRelative( sal_Bool bNewRelative ) { Selection aSelection = GetSelection(); - String aStr = GetText(); + OUString aStr = GetText(); if ( bNewRelative ) { diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 6435b0ac0e07..b6ad3f16b8e1 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -251,7 +251,7 @@ SvxRubyDialog::SvxRubyDialog(SfxBindings *pBind, SfxChildWindow *pCW, UpdateColors(); - String leftLabelName = m_pLeftFT->GetText(), rightLabelName = m_pRightFT->GetText(); + OUString leftLabelName = m_pLeftFT->GetText(), rightLabelName = m_pRightFT->GetText(); m_pLeft2ED->SetAccessibleName(leftLabelName); m_pLeft3ED->SetAccessibleName(leftLabelName); m_pLeft4ED->SetAccessibleName(leftLabelName); @@ -306,7 +306,7 @@ void SvxRubyDialog::Activate() if(xRubySel.is()) { Reference< XModel > xModel = pImpl->GetModel(); - const String sCharStyleSelect = m_pCharStyleLB->GetSelectEntry(); + const OUString sCharStyleSelect = m_pCharStyleLB->GetSelectEntry(); ClearCharStyleList(); Reference<XStyleFamiliesSupplier> xSupplier(xModel, UNO_QUERY); if(xSupplier.is()) @@ -356,7 +356,7 @@ void SvxRubyDialog::Activate() { OSL_FAIL("exception in style access"); } - if(sCharStyleSelect.Len()) + if(!sCharStyleSelect.isEmpty()) m_pCharStyleLB->SelectEntry(sCharStyleSelect); } m_pCharStyleLB->Enable(xSupplier.is()); @@ -813,7 +813,7 @@ void RubyPreview::Paint( const Rectangle& /* rRect */ ) nYBase = nTmp; } long nYOutput, nOutTextWidth; - String sOutputText; + OUString sOutputText; if(bRubyStretch) @@ -854,13 +854,13 @@ void RubyPreview::Paint( const Rectangle& /* rRect */ ) } // no break! case RubyAdjust_BLOCK: - if(sOutputText.Len() > 1) + if(sOutputText.getLength() > 1) { - xub_StrLen nCount = sOutputText.Len(); + sal_Int32 nCount = sOutputText.getLength(); long nSpace = ((nRightEnd - nLeftStart) - GetTextWidth(sOutputText)) / (nCount - 1); - for(xub_StrLen i = 0; i < nCount; i++) + for(sal_Int32 i = 0; i < nCount; i++) { - OUString sChar(sOutputText.GetChar(i)); + OUString sChar(sOutputText[i]); DrawText( Point( nLeftStart , nYOutput), sChar); long nCharWidth = GetTextWidth(sChar); nLeftStart += nCharWidth + nSpace; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 2c47fdbfba3b..d9535b14d2d3 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -732,16 +732,16 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) } else { - String aText = m_pSearchAttrText->GetText(); + OUString aText = m_pSearchAttrText->GetText(); m_pSearchAttrText->Hide(); - if ( aText.Len() ) + if ( !aText.isEmpty() ) pImpl->m_pSearchFormats->SetText( aText ); pImpl->m_pSearchFormats->Show(); aText = m_pReplaceAttrText->GetText(); m_pReplaceAttrText->Hide(); - if ( aText.Len() ) + if ( !aText.isEmpty() ) pImpl->m_pReplaceFormats->SetText( aText ); pImpl->m_pReplaceFormats->Show(); } @@ -940,7 +940,7 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) if ( bSetSearch && !bAttributes ) m_pSearchLB->SetText(aSearchStrings[0]); - String aReplaceTxt = pSearchItem->GetReplaceString(); + OUString aReplaceTxt = pSearchItem->GetReplaceString(); if (!aReplaceStrings.empty()) aReplaceTxt = aReplaceStrings[0]; @@ -1299,13 +1299,13 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn ) { if ( !m_pLayoutBtn->IsChecked() || bInclusive ) { - String aStr( m_pSearchLB->GetText() ); + OUString aStr( m_pSearchLB->GetText() ); - if ( aStr.Len() ) + if ( !aStr.isEmpty() ) Remember_Impl( aStr, sal_True ); aStr = m_pReplaceLB->GetText(); - if ( aStr.Len() ) + if ( !aStr.isEmpty() ) Remember_Impl( aStr, sal_False ); } SaveToModule_Impl(); @@ -1560,8 +1560,8 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, sal_Bool _bSearch ) void SvxSearchDialog::TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool ) { - String aOldSrch( m_pSearchTmplLB->GetSelectEntry() ); - String aOldRepl( m_pReplaceTmplLB->GetSelectEntry() ); + OUString aOldSrch( m_pSearchTmplLB->GetSelectEntry() ); + OUString aOldRepl( m_pReplaceTmplLB->GetSelectEntry() ); m_pSearchTmplLB->Clear(); m_pReplaceTmplLB->Clear(); rPool.SetSearchMask( pSearchItem->GetFamily(), SFXSTYLEBIT_ALL ); @@ -1580,11 +1580,11 @@ void SvxSearchDialog::TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool ) m_pReplaceTmplLB->SetUpdateMode( sal_True ); m_pSearchTmplLB->SelectEntryPos(0); - if ( aOldSrch.Len() ) + if ( !aOldSrch.isEmpty() ) m_pSearchTmplLB->SelectEntry( aOldSrch ); m_pReplaceTmplLB->SelectEntryPos(0); - if ( aOldRepl.Len() ) + if ( !aOldRepl.isEmpty() ) m_pReplaceTmplLB->SelectEntry( aOldRepl ); if ( m_pSearchTmplLB->GetEntryCount() ) @@ -1926,7 +1926,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) pWhRanges[nPos] = 0; SfxItemPool& rPool = pSh->GetPool(); SfxItemSet aSet( rPool, pWhRanges ); - String aTxt; + OUString aTxt; aSet.InvalidateAllItems(); aSet.Put(SvxBrushItem(nBrushWhich)); @@ -1952,7 +1952,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl) { SfxAbstractTabDialog* pDlg = pFact->CreateTabItemDialog( this, aSet, RID_SVXDLG_SEARCHFORMAT ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); - aTxt.Insert( pDlg->GetText(), 0 ); + aTxt = pDlg->GetText() + aTxt; pDlg->SetText( aTxt ); if ( pDlg->Execute() == RET_OK ) @@ -2012,17 +2012,17 @@ IMPL_LINK_NOARG(SvxSearchDialog, NoFormatHdl_Impl) if ( bSearch ) { if ( !pImpl->bMultiLineEdit ) - m_pSearchAttrText->SetText( String() ); + m_pSearchAttrText->SetText( "" ); else - pImpl->m_pSearchFormats->SetText( String() ); + pImpl->m_pSearchFormats->SetText( "" ); pSearchList->Clear(); } else { if ( !pImpl->bMultiLineEdit ) - m_pReplaceAttrText->SetText( String() ); + m_pReplaceAttrText->SetText( "" ); else - pImpl->m_pReplaceFormats->SetText( String() ); + pImpl->m_pReplaceFormats->SetText( "" ); pReplaceList->Clear(); } pImpl->bSaveToModule = sal_False; diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index 7951fe31d96f..b620965eef9a 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -92,8 +92,7 @@ static const sal_Unicode aBulletTypes[] = static Font& lcl_GetDefaultBulletFont() { static sal_Bool bInit = 0; - static Font aDefBulletFont( OUString("StarSymbol"), - String(), Size( 0, 14 ) ); + static Font aDefBulletFont( "StarSymbol", "", Size( 0, 14 ) ); if(!bInit) { aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); @@ -218,10 +217,10 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) { sal_uInt16 nY = 11 + i * 33; aStart.Y() = aBLPos.Y() + nRectHeight * nY / 100; - String sText; + OUString sText; if(nPageType == NUM_PAGETYPE_BULLET) { - sText = aBulletTypes[nItemId - 1]; + sText = OUString( aBulletTypes[nItemId - 1] ); aStart.Y() -= pDev->GetTextHeight()/2; aStart.X() = aBLPos.X() + 5; } diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 18c739f47ee7..59ab7098d138 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -77,7 +77,7 @@ public: ~RulerDebugWindow(); ListBox& GetLBox() {return aBox;} - static void AddDebugText(const sal_Char* pDescription, const String& rText ); + static void AddDebugText(const sal_Char* pDescription, const OUString& rText ); }; static RulerDebugWindow* pDebugWindow = 0; @@ -85,7 +85,7 @@ RulerDebugWindow::~RulerDebugWindow() { pDebugWindow = 0; } -void RulerDebugWindow::AddDebugText(const sal_Char* pDescription, const String& rText ) +void RulerDebugWindow::AddDebugText(const sal_Char* pDescription, const OUString& rText ) { if(!pDebugWindow) { diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index 99fda8ec22ee..ace12436aa98 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -209,8 +209,8 @@ void SvxTextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc, void SvxTextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc, sal_uInt16 nPos ) { - const String& rEntry = m_pEncTable->GetTextString( nEnc ); - if ( rEntry.Len() ) + const OUString& rEntry = m_pEncTable->GetTextString( nEnc ); + if ( !rEntry.isEmpty() ) InsertTextEncoding( nEnc, rEntry, nPos ); else SAL_WARN( "svx.dialog", "SvxTextEncodingBox::InsertTextEncoding: no resource string for text encoding: " << static_cast<sal_Int32>( nEnc ) ); |