summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-12-09 01:58:49 -0500
committerAugust Sodora <augsod@gmail.com>2011-12-09 01:58:49 -0500
commitf5549c9429c8dbda4e5ad213f1f5c811567625bd (patch)
tree8a4843524934e41af718f89af9668b459acf4c83 /basctl
parent7c8b0959fd24d4938d26e732817b59a57dda3f1d (diff)
String->OUString
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx62
-rw-r--r--basctl/source/basicide/baside2.hxx9
-rw-r--r--basctl/source/basicide/baside3.cxx45
-rw-r--r--basctl/source/basicide/basides1.cxx83
-rw-r--r--basctl/source/basicide/basides2.cxx47
-rw-r--r--basctl/source/basicide/basides3.cxx17
-rw-r--r--basctl/source/basicide/basidesh.cxx34
-rw-r--r--basctl/source/basicide/basobj3.cxx2
-rw-r--r--basctl/source/basicide/bastypes.cxx26
-rw-r--r--basctl/source/basicide/moduldlg.cxx14
-rw-r--r--basctl/source/inc/baside3.hxx8
-rw-r--r--basctl/source/inc/basidesh.hxx30
-rw-r--r--basctl/source/inc/bastypes.hxx16
13 files changed, 190 insertions, 203 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index ddb3781e3f87..d1a15898505c 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -168,8 +168,8 @@ void lcl_ConvertTabsToSpaces( String& rLine )
}
}
-ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
- String aName, ::rtl::OUString& aModule )
+ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, ::rtl::OUString aLibName,
+ ::rtl::OUString aName, ::rtl::OUString& aModule )
:IDEBaseWindow( pParent, rDocument, aLibName, aName )
,aXEditorWindow( this )
,m_aModule( aModule )
@@ -304,7 +304,7 @@ sal_Bool ModulWindow::BasicExecute()
{
if ( !aDocument.allowMacros() )
{
- WarningBox( this, WB_OK, String( IDEResId( RID_STR_CANNOTRUNMACRO ) ) ).Execute();
+ WarningBox( this, WB_OK, ResId::toString( IDEResId( RID_STR_CANNOTRUNMACRO ) ) ).Execute();
return sal_False;
}
}
@@ -436,13 +436,13 @@ sal_Bool ModulWindow::LoadBasic()
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY );
}
- if ( aCurPath.Len() )
+ if ( !aCurPath.isEmpty() )
xFP->setDisplayDirectory ( aCurPath );
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
- xFltMgr->appendFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) );
- xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
- xFltMgr->setCurrentFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) );
+ xFltMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) );
+ xFltMgr->appendFilter( ResId::toString(IDEResId( RID_STR_FILTER_ALLFILES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
+ xFltMgr->setCurrentFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) );
if( xFP->execute() == RET_OK )
{
@@ -469,7 +469,7 @@ sal_Bool ModulWindow::LoadBasic()
bDone = sal_True;
}
else
- ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_COULDNTREAD ) ) ).Execute();
+ ErrorBox( this, WB_OK | WB_DEF_OK, ResId::toString( IDEResId( RID_STR_COULDNTREAD ) ) ).Execute();
}
return bDone;
}
@@ -496,13 +496,13 @@ sal_Bool ModulWindow::SaveBasicSource()
aValue <<= (sal_Bool) sal_True;
xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
- if ( aCurPath.Len() )
+ if ( !aCurPath.isEmpty() )
xFP->setDisplayDirectory ( aCurPath );
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
- xFltMgr->appendFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) );
- xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
- xFltMgr->setCurrentFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) );
+ xFltMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) );
+ xFltMgr->appendFilter( ResId::toString(IDEResId( RID_STR_FILTER_ALLFILES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
+ xFltMgr->setCurrentFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) );
if( xFP->execute() == RET_OK )
{
@@ -530,14 +530,13 @@ sal_Bool ModulWindow::SaveBasicSource()
return bDone;
}
-sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
+sal_Bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName );
sal_Bool ModulWindow::ImportDialog()
{
const ScriptDocument& rDocument = GetDocument();
- String aLibName = GetLibName();
- sal_Bool bRet = implImportDialog( this, aCurPath, rDocument, aLibName );
- return bRet;
+ ::rtl::OUString aLibName = GetLibName();
+ return implImportDialog( this, aCurPath, rDocument, aLibName );
}
sal_Bool ModulWindow::ToggleBreakPoint( sal_uLong nLine )
@@ -667,7 +666,7 @@ long ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
// ReturnWert: BOOL
// FALSE: cancel
// TRUE: go on....
- String aErrorText( pBasic->GetErrorText() );
+ ::rtl::OUString aErrorText( pBasic->GetErrorText() );
sal_uInt16 nErrorLine = pBasic->GetLine() - 1;
sal_uInt16 nErrCol1 = pBasic->GetCol1();
sal_uInt16 nErrCol2 = pBasic->GetCol2();
@@ -677,18 +676,17 @@ long ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
AssertValidEditEngine();
GetEditView()->SetSelection( TextSelection( TextPaM( nErrorLine, nErrCol1 ), TextPaM( nErrorLine, nErrCol2 ) ) );
- String aErrorTextPrefix;
+ ::rtl::OUStringBuffer aErrorTextPrefixBuf;
if( pBasic->IsCompilerError() )
- {
- aErrorTextPrefix = String( IDEResId( RID_STR_COMPILEERROR ) );
- }
+ aErrorTextPrefixBuf.append(ResId::toString(IDEResId(RID_STR_COMPILEERROR)));
else
{
- aErrorTextPrefix = String( IDEResId( RID_STR_RUNTIMEERROR ) );
- aErrorTextPrefix += StarBASIC::GetVBErrorCode( pBasic->GetErrorCode() );
- aErrorTextPrefix += ' ';
+ aErrorTextPrefixBuf.append(ResId::toString(IDEResId(RID_STR_RUNTIMEERROR)));
+ aErrorTextPrefixBuf.append(StarBASIC::GetVBErrorCode(pBasic->GetErrorCode()));
+ aErrorTextPrefixBuf.append(' ');
pLayout->GetStackWindow().UpdateCalls();
}
+ ::rtl::OUString aErrorTextPrefix(aErrorTextPrefixBuf.makeStringAndClear());
// if other basic, the IDE should try to display the correct module
sal_Bool bMarkError = ( pBasic == GetBasic() ) ? sal_True : sal_False;
if ( bMarkError )
@@ -765,12 +763,12 @@ void ModulWindow::BasicAddWatch()
if ( !GetEditView()->HasSelection() )
{
TextPaM aWordStart;
- String aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aWordStart );
- if ( aWord.Len() )
+ ::rtl::OUString aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aWordStart );
+ if ( !aWord.isEmpty() )
{
TextSelection aSel( aWordStart );
sal_uInt16& rIndex = aSel.GetEnd().GetIndex();
- rIndex = rIndex + aWord.Len();
+ rIndex = rIndex + aWord.getLength();
GetEditView()->SetSelection( aSel );
bAdd = sal_True;
}
@@ -1187,23 +1185,19 @@ void ModulWindow::GoOnTop()
BasicIDEGlobals::GetShell()->GetViewFrame()->ToTop();
}
-String ModulWindow::GetSbModuleName()
+::rtl::OUString ModulWindow::GetSbModuleName()
{
- String aModuleName;
+ ::rtl::OUString aModuleName;
if ( XModule().Is() )
aModuleName = xModule->GetName();
return aModuleName;
}
-
-
-String ModulWindow::GetTitle()
+::rtl::OUString ModulWindow::GetTitle()
{
return GetSbModuleName();
}
-
-
void ModulWindow::FrameWindowMoved()
{
}
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 1804df9bf01f..b8aa9e87ecb5 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -324,7 +324,7 @@ private:
BasicStatus aStatus;
SbModuleRef xModule;
ModulWindowLayout* pLayout;
- String aCurPath;
+ ::rtl::OUString aCurPath;
::rtl::OUString m_aModule;
long BasicErrorHdl( StarBASIC* pBasic );
@@ -349,8 +349,7 @@ protected:
public:
TYPEINFO();
- ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
- String aName, ::rtl::OUString& aModule );
+ ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, ::rtl::OUString aLibName, ::rtl::OUString aName, ::rtl::OUString& aModule );
~ModulWindow();
@@ -363,7 +362,7 @@ public:
virtual sal_Int32 countPages( Printer* pPrinter );
// print page
virtual void printPage( sal_Int32 nPage, Printer* pPrinter );
- virtual String GetTitle();
+ virtual ::rtl::OUString GetTitle();
virtual BasicEntryDescriptor CreateEntryDescriptor();
virtual sal_Bool AllowUndo();
virtual void SetReadOnly( sal_Bool bReadOnly );
@@ -375,7 +374,7 @@ public:
SbModule* GetSbModule() { return xModule; }
void SetSbModule( SbModule* pModule ) { xModule = pModule; }
- String GetSbModuleName();
+ ::rtl::OUString GetSbModuleName();
sal_Bool CompileBasic();
sal_Bool BasicRun();
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index a4fbd191d8f5..55e72c9c7270 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-
#define _SDR_NOITEMS
#define _SDR_NOTOUCH
#define _SDR_NOTRANSFORM
@@ -59,6 +58,7 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
@@ -83,7 +83,7 @@ DBG_NAME( DialogWindow )
TYPEINIT1( DialogWindow, IDEBaseWindow );
-DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName,
+DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, ::rtl::OUString aLibName, ::rtl::OUString aName,
const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xDialogModel )
:IDEBaseWindow( pParent, rDocument, aLibName, aName )
,pUndoMgr(NULL)
@@ -104,9 +104,8 @@ DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, St
SetHelpId( HID_BASICIDE_DIALOGWINDOW );
// set readonly mode for readonly libraries
- ::rtl::OUString aOULibName( aLibName );
Reference< script::XLibraryContainer2 > xDlgLibContainer( GetDocument().getLibraryContainer( E_DIALOGS ), UNO_QUERY );
- if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryReadOnly( aOULibName ) )
+ if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) )
SetReadOnly( sal_True );
if ( rDocument.isDocument() && rDocument.isReadOnly() )
@@ -676,7 +675,7 @@ Reference< container::XNameContainer > DialogWindow::GetDialog() const
return pEditor->GetDialog();
}
-sal_Bool DialogWindow::RenameDialog( const String& rNewName )
+sal_Bool DialogWindow::RenameDialog( const ::rtl::OUString& rNewName )
{
if ( !BasicIDE::RenameDialog( this, GetDocument(), GetLibName(), GetName(), rNewName ) )
return sal_False;
@@ -729,12 +728,12 @@ sal_Bool DialogWindow::SaveDialog()
aValue <<= (sal_Bool) sal_True;
xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
- if ( aCurPath.Len() )
+ if ( !aCurPath.isEmpty() )
xFP->setDisplayDirectory ( aCurPath );
xFP->setDefaultName( ::rtl::OUString( GetName() ) );
- String aDialogStr( IDEResId( RID_STR_STDDIALOGNAME ) );
+ ::rtl::OUString aDialogStr(ResId::toString(IDEResId(RID_STR_STDDIALOGNAME)));
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
xFltMgr->appendFilter( aDialogStr, String( RTL_CONSTASCII_USTRINGPARAM( "*.xdl" ) ) );
xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
@@ -973,7 +972,7 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent,
SetImage( QueryBox::GetStandardImage() );
}
-sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName )
+sal_Bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName )
{
sal_Bool bDone = sal_False;
@@ -993,11 +992,11 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
aValue <<= (sal_Bool) sal_True;
xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
- String aCurPath( rCurPath );
- if ( aCurPath.Len() )
+ ::rtl::OUString aCurPath( rCurPath );
+ if ( !aCurPath.isEmpty() )
xFP->setDisplayDirectory ( aCurPath );
- String aDialogStr( IDEResId( RID_STR_STDDIALOGNAME ) );
+ ::rtl::OUString aDialogStr(ResId::toString(IDEResId(RID_STR_STDDIALOGNAME)));
Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
xFltMgr->appendFilter( aDialogStr, String( RTL_CONSTASCII_USTRINGPARAM( "*.xdl" ) ) );
xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
@@ -1033,7 +1032,7 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
- String aXmlDlgName;
+ ::rtl::OUString aXmlDlgName;
Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
if( xDialogModelPropSet.is() )
{
@@ -1047,14 +1046,14 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
catch(const beans::UnknownPropertyException& )
{}
}
- bool bValidName = (aXmlDlgName.Len() != 0);
+ bool bValidName = !aXmlDlgName.isEmpty();
OSL_ASSERT( bValidName );
if( !bValidName )
return bDone;
bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName );
- String aNewDlgName = aXmlDlgName;
+ ::rtl::OUString aNewDlgName = aXmlDlgName;
enum NameClashMode
{
NO_CLASH,
@@ -1064,9 +1063,9 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
NameClashMode eNameClashMode = NO_CLASH;
if( bDialogAlreadyExists )
{
- String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_CLASH_TITLE ) );
- String aQueryBoxText( IDEResId( RID_STR_DLGIMP_CLASH_TEXT ) );
- aQueryBoxText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "$(ARG1)" ) ), aXmlDlgName );
+ ::rtl::OUString aQueryBoxTitle(ResId::toString(IDEResId(RID_STR_DLGIMP_CLASH_TITLE)));
+ ::rtl::OUString aQueryBoxText(ResId::toString(IDEResId(RID_STR_DLGIMP_CLASH_TEXT)));
+ aQueryBoxText = ::comphelper::string::replace(aQueryBoxText, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG1)")), aXmlDlgName);
NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
sal_uInt16 nRet = aQueryBox.Execute();
@@ -1128,8 +1127,8 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
bool bAddDialogLanguagesToLib = false;
if( nOnlyInImportLanguageCount > 0 )
{
- String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_MISMATCH_TITLE ) );
- String aQueryBoxText( IDEResId( RID_STR_DLGIMP_MISMATCH_TEXT ) );
+ ::rtl::OUString aQueryBoxTitle(ResId::toString(IDEResId(RID_STR_DLGIMP_MISMATCH_TITLE)));
+ ::rtl::OUString aQueryBoxText(ResId::toString(IDEResId(RID_STR_DLGIMP_MISMATCH_TEXT)));
LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
sal_uInt16 nRet = aQueryBox.Execute();
if( RET_YES == nRet )
@@ -1279,7 +1278,7 @@ sal_Bool DialogWindow::ImportDialog()
DBG_CHKTHIS( DialogWindow, 0 );
const ScriptDocument& rDocument = GetDocument();
- String aLibName = GetLibName();
+ ::rtl::OUString aLibName = GetLibName();
sal_Bool bRet = implImportDialog( this, aCurPath, rDocument, aLibName );
return bRet;
}
@@ -1309,7 +1308,7 @@ sal_Bool DialogWindow::IsModified()
return pUndoMgr;
}
-String DialogWindow::GetTitle()
+::rtl::OUString DialogWindow::GetTitle()
{
return GetName();
}
@@ -1317,8 +1316,8 @@ String DialogWindow::GetTitle()
BasicEntryDescriptor DialogWindow::CreateEntryDescriptor()
{
ScriptDocument aDocument( GetDocument() );
- String aLibName( GetLibName() );
- String aLibSubName;
+ ::rtl::OUString aLibName( GetLibName() );
+ ::rtl::OUString aLibSubName;
LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName );
return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG );
}
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index b9245db01654..5de3788a3810 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <comphelper/string.hxx>
#include <svl/visitem.hxx>
#include <svtools/xtextedt.hxx>
#include <vcl/msgbox.hxx>
@@ -106,8 +107,8 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
case SID_BASICIDE_DELETECURRENT:
{
ScriptDocument aDocument( pCurWin->GetDocument() );
- String aLibName = pCurWin->GetLibName();
- String aName = pCurWin->GetName();
+ ::rtl::OUString aLibName = pCurWin->GetLibName();
+ ::rtl::OUString aName = pCurWin->GetName();
if ( pCurWin->ISA( ModulWindow ) )
{
@@ -178,9 +179,8 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
else
nFound = ((ModulWindow*)pCurWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem );
- IDEResId nId( RID_STR_SEARCHREPLACES );
- String aReplStr( nId );
- aReplStr.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), String::CreateFromInt32( nFound ) );
+ ::rtl::OUString aReplStr(ResId::toString(IDEResId(RID_STR_SEARCHREPLACES)));
+ aReplStr = ::comphelper::string::replace(aReplStr, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XX")), ::rtl::OUString::valueOf(nFound));
InfoBox( pCurWin, aReplStr ).Execute();
}
else
@@ -200,7 +200,7 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
SfxViewFrame* pViewFrame = GetViewFrame();
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : NULL;
Window* pParent = pChildWin ? pChildWin->GetWindow() : NULL;
- QueryBox aQuery( pParent, WB_YES_NO|WB_DEF_YES, String( IDEResId( RID_STR_SEARCHFROMSTART ) ) );
+ QueryBox aQuery(pParent, WB_YES_NO|WB_DEF_YES, ResId::toString(IDEResId(RID_STR_SEARCHFROMSTART)));
if ( aQuery.Execute() == RET_YES )
{
pWin = aIDEWindowTable.First();
@@ -385,9 +385,9 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
StartListening( *pBasMgr, sal_True /* log on only once */ );
- String aLibName( rInfo.GetLib() );
- if ( !aLibName.Len() )
- aLibName = String::CreateFromAscii( "Standard" );
+ ::rtl::OUString aLibName( rInfo.GetLib() );
+ if ( aLibName.isEmpty() )
+ aLibName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard"));
StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
if ( !pBasic )
{
@@ -409,7 +409,7 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
{
if ( rInfo.GetModule().Len() || !pBasic->GetModules()->Count() )
{
- String aModName = rInfo.GetModule();
+ ::rtl::OUString aModName = rInfo.GetModule();
::rtl::OUString sModuleCode;
if ( aDocument.createModule( aLibName, aModName, sal_False, sModuleCode ) )
@@ -445,15 +445,15 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
DBG_ASSERT( pWin, "Window nicht im Liste, aber in TabBar ?" );
if ( pWin )
{
- String aNewName( rModName.GetValue() );
- String aOldName( pWin->GetName() );
+ ::rtl::OUString aNewName( rModName.GetValue() );
+ ::rtl::OUString aOldName( pWin->GetName() );
if ( aNewName != aOldName )
{
bool bRenameOk = false;
if ( pWin->IsA( TYPE( ModulWindow ) ) )
{
ModulWindow* pModWin = (ModulWindow*)pWin;
- String aLibName = ( pModWin->GetLibName() );
+ ::rtl::OUString aLibName = ( pModWin->GetLibName() );
ScriptDocument aDocument( pWin->GetDocument() );
if ( BasicIDE::RenameModule( pModWin, aDocument, aLibName, aOldName, aNewName ) )
@@ -534,7 +534,7 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
uno::Reference< frame::XModel > xModel( rShellItem.GetValue(), UNO_QUERY );
ScriptDocument aDocument( xModel.is() ? ScriptDocument( xModel ) : ScriptDocument::getApplicationScriptDocument() );
const SfxStringItem& rLibNameItem = (const SfxStringItem&)rReq.GetArgs()->Get( SID_BASICIDE_ARG_LIBNAME );
- String aLibName( rLibNameItem.GetValue() );
+ ::rtl::OUString aLibName( rLibNameItem.GetValue() );
if ( nSlot == SID_BASICIDE_LIBSELECTED )
{
@@ -569,7 +569,7 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
}
else if ( nSlot == SID_BASICIDE_LIBREMOVED )
{
- if ( !m_aCurLibName.Len() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
+ if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
{
RemoveWindows( aDocument, aLibName, sal_True );
if ( aDocument == m_aCurDocument && aLibName == m_aCurLibName )
@@ -611,9 +611,9 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX );
ScriptDocument aDocument( rSbxItem.GetDocument() );
- String aLibName( rSbxItem.GetLibName() );
- String aName( rSbxItem.GetName() );
- if ( !m_aCurLibName.Len() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
+ ::rtl::OUString aLibName( rSbxItem.GetLibName() );
+ ::rtl::OUString aName( rSbxItem.GetName() );
+ if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
{
if ( rSbxItem.GetType() == BASICIDE_TYPE_MODULE )
FindBasWin( aDocument, aLibName, aName, sal_True );
@@ -637,8 +637,8 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX );
ScriptDocument aDocument( rSbxItem.GetDocument() );
- String aLibName( rSbxItem.GetLibName() );
- String aName( rSbxItem.GetName() );
+ ::rtl::OUString aLibName( rSbxItem.GetLibName() );
+ ::rtl::OUString aName( rSbxItem.GetName() );
SetCurLib( aDocument, aLibName );
IDEBaseWindow* pWin = 0;
if ( rSbxItem.GetType() == BASICIDE_TYPE_DIALOG )
@@ -672,8 +672,8 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
SFX_REQUEST_ARG( rReq, pDocumentItem, SfxStringItem, SID_BASICIDE_ARG_DOCUMENT, sal_False );
if ( pDocumentItem )
{
- String sDocumentCaption = pDocumentItem->GetValue();
- if ( sDocumentCaption.Len() )
+ ::rtl::OUString sDocumentCaption = pDocumentItem->GetValue();
+ if ( !sDocumentCaption.isEmpty() )
pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) );
}
@@ -692,16 +692,16 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
if ( !pLibNameItem )
break;
- String aLibName( pLibNameItem->GetValue() );
+ ::rtl::OUString aLibName( pLibNameItem->GetValue() );
pDocument->loadLibraryIfExists( E_SCRIPTS, aLibName );
SetCurLib( *pDocument, aLibName );
SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_BASICIDE_ARG_NAME, sal_False );
if ( pNameItem )
{
- String aName( pNameItem->GetValue() );
- String aModType( String::CreateFromAscii( "Module" ) );
- String aDlgType( String::CreateFromAscii( "Dialog" ) );
- String aType( aModType );
+ ::rtl::OUString aName( pNameItem->GetValue() );
+ ::rtl::OUString aModType(RTL_CONSTASCII_USTRINGPARAM("Module"));
+ ::rtl::OUString aDlgType(RTL_CONSTASCII_USTRINGPARAM("Dialog"));
+ ::rtl::OUString aType( aModType );
SFX_REQUEST_ARG( rReq, pTypeItem, SfxStringItem, SID_BASICIDE_ARG_TYPE, sal_False );
if ( pTypeItem )
aType = pTypeItem->GetValue();
@@ -945,8 +945,8 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
break;
case SID_BASICIDE_LIBSELECTOR:
{
- String aName;
- if ( m_aCurLibName.Len() )
+ ::rtl::OUString aName;
+ if ( !m_aCurLibName.isEmpty() )
{
LibraryLocation eLocation = m_aCurDocument.getLibraryLocation( m_aCurLibName );
aName = CreateMgrAndLibStr( m_aCurDocument.getTitle( eLocation ), m_aCurLibName );
@@ -957,7 +957,7 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
break;
case SID_SEARCH_ITEM:
{
- String aSelected = GetSelectionText( sal_True );
+ ::rtl::OUString aSelected = GetSelectionText( sal_True );
SvxSearchItem& rItem = BasicIDEGlobals::GetExtraData()->GetSearchItem();
rItem.SetSearchString( aSelected );
rSet.Put( rItem );
@@ -965,8 +965,7 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
break;
case SID_BASICIDE_STAT_DATE:
{
- String aDate;
- aDate = String( RTL_CONSTASCII_USTRINGPARAM( "Datum?!" ) );
+ ::rtl::OUString aDate(RTL_CONSTASCII_USTRINGPARAM("Datum?!"));
SfxStringItem aItem( SID_BASICIDE_STAT_DATE, aDate );
rSet.Put( aItem );
}
@@ -994,7 +993,7 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
{
if ( pCurWin )
{
- String aTitle = pCurWin->CreateQualifiedName();
+ ::rtl::OUString aTitle = pCurWin->CreateQualifiedName();
SfxStringItem aItem( SID_BASICIDE_STAT_TITLE, aTitle );
rSet.Put( aItem );
}
@@ -1022,11 +1021,11 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_BASICIDE_CURRENT_LANG:
{
- if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().Len() == 0 )
+ if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
rSet.DisableItem( nWh );
else
{
- String aItemStr;
+ ::rtl::OUString aItemStr;
LocalizationMgr* pCurMgr = GetCurLocalizationMgr();
if ( pCurMgr->isLibraryLocalized() )
{
@@ -1057,7 +1056,7 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_BASICIDE_MANAGE_LANG:
{
- if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().Len() == 0 )
+ if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() )
rSet.DisableItem( nWh );
}
break;
@@ -1250,14 +1249,14 @@ IDEBaseWindow* BasicIDEShell::FindApplicationWindow()
return FindWindow( ScriptDocument::getApplicationScriptDocument() );
}
-IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const String& rLibName, const String& rName, BasicIDEType nType, sal_Bool bFindSuspended )
+IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rName, BasicIDEType nType, sal_Bool bFindSuspended )
{
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin )
{
if ( !pWin->IsSuspended() || bFindSuspended )
{
- if ( !rLibName.Len() || !rName.Len() || nType == BASICIDE_TYPE_UNKNOWN )
+ if ( rLibName.isEmpty() || rName.isEmpty() || nType == BASICIDE_TYPE_UNKNOWN )
{
// return any non-suspended window
return pWin;
@@ -1315,7 +1314,7 @@ long BasicIDEShell::CallBasicBreakHdl( StarBASIC* pBasic )
ModulWindow* BasicIDEShell::ShowActiveModuleWindow( StarBASIC* pBasic )
{
- SetCurLib( ScriptDocument::getApplicationScriptDocument(), String(), false );
+ SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(), false );
SbModule* pActiveModule = StarBASIC::GetActiveModule();
SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
@@ -1335,7 +1334,7 @@ ModulWindow* BasicIDEShell::ShowActiveModuleWindow( StarBASIC* pBasic )
if ( pBasMgr )
{
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
- String aLibName = pLib->GetName();
+ ::rtl::OUString aLibName = pLib->GetName();
pWin = FindBasWin( aDocument, aLibName, pActiveModule->GetName(), sal_True );
DBG_ASSERT( pWin, "Error/Step-Hdl: Fenster wurde nicht erzeugt/gefunden!" );
SetCurLib( aDocument, aLibName );
@@ -1433,8 +1432,8 @@ void BasicIDEShell::Deactivate( sal_Bool bMDI )
IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin );
if ( /* !pWin->IsSuspended() && */ !pWin->CanClose() )
{
- if ( m_aCurLibName.Len() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
- SetCurLib( ScriptDocument::getApplicationScriptDocument(), String(), false );
+ if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
+ SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(), false );
SetCurWindow( pWin, sal_True );
break;
}
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index 8cde3a4afacd..791732153352 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -127,33 +127,31 @@ sal_uInt16 BasicIDEShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffF
void BasicIDEShell::SetMDITitle()
{
- String aTitle;
-
- if ( m_aCurLibName.Len() )
+ ::rtl::OUStringBuffer aTitleBuf;
+ if ( !m_aCurLibName.isEmpty() )
{
LibraryLocation eLocation = m_aCurDocument.getLibraryLocation( m_aCurLibName );
- aTitle = m_aCurDocument.getTitle( eLocation );
- aTitle += '.';
- aTitle += m_aCurLibName;
+ aTitleBuf.append(m_aCurDocument.getTitle(eLocation));
+ aTitleBuf.append('.');
+ aTitleBuf.append(m_aCurLibName);
}
else
- {
- aTitle = String( IDEResId( RID_STR_ALL ) );
- }
+ aTitleBuf.append(ResId::toString(IDEResId(RID_STR_ALL)));
::basctl::DocumentSignature aCurSignature( m_aCurDocument );
if ( aCurSignature.getScriptingSignatureState() == SIGNATURESTATE_SIGNATURES_OK )
{
- aTitle += String::CreateFromAscii( " " );
- aTitle += String( IDEResId( RID_STR_SIGNED ) );
- aTitle += String::CreateFromAscii( " " );
+ aTitleBuf.append(' ');
+ aTitleBuf.append(ResId::toString(IDEResId(RID_STR_SIGNED)));
+ aTitleBuf.append(' ');
}
+ ::rtl::OUString aTitle(aTitleBuf.makeStringAndClear());
SfxViewFrame* pViewFrame = GetViewFrame();
if ( pViewFrame )
{
SfxObjectShell* pShell = pViewFrame->GetObjectShell();
- if ( pShell && aTitle != pShell->GetTitle( SFX_TITLE_CAPTION ) )
+ if ( pShell && !pShell->GetTitle( SFX_TITLE_CAPTION ).Equals(aTitle) )
{
pShell->SetTitle( aTitle );
pShell->SetModified( sal_False );
@@ -187,22 +185,22 @@ void BasicIDEShell::CreateModulWindowLayout()
pModulLayout = new ModulWindowLayout( &GetViewFrame()->GetWindow() );
}
-ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const String& rLibName, const String& rModName )
+ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rModName )
{
bCreatingWindow = sal_True;
sal_uLong nKey = 0;
ModulWindow* pWin = 0;
- String aLibName( rLibName );
- String aModName( rModName );
+ ::rtl::OUString aLibName( rLibName );
+ ::rtl::OUString aModName( rModName );
- if ( !aLibName.Len() )
- aLibName = String::CreateFromAscii( "Standard" );
+ if ( aLibName.isEmpty() )
+ aLibName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard"));
uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
- if ( !aModName.Len() )
+ if ( aModName.isEmpty() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
// maybe there's an suspended one?
@@ -250,7 +248,12 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const
ModuleInfoHelper::getObjectName( xLib, rModName, sObjName );
if( !sObjName.isEmpty() )
{
- aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
+ ::rtl::OUStringBuffer aModNameBuf(aModName);
+ aModNameBuf.append(' ');
+ aModNameBuf.append('(');
+ aModNameBuf.append(sObjName);
+ aModNameBuf.append(')');
+ aModName = aModNameBuf.makeStringAndClear();
}
}
pTabBar->InsertPage( (sal_uInt16)nKey, aModName );
@@ -263,7 +266,7 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const
return pWin;
}
-ModulWindow* BasicIDEShell::FindBasWin( const ScriptDocument& rDocument, const String& rLibName, const String& rModName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended )
+ModulWindow* BasicIDEShell::FindBasWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rModName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended )
{
ModulWindow* pModWin = 0;
IDEBaseWindow* pWin = aIDEWindowTable.First();
@@ -271,7 +274,7 @@ ModulWindow* BasicIDEShell::FindBasWin( const ScriptDocument& rDocument, const S
{
if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( ModulWindow ) ) )
{
- if ( !rLibName.Len() )
+ if ( rLibName.isEmpty() )
pModWin = (ModulWindow*)pWin;
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rModName )
pModWin = (ModulWindow*)pWin;
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index 06371e0a818f..b00d8e6dcbbe 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -53,22 +53,21 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
-
-DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName )
+DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName )
{
bCreatingWindow = sal_True;
sal_uLong nKey = 0;
DialogWindow* pWin = 0;
- String aLibName( rLibName );
- String aDlgName( rDlgName );
+ ::rtl::OUString aLibName( rLibName );
+ ::rtl::OUString aDlgName( rDlgName );
- if ( !aLibName.Len() )
- aLibName = String::CreateFromAscii( "Standard" );
+ if ( aLibName.isEmpty() )
+ aLibName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard"));
rDocument.getOrCreateLibrary( E_DIALOGS, aLibName );
- if ( !aDlgName.Len() )
+ if ( aDlgName.isEmpty() )
aDlgName = rDocument.createObjectName( E_DIALOGS, aLibName );
// maybe there's a suspended one?
@@ -134,7 +133,7 @@ DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, cons
return pWin;
}
-DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended )
+DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended )
{
DialogWindow* pDlgWin = 0;
IDEBaseWindow* pWin = aIDEWindowTable.First();
@@ -142,7 +141,7 @@ DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const
{
if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( DialogWindow ) ) )
{
- if ( !rLibName.Len() )
+ if ( rLibName.isEmpty() )
pDlgWin = (DialogWindow*)pWin;
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rDlgName )
pDlgWin = (DialogWindow*)pWin;
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index e99224ce7ff5..ac459896595d 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-
// CLOOKS:
#define _SPIN_HXX
#define _PRVWIN_HXX
@@ -88,7 +87,7 @@ public:
{
}
- void addContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName )
+ void addContainerListener( const ScriptDocument& rScriptDocument, const ::rtl::OUString& aLibName )
{
try
{
@@ -101,7 +100,7 @@ public:
}
catch(const uno::Exception& ) {}
}
- void removeContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName )
+ void removeContainerListener( const ScriptDocument& rScriptDocument, const ::rtl::OUString& aLibName )
{
try
{
@@ -192,7 +191,7 @@ void BasicIDEShell::Init()
BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = sal_True;
- SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) );
+ SetName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) );
SetHelpId( SVX_INTERFACE_BASIDE_VIEWSH );
LibBoxControl::RegisterControl( SID_BASICIDE_LIBSELECTOR );
@@ -217,7 +216,7 @@ void BasicIDEShell::Init()
InitScrollBars();
InitTabBar();
- SetCurLib( ScriptDocument::getApplicationScriptDocument(), String::CreateFromAscii( "Standard" ), false, false );
+ SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")), false, false );
BasicIDEGlobals::ShellCreated(this);
@@ -349,7 +348,7 @@ void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument )
pData->GetLibInfos().RemoveInfoFor( _rDocument );
if ( bSetCurLib )
- SetCurLib( ScriptDocument::getApplicationScriptDocument(), String::CreateFromAscii( "Standard" ), true, false );
+ SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")), true, false );
else if ( bSetCurWindow )
SetCurWindow( FindApplicationWindow(), sal_True );
}
@@ -408,9 +407,8 @@ sal_uInt16 BasicIDEShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
if( bUI )
{
- String aErrorStr( IDEResId( RID_STR_CANNOTCLOSE ) );
Window *pParent = &GetViewFrame()->GetWindow();
- InfoBox( pParent, aErrorStr ).Execute();
+ InfoBox( pParent, ResId::toString(IDEResId(RID_STR_CANNOTCLOSE))).Execute();
}
return sal_False;
}
@@ -422,8 +420,8 @@ sal_uInt16 BasicIDEShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin );
if ( !pWin->CanClose() )
{
- if ( m_aCurLibName.Len() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
- SetCurLib( ScriptDocument::getApplicationScriptDocument(), String(), false );
+ if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
+ SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(), false );
SetCurWindow( pWin, sal_True );
bCanClose = sal_False;
}
@@ -693,7 +691,7 @@ void BasicIDEShell::CheckWindows()
-void BasicIDEShell::RemoveWindows( const ScriptDocument& rDocument, const String& rLibName, sal_Bool bDestroy )
+void BasicIDEShell::RemoveWindows( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, sal_Bool bDestroy )
{
sal_Bool bChangeCurWindow = pCurWin ? sal_False : sal_True;
for ( sal_uLong nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ )
@@ -718,7 +716,7 @@ void BasicIDEShell::UpdateWindows()
{
// remove all windows that may not be displayed
sal_Bool bChangeCurWindow = pCurWin ? sal_False : sal_True;
- if ( m_aCurLibName.Len() )
+ if ( !m_aCurLibName.isEmpty() )
{
for ( sal_uLong nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ )
{
@@ -761,9 +759,9 @@ void BasicIDEShell::UpdateWindows()
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
{
- String aLibName = pLibNames[ i ];
+ ::rtl::OUString aLibName = pLibNames[ i ];
- if ( !m_aCurLibName.Len() || ( *doc == m_aCurDocument && aLibName == m_aCurLibName ) )
+ if ( m_aCurLibName.isEmpty() || ( *doc == m_aCurDocument && aLibName == m_aCurLibName ) )
{
// check, if library is password protected and not verified
sal_Bool bProtected = sal_False;
@@ -889,7 +887,7 @@ void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow_, sal_Bool bDestroy, sa
if ( pWindow_->GetDocument().isInVBAMode() )
{
SbModule* pMod = StarBASIC::GetActiveModule();
- if ( !pMod || ( pMod && ( pMod->GetName() != pWindow_->GetName() ) ) )
+ if ( !pMod || ( pMod && ( !pMod->GetName().Equals(pWindow_->GetName()) ) ) )
bStop = false;
}
if ( bStop )
@@ -980,7 +978,7 @@ void BasicIDEShell::EnableScrollbars( sal_Bool bEnable )
}
}
-void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName, bool bUpdateWindows, bool bCheck )
+void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, ::rtl::OUString aLibName, bool bUpdateWindows, bool bCheck )
{
if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) )
{
@@ -1012,14 +1010,14 @@ void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName,
}
}
-void BasicIDEShell::SetCurLibForLocalization( const ScriptDocument& rDocument, String aLibName )
+void BasicIDEShell::SetCurLibForLocalization( const ScriptDocument& rDocument, ::rtl::OUString aLibName )
{
// Create LocalizationMgr
delete m_pCurLocalizationMgr;
Reference< resource::XStringResourceManager > xStringResourceManager;
try
{
- if( aLibName.Len() )
+ if( !aLibName.isEmpty() )
{
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, sal_True ) );
xStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 437569ac2be3..29a4bedac2b1 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -232,7 +232,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const
//----------------------------------------------------------------------------
-bool RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName )
+bool RemoveDialog( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName )
{
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index c019142ba796..a68a0d887141 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -192,28 +192,24 @@ void IDEBaseWindow::UpdateData()
{
}
-
-String IDEBaseWindow::GetTitle()
+::rtl::OUString IDEBaseWindow::GetTitle()
{
- return String();
+ return ::rtl::OUString();
}
-
-
-String IDEBaseWindow::CreateQualifiedName()
+::rtl::OUString IDEBaseWindow::CreateQualifiedName()
{
- String aName;
- if ( m_aLibName.Len() )
+ ::rtl::OUStringBuffer aName;
+ if ( !m_aLibName.isEmpty() )
{
LibraryLocation eLocation = m_aDocument.getLibraryLocation( m_aLibName );
- aName = m_aDocument.getTitle( eLocation );
- aName += '.';
- aName += m_aLibName;
- aName += '.';
- aName += GetTitle();
+ aName.append(m_aDocument.getTitle(eLocation));
+ aName.append('.');
+ aName.append(m_aLibName);
+ aName.append('.');
+ aName.append(GetTitle());
}
-
- return aName;
+ return aName.makeStringAndClear();
}
void IDEBaseWindow::SetReadOnly( sal_Bool )
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 0c66258da524..af0a34e34019 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -275,8 +275,8 @@ sal_Bool ExtBasicTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry*
void BasicIDEShell::CopyDialogResources( Reference< io::XInputStreamProvider >& io_xISP,
- const ScriptDocument& rSourceDoc, const String& rSourceLibName, const ScriptDocument& rDestDoc,
- const String& rDestLibName, const String& rDlgName )
+ const ScriptDocument& rSourceDoc, const ::rtl::OUString& rSourceLibName, const ScriptDocument& rDestDoc,
+ const ::rtl::OUString& rDestLibName, const ::rtl::OUString& rDlgName )
{
if ( !io_xISP.is() )
return;
@@ -354,13 +354,13 @@ sal_Bool ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxE
// get target shell and target library name
BasicEntryDescriptor aDestDesc( GetEntryDescriptor( rpNewParent ) );
const ScriptDocument& rDestDoc( aDestDesc.GetDocument() );
- String aDestLibName( aDestDesc.GetLibName() );
+ ::rtl::OUString aDestLibName( aDestDesc.GetLibName() );
// get source shell, library name and module/dialog name
BasicEntryDescriptor aSourceDesc( GetEntryDescriptor( FirstSelected() ) );
const ScriptDocument rSourceDoc( aSourceDesc.GetDocument() );
- String aSourceLibName( aSourceDesc.GetLibName() );
- String aSourceName( aSourceDesc.GetName() );
+ ::rtl::OUString aSourceLibName( aSourceDesc.GetLibName() );
+ ::rtl::OUString aSourceName( aSourceDesc.GetName() );
BasicEntryType eType( aSourceDesc.GetType() );
// get dispatcher
@@ -889,8 +889,8 @@ void ObjectPage::DeleteCurrent()
DBG_ASSERT( aDocument.isAlive(), "ObjectPage::DeleteCurrent: no document!" );
if ( !aDocument.isAlive() )
return;
- String aLibName( aDesc.GetLibName() );
- String aName( aDesc.GetName() );
+ ::rtl::OUString aLibName( aDesc.GetLibName() );
+ ::rtl::OUString aName( aDesc.GetName() );
BasicEntryType eType( aDesc.GetType() );
if ( ( eType == OBJ_TYPE_MODULE && QueryDelModule( aName, this ) ) ||
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index 556254185802..a3635009e1a3 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -53,7 +53,7 @@ private:
DlgEditor* pEditor;
SfxUndoManager* pUndoMgr;
Link aOldNotifyUndoActionHdl;
- String aCurPath;
+ ::rtl::OUString aCurPath;
protected:
virtual void Paint( const Rectangle& );
@@ -74,7 +74,7 @@ protected:
public:
TYPEINFO();
- DialogWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName,
+ DialogWindow( Window* pParent, const ScriptDocument& rDocument, ::rtl::OUString aLibName, ::rtl::OUString aName,
const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xDialogModel );
DialogWindow( DialogWindow* pCurView ); // never implemented
~DialogWindow();
@@ -86,13 +86,13 @@ public:
DlgEdModel* GetModel() const;
DlgEdPage* GetPage() const;
DlgEdView* GetView() const;
- sal_Bool RenameDialog( const String& rNewName );
+ sal_Bool RenameDialog( const ::rtl::OUString& rNewName );
void DisableBrowser();
void UpdateBrowser();
sal_Bool SaveDialog();
sal_Bool ImportDialog();
- virtual String GetTitle();
+ virtual ::rtl::OUString GetTitle();
virtual BasicEntryDescriptor CreateEntryDescriptor();
virtual void SetReadOnly( sal_Bool bReadOnly );
virtual sal_Bool IsReadOnly();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 0c10e83ff1d1..0f09c455ee52 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -67,7 +67,7 @@ typedef Table IDEWindowTable;
namespace BasicIDE
{
- bool RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
+ bool RemoveDialog( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName );
}
class BasicIDEShell :public SfxViewShell
@@ -75,8 +75,8 @@ class BasicIDEShell :public SfxViewShell
{
friend class JavaDebuggingListenerImpl;
friend class LocalizationMgr;
-friend sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
-friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
+ friend sal_Bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName );
+ friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName );
ObjectCatalog* pObjectCatalog;
@@ -84,7 +84,7 @@ friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const Strin
sal_uInt16 nCurKey;
IDEBaseWindow* pCurWin;
ScriptDocument m_aCurDocument;
- String m_aCurLibName;
+ ::rtl::OUString m_aCurLibName;
LocalizationMgr* m_pCurLocalizationMgr;
ScrollBar aHScrollBar;
@@ -105,15 +105,15 @@ friend class ContainerListenerImpl;
void InitTabBar();
void InitScrollBars();
void CheckWindows();
- void RemoveWindows( const ScriptDocument& rDocument, const String& rLibName, sal_Bool bDestroy );
+ void RemoveWindows( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, sal_Bool bDestroy );
void UpdateWindows();
void ShowObjectDialog( sal_Bool bShow, sal_Bool bCreateOrDestroy );
void InvalidateBasicIDESlots();
void StoreAllWindowData( sal_Bool bPersistent = sal_True );
void SetMDITitle();
void EnableScrollbars( sal_Bool bEnable );
- void SetCurLib( const ScriptDocument& rDocument, String aLibName, bool bUpdateWindows = true , bool bCheck = true );
- void SetCurLibForLocalization( const ScriptDocument& rDocument, String aLibName );
+ void SetCurLib( const ScriptDocument& rDocument, ::rtl::OUString aLibName, bool bUpdateWindows = true , bool bCheck = true );
+ void SetCurLibForLocalization( const ScriptDocument& rDocument, ::rtl::OUString aLibName );
void ImplStartListening( StarBASIC* pBasic );
@@ -134,10 +134,10 @@ protected:
void RemoveWindow( IDEBaseWindow* pWindow, sal_Bool bDestroy, sal_Bool bAllowChangeCurWindow = sal_True );
void ArrangeTabBar();
- ModulWindow* CreateBasWin( const ScriptDocument& rDocument, const String& rLibName, const String& rModName );
- DialogWindow* CreateDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
+ ModulWindow* CreateBasWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rModName );
+ DialogWindow* CreateDlgWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName );
- ModulWindow* FindBasWin( const ScriptDocument& rDocument, const String& rLibName, const String& rModName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended = sal_False );
+ ModulWindow* FindBasWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rModName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended = sal_False );
ModulWindow* ShowActiveModuleWindow( StarBASIC* pBasic );
virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
@@ -175,7 +175,7 @@ public:
IDEBaseWindow* GetCurWindow() const { return pCurWin; }
const ScriptDocument&
GetCurDocument() const { return m_aCurDocument; }
- const String& GetCurLibName() const { return m_aCurLibName; }
+ const ::rtl::OUString& GetCurLibName() const { return m_aCurLibName; }
ObjectCatalog* GetObjectCatalog() const { return pObjectCatalog; }
LocalizationMgr* GetCurLocalizationMgr() const { return m_pCurLocalizationMgr; }
@@ -211,8 +211,8 @@ public:
ModulWindowLayout* GetLayoutWindow() const { return pModulLayout; }
- IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), BasicIDEType nType = BASICIDE_TYPE_UNKNOWN, sal_Bool bFindSuspended = sal_False );
- DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended = sal_False );
+ IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName = ::rtl::OUString(), const ::rtl::OUString& rName = ::rtl::OUString(), BasicIDEType nType = BASICIDE_TYPE_UNKNOWN, sal_Bool bFindSuspended = sal_False );
+ DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended = sal_False );
IDEBaseWindow* FindApplicationWindow();
sal_Bool NextPage( sal_Bool bPrev = sal_False );
@@ -222,8 +222,8 @@ public:
// For Dialog Drag&Drop in Dialog Organizer
static void CopyDialogResources(
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider >& io_xISP,
- const ScriptDocument& rSourceDoc, const String& rSourceLibName, const ScriptDocument& rDestDoc,
- const String& rDestLibName, const String& rDlgName );
+ const ScriptDocument& rSourceDoc, const ::rtl::OUString& rSourceLibName, const ScriptDocument& rDestDoc,
+ const ::rtl::OUString& rDestLibName, const ::rtl::OUString& rDlgName );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
GetCurrentDocument() const;
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index c204f8d42f9e..1ab45fc2750b 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -129,8 +129,8 @@ private:
sal_uInt8 nStatus;
ScriptDocument m_aDocument;
- String m_aLibName;
- String m_aName;
+ ::rtl::OUString m_aLibName;
+ ::rtl::OUString m_aName;
protected:
virtual void DoScroll( ScrollBar* pCurScrollBar );
@@ -161,8 +161,8 @@ public:
// print page
virtual void printPage( sal_Int32 nPage, Printer* pPrinter ) = 0;
- virtual String GetTitle();
- String CreateQualifiedName();
+ virtual ::rtl::OUString GetTitle();
+ ::rtl::OUString CreateQualifiedName();
virtual BasicEntryDescriptor CreateEntryDescriptor() = 0;
virtual sal_Bool IsModified();
@@ -195,10 +195,10 @@ public:
GetDocument() const { return m_aDocument; }
void SetDocument( const ScriptDocument& rDocument ) { m_aDocument = rDocument; }
bool IsDocument( const ScriptDocument& rDocument ) const { return rDocument == m_aDocument; }
- const String& GetLibName() const { return m_aLibName; }
- void SetLibName( const String& aLibName ) { m_aLibName = aLibName; }
- const String& GetName() const { return m_aName; }
- void SetName( const String& aName ) { m_aName = aName; }
+ const ::rtl::OUString& GetLibName() const { return m_aLibName; }
+ void SetLibName( const ::rtl::OUString& aLibName ) { m_aLibName = aLibName; }
+ const ::rtl::OUString& GetName() const { return m_aName; }
+ void SetName( const ::rtl::OUString& aName ) { m_aName = aName; }
};
class LibInfoKey