[Libreoffice-commits] core.git: 69 commits - basctl/source cui/source include/sfx2 include/svx sc/inc sc/source sd/inc sd/source sfx2/inc sfx2/source svx/source sw/inc sw/source writerperfect/source
Noel Grandin
noel at peralex.com
Thu Aug 29 00:31:10 PDT 2013
basctl/source/basicide/basides1.cxx | 2
basctl/source/basicide/basides2.cxx | 2
cui/source/dialogs/cuiimapwnd.cxx | 2
cui/source/dialogs/hltpbase.cxx | 6
cui/source/dialogs/linkdlg.cxx | 22 +-
cui/source/factory/dlgfact.cxx | 20 -
cui/source/factory/dlgfact.hxx | 14 -
include/sfx2/app.hxx | 18 -
include/sfx2/basedlgs.hxx | 6
include/sfx2/bindings.hxx | 2
include/sfx2/childwin.hxx | 8
include/sfx2/controlwrapper.hxx | 4
include/sfx2/dinfdlg.hxx | 4
include/sfx2/dispatch.hxx | 6
include/sfx2/docfac.hxx | 14 -
include/sfx2/docfile.hxx | 10
include/sfx2/docfilt.hxx | 10
include/sfx2/docinsert.hxx | 8
include/sfx2/doctempl.hxx | 22 +-
include/sfx2/event.hxx | 14 -
include/sfx2/evntconf.hxx | 10
include/sfx2/fcontnr.hxx | 22 +-
include/sfx2/filedlghelper.hxx | 46 ++--
include/sfx2/frame.hxx | 2
include/sfx2/frmdescr.hxx | 14 -
include/sfx2/frmhtml.hxx | 3
include/sfx2/frmhtmlw.hxx | 12 -
include/sfx2/linkmgr.hxx | 42 +--
include/sfx2/linksrc.hxx | 10
include/sfx2/lnkbase.hxx | 18 -
include/sfx2/macropg.hxx | 12 -
include/sfx2/mailmodelapi.hxx | 16 -
include/sfx2/mgetempl.hxx | 10
include/sfx2/mieclip.hxx | 4
include/sfx2/minfitem.hxx | 34 +--
include/sfx2/mnuitem.hxx | 16 -
include/sfx2/msgpool.hxx | 4
include/sfx2/new.hxx | 2
include/sfx2/newstyle.hxx | 2
include/sfx2/objface.hxx | 20 -
include/sfx2/objsh.hxx | 48 ++--
include/sfx2/opengrf.hxx | 12 -
include/sfx2/passwd.hxx | 18 -
include/sfx2/printer.hxx | 4
include/sfx2/progress.hxx | 8
include/sfx2/request.hxx | 1
include/sfx2/sfxbasemodel.hxx | 2
include/sfx2/sfxdlg.hxx | 18 -
include/sfx2/sfxhtml.hxx | 14 -
include/sfx2/shell.hxx | 4
include/sfx2/styfitem.hxx | 12 -
include/sfx2/tabdlg.hxx | 20 -
include/sfx2/templdlg.hxx | 2
include/svx/imapdlg.hxx | 2
include/svx/svdotext.hxx | 4
include/svx/svxdlg.hxx | 4
sc/inc/arealink.hxx | 36 +--
sc/inc/externalrefmgr.hxx | 2
sc/inc/tablink.hxx | 2
sc/source/core/data/documen3.cxx | 2
sc/source/core/inc/ddelink.hxx | 2
sc/source/core/tool/ddelink.cxx | 2
sc/source/filter/excel/xicontent.cxx | 4
sc/source/filter/inc/xicontent.hxx | 4
sc/source/filter/xml/xmlcelli.cxx | 4
sc/source/ui/docshell/arealink.cxx | 32 +-
sc/source/ui/docshell/docfunc.cxx | 4
sc/source/ui/docshell/docsh.cxx | 4
sc/source/ui/docshell/externalrefmgr.cxx | 4
sc/source/ui/docshell/servobj.cxx | 2
sc/source/ui/docshell/tablink.cxx | 2
sc/source/ui/formdlg/dwfunctr.cxx | 35 +--
sc/source/ui/inc/docfunc.hxx | 4
sc/source/ui/inc/docsh.hxx | 2
sc/source/ui/inc/servobj.hxx | 2
sc/source/ui/inc/undoblk.hxx | 24 +-
sc/source/ui/miscdlgs/acredlin.cxx | 41 +--
sc/source/ui/undo/areasave.cxx | 2
sc/source/ui/undo/undoblk3.cxx | 10
sc/source/ui/view/drawvie3.cxx | 4
sc/source/ui/view/viewfun2.cxx | 4
sd/inc/pglink.hxx | 2
sd/inc/sdpage.hxx | 4
sd/source/core/pglink.cxx | 10
sd/source/core/sdpage2.cxx | 4
sd/source/ui/dlg/copydlg.cxx | 16 -
sd/source/ui/view/drviewsc.cxx | 2
sfx2/inc/inettbc.hxx | 2
sfx2/inc/srchdlg.hxx | 10
sfx2/source/appl/app.cxx | 12 -
sfx2/source/appl/appcfg.cxx | 4
sfx2/source/appl/appdde.cxx | 2
sfx2/source/appl/appopen.cxx | 29 +-
sfx2/source/appl/appserv.cxx | 1
sfx2/source/appl/childwin.cxx | 67 ++----
sfx2/source/appl/fileobj.cxx | 18 -
sfx2/source/appl/fileobj.hxx | 8
sfx2/source/appl/helpinterceptor.cxx | 2
sfx2/source/appl/helpinterceptor.hxx | 16 -
sfx2/source/appl/impldde.cxx | 14 -
sfx2/source/appl/impldde.hxx | 4
sfx2/source/appl/linkmgr2.cxx | 84 ++-----
sfx2/source/appl/linksrc.cxx | 6
sfx2/source/appl/lnkbase2.cxx | 38 +--
sfx2/source/appl/newhelp.cxx | 66 +++---
sfx2/source/appl/newhelp.hxx | 82 +++----
sfx2/source/appl/opengrf.cxx | 14 -
sfx2/source/appl/workwin.cxx | 4
sfx2/source/bastyp/fltfnc.cxx | 75 +++---
sfx2/source/bastyp/frmhtml.cxx | 19 -
sfx2/source/bastyp/frmhtmlw.cxx | 69 +++---
sfx2/source/bastyp/helper.cxx | 26 +-
sfx2/source/bastyp/mieclip.cxx | 2
sfx2/source/bastyp/progress.cxx | 30 +-
sfx2/source/bastyp/sfxhtml.cxx | 66 ++----
sfx2/source/config/evntconf.cxx | 4
sfx2/source/control/bindings.cxx | 2
sfx2/source/control/dispatch.cxx | 8
sfx2/source/control/minfitem.cxx | 16 -
sfx2/source/control/msgpool.cxx | 4
sfx2/source/control/objface.cxx | 32 +-
sfx2/source/control/request.cxx | 8
sfx2/source/control/shell.cxx | 6
sfx2/source/control/templatelocalview.cxx | 6
sfx2/source/dialog/alienwarn.cxx | 2
sfx2/source/dialog/basedlgs.cxx | 12 -
sfx2/source/dialog/dinfdlg.cxx | 106 ++++-----
sfx2/source/dialog/dockwin.cxx | 64 ++---
sfx2/source/dialog/filedlghelper.cxx | 174 ++++++++--------
sfx2/source/dialog/filedlgimpl.hxx | 16 -
sfx2/source/dialog/filtergrouping.cxx | 30 +-
sfx2/source/dialog/mailmodel.cxx | 60 ++---
sfx2/source/dialog/mgetempl.cxx | 16 -
sfx2/source/dialog/newstyle.cxx | 2
sfx2/source/dialog/passwd.cxx | 2
sfx2/source/dialog/securitypage.cxx | 22 +-
sfx2/source/dialog/splitwin.cxx | 18 -
sfx2/source/dialog/srchdlg.cxx | 30 +-
sfx2/source/dialog/tabdlg.cxx | 56 -----
sfx2/source/dialog/taskpane.cxx | 4
sfx2/source/dialog/templdlg.cxx | 97 ++++----
sfx2/source/dialog/versdlg.cxx | 28 +-
sfx2/source/doc/docfac.cxx | 46 ++--
sfx2/source/doc/docfile.cxx | 36 +--
sfx2/source/doc/docfilt.cxx | 14 -
sfx2/source/doc/docinf.cxx | 14 -
sfx2/source/doc/docinsert.cxx | 8
sfx2/source/doc/doctempl.cxx | 48 ++--
sfx2/source/doc/doctemplates.cxx | 10
sfx2/source/doc/frmdescr.cxx | 4
sfx2/source/doc/guisaveas.cxx | 2
sfx2/source/doc/iframe.cxx | 2
sfx2/source/doc/new.cxx | 54 ++--
sfx2/source/doc/objcont.cxx | 22 +-
sfx2/source/doc/objembed.cxx | 2
sfx2/source/doc/objmisc.cxx | 115 +++++-----
sfx2/source/doc/objserv.cxx | 22 +-
sfx2/source/doc/objstor.cxx | 26 +-
sfx2/source/doc/objxtor.cxx | 74 +++---
sfx2/source/doc/oleprops.cxx | 66 +++---
sfx2/source/doc/oleprops.hxx | 34 +--
sfx2/source/doc/printhelper.cxx | 16 -
sfx2/source/doc/querytemplate.cxx | 2
sfx2/source/doc/querytemplate.hxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 18 -
sfx2/source/doc/templatedlg.cxx | 2
sfx2/source/explorer/nochaos.cxx | 2
sfx2/source/inc/alienwarn.hxx | 2
sfx2/source/inc/appdata.hxx | 2
sfx2/source/inc/fltfnc.hxx | 28 --
sfx2/source/inc/nfltdlg.hxx | 57 -----
sfx2/source/inc/objshimp.hxx | 8
sfx2/source/inc/sfxtypes.hxx | 2
sfx2/source/inc/templdgi.hxx | 8
sfx2/source/inc/virtmenu.hxx | 2
sfx2/source/inc/workwin.hxx | 8
sfx2/source/inet/inettbc.cxx | 20 -
sfx2/source/menu/mnuitem.cxx | 36 +--
sfx2/source/menu/mnumgr.cxx | 22 +-
sfx2/source/menu/thessubmenu.cxx | 16 -
sfx2/source/menu/thessubmenu.hxx | 6
sfx2/source/menu/virtmenu.cxx | 8
sfx2/source/notify/eventsupplier.cxx | 14 -
sfx2/source/sidebar/Deck.cxx | 4
sfx2/source/statbar/stbitem.cxx | 2
sfx2/source/toolbox/tbxitem.cxx | 1
sfx2/source/view/frame.cxx | 16 -
sfx2/source/view/frmload.cxx | 4
sfx2/source/view/impviewframe.hxx | 4
sfx2/source/view/printer.cxx | 4
sfx2/source/view/viewfrm.cxx | 50 ++--
sfx2/source/view/viewfrm2.cxx | 16 -
sfx2/source/view/viewprn.cxx | 10
sfx2/source/view/viewsh.cxx | 12 -
svx/source/dialog/imapdlg.cxx | 8
svx/source/dialog/imapwnd.cxx | 8
svx/source/svdraw/svdograf.cxx | 4
svx/source/svdraw/svdoole2.cxx | 8
svx/source/svdraw/svdotxln.cxx | 26 --
sw/inc/docsh.hxx | 2
sw/inc/ndgrf.hxx | 4
sw/inc/swbaslnk.hxx | 2
sw/inc/swserv.hxx | 2
sw/source/core/doc/doc.cxx | 2
sw/source/core/doc/swserv.cxx | 2
sw/source/core/docnode/section.cxx | 4
sw/source/core/docnode/swbaslnk.cxx | 2
sw/source/core/fields/ddefld.cxx | 4
sw/source/core/fields/docufld.cxx | 4
sw/source/core/graphic/ndgrf.cxx | 37 +--
sw/source/core/ole/ndole.cxx | 4
sw/source/ui/app/docsh.cxx | 4
sw/source/ui/chrdlg/chardlg.cxx | 9
sw/source/ui/dialog/ascfldlg.cxx | 26 +-
sw/source/ui/dochdl/swdtflvr.cxx | 8
sw/source/ui/frmdlg/frmpage.cxx | 6
sw/source/ui/inc/redlndlg.hxx | 2
sw/source/ui/misc/redlndlg.cxx | 10
sw/source/ui/shells/basesh.cxx | 2
writerperfect/source/writer/WordPerfectImportFilter.cxx | 2
220 files changed, 1748 insertions(+), 1980 deletions(-)
New commits:
commit ec7c28017953c43cce2b326c63f66d8051e0b705
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 28 17:46:16 2013 +0200
convert sfx2/source/bastyp/* from String to OUString
Change-Id: I984ca2833d65ce37967058b1cb5800c61defe88c
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 1d13a3d..5f52850 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -126,7 +126,7 @@ static void CreateFilterArr()
}
//----------------------------------------------------------------
-inline String ToUpper_Impl( const String &rStr )
+inline OUString ToUpper_Impl( const OUString &rStr )
{
return SvtSysLocale().GetCharClass().uppercase( rStr );
}
@@ -198,8 +198,8 @@ const SfxFilter* SfxFilterContainer::GetDefaultFilter_Impl( const OUString& rNam
return NULL;
// For the following code we need some additional information.
- String sServiceName = aOpt.GetFactoryName(eFactory);
- String sDefaultFilter = aOpt.GetFactoryDefaultFilter(eFactory);
+ OUString sServiceName = aOpt.GetFactoryName(eFactory);
+ OUString sDefaultFilter = aOpt.GetFactoryDefaultFilter(eFactory);
// Try to get the default filter. Dont fiorget to verify it.
// May the set default filter does not exists any longer or
@@ -509,8 +509,8 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL )
{
// Here could a re-installation be offered
- String aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
- aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() );
+ OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
+ aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText );
short nRet = aQuery.Execute();
if ( nRet == RET_YES )
@@ -527,8 +527,8 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
}
else if ( pFilter->GetFilterFlags() & SFX_FILTER_CONSULTSERVICE )
{
- String aText( SfxResId(STR_FILTER_CONSULT_SERVICE).toString() );
- aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() );
+ OUString aText( SfxResId(STR_FILTER_CONSULT_SERVICE).toString() );
+ aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
InfoBox ( NULL, aText ).Execute();
return sal_False;
}
@@ -601,9 +601,9 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
if ( !bHidden && pFlags )
{
- String aFlags( pFlags->GetValue() );
- aFlags.ToUpperAscii();
- if( STRING_NOTFOUND != aFlags.Search( 'H' ) )
+ OUString aFlags( pFlags->GetValue() );
+ aFlags = aFlags.toAsciiUpperCase();
+ if( -1 != aFlags.indexOf( 'H' ) )
bHidden = sal_True;
}
*ppFilter = pFilter;
@@ -721,14 +721,14 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const OUString& rExt, Sf
SfxFilterFlags nFlags = pFilter->GetFilterFlags();
if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) )
{
- String sWildCard = ToUpper_Impl( pFilter->GetWildcard().getGlob() );
- String sExt = ToUpper_Impl( rExt );
+ OUString sWildCard = ToUpper_Impl( pFilter->GetWildcard().getGlob() );
+ OUString sExt = ToUpper_Impl( rExt );
- if (!sExt.Len())
+ if (sExt.isEmpty())
continue;
- if (sExt.GetChar(0) != (sal_Unicode)'.')
- sExt.Insert((sal_Unicode)'.', 0);
+ if (sExt[0] != (sal_Unicode)'.')
+ sExt = "." + sExt;
WildCard aCheck(sWildCard, ';');
if (aCheck.Matches(sExt))
@@ -740,9 +740,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const OUString& rExt, Sf
}
// Use extension without dot!
- String sExt( rExt );
- if ( sExt.Len() && ( sExt.GetChar(0) == (sal_Unicode)'.' ))
- sExt.Erase(0,1);
+ OUString sExt( rExt );
+ if ( !sExt.isEmpty() && ( sExt[0] == (sal_Unicode)'.' ))
+ sExt = sExt.copy(1);
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
aSeq[0].Name = OUString("Extensions");
@@ -786,9 +786,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4UIName( const OUString& rName, SfxF
const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
{
- String aName( rName );
- sal_uInt16 nIndex = aName.SearchAscii(": ");
- if ( nIndex != STRING_NOTFOUND )
+ OUString aName( rName );
+ sal_Int32 nIndex = aName.indexOf(": ");
+ if ( nIndex != -1 )
{
SAL_WARN( "sfx.bastyp", "Old filter name used!");
aName = rName.copy( nIndex + 2 );
@@ -842,7 +842,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName,
IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, OUString*, pString )
{
const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT );
- if (pFilter && !pFilter->GetWildcard().Matches( String() ) &&
+ if (pFilter && !pFilter->GetWildcard().Matches( OUString() ) &&
!pFilter->GetWildcard().Matches(OUString("*.*")) &&
!pFilter->GetWildcard().Matches(OUString('*'))
)
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx
index 08daee8..ecdc5ee 100644
--- a/sfx2/source/bastyp/frmhtml.cxx
+++ b/sfx2/source/bastyp/frmhtml.cxx
@@ -73,9 +73,8 @@ void SfxFrameHTMLParser::ParseFrameOptions(
}
case HTML_O_SRC:
pFrame->SetURL(
- String(
INetURLObject::GetAbsURL(
- rBaseURL, aOption.GetString())) );
+ rBaseURL, aOption.GetString()) );
break;
case HTML_O_NAME:
pFrame->SetName( aOption.GetString() );
@@ -101,10 +100,10 @@ void SfxFrameHTMLParser::ParseFrameOptions(
break;
case HTML_O_FRAMEBORDER:
{
- String aStr = aOption.GetString();
+ OUString aStr = aOption.GetString();
sal_Bool bBorder = sal_True;
- if ( aStr.EqualsIgnoreCaseAscii("NO") ||
- aStr.EqualsIgnoreCaseAscii("0") )
+ if ( aStr.equalsIgnoreAsciiCase("NO") ||
+ aStr.equalsIgnoreAsciiCase("0") )
bBorder = sal_False;
pFrame->SetFrameBorder( bBorder );
break;
@@ -115,17 +114,17 @@ void SfxFrameHTMLParser::ParseFrameOptions(
default:
if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_READONLY))
{
- String aStr = aOption.GetString();
+ OUString aStr = aOption.GetString();
sal_Bool bReadonly = sal_True;
- if ( aStr.EqualsIgnoreCaseAscii("FALSE") )
+ if ( aStr.equalsIgnoreAsciiCase("FALSE") )
bReadonly = sal_False;
pFrame->SetReadOnly( bReadonly );
}
else if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_EDIT))
{
- String aStr = aOption.GetString();
+ OUString aStr = aOption.GetString();
sal_Bool bEdit = sal_True;
- if ( aStr.EqualsIgnoreCaseAscii("FALSE") )
+ if ( aStr.equalsIgnoreAsciiCase("FALSE") )
bEdit = sal_False;
pFrame->SetEditable( bEdit );
}
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 7be9957..3a8a40b 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -96,8 +96,8 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
if( pCharSet )
{
- String aContentType = OUString(sHTML_MIME_text_html);
- aContentType.AppendAscii( pCharSet );
+ OUString aContentType(sHTML_MIME_text_html);
+ aContentType += OUString(pCharSet, strlen(pCharSet), RTL_TEXTENCODING_UTF8);
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, aContentType, sal_True,
eDestEnc, pNonConvertableChars );
}
@@ -109,8 +109,8 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_title );
if( i_xDocProps.is() )
{
- const String& rTitle = i_xDocProps->getTitle();
- if( rTitle.Len() )
+ const OUString& rTitle = i_xDocProps->getTitle();
+ if( !rTitle.isEmpty() )
HTMLOutFuncs::Out_String( rStrm, rTitle, eDestEnc, pNonConvertableChars );
}
HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_title, sal_False );
@@ -118,8 +118,8 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
// Target-Frame
if( i_xDocProps.is() )
{
- const String& rTarget = i_xDocProps->getDefaultTarget();
- if( rTarget.Len() )
+ const OUString& rTarget = i_xDocProps->getDefaultTarget();
+ if( !rTarget.isEmpty() )
{
rStrm << sNewLine;
if( pIndent )
@@ -135,10 +135,10 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
}
// Who we are
- String sGenerator( SfxResId(STR_HTML_GENERATOR).toString() );
+ OUString sGenerator( SfxResId(STR_HTML_GENERATOR).toString() );
OUString os( "$_OS" );
::rtl::Bootstrap::expandMacros(os);
- sGenerator.SearchAndReplaceAscii( "%1", os );
+ sGenerator = sGenerator.replaceFirst( "%1", os );
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_generator, sGenerator, sal_False, eDestEnc, pNonConvertableChars );
if( i_xDocProps.is() )
@@ -147,16 +147,15 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
if( (i_xDocProps->getAutoloadSecs() != 0) ||
!i_xDocProps->getAutoloadURL().isEmpty() )
{
- String sContent = OUString::number(
+ OUString sContent = OUString::number(
i_xDocProps->getAutoloadSecs() );
- const String &rReloadURL = i_xDocProps->getAutoloadURL();
- if( rReloadURL.Len() )
+ const OUString &rReloadURL = i_xDocProps->getAutoloadURL();
+ if( !rReloadURL.isEmpty() )
{
- sContent.AppendAscii( ";URL=" );
- sContent += String(
- URIHelper::simpleNormalizedMakeRelative(
- rBaseURL, rReloadURL));
+ sContent += ";URL=";
+ sContent += URIHelper::simpleNormalizedMakeRelative(
+ rBaseURL, rReloadURL);
}
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_refresh, sContent, sal_True,
@@ -164,8 +163,8 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
}
// Author
- const String& rAuthor = i_xDocProps->getAuthor();
- if( rAuthor.Len() )
+ const OUString& rAuthor = i_xDocProps->getAuthor();
+ if( !rAuthor.isEmpty() )
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_author, rAuthor, sal_False,
eDestEnc, pNonConvertableChars );
@@ -173,15 +172,15 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
::util::DateTime uDT = i_xDocProps->getCreationDate();
Date aD(uDT.Day, uDT.Month, uDT.Year);
Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- String sOut = OUString::number(aD.GetDate());
- sOut += ';';
+ OUString sOut = OUString::number(aD.GetDate());
+ sOut += ";";
sOut += OUString::number(aT.GetTime());
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, sOut, sal_False,
eDestEnc, pNonConvertableChars );
// changedby
- const String& rChangedBy = i_xDocProps->getModifiedBy();
- if( rChangedBy.Len() )
+ const OUString& rChangedBy = i_xDocProps->getModifiedBy();
+ if( !rChangedBy.isEmpty() )
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changedby, rChangedBy, sal_False,
eDestEnc, pNonConvertableChars );
@@ -190,27 +189,27 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
Date aD2(uDT.Day, uDT.Month, uDT.Year);
Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
sOut = OUString::number(aD2.GetDate());
- sOut += ';';
+ sOut += ";";
sOut += OUString::number(aT2.GetTime());
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, sOut, sal_False,
eDestEnc, pNonConvertableChars );
// Subject
- const String& rTheme = i_xDocProps->getSubject();
- if( rTheme.Len() )
+ const OUString& rTheme = i_xDocProps->getSubject();
+ if( !rTheme.isEmpty() )
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_classification, rTheme, sal_False,
eDestEnc, pNonConvertableChars );
// Description
- const String& rComment = i_xDocProps->getDescription();
- if( rComment.Len() )
+ const OUString& rComment = i_xDocProps->getDescription();
+ if( !rComment.isEmpty() )
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_description, rComment, sal_False,
eDestEnc, pNonConvertableChars);
// Keywords
- String Keywords = ::comphelper::string::convertCommaSeparated(
+ OUString Keywords = ::comphelper::string::convertCommaSeparated(
i_xDocProps->getKeywords());
- if( Keywords.Len() )
+ if( !Keywords.isEmpty() )
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_keywords, Keywords, sal_False,
eDestEnc, pNonConvertableChars);
@@ -233,7 +232,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
uno::TypeClass_STRING);
OUString str;
aStr >>= str;
- String valstr(comphelper::string::stripEnd(str, ' '));
+ OUString valstr(comphelper::string::stripEnd(str, ' '));
OutMeta( rStrm, pIndent, name, valstr, sal_False,
eDestEnc, pNonConvertableChars );
}
@@ -257,8 +256,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
uno::Any aAny = xSet->getPropertyValue("FrameURL");
if ( (aAny >>= aStr) && !aStr.isEmpty() )
{
- String aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI );
- if( aURL.Len() )
+ OUString aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI );
+ if( !aURL.isEmpty() )
{
aURL = URIHelper::simpleNormalizedMakeRelative(
rBaseURL, aURL );
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index 3713d54..dfc3a23 100644
--- a/sfx2/source/bastyp/helper.cxx
+++ b/sfx2/source/bastyp/helper.cxx
@@ -94,13 +94,13 @@ std::vector<OUString> SfxContentHelper::GetResultSet( const OUString& rURL )
{
while ( xResultSet->next() )
{
- String aTitle( xRow->getString(1) );
- String aType( xRow->getString(2) );
- String aRow = aTitle;
- aRow += '\t';
+ OUString aTitle( xRow->getString(1) );
+ OUString aType( xRow->getString(2) );
+ OUString aRow = aTitle;
+ aRow += "\t";
aRow += aType;
- aRow += '\t';
- aRow += String( xContentAccess->queryContentIdentifierString() );
+ aRow += "\t";
+ aRow += xContentAccess->queryContentIdentifierString();
aList.push_back( OUString( aRow ) );
}
}
@@ -163,14 +163,14 @@ std::vector< OUString > SfxContentHelper::GetHelpTreeViewContents( const OUStrin
{
while ( xResultSet->next() )
{
- String aTitle( xRow->getString(1) );
+ OUString aTitle( xRow->getString(1) );
sal_Bool bFolder = xRow->getBoolean(2);
- String aRow = aTitle;
- aRow += '\t';
- aRow += String( xContentAccess->queryContentIdentifierString() );
- aRow += '\t';
- aRow += bFolder ? '1' : '0';
- aProperties.push_back( OUString( aRow ) );
+ OUString aRow = aTitle;
+ aRow += "\t";
+ aRow += xContentAccess->queryContentIdentifierString();
+ aRow += "\t";
+ aRow += bFolder ? "1" : "0";
+ aProperties.push_back( aRow );
}
}
catch( const ucb::CommandAbortedException& )
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 21a234a..d3a2569 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -51,21 +51,21 @@ using namespace ::com::sun::star::task;
struct SfxProgress_Impl
{
Reference < XStatusIndicator > xStatusInd;
- String aText, aStateText;
- sal_uIntPtr nMax;
+ OUString aText, aStateText;
+ sal_uIntPtr nMax;
clock_t nCreate;
clock_t nNextReschedule;
- sal_Bool bLocked, bAllDocs;
- sal_Bool bWaitMode;
- sal_Bool bAllowRescheduling;
- sal_Bool bRunning;
+ sal_Bool bLocked, bAllDocs;
+ sal_Bool bWaitMode;
+ sal_Bool bAllowRescheduling;
+ sal_Bool bRunning;
SfxProgress* pActiveProgress;
SfxObjectShellRef xObjSh;
SfxWorkWindow* pWorkWin;
SfxViewFrame* pView;
- SfxProgress_Impl( const String& );
+ SfxProgress_Impl( const OUString& );
void Enable_Impl( sal_Bool );
};
@@ -102,7 +102,7 @@ void SfxProgress_Impl::Enable_Impl( sal_Bool bEnable )
// -----------------------------------------------------------------------
-SfxProgress_Impl::SfxProgress_Impl( const String &/*rTitle*/ )
+SfxProgress_Impl::SfxProgress_Impl( const OUString &/*rTitle*/ )
: pActiveProgress(0), pWorkWin(0), pView(0)
{
}
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index c50e095..c2c6741 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -46,9 +46,9 @@
using namespace ::com::sun::star;
-sal_Char sHTML_MIME_text[] = "text/";
-sal_Char sHTML_MIME_application[] = "application/";
-sal_Char sHTML_MIME_experimental[] = "x-";
+const sal_Char sHTML_MIME_text[] = "text/";
+const sal_Char sHTML_MIME_application[] = "application/";
+const sal_Char sHTML_MIME_experimental[] = "x-";
// <INPUT TYPE=xxx>
static HTMLOptionEnum const aAreaShapeOptEnums[] =
@@ -88,7 +88,7 @@ bool SfxHTMLParser::ParseMapOptions(
{
DBG_ASSERT( pImageMap, "ParseMapOptions: No Image-Map" );
- String aName;
+ OUString aName;
for (size_t i = rOptions.size(); i; )
{
@@ -101,10 +101,10 @@ bool SfxHTMLParser::ParseMapOptions(
}
}
- if( aName.Len() )
+ if( !aName.isEmpty() )
pImageMap->SetName( aName );
- return aName.Len() > 0;
+ return !aName.isEmpty();
}
bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBaseURL,
@@ -116,7 +116,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBase
sal_uInt16 nShape = IMAP_OBJ_RECTANGLE;
std::vector<sal_uInt32> aCoords;
- String aName, aHRef, aAlt, aTarget, sEmpty;
+ OUString aName, aHRef, aAlt, aTarget, sEmpty;
sal_Bool bNoHRef = sal_False;
SvxMacroTableDtor aMacroTbl;
@@ -163,8 +163,8 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBase
IMAPOBJ_SETEVENT:
if( nEvent )
{
- String sTmp( rOption.GetString() );
- if( sTmp.Len() )
+ OUString sTmp( rOption.GetString() );
+ if( !sTmp.isEmpty() )
{
sTmp = convertLineEnd(sTmp, GetSystemLineEnd());
aMacroTbl.Insert( nEvent, SvxMacro( sTmp, sEmpty, eScrpType ));
@@ -175,7 +175,7 @@ IMAPOBJ_SETEVENT:
}
if( bNoHRef )
- aHRef.Erase();
+ aHRef = "";
sal_Bool bNewArea = sal_True;
switch( nShape )
@@ -185,7 +185,7 @@ IMAPOBJ_SETEVENT:
{
Rectangle aRect( aCoords[0], aCoords[1],
aCoords[2], aCoords[3] );
- IMapRectangleObject aMapRObj( aRect, aHRef, aAlt, String(), aTarget, aName,
+ IMapRectangleObject aMapRObj( aRect, aHRef, aAlt, OUString(), aTarget, aName,
!bNoHRef );
if( !aMacroTbl.empty() )
aMapRObj.SetMacroTable( aMacroTbl );
@@ -196,7 +196,7 @@ IMAPOBJ_SETEVENT:
if( aCoords.size() >=3 )
{
Point aPoint( aCoords[0], aCoords[1] );
- IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt, String(),
+ IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt, OUString(),
aTarget, aName, !bNoHRef );
if( !aMacroTbl.empty() )
aMapCObj.SetMacroTable( aMacroTbl );
@@ -210,7 +210,7 @@ IMAPOBJ_SETEVENT:
Polygon aPoly( nCount );
for( sal_uInt16 i=0; i<nCount; i++ )
aPoly[i] = Point( aCoords[2*i], aCoords[2*i+1] );
- IMapPolygonObject aMapPObj( aPoly, aHRef, aAlt, String(), aTarget, aName,
+ IMapPolygonObject aMapPObj( aPoly, aHRef, aAlt, OUString(), aTarget, aName,
!bNoHRef );
if( !aMacroTbl.empty() )
aMapPObj.SetMacroTable( aMacroTbl );
@@ -279,27 +279,25 @@ void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader )
{
if( !aKV.GetValue().isEmpty() )
{
- String aTmp( aKV.GetValue() );
- if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_text, 0, 5 ) )
- aTmp.Erase( 0, 5 );
- else if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_application,
- 0, 12 ) )
- aTmp.Erase( 0, 12 );
+ OUString aTmp( aKV.GetValue() );
+ if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_text ) )
+ aTmp = aTmp.copy( 5 );
+ else if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_application ) )
+ aTmp = aTmp.copy( 12 );
else
break;
- if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_experimental, 0,
- 2 ) )
+ if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_experimental ) )
{
- aTmp.Erase( 0, 2 );
+ aTmp = aTmp.copy( 2 );
}
- if( aTmp.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_LG_starbasic ) )
+ if( aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_starbasic ) )
{
eScriptType = STARBASIC;
aScriptType = SVX_MACRO_LANGUAGE_STARBASIC;
}
- if( !aTmp.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_LG_javascript ) )
+ if( !aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_javascript ) )
{
eScriptType = EXTENDED_STYPE;
aScriptType = aTmp;
commit 1451499bdbe4258708334f53ea6198965159bf7f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 28 17:28:19 2013 +0200
convert sfx2/source/control/* from String to OUString
Change-Id: I89f5cfe46b789a4a08d4b9f096e95d7cf0a887e1
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 8c96d0d..da6ee02 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -326,14 +326,14 @@ const SfxSlot* SfxInterface::GetSlot( const OUString& rCommand ) const
{
static const char UNO_COMMAND[] = ".uno:";
- String aCommand( rCommand );
- if ( aCommand.SearchAscii( UNO_COMMAND ) == 0 )
- aCommand.Erase( 0, sizeof( UNO_COMMAND )-1 );
+ OUString aCommand( rCommand );
+ if ( aCommand.startsWith( UNO_COMMAND ) )
+ aCommand = aCommand.copy( sizeof( UNO_COMMAND )-1 );
for ( sal_uInt16 n=0; n<nCount; n++ )
{
if ( (pSlots+n)->pUnoName &&
- aCommand.CompareIgnoreCaseToAscii( (pSlots+n)->GetUnoName() ) == COMPARE_EQUAL )
+ aCommand.compareToIgnoreAsciiCaseAscii( (pSlots+n)->GetUnoName() ) == 0 )
return pSlots+n;
}
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index a95b59f..4031505 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -55,7 +55,7 @@ struct SfxRequest_Impl: public SfxListener
{
SfxRequest* pAnti; // Owner because of dying pool
- String aTarget; // if possible from target object set by App
+ OUString aTarget; // if possible from target object set by App
SfxItemPool* pPool; // ItemSet build with this pool
SfxPoolItem* pRetVal; // Return value belongs to itself
SfxShell* pShell; // run from this shell
@@ -334,13 +334,13 @@ void SfxRequest_Impl::Record
*/
{
- String aCommand = OUString(".uno:");
- aCommand.AppendAscii( pSlot->GetUnoName() );
+ OUString aCommand(".uno:");
+ aCommand += OUString( pSlot->GetUnoName(), strlen( pSlot->GetUnoName() ), RTL_TEXTENCODING_UTF8 );
OUString aCmd( aCommand );
if(xRecorder.is())
{
uno::Reference< container::XIndexReplace > xReplace( xRecorder, uno::UNO_QUERY );
- if ( xReplace.is() && aCmd.compareToAscii(".uno:InsertText") == COMPARE_EQUAL )
+ if ( xReplace.is() && aCmd == ".uno:InsertText" )
{
sal_Int32 nCount = xReplace->getCount();
if ( nCount )
commit 8f81b215a05d242aea06fdfa54ebe22e9c266d65
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 28 17:23:08 2013 +0200
convert sfx2/source/dialog/* from String to OUString
Change-Id: Ifa4c7ac957ea0c329cbe867c116465bcfb4f314e
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 793c7dc..dc36dd8 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -99,16 +99,16 @@ class DisposeListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::
// -----------------------------------------------------------------------
-sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize )
+sal_Bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize )
{
if ( comphelper::string::getTokenCount(rStr, '/') != 4 )
return sal_False;
sal_Int32 nIdx = 0;
- rPos.X() = rStr.GetToken(0, '/', nIdx).ToInt32();
- rPos.Y() = rStr.GetToken(0, '/', nIdx).ToInt32();
- rSize.Width() = rStr.GetToken(0, '/', nIdx).ToInt32();
- rSize.Height() = rStr.GetToken(0, '/', nIdx).ToInt32();
+ rPos.X() = rStr.getToken(0, '/', nIdx).toInt32();
+ rPos.Y() = rStr.getToken(0, '/', nIdx).toInt32();
+ rSize.Width() = rStr.getToken(0, '/', nIdx).toInt32();
+ rSize.Height() = rStr.getToken(0, '/', nIdx).toInt32();
// negative sizes are invalid
if ( rSize.Width() < 0 || rSize.Height() < 0 )
@@ -117,19 +117,19 @@ sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize )
return sal_True;
}
-sal_Bool GetSplitSizeFromString( const String& rStr, Size& rSize )
+sal_Bool GetSplitSizeFromString( const OUString& rStr, Size& rSize )
{
- xub_StrLen nIndex = rStr.Search( ',' );
- if ( nIndex != STRING_NOTFOUND )
+ sal_Int32 nIndex = rStr.indexOf( ',' );
+ if ( nIndex != -1 )
{
- String aStr = rStr.Copy( nIndex+1 );
+ OUString aStr = rStr.copy( nIndex+1 );
sal_Int32 nCount = comphelper::string::getTokenCount(aStr, ';');
if ( nCount != 2 )
return sal_False;
- rSize.Width() = aStr.GetToken(0, ';' ).ToInt32();
- rSize.Height() = aStr.GetToken(1, ';' ).ToInt32();
+ rSize.Width() = aStr.getToken(0, ';' ).toInt32();
+ rSize.Height() = aStr.getToken(1, ';' ).toInt32();
// negative sizes are invalid
if ( rSize.Width() < 0 || rSize.Height() < 0 )
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 0f54b05..f51af2b 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -124,7 +124,7 @@ void SfxModalDialog::GetDialogData_Impl()
Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- aExtraData = String( aTemp );
+ aExtraData = aTemp;
}
}
@@ -686,7 +686,7 @@ IMPL_LINK_NOARG(SfxSingleTabDialogBase, OKHdl_Impl)
{
// Save user data in IniManager.
pImpl->m_pSfxPage->FillUserData();
- String sData( pImpl->m_pSfxPage->GetUserData() );
+ OUString sData( pImpl->m_pSfxPage->GetUserData() );
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( sData ) ) );
EndDialog( RET_OK );
@@ -855,11 +855,11 @@ void SfxNoLayoutSingleTabDialog::SetTabPage( SfxTabPage* pTabPage,
{
// First obtain the user data, only then Reset()
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
- String sUserData;
+ OUString sUserData;
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- sUserData = String( aTemp );
+ sUserData = aTemp;
pImpl->m_pSfxPage->SetUserData( sUserData );
pImpl->m_pSfxPage->Reset( *GetInputItemSet() );
pImpl->m_pSfxPage->Show();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index d2fa0e8..83ce0c0 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -119,7 +119,7 @@ namespace {
String CreateSizeText( sal_Int64 nSize )
{
- String aUnitStr = OUString(' ');
+ OUString aUnitStr(" ");
aUnitStr += SfxResId(STR_BYTES).toString();
sal_Int64 nSize1 = nSize;
sal_Int64 nSize2 = nSize1;
@@ -131,7 +131,7 @@ String CreateSizeText( sal_Int64 nSize )
if ( nSize1 >= 10000 && nSize1 < nMega )
{
nSize1 /= 1024;
- aUnitStr = ' ';
+ aUnitStr = " ";
aUnitStr += SfxResId(STR_KB).toString();
fSize /= 1024;
nDec = 0;
@@ -139,7 +139,7 @@ String CreateSizeText( sal_Int64 nSize )
else if ( nSize1 >= nMega && nSize1 < nGiga )
{
nSize1 /= nMega;
- aUnitStr = ' ';
+ aUnitStr = " ";
aUnitStr += SfxResId(STR_MB).toString();
fSize /= nMega;
nDec = 2;
@@ -147,14 +147,14 @@ String CreateSizeText( sal_Int64 nSize )
else if ( nSize1 >= nGiga )
{
nSize1 /= nGiga;
- aUnitStr = ' ';
+ aUnitStr = " ";
aUnitStr += SfxResId(STR_GB).toString();
fSize /= nGiga;
nDec = 3;
}
const SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData();
- String aSizeStr( rLocaleWrapper.getNum( nSize1, 0 ) );
+ OUString aSizeStr( rLocaleWrapper.getNum( nSize1, 0 ) );
aSizeStr += aUnitStr;
if ( nSize1 < nSize2 )
{
@@ -165,20 +165,20 @@ String CreateSizeText( sal_Int64 nSize )
aSizeStr += " (";
aSizeStr += rLocaleWrapper.getNum( nSize2, 0 );
- aSizeStr += ' ';
+ aSizeStr += " ";
aSizeStr += SfxResId(STR_BYTES).toString();
- aSizeStr += ')';
+ aSizeStr += ")";
}
return aSizeStr;
}
-String ConvertDateTime_Impl( const String& rName,
+String ConvertDateTime_Impl( const OUString& rName,
const util::DateTime& uDT, const LocaleDataWrapper& rWrapper )
{
Date aD(uDT.Day, uDT.Month, uDT.Year);
Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
- const String pDelim ( ", " );
- String aStr( rWrapper.getDate( aD ) );
+ const OUString pDelim ( ", " );
+ OUString aStr( rWrapper.getDate( aD ) );
aStr += pDelim;
aStr += rWrapper.getTime( aT, sal_True, sal_False );
OUString aAuthor = comphelper::string::stripStart(rName, ' ');
@@ -485,7 +485,7 @@ void SfxDocumentInfoItem::AddCustomProperty( const OUString& sName, const Any& r
bool SfxDocumentInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
- String aValue;
+ OUString aValue;
sal_Int32 nValue = 0;
sal_Bool bValue = sal_False;
sal_Bool bIsInt = sal_False;
@@ -711,32 +711,32 @@ void SfxDocumentDescPage::Reset(const SfxItemSet &rSet)
//------------------------------------------------------------------------
namespace
{
- String GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime )
+ OUString GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime )
{
const LocaleDataWrapper& rWrapper( Application::GetSettings().GetLocaleDataWrapper() );
Date aDate( _nDate );
Time aTime( _nTime );
- String aStr( rWrapper.getDate( aDate ) );
- aStr.AppendAscii( ", " );
+ OUString aStr( rWrapper.getDate( aDate ) );
+ aStr += ", ";
aStr += rWrapper.getTime( aTime );
return aStr;
}
// copy from xmlsecurity/source/dialog/resourcemanager.cxx
- String GetContentPart( const String& _rRawString, const String& _rPartId )
+ OUString GetContentPart( const OUString& _rRawString, const OUString& _rPartId )
{
- String s;
+ OUString s;
- xub_StrLen nContStart = _rRawString.Search( _rPartId );
- if ( nContStart != STRING_NOTFOUND )
+ sal_Int32 nContStart = _rRawString.indexOf( _rPartId );
+ if ( nContStart != -1 )
{
- nContStart = nContStart + _rPartId.Len();
+ nContStart = nContStart + _rPartId.getLength();
++nContStart; // now it's start of content, directly after Id
- xub_StrLen nContEnd = _rRawString.Search( sal_Unicode( ',' ), nContStart );
+ sal_Int32 nContEnd = _rRawString.indexOf( ',', nContStart );
- s = String( _rRawString, nContStart, nContEnd - nContStart );
+ s = _rRawString.copy( nContStart, nContEnd - nContStart );
}
return s;
@@ -794,7 +794,7 @@ SfxDocumentPage::SfxDocumentPage(Window* pParent, const SfxItemSet& rItemSet)
IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl)
{
- String aName;
+ OUString aName;
if ( bEnableUseUserData && m_pUseUserDataCB->IsChecked() )
aName = SvtUserOptions().GetFullName();
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
@@ -859,7 +859,7 @@ void SfxDocumentPage::ImplUpdateSignatures()
Reference< security::XDocumentDigitalSignatures > xD(
security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) );
- String s;
+ OUString s;
Sequence< security::DocumentSignatureInformation > aInfos;
aInfos = xD->verifyDocumentContentSignatures( pMedium->GetZipStorageToSign_Impl(),
uno::Reference< io::XInputStream >() );
@@ -870,7 +870,7 @@ void SfxDocumentPage::ImplUpdateSignatures()
OUString aCN_Id("CN");
const security::DocumentSignatureInformation& rInfo = aInfos[ 0 ];
s = GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime );
- s.AppendAscii( ", " );
+ s += ", ";
s += GetContentPart( rInfo.Signer->getSubjectName(), aCN_Id );
}
m_pSignedValFt->SetText( s );
@@ -997,23 +997,23 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
}
// determine file name
- String aFile( m_pInfoItem->GetValue() );
- String aFactory( aFile );
- if ( aFile.Len() > 2 && aFile.GetChar(0) == '[' )
+ OUString aFile( m_pInfoItem->GetValue() );
+ OUString aFactory( aFile );
+ if ( aFile.getLength() > 2 && aFile[0] == '[' )
{
- sal_uInt16 nPos = aFile.Search( ']' );
- aFactory = aFile.Copy( 1, nPos-1 );
- aFile = aFile.Copy( nPos+1 );
+ sal_Int32 nPos = aFile.indexOf( ']' );
+ aFactory = aFile.copy( 1, nPos-1 );
+ aFile = aFile.copy( nPos+1 );
}
// determine name
- String aName;
+ OUString aName;
const SfxPoolItem* pItem = 0;
if ( SFX_ITEM_SET != rSet.GetItemState( ID_FILETP_TITLE, sal_False, &pItem ) )
{
INetURLObject aURL(aFile);
aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
- if ( !aName.Len() || aURL.GetProtocol() == INET_PROT_PRIVATE )
+ if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIVATE )
aName = SfxResId( STR_NONAME ).toString();
m_pNameED->SetReadOnly( sal_True );
}
@@ -1036,17 +1036,17 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( aFactory);
- const String& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
+ const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
m_pBmp->SetImage( SvFileInformationManager::GetImage( aURL, sal_True ) );
// determine size and type
- String aSizeText( m_aUnknownSize );
+ OUString aSizeText( m_aUnknownSize );
if ( aURL.GetProtocol() == INET_PROT_FILE )
aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) );
m_pShowSizeFT->SetText( aSizeText );
- String aDescription = SvFileInformationManager::GetDescription( INetURLObject(rMainURL) );
- if ( aDescription.Len() == 0 )
+ OUString aDescription = SvFileInformationManager::GetDescription( INetURLObject(rMainURL) );
+ if ( aDescription.isEmpty() )
aDescription = SfxResId( STR_SFX_NEWOFFICEDOC ).toString();
m_pShowTypeFT->SetText( aDescription );
@@ -1059,7 +1059,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
aPath.removeSegment();
// we know it's a folder -> don't need the final slash, but it's better for WB_PATHELLIPSIS
aPath.removeFinalSlash();
- String aText( aPath.PathToFileName() ); //! (pb) MaxLen?
+ OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen?
m_pFileValFt->SetText( aText );
}
else if ( aURL.GetProtocol() != INET_PROT_PRIVATE )
@@ -1116,20 +1116,20 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
// Determine the Titels
const SfxPoolItem* pItem = 0;
- String aTitle( GetText() );
+ OUString aTitle( GetText() );
if ( SFX_ITEM_SET !=
rItemSet.GetItemState( SID_EXPLORER_PROPS_START, sal_False, &pItem ) )
{
// File name
- String aFile( m_pInfoItem->GetValue() );
+ OUString aFile( m_pInfoItem->GetValue() );
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( aFile);
if ( INET_PROT_PRIV_SOFFICE != aURL.GetProtocol() )
{
- String aLastName( aURL.GetLastName() );
- if ( aLastName.Len() )
+ OUString aLastName( aURL.GetLastName() );
+ if ( !aLastName.isEmpty() )
aTitle += aLastName;
else
aTitle += aFile;
@@ -1292,14 +1292,14 @@ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt )
void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration )
{
m_aDuration = rDuration;
- String sText(rDuration.Negative ? OUString('-') : OUString('+'));
+ OUString sText(rDuration.Negative ? OUString('-') : OUString('+'));
sText += m_pLine->m_sDurationFormat;
- sText.SearchAndReplace(OUString("%1"), OUString::number( rDuration.Years ) );
- sText.SearchAndReplace(OUString("%2"), OUString::number( rDuration.Months ) );
- sText.SearchAndReplace(OUString("%3"), OUString::number( rDuration.Days ) );
- sText.SearchAndReplace(OUString("%4"), OUString::number( rDuration.Hours ) );
- sText.SearchAndReplace(OUString("%5"), OUString::number( rDuration.Minutes) );
- sText.SearchAndReplace(OUString("%6"), OUString::number( rDuration.Seconds) );
+ sText = sText.replaceFirst( "%1", OUString::number( rDuration.Years ) );
+ sText = sText.replaceFirst( "%2", OUString::number( rDuration.Months ) );
+ sText = sText.replaceFirst( "%3", OUString::number( rDuration.Days ) );
+ sText = sText.replaceFirst( "%4", OUString::number( rDuration.Hours ) );
+ sText = sText.replaceFirst( "%5", OUString::number( rDuration.Minutes) );
+ sText = sText.replaceFirst( "%6", OUString::number( rDuration.Seconds) );
SetText( sText );
}
@@ -1525,8 +1525,8 @@ bool CustomPropertiesWindow::IsLineValid( CustomPropertyLine* pLine ) const
pLine->m_bTypeLostFocus = false;
sal_Int64 nType = sal_Int64(
(sal_IntPtr)pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) );
- String sValue = pLine->m_aValueEdit.GetText();
- if ( sValue.Len() == 0 )
+ OUString sValue = pLine->m_aValueEdit.GetText();
+ if ( sValue.isEmpty() )
return true;
sal_uInt32 nIndex = 0xFFFFFFFF;
@@ -1861,8 +1861,8 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
if ( pLine->m_bIsRemoved )
continue;
- String sPropertyName = pLine->m_aNameBox.GetText();
- if ( sPropertyName.Len() > 0 )
+ OUString sPropertyName = pLine->m_aNameBox.GetText();
+ if ( !sPropertyName.isEmpty() )
{
aPropertiesSeq[i].Name = sPropertyName;
sal_Int64 nType = sal_Int64(
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index e321ea3..0b453de 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -54,8 +54,8 @@
using namespace ::com::sun::star;
// implemented in 'sfx2/source/appl/childwin.cxx'
-extern sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize );
-extern sal_Bool GetSplitSizeFromString( const String& rStr, Size& rSize );
+extern sal_Bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize );
+extern sal_Bool GetSplitSizeFromString( const OUString& rStr, Size& rSize );
// If you want to change the number you also have to:
// - Add new slot ids to sfxsids.hrc
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index d72c4a1..a1ea3a2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -156,8 +156,8 @@ const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
return pRet;
}
-String EncodeSpaces_Impl( const String& rSource );
-String DecodeSpaces_Impl( const String& rSource );
+OUString EncodeSpaces_Impl( const OUString& rSource );
+OUString DecodeSpaces_Impl( const OUString& rSource );
// ------------------------------------------------------------------------
// ----------- FileDialogHelper_Impl ---------------------------
@@ -292,7 +292,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve
OUString aHelpText;
Help* pHelp = Application::GetHelp();
if ( pHelp )
- aHelpText = String( pHelp->GetHelpText( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), NULL ) );
+ aHelpText = pHelp->GetHelpText( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), NULL );
return aHelpText;
}
@@ -396,10 +396,10 @@ void FileDialogHelper_Impl::SaveLastUsedFilter( void )
// ------------------------------------------------------------------------
const SfxFilter* FileDialogHelper_Impl::getCurentSfxFilter()
{
- String aFilterName = getCurrentFilterUIName();
+ OUString aFilterName = getCurrentFilterUIName();
const SfxFilter* pFilter = NULL;
- if ( mpMatcher && aFilterName.Len() )
+ if ( mpMatcher && !aFilterName.isEmpty() )
pFilter = mpMatcher->GetFilter4UIName( aFilterName, m_nMustFlags, m_nDontFlags );
return pFilter;
@@ -1632,9 +1632,9 @@ OUString FileDialogHelper_Impl::getPath() const
// ------------------------------------------------------------------------
OUString FileDialogHelper_Impl::getFilter() const
{
- String aFilter = getCurrentFilterUIName();
+ OUString aFilter = getCurrentFilterUIName();
- if( !aFilter.Len() )
+ if( aFilter.isEmpty() )
aFilter = maCurFilter;
return aFilter;
@@ -1899,21 +1899,21 @@ void FileDialogHelper_Impl::addGraphicFilter()
sal_uInt16 i, j, nCount = mpGraphicFilter->GetImportFormatCount();
// compute the extension string for all known import filters
- String aExtensions;
+ OUString aExtensions;
for ( i = 0; i < nCount; i++ )
{
j = 0;
- String sWildcard;
+ OUString sWildcard;
while( true )
{
sWildcard = mpGraphicFilter->GetImportWildcard( i, j++ );
- if ( !sWildcard.Len() )
+ if ( sWildcard.isEmpty() )
break;
- if ( aExtensions.Search( sWildcard ) == STRING_NOTFOUND )
+ if ( aExtensions.indexOf( sWildcard ) == -1 )
{
- if ( aExtensions.Len() )
- aExtensions += sal_Unicode(';');
+ if ( !aExtensions.isEmpty() )
+ aExtensions += ";";
aExtensions += sWildcard;
}
}
@@ -1941,19 +1941,19 @@ void FileDialogHelper_Impl::addGraphicFilter()
// Now add the filter
for ( i = 0; i < nCount; i++ )
{
- String aName = mpGraphicFilter->GetImportFormatName( i );
- String aExt;
+ OUString aName = mpGraphicFilter->GetImportFormatName( i );
+ OUString aExt;
j = 0;
- String sWildcard;
+ OUString sWildcard;
while( true )
{
sWildcard = mpGraphicFilter->GetImportWildcard( i, j++ );
- if ( !sWildcard.Len() )
+ if ( sWildcard.isEmpty() )
break;
- if ( aExt.Search( sWildcard ) == STRING_NOTFOUND )
+ if ( aExt.indexOf( sWildcard ) == -1 )
{
- if ( aExt.Len() )
- aExt += sal_Unicode(';');
+ if ( !aExt.isEmpty() )
+ aExt += ";";
aExt += sWildcard;
}
}
@@ -1984,7 +1984,7 @@ void FileDialogHelper_Impl::saveConfig()
if ( mbHasPreview )
{
SvtViewOptions aDlgOpt( E_DIALOG, IMPGRF_CONFIGNAME );
- String aUserData = OUString(GRF_CONFIG_STR);
+ String aUserData(GRF_CONFIG_STR);
try
{
@@ -1998,7 +1998,7 @@ void FileDialogHelper_Impl::saveConfig()
if ( aObj.GetProtocol() == INET_PROT_FILE )
aUserData.SetToken( 2, ' ', aObj.GetMainURL( INetURLObject::NO_DECODE ) );
- String aFilter = getFilter();
+ OUString aFilter = getFilter();
aFilter = EncodeSpaces_Impl( aFilter );
aUserData.SetToken( 3, ' ', aFilter );
@@ -2010,14 +2010,14 @@ void FileDialogHelper_Impl::saveConfig()
{
sal_Bool bWriteConfig = sal_False;
SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME );
- String aUserData = OUString(STD_CONFIG_STR);
+ String aUserData(STD_CONFIG_STR);
if ( aDlgOpt.Exists() )
{
Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- aUserData = String( aTemp );
+ aUserData = aTemp;
}
if ( mbHasAutoExt )
@@ -2052,7 +2052,7 @@ void FileDialogHelper_Impl::saveConfig()
sal_Bool bSelection = sal_True;
aValue >>= bSelection;
if ( comphelper::string::getTokenCount(aUserData, ' ') < 3 )
- aUserData.Append(' ');
+ aUserData += " ";
aUserData.SetToken( 2, ' ', OUString::number( (sal_Int32) bSelection ) );
bWriteConfig = sal_True;
}
@@ -2070,22 +2070,22 @@ void FileDialogHelper_Impl::saveConfig()
// ------------------------------------------------------------------------
namespace
{
- static OUString getInitPath( const String& _rFallback, const xub_StrLen _nFallbackToken )
+ static OUString getInitPath( const OUString& _rFallback, const xub_StrLen _nFallbackToken )
{
SfxApplication *pSfxApp = SFX_APP();
- String sPath = pSfxApp->GetLastDir_Impl();
+ OUString sPath = pSfxApp->GetLastDir_Impl();
- if ( !sPath.Len() )
- sPath = _rFallback.GetToken( _nFallbackToken, ' ' );
+ if ( sPath.isEmpty() )
+ sPath = _rFallback.getToken( _nFallbackToken, ' ' );
// check if the path points to a valid (accessible) directory
sal_Bool bValid = sal_False;
- if ( sPath.Len() )
+ if ( !sPath.isEmpty() )
{
- String sPathCheck( sPath );
- if ( sPathCheck.GetBuffer()[ sPathCheck.Len() - 1 ] != '/' )
- sPathCheck += '/';
- sPathCheck += '.';
+ OUString sPathCheck( sPath );
+ if ( sPathCheck[ sPathCheck.getLength() - 1 ] != '/' )
+ sPathCheck += "/";
+ sPathCheck += ".";
try
{
::ucbhelper::Content aContent( sPathCheck, uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
@@ -2095,7 +2095,7 @@ namespace
}
if ( !bValid )
- sPath.Erase();
+ sPath = "";
return sPath;
}
@@ -2113,27 +2113,27 @@ void FileDialogHelper_Impl::loadConfig()
if ( mbHasPreview )
{
SvtViewOptions aViewOpt( E_DIALOG, IMPGRF_CONFIGNAME );
- String aUserData;
+ OUString aUserData;
if ( aViewOpt.Exists() )
{
Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- aUserData = String( aTemp );
+ aUserData = aTemp;
}
- if ( aUserData.Len() > 0 )
+ if ( !aUserData.isEmpty() )
{
try
{
// respect the last "insert as link" state
- sal_Bool bLink = (sal_Bool) aUserData.GetToken( 0, ' ' ).ToInt32();
+ sal_Bool bLink = (sal_Bool) aUserData.getToken( 0, ' ' ).toInt32();
aValue <<= bLink;
xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue );
// respect the last "show preview" state
- sal_Bool bShowPreview = (sal_Bool) aUserData.GetToken( 1, ' ' ).ToInt32();
+ sal_Bool bShowPreview = (sal_Bool) aUserData.getToken( 1, ' ' ).toInt32();
aValue <<= bShowPreview;
xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue );
@@ -2142,7 +2142,7 @@ void FileDialogHelper_Impl::loadConfig()
if ( maCurFilter.isEmpty() )
{
- String aFilter = aUserData.GetToken( 3, ' ' );
+ OUString aFilter = aUserData.getToken( 3, ' ' );
aFilter = DecodeSpaces_Impl( aFilter );
setFilter( aFilter );
}
@@ -2159,17 +2159,17 @@ void FileDialogHelper_Impl::loadConfig()
else
{
SvtViewOptions aViewOpt( E_DIALOG, IODLG_CONFIGNAME );
- String aUserData;
+ OUString aUserData;
if ( aViewOpt.Exists() )
{
Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- aUserData = String( aTemp );
+ aUserData = aTemp;
}
- if ( ! aUserData.Len() )
+ if ( aUserData.isEmpty() )
aUserData = STD_CONFIG_STR;
if ( maPath.isEmpty() )
@@ -2177,7 +2177,7 @@ void FileDialogHelper_Impl::loadConfig()
if ( mbHasAutoExt )
{
- sal_Int32 nFlag = aUserData.GetToken( 0, ' ' ).ToInt32();
+ sal_Int32 nFlag = aUserData.getToken( 0, ' ' ).toInt32();
aValue <<= (sal_Bool) nFlag;
try
{
@@ -2188,7 +2188,7 @@ void FileDialogHelper_Impl::loadConfig()
if( mbHasSelectionBox )
{
- sal_Int32 nFlag = aUserData.GetToken( 2, ' ' ).ToInt32();
+ sal_Int32 nFlag = aUserData.getToken( 2, ' ' ).toInt32();
aValue <<= (sal_Bool) nFlag;
try
{
@@ -2789,7 +2789,7 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, OUString& aURL, SfxItem
}
// ------------------------------------------------------------------------
-String EncodeSpaces_Impl( const String& rSource )
+OUString EncodeSpaces_Impl( const OUString& rSource )
{
OUString sRet( rSource );
sRet = sRet.replaceAll( " ", "%20" );
@@ -2797,7 +2797,7 @@ String EncodeSpaces_Impl( const String& rSource )
}
// ------------------------------------------------------------------------
-String DecodeSpaces_Impl( const String& rSource )
+OUString DecodeSpaces_Impl( const OUString& rSource )
{
OUString sRet( rSource );
sRet = sRet.replaceAll( "%20", " " );
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index 6fc6901..aaab080 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -454,7 +454,7 @@ namespace sfx2
::std::vector< OUString > aWildCards;
public:
- AppendWildcardToDescriptor( const String& _rWildCard );
+ AppendWildcardToDescriptor( const OUString& _rWildCard );
// operate on a single class entry
void operator() ( const FilterGroupEntryReferrer::value_type& _rClassReference )
@@ -469,17 +469,17 @@ namespace sfx2
};
//====================================================================
- AppendWildcardToDescriptor::AppendWildcardToDescriptor( const String& _rWildCard )
+ AppendWildcardToDescriptor::AppendWildcardToDescriptor( const OUString& _rWildCard )
{
- DBG_ASSERT( _rWildCard.Len(),
+ DBG_ASSERT( !_rWildCard.isEmpty(),
"AppendWildcardToDescriptor::AppendWildcardToDescriptor: invalid wildcard!" );
- DBG_ASSERT( _rWildCard.GetBuffer()[0] != s_cWildcardSeparator,
+ DBG_ASSERT( _rWildCard[0] != s_cWildcardSeparator,
"AppendWildcardToDescriptor::AppendWildcardToDescriptor: wildcard already separated!" );
aWildCards.reserve( comphelper::string::getTokenCount(_rWildCard, s_cWildcardSeparator) );
- const sal_Unicode* pTokenLoop = _rWildCard.GetBuffer();
- const sal_Unicode* pTokenLoopEnd = pTokenLoop + _rWildCard.Len();
+ const sal_Unicode* pTokenLoop = _rWildCard.getStr();
+ const sal_Unicode* pTokenLoopEnd = pTokenLoop + _rWildCard.getLength();
const sal_Unicode* pTokenStart = pTokenLoop;
for ( ; pTokenLoop != pTokenLoopEnd; ++pTokenLoop )
{
@@ -610,9 +610,9 @@ namespace sfx2
// the group which we currently work with
GroupedFilterList::iterator aCurrentGroup = _rAllFilters.end(); // no current group
// the filter container of the current group - if this changes between two filters, a new group is reached
- String aCurrentServiceName;
+ OUString aCurrentServiceName;
- String sFilterWildcard;
+ OUString sFilterWildcard;
OUString sFilterName;
// loop through all the filters
for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() )
@@ -621,11 +621,11 @@ namespace sfx2
sFilterWildcard = pFilter->GetWildcard().getGlob();
AppendWildcardToDescriptor aExtendWildcard( sFilterWildcard );
- DBG_ASSERT( sFilterWildcard.Len(), "sfx2::lcl_GroupAndClassify: invalid wildcard of this filter!" );
+ DBG_ASSERT( !sFilterWildcard.isEmpty(), "sfx2::lcl_GroupAndClassify: invalid wildcard of this filter!" );
// ===========================================================
// check for a change in the group
- String aServiceName = pFilter->GetServiceName();
+ OUString aServiceName = pFilter->GetServiceName();
if ( aServiceName != aCurrentServiceName )
{ // we reached a new group
@@ -692,7 +692,7 @@ namespace sfx2
// within the "real" group (aCollectedLocals is only temporary)
// -> do this now (as we just encountered the first filter belonging to this local class
// add a new entry which is the "real" group entry
- aCurrentGroup->push_back( FilterDescriptor( aBelongsToLocal->second->First, String() ) );
+ aCurrentGroup->push_back( FilterDescriptor( aBelongsToLocal->second->First, OUString() ) );
// the position where we inserted the entry
FilterGroup::iterator aInsertPos = aCurrentGroup->end();
--aInsertPos;
@@ -750,7 +750,7 @@ namespace sfx2
// operate on a single filter
void operator() ( const FilterDescriptor& _rFilterEntry )
{
- String sDisplayText = m_bAddExtension
+ OUString sDisplayText = m_bAddExtension
? addExtension( _rFilterEntry.First, _rFilterEntry.Second, sal_True, *m_pFileDlgImpl )
: _rFilterEntry.First;
m_xFilterManager->appendFilter( sDisplayText, _rFilterEntry.Second );
@@ -762,7 +762,7 @@ namespace sfx2
// =======================================================================
//--------------------------------------------------------------------
- sal_Bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, String& /* [out] */ _rAllFilterName )
+ sal_Bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, OUString& /* [out] */ _rAllFilterName )
{
sal_Bool bHasAll = sal_False;
_rAllFilterName = SfxResId( STR_SFX_FILTERNAME_ALL ).toString();
@@ -781,7 +781,7 @@ namespace sfx2
void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters )
{
// ===============================================================
- String sAllFilterName;
+ OUString sAllFilterName;
if ( !lcl_hasAllFilesFilter( _rFilterMatcher, sAllFilterName ) )
{
// get the first group of filters (by definition, this group contains the global classes)
@@ -1182,7 +1182,7 @@ namespace sfx2
if ( sRet.indexOf( sAllFilter ) == -1 )
{
- String sExt = _rExtension;
+ OUString sExt = _rExtension;
if ( !_bForOpen )
{
// show '*' in extensions only when opening a document
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 7f5bb38..3357e32 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -930,15 +930,15 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom )
{
SvtUserOptions aUserCFG;
- String aName = aUserCFG.GetLastName ();
- String aFirstName = aUserCFG.GetFirstName ();
- if ( aFirstName.Len() || aName.Len() )
+ OUString aName = aUserCFG.GetLastName ();
+ OUString aFirstName = aUserCFG.GetFirstName ();
+ if ( !aFirstName.isEmpty() || !aName.isEmpty() )
{
- if ( aFirstName.Len() )
+ if ( !aFirstName.isEmpty() )
{
rFrom = comphelper::string::strip(aFirstName, ' ');
- if ( aName.Len() )
+ if ( !aName.isEmpty() )
rFrom += " ";
}
rFrom += comphelper::string::strip(aName, ' ');
@@ -947,13 +947,13 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom )
rFrom = comphelper::string::remove(rFrom, '>');
rFrom = comphelper::string::remove(rFrom, '@');
}
- String aEmailName = aUserCFG.GetEmail();
+ OUString aEmailName = aUserCFG.GetEmail();
// remove illegal characters
aEmailName = comphelper::string::remove(aEmailName, '<');
aEmailName = comphelper::string::remove(aEmailName, '>');
- if ( aEmailName.Len() )
+ if ( !aEmailName.isEmpty() )
{
if ( !rFrom.isEmpty() )
rFrom += " ";
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index eab0f50..bb351f0 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -89,9 +89,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS
if ( pStyle->GetName().isEmpty() && pPool )
{
// NullString as Name -> generate Name
- String aNoName( SfxResId(STR_NONAME).toString() );
+ OUString aNoName( SfxResId(STR_NONAME).toString() );
sal_uInt16 nNo = 1;
- String aNo( aNoName );
+ OUString aNo( aNoName );
aNoName += OUString::number( nNo );
while ( pPool->Find( aNoName ) )
{
@@ -147,7 +147,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS
while ( pPoolStyle )
{
- const String aStr( pPoolStyle->GetName() );
+ const OUString aStr( pPoolStyle->GetName() );
// own name as base template
if ( aStr != aName )
m_pBaseLb->InsertEntry( aStr );
@@ -336,7 +336,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
*/
{
- const String aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
+ const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
pEdit->SetText( aStr );
// Update the Listbox of the base template if possible
if ( aStr != aBuf )
@@ -411,7 +411,7 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ )
{
bModified = sal_False;
- String sCmp( pStyle->GetName() );
+ OUString sCmp( pStyle->GetName() );
if ( sCmp != aName )
pStyle->SetName( aName );
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index a81cd6d..03fc302 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -31,7 +31,7 @@
IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
{
(void)pControl; //unused
- const String aName( aColBox.GetText() );
+ const OUString aName( aColBox.GetText() );
SfxStyleSheetBase* pStyle = rPool.Find( aName, rPool.GetSearchFamily(), SFXSTYLEBIT_ALL );
if ( pStyle )
{
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 334ad54..f4fc054 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -96,7 +96,7 @@ namespace
static short lcl_GetPassword(
Window *pParent,
bool bProtect,
- /*out*/String &rPassword )
+ /*out*/OUString &rPassword )
{
bool bRes = false;
SfxPasswordDialog aPasswdDlg( pParent );
@@ -112,7 +112,7 @@ static short lcl_GetPassword(
}
-static bool lcl_IsPasswordCorrect( const String &rPassword )
+static bool lcl_IsPasswordCorrect( const OUString &rPassword )
{
bool bRes = false;
@@ -144,9 +144,9 @@ struct SfxSecurityPage_Impl
bool m_bOrigPasswordIsConfirmed;
bool m_bNewPasswordIsValid;
- String m_aNewPassword;
+ OUString m_aNewPassword;
- String m_aEndRedliningWarning;
+ OUString m_aEndRedliningWarning;
bool m_bEndRedliningWarningDone;
DECL_LINK( RecordChangesCBToggleHdl, void* );
@@ -203,8 +203,8 @@ sal_Bool SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & )
// sanity checks
DBG_ASSERT( bDoRecordChanges || !bDoChangeProtection, "no change recording should imply no change protection" );
DBG_ASSERT( bDoChangeProtection || !bDoRecordChanges, "no change protection should imply no change recording" );
- DBG_ASSERT( !bDoChangeProtection || m_aNewPassword.Len() > 0, "change protection should imply password length is > 0" );
- DBG_ASSERT( bDoChangeProtection || m_aNewPassword.Len() == 0, "no change protection should imply password length is 0" );
+ DBG_ASSERT( !bDoChangeProtection || !m_aNewPassword.isEmpty(), "change protection should imply password length is > 0" );
+ DBG_ASSERT( bDoChangeProtection || m_aNewPassword.isEmpty(), "no change protection should imply password length is 0" );
// change recording
if (bDoRecordChanges != pCurDocShell->IsChangeRecording())
@@ -348,7 +348,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
&& m_pProtectPB->IsVisible();
if (!bAlreadyDone && bNeedPasssword)
{
- String aPasswordText;
+ OUString aPasswordText;
// dialog canceled or no password provided
if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText ))
@@ -368,7 +368,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
// remember required values to change protection and change recording in
// FillItemSet_Impl later on if password was correct.
m_bNewPasswordIsValid = true;
- m_aNewPassword = String();
+ m_aNewPassword = "";
m_pProtectPB->Show();
m_pUnProtectPB->Hide();
}
@@ -387,7 +387,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl)
const bool bCurrentProtection = m_pUnProtectPB->IsVisible();
// ask user for password (if still necessary)
- String aPasswordText;
+ OUString aPasswordText;
bool bNewProtection = !bCurrentProtection;
const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed;
if (bNeedPassword)
@@ -410,7 +410,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl)
// remember required values to change protection and change recording in
// FillItemSet_Impl later on if password was correct.
m_bNewPasswordIsValid = true;
- m_aNewPassword = bNewProtection? aPasswordText : String();
+ m_aNewPassword = bNewProtection? aPasswordText : OUString();
m_pRecordChangesCB->Check( bNewProtection );
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 06da27c6..891f89d 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -264,34 +264,34 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
if ( bWithButtons )
{
// Read Configuration
- String aWindowId = OUString("SplitWindow");
+ OUString aWindowId("SplitWindow");
aWindowId += OUString::number( (sal_Int32) eTbxAlign );
SvtViewOptions aWinOpt( E_WINDOW, aWindowId );
- String aWinData;
+ OUString aWinData;
Any aUserItem = aWinOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- aWinData = String( aTemp );
- if ( aWinData.Len() && aWinData.GetChar( (sal_uInt16) 0 ) == 'V' )
+ aWinData = aTemp;
+ if ( !aWinData.isEmpty() && aWinData[0] == 'V' )
{
- pEmptyWin->nState = (sal_uInt16) aWinData.GetToken( 1, ',' ).ToInt32();
+ pEmptyWin->nState = (sal_uInt16) aWinData.getToken( 1, ',' ).toInt32();
if ( pEmptyWin->nState & 2 )
pEmptyWin->bFadeIn = sal_True;
bPinned = sal_True; // always assume pinned - floating mode not used anymore
sal_uInt16 i=2;
- sal_uInt16 nCount = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32();
+ sal_uInt16 nCount = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
SfxDock_Impl *pDock = new SfxDock_Impl;
pDock->pWin = 0;
pDock->bNewLine = sal_False;
pDock->bHide = sal_True;
- pDock->nType = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32();
+ pDock->nType = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
if ( !pDock->nType )
{
// could mean NewLine
- pDock->nType = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32();
+ pDock->nType = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
if ( !pDock->nType )
{
// Read error
@@ -367,7 +367,7 @@ void SfxSplitWindow::SaveConfig_Impl()
aWinData.append(static_cast<sal_Int32>(pDock->nType));
}
- String aWindowId = OUString("SplitWindow");
+ OUString aWindowId("SplitWindow");
aWindowId += OUString::number( (sal_Int32) GetAlign() );
SvtViewOptions aWinOpt( E_WINDOW, aWindowId );
aWinOpt.SetUserItem( USERITEM_NAME, makeAny( aWinData.makeStringAndClear() ) );
diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
index 66fb596..531fa1b4 100644
--- a/sfx2/source/dialog/srchdlg.cxx
+++ b/sfx2/source/dialog/srchdlg.cxx
@@ -87,18 +87,18 @@ void SearchDialog::LoadConfig()
OUString aTemp;
if ( aUserItem >>= aTemp )
{
- String sUserData( aTemp );
+ OUString sUserData( aTemp );
DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" );
sal_Int32 nIdx = 0;
- String sSearchText = sUserData.GetToken( 0, ';', nIdx );
- m_aWholeWordsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
- m_aMatchCaseBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
- m_aWrapAroundBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
- m_aBackwardsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
+ OUString sSearchText = sUserData.getToken( 0, ';', nIdx );
+ m_aWholeWordsBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
+ m_aMatchCaseBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
+ m_aWrapAroundBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
+ m_aBackwardsBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
nIdx = 0;
while ( nIdx != -1 )
- m_aSearchEdit.InsertEntry( sSearchText.GetToken( 0, '\t', nIdx ) );
+ m_aSearchEdit.InsertEntry( sSearchText.getToken( 0, '\t', nIdx ) );
m_aSearchEdit.SelectEntryPos(0);
}
}
@@ -110,21 +110,21 @@ void SearchDialog::SaveConfig()
{
SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName );
aViewOpt.SetWindowState(OStringToOUString(m_sWinState, RTL_TEXTENCODING_ASCII_US));
- String sUserData;
+ OUString sUserData;
sal_uInt16 i = 0, nCount = std::min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT );
for ( ; i < nCount; ++i )
{
sUserData += m_aSearchEdit.GetEntry(i);
- sUserData += '\t';
+ sUserData += "\t";
}
sUserData = comphelper::string::stripStart(sUserData, '\t');
- sUserData += ';';
+ sUserData += ";";
sUserData += OUString::number( m_aWholeWordsBox.IsChecked() ? 1 : 0 );
- sUserData += ';';
+ sUserData += ";";
sUserData += OUString::number( m_aMatchCaseBox.IsChecked() ? 1 : 0 );
- sUserData += ';';
+ sUserData += ";";
sUserData += OUString::number( m_aWrapAroundBox.IsChecked() ? 1 : 0 );
- sUserData += ';';
+ sUserData += ";";
sUserData += OUString::number( m_aBackwardsBox.IsChecked() ? 1 : 0 );
Any aUserItem = makeAny( OUString( sUserData ) );
@@ -133,7 +133,7 @@ void SearchDialog::SaveConfig()
IMPL_LINK_NOARG(SearchDialog, FindHdl)
{
- String sSrchTxt = m_aSearchEdit.GetText();
+ OUString sSrchTxt = m_aSearchEdit.GetText();
sal_uInt16 nPos = m_aSearchEdit.GetEntryPos( sSrchTxt );
if ( nPos > 0 && nPos != COMBOBOX_ENTRY_NOTFOUND )
m_aSearchEdit.RemoveEntryAt(nPos);
@@ -145,7 +145,7 @@ IMPL_LINK_NOARG(SearchDialog, FindHdl)
IMPL_LINK_NOARG(SearchDialog, ToggleHdl)
{
- String sTemp = m_aWrapAroundBox.GetText();
+ OUString sTemp = m_aWrapAroundBox.GetText();
m_aWrapAroundBox.SetText( m_sToggleText );
m_sToggleText = sTemp;
return 0;
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index d992593..a6ee323 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -495,8 +495,8 @@ SfxTabDialog::~SfxTabDialog()
{
// save settings of all pages (user data)
pDataObject->pTabPage->FillUserData();
- String aPageData( pDataObject->pTabPage->GetUserData() );
- if ( aPageData.Len() )
+ OUString aPageData( pDataObject->pTabPage->GetUserData() );
+ if ( !aPageData.isEmpty() )
{
// save settings of all pages (user data)
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
@@ -864,8 +864,8 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
if ( pDataObject->pTabPage )
{
pDataObject->pTabPage->FillUserData();
- String aPageData( pDataObject->pTabPage->GetUserData() );
- if ( aPageData.Len() )
+ OUString aPageData( pDataObject->pTabPage->GetUserData() );
+ if ( !aPageData.isEmpty() )
{
// save settings of this page (user data)
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
@@ -1302,11 +1302,11 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
pDataObject->pTabPage = pTabPage;
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
- String sUserData;
+ OUString sUserData;
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
- sUserData = String( aTemp );
+ sUserData = aTemp;
pTabPage->SetUserData( sUserData );
Size aSiz = pTabPage->GetSizePixel();
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index 180115b..eaf831f 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -869,7 +869,7 @@ namespace sfx2
);
virtual ~TaskPaneController_Impl();
- void SetDefaultTitle( const String& i_rTitle );
+ void SetDefaultTitle( const OUString& i_rTitle );
void ActivateToolPanel( const OUString& i_rPanelURL );
protected:
@@ -971,7 +971,7 @@ namespace sfx2
}
// -----------------------------------------------------------------------------------------------------------------
- void TaskPaneController_Impl::SetDefaultTitle( const String& i_rTitle )
+ void TaskPaneController_Impl::SetDefaultTitle( const OUString& i_rTitle )
{
m_sDefaultTitle = i_rTitle;
impl_updateDockingWindowTitle();
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 08bf350..2a55713 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -516,11 +516,11 @@ typedef std::vector<OUString> ExpandedEntries_t;
class StyleTreeListBox_Impl : public DropListBox_Impl
{
private:
- SvTreeListEntry* pCurEntry;
+ SvTreeListEntry* pCurEntry;
Link aDoubleClickLink;
Link aDropLink;
- String aParent;
- String aStyle;
+ OUString aParent;
+ OUString aStyle;
protected:
virtual void Command( const CommandEvent& rMEvt );
@@ -538,8 +538,8 @@ public:
void SetDoubleClickHdl(const Link &rLink) { aDoubleClickLink = rLink; }
void SetDropHdl(const Link &rLink) { aDropLink = rLink; }
using SvTreeListBox::GetParent;
- const String& GetParent() const { return aParent; }
- const String& GetStyle() const { return aStyle; }
+ const OUString& GetParent() const { return aParent; }
+ const OUString& GetStyle() const { return aStyle; }
void MakeExpanded_Impl(ExpandedEntries_t& rEntries) const;
virtual PopupMenu* CreateContextMenu( void );
@@ -705,13 +705,13 @@ class StyleTreeArr_Impl;
struct StyleTree_Impl
{
- String aName;
- String aParent;
+ OUString aName;
+ OUString aParent;
StyleTreeArr_Impl *pChildren;
sal_Bool bIsExpanded;
- sal_Bool HasParent() const { return aParent.Len() != 0; }
+ sal_Bool HasParent() const { return !aParent.isEmpty(); }
- StyleTree_Impl(const String &rName, const String &rParent):
+ StyleTree_Impl(const OUString &rName, const OUString &rParent):
aName(rName), aParent(rParent), pChildren(0), bIsExpanded(0) {}
~StyleTree_Impl();
void Put(StyleTree_Impl* pIns, sal_uIntPtr lPos=ULONG_MAX);
@@ -1046,7 +1046,7 @@ void SfxCommonTemplateDialog_Impl::Initialize()
SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
{
- String aEmpty;
+ OUString aEmpty;
if ( bIsWater )
Execute_Impl(SID_STYLE_WATERCAN, aEmpty, aEmpty, 0);
GetWindow()->Hide();
@@ -1111,7 +1111,7 @@ SfxStyleSheetBase *SfxCommonTemplateDialog_Impl::GetSelectedStyle() const
{
if (!IsInitialized() || !pStyleSheetPool || !HasSelectedStyle())
return NULL;
- const String aTemplName( GetSelectedEntry() );
+ const OUString aTemplName( GetSelectedEntry() );
const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
return pStyleSheetPool->Find( aTemplName, pItem->GetFamily(), SFXSTYLEBIT_ALL );
}
@@ -1277,7 +1277,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
pTreeBox->SetUpdateMode( sal_True );
- String aStyle;
+ OUString aStyle;
if(pState) // Select current entry
aStyle = pState->GetStyleName();
SelectStyle(aStyle);
@@ -1422,7 +1422,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
}
// Selects the current style if any
SfxTemplateItem *pState = pFamilyState[nActFamily-1];
- String aStyle;
+ OUString aStyle;
if(pState)
aStyle = pState->GetStyleName();
SelectStyle(aStyle);
@@ -1586,7 +1586,7 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
else
nAppFilter = pItem->GetValue();
}
- const String aStyle(pItem->GetStyleName());
+ const OUString aStyle(pItem->GetStyleName());
SelectStyle(aStyle);
EnableDelete();
EnableNew( bCanNew );
@@ -1608,7 +1608,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, pTim )
SfxTemplateItem *pState = pFamilyState[nActFamily-1];
if(pState)
{
- const String aStyle(pState->GetStyleName());
+ const OUString aStyle(pState->GetStyleName());
SelectStyle(aStyle);
EnableDelete();
}
@@ -1652,8 +1652,8 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
if( pStyleSheetPool )
{
- String aStr = GetSelectedEntry();
- if( aStr.Len() && pStyleSheetPool )
+ OUString aStr = GetSelectedEntry();
+ if( !aStr.isEmpty() && pStyleSheetPool )
{
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
if( !pItem ) break;
@@ -1766,7 +1766,7 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl(
if(SID_STYLE_UPDATE_BY_EXAMPLE == nId)
{
// Special solution for Numbering update in Writer
- const String aTemplName(GetSelectedEntry());
+ const OUString aTemplName(GetSelectedEntry());
aUpdName.SetValue(aTemplName);
pItems[ nCount++ ] = &aUpdName;
}
@@ -1822,7 +1822,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
bHierarchical=sal_True;
m_bWantHierarchical = sal_True;
SaveSelection(); // fdo#61429 store "hierarchical"
- const String aSelectEntry( GetSelectedEntry());
+ const OUString aSelectEntry( GetSelectedEntry());
aFmtLb.Hide();
pTreeBox = new StyleTreeListBox_Impl(
@@ -1895,7 +1895,7 @@ void SfxCommonTemplateDialog_Impl::FamilySelect(sal_uInt16 nEntry)
void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
{
- String aEmpty;
+ OUString aEmpty;
switch(nEntry)
{
case SID_STYLE_WATERCAN:
@@ -1906,7 +1906,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
// when a template is chosen.
if(!bState && aFmtLb.GetSelectionCount())
{
- const String aTemplName(
+ const OUString aTemplName(
GetSelectedEntry());
Execute_Impl(
SID_STYLE_WATERCAN, aTemplName, aEmpty,
@@ -1945,7 +1945,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
if(RET_OK == pDlg->Execute())
{
pStyleSheetPool->SetSearchMask(eFam, nFilter);
- const String aTemplName(pDlg->GetName());
+ const OUString aTemplName(pDlg->GetName());
Execute_Impl(SID_STYLE_NEW_BY_EXAMPLE,
aTemplName, aEmpty,
(sal_uInt16)GetFamilyItem_Impl()->GetFamily(),
@@ -2056,7 +2056,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, DropHdl, StyleTreeListBox_Impl *, pBox
// Handler for the New-Buttons
void SfxCommonTemplateDialog_Impl::NewHdl(void *)
{
- String aEmpty;
+ OUString aEmpty;
if ( nActFamily != 0xffff && (aFmtLb.GetSelectionCount() <= 1))
{
Window* pTmp;
@@ -2097,7 +2097,7 @@ void SfxCommonTemplateDialog_Impl::EditHdl(void *)
if(IsInitialized() && HasSelectedStyle())
{
sal_uInt16 nFilter = nActFilter;
- String aTemplName(GetSelectedEntry());
+ OUString aTemplName(GetSelectedEntry());
GetSelectedStyle(); // -Wall required??
Window* pTmp;
//DefModalDialogParent set for modality of the following dialogs
@@ -2106,7 +2106,7 @@ void SfxCommonTemplateDialog_Impl::EditHdl(void *)
Application::SetDefDialogParent( pWindow->GetParent() );
else
Application::SetDefDialogParent( pWindow );
- if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, String(),
+ if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),
(sal_uInt16)GetFamilyItem_Impl()->GetFamily(), 0, &nFilter ) )
{
}
@@ -2122,13 +2122,13 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
if ( IsInitialized() && HasSelectedStyle() )
{
bool bUsedStyle = 0; // one of the selected styles are used in the document?
- String aRet;
+ OUString aRet;
std::vector<SvTreeListEntry*> aList;
SvTreeListEntry* pEntry = aFmtLb.FirstSelected();
const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
- String aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
+ OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
aMsg += SfxResId(STR_DELETE_STYLE).toString();
while (pEntry)
@@ -2140,7 +2140,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
else
aRet = aFmtLb.GetEntryText( pEntry );
- const String aTemplName( aRet );
+ const OUString aTemplName( aRet );
SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( aTemplName, pItem->GetFamily(), SFXSTYLEBIT_ALL );
@@ -2180,11 +2180,11 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
else
aRet = aFmtLb.GetEntryText( *it );
- const String aTemplName( aRet );
+ const OUString aTemplName( aRet );
PrepareDeleteAction();
bDontUpdate = sal_True; // To prevent the Treelistbox to shut down while deleting
Execute_Impl( SID_STYLE_DELETE, aTemplName,
- String(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
+ OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
if ( pTreeBox )
{
@@ -2202,12 +2202,12 @@ void SfxCommonTemplateDialog_Impl::HideHdl(void *)
{
if ( IsInitialized() && HasSelectedStyle() )
{
- const String aTemplName( GetSelectedEntry() );
+ const OUString aTemplName( GetSelectedEntry() );
SfxStyleSheetBase* pStyle = GetSelectedStyle();
if ( pStyle )
{
Execute_Impl( SID_STYLE_HIDE, aTemplName,
- String(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
+ OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
}
}
}
@@ -2216,12 +2216,12 @@ void SfxCommonTemplateDialog_Impl::ShowHdl(void *)
{
if ( IsInitialized() && HasSelectedStyle() )
{
- const String aTemplName( GetSelectedEntry() );
+ const OUString aTemplName( GetSelectedEntry() );
SfxStyleSheetBase* pStyle = GetSelectedStyle();
if ( pStyle )
{
Execute_Impl( SID_STYLE_SHOW, aTemplName,
- String(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
+ OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
}
}
}
@@ -2233,7 +2233,7 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
if(IsInitialized() && HasSelectedStyle())
{
OSL_ENSURE(pStyleSheetPool, "No StyleSheetPool");
- const String aTemplName(GetSelectedEntry());
+ const OUString aTemplName(GetSelectedEntry());
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
const SfxStyleFamily eFam = pItem->GetFamily();
sal_uInt16 nFilter = 0;
@@ -2286,7 +2286,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, pControl )
{
sal_uInt16 nModifier = aFmtLb.GetModifier();
Execute_Impl(SID_STYLE_APPLY,
- GetSelectedEntry(), String(),
+ GetSelectedEntry(), OUString(),
( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(),
0, 0, &nModifier );
}
@@ -2308,7 +2308,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox
// only if that region is allowed
0 != pFamilyState[nActFamily-1] && (aFmtLb.GetSelectionCount() <= 1) )
{
- String aEmpty;
+ OUString aEmpty;
Execute_Impl(SID_STYLE_WATERCAN,
aEmpty, aEmpty, 0);
Execute_Impl(SID_STYLE_WATERCAN,
@@ -2661,7 +2661,7 @@ void SfxTemplateDialog_Impl::Command( const CommandEvent& rCEvt )
void SfxTemplateDialog_Impl::EnableItem(sal_uInt16 nMesId, sal_Bool bCheck)
{
- String aEmpty;
+ OUString aEmpty;
switch(nMesId)
{
case SID_STYLE_WATERCAN :
@@ -2855,7 +2855,7 @@ void SfxCommonTemplateDialog_Impl::UpdateFamily_Impl()
// only if that area is allowed
0 != pFamilyState[ nActFamily - 1 ] )
Execute_Impl( SID_STYLE_APPLY, GetSelectedEntry(),
- String(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
+ OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
}
void SfxCommonTemplateDialog_Impl::ReplaceUpdateButtonByMenu()
{
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 24fdc2b..abc4644 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -50,9 +50,9 @@ using ::std::vector;
// **************************************************************************
struct SfxVersionInfo
{
- String aName;
- String aComment;
- String aAuthor;
+ OUString aName;
+ OUString aComment;
+ OUString aAuthor;
DateTime aCreationDate;
SfxVersionInfo();
@@ -265,8 +265,8 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
// set dialog title (filename or docinfo title)
- String sText = GetText();
- ( sText += ' ' ) += pViewFrame->GetObjectShell()->GetTitle();
+ OUString sText = GetText();
+ sText = sText + " " + pViewFrame->GetObjectShell()->GetTitle();
SetText( sText );
Init_Impl();
@@ -274,28 +274,28 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
m_pVersionBox->setColSizes();
}
-String ConvertWhiteSpaces_Impl( const String& rText )
+String ConvertWhiteSpaces_Impl( const OUString& rText )
{
// converted linebreaks and tabs to blanks; it's necessary for the display
- String sConverted;
- const sal_Unicode* pChars = rText.GetBuffer();
+ OUStringBuffer sConverted;
+ const sal_Unicode* pChars = rText.getStr();
while ( *pChars )
{
switch ( *pChars )
{
case '\n' :
case '\t' :
- sConverted += ' ';
+ sConverted.append(' ');
break;
default:
- sConverted += *pChars;
+ sConverted.append(*pChars);
}
++pChars;
}
- return sConverted;
+ return sConverted.makeStringAndClear();
}
void SfxVersionDialog::Init_Impl()
@@ -309,10 +309,10 @@ void SfxVersionDialog::Init_Impl()
for ( size_t n = 0; n < m_pTable->size(); ++n )
{
SfxVersionInfo *pInfo = m_pTable->at( n );
- String aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
- aEntry += '\t';
+ OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
+ aEntry += "\t";
aEntry += pInfo->aAuthor;
- aEntry += '\t';
+ aEntry += "\t";
aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
pEntry->SetUserData( pInfo );
commit f9e78cd49f3c22b969531fa787ca63261d548f80
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 28 15:17:08 2013 +0200
convert sfx2/source/doc/* from String to OUString
Change-Id: Id9a58c4dca372dc36bdd8a359c7c0101cfffd88c
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 1090856..641fd68 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -141,8 +141,8 @@ void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& ) thr
//====================================================================
-void SetTemplate_Impl( const String &rFileName,
- const String &rLongName,
+void SetTemplate_Impl( const OUString &rFileName,
+ const OUString &rLongName,
SfxObjectShell *pDoc)
{
// write TemplateName to DocumentProperties of document
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index e264cde..7ca2879 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -73,7 +73,7 @@ struct SfxObjectFactory_Impl
SfxFilterContainer* pFilterContainer;
SfxModule* pModule;
sal_uInt16 nImageId;
- String aStandardTemplate;
+ OUString aStandardTemplate;
sal_Bool bTemplateInitialized;
SvGlobalName aClassName;
@@ -107,22 +107,22 @@ SfxObjectFactory::SfxObjectFactory
DBG_CTOR(SfxObjectFactory, 0);
pImpl->pFilterContainer = new SfxFilterContainer( OUString::createFromAscii( pName ) );
- String aShortName( OUString::createFromAscii( pShortName ) );
- aShortName.ToLowerAscii();
+ OUString aShortName( OUString::createFromAscii( pShortName ) );
+ aShortName = aShortName.toAsciiLowerCase();
pImpl->aClassName = rName;
- if ( aShortName.EqualsAscii( "swriter" ) )
+ if ( aShortName == "swriter" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SW );
- else if ( aShortName.EqualsAscii( "swriter/web" ) )
+ else if ( aShortName == "swriter/web" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWWEB );
- else if ( aShortName.EqualsAscii( "swriter/globaldocument" ) )
+ else if ( aShortName == "swriter/globaldocument" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWGLOB );
- else if ( aShortName.EqualsAscii( "scalc" ) )
+ else if ( aShortName == "scalc" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SC );
- else if ( aShortName.EqualsAscii( "simpress" ) )
+ else if ( aShortName == "simpress" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SI );
- else if ( aShortName.EqualsAscii( "sdraw" ) )
+ else if ( aShortName == "sdraw" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SD );
- else if ( aShortName.EqualsAscii( "message" ) )
+ else if ( aShortName == "message" )
pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_MESSAGE );
}
@@ -146,7 +146,7 @@ void SfxObjectFactory::RegisterViewFactory
{
#if OSL_DEBUG_LEVEL > 0
{
- const String sViewName( rFactory.GetAPIViewName() );
+ const OUString sViewName( rFactory.GetAPIViewName() );
for ( SfxViewFactoryArr_Impl::const_iterator it = pImpl->aViewFactoryArr.begin(); it != pImpl->aViewFactoryArr.end(); ++it )
{
if ( (*it)->GetAPIViewName() != sViewName )
@@ -208,7 +208,7 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU
static OUString DEF_TPL_STR("/soffice.");
OUString sURL;
- String sPath;
+ OUString sPath;
sal_Unicode aPathBuffer[nMaxPathSize];
if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize ))
sPath = OUString( aPathBuffer );
@@ -388,7 +388,7 @@ OUString SfxObjectFactory::GetModuleName() const
OUString sDocService(GetDocumentServiceName());
::comphelper::SequenceAsHashMap aPropSet( xModuleManager->getByName(sDocService) );
OUString sModuleName = aPropSet.getUnpackedValueOrDefault("ooSetupFactoryUIName", OUString());
- return String(sModuleName);
+ return sModuleName;
}
catch(const css::uno::RuntimeException&)
{
@@ -398,7 +398,7 @@ OUString SfxObjectFactory::GetModuleName() const
{
}
- return String();
+ return OUString();
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index cfa7c67..60bcd20 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -746,9 +746,9 @@ sal_Bool SfxMedium::IsPreview_Impl()
SFX_ITEMSET_ARG( GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, false);
if ( pFlags )
{
- String aFileFlags = pFlags->GetValue();
- aFileFlags.ToUpperAscii();
- if ( STRING_NOTFOUND != aFileFlags.Search( 'B' ) )
+ OUString aFileFlags = pFlags->GetValue();
+ aFileFlags = aFileFlags.toAsciiUpperCase();
+ if ( -1 != aFileFlags.indexOf( 'B' ) )
bPreview = true;
}
}
@@ -965,7 +965,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< OUString >& a
namespace
{
- bool isSuitableProtocolForLocking(const String & rLogicName)
+ bool isSuitableProtocolForLocking(const OUString & rLogicName)
{
INetURLObject aUrl( rLogicName );
INetProtocol eProt = aUrl.GetProtocol();
@@ -1047,7 +1047,7 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
{
// the file is not readonly, check the ACL
- String aPhysPath;
+ OUString aPhysPath;
if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() );
}
@@ -1357,7 +1357,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf
{
// Unpack Stream in TempDir
::utl::TempFile aTempFile;
- String aTmpName = aTempFile.GetURL();
+ OUString aTmpName = aTempFile.GetURL();
SvFileStream aTmpStream( aTmpName, SFX_STREAM_READWRITE );
*pStream >> aTmpStream;
@@ -2161,8 +2161,8 @@ void SfxMedium::DoBackup_Impl()
bool bSuccess = false;
// get path for backups
- String aBakDir = SvtPathOptions().GetBackupPath();
- if( aBakDir.Len() )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list