summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-19 15:20:39 +0200
committerNoel Grandin <noel@peralex.com>2013-10-01 10:08:36 +0200
commita952bd8aacba91ed654f11da07cbf0059d378918 (patch)
treec0fdd92d645df903db778c0b2606ac41be8a2e80 /extensions
parentde6a35f52276b601a8ebc68fbcfd28ad2db84f6f (diff)
convert extensions module from String to OUString
Change-Id: Ia0cb9fe1eaebdd295fb1742074fe2c48be61c077
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/abpilot/abpfinalpage.cxx18
-rw-r--r--extensions/source/bibliography/bibload.cxx16
-rw-r--r--extensions/source/bibliography/bibview.cxx6
-rw-r--r--extensions/source/bibliography/datman.cxx36
-rw-r--r--extensions/source/bibliography/framectr.cxx26
-rw-r--r--extensions/source/bibliography/general.cxx14
-rw-r--r--extensions/source/bibliography/general.hxx16
-rw-r--r--extensions/source/bibliography/toolbar.cxx8
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx10
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx8
-rw-r--r--extensions/source/dbpilots/controlwizard.hxx2
-rw-r--r--extensions/source/dbpilots/dbptypes.hxx6
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx2
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx6
-rw-r--r--extensions/source/dbpilots/groupboxwiz.hxx8
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx4
-rw-r--r--extensions/source/dbpilots/listcombowizard.hxx10
-rw-r--r--extensions/source/dbpilots/optiongrouplayouter.cxx2
-rw-r--r--extensions/source/plugin/base/manager.cxx4
-rw-r--r--extensions/source/plugin/base/xplugin.cxx4
-rw-r--r--extensions/source/plugin/inc/plugin/plcom.hxx6
-rw-r--r--extensions/source/plugin/inc/plugin/unx/sysplug.hxx4
-rw-r--r--extensions/source/plugin/unx/sysplug.cxx4
-rw-r--r--extensions/source/propctrlr/eformshelper.cxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx6
-rw-r--r--extensions/source/propctrlr/formlinkdialog.cxx32
-rw-r--r--extensions/source/propctrlr/formlinkdialog.hxx2
-rw-r--r--extensions/source/propctrlr/formmetadata.cxx28
-rw-r--r--extensions/source/propctrlr/formmetadata.hxx14
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx2
-rw-r--r--extensions/source/propctrlr/listselectiondlg.hxx2
-rw-r--r--extensions/source/propctrlr/newdatatype.cxx10
-rw-r--r--extensions/source/propctrlr/newdatatype.hxx2
-rw-r--r--extensions/source/propctrlr/propertyeditor.cxx2
-rw-r--r--extensions/source/propctrlr/propertyeditor.hxx2
-rw-r--r--extensions/source/propctrlr/propertyinfo.hxx12
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx84
-rw-r--r--extensions/source/propctrlr/stringrepresentation.cxx8
-rw-r--r--extensions/source/propctrlr/usercontrol.cxx12
-rw-r--r--extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx4
-rw-r--r--extensions/source/scanner/grid.cxx4
-rw-r--r--extensions/source/scanner/sane.cxx10
-rw-r--r--extensions/source/scanner/sane.hxx30
-rw-r--r--extensions/source/scanner/sanedlg.cxx49
44 files changed, 268 insertions, 269 deletions
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx
index 0802f0ae4d61..9bb73f179a6d 100644
--- a/extensions/source/abpilot/abpfinalpage.cxx
+++ b/extensions/source/abpilot/abpfinalpage.cxx
@@ -89,15 +89,15 @@ namespace abp
INetURLObject aURL( rSettings.sDataSourceName );
if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
{
- String sPath = SvtPathOptions().GetWorkPath();
- sPath += '/';
- sPath += String(rSettings.sDataSourceName);
+ OUString sPath = SvtPathOptions().GetWorkPath();
+ sPath += "/";
+ sPath += rSettings.sDataSourceName;
const SfxFilter* pFilter = lcl_getBaseFilter();
if ( pFilter )
{
- String sExt = pFilter->GetDefaultExtension();
- sPath += sExt.GetToken(1,'*');
+ OUString sExt = pFilter->GetDefaultExtension();
+ sPath += sExt.getToken(1,'*');
}
aURL.SetURL(sPath);
@@ -105,11 +105,11 @@ namespace abp
OSL_ENSURE( aURL.GetProtocol() != INET_PROT_NOT_VALID ,"No valid file name!");
rSettings.sDataSourceName = aURL.GetMainURL( INetURLObject::NO_DECODE );
m_aLocationController.setURL( rSettings.sDataSourceName );
- String sName = aURL.getName( );
- xub_StrLen nPos = sName.Search(String(aURL.GetExtension()));
- if ( nPos != STRING_NOTFOUND )
+ OUString sName = aURL.getName( );
+ sal_Int32 nPos = sName.indexOf(aURL.GetExtension());
+ if ( nPos != -1 )
{
- sName.Erase(nPos-1,4);
+ sName = sName.replaceAt(nPos-1, 4, "");
}
m_aName.SetText(sName);
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 9dbb7be0469b..adb0046e962f 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -233,8 +233,8 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString
m_pBibMod = OpenBibModul();
- String aURLStr( rURL );
- String aPartName = aURLStr.GetToken( 1, '/' );
+ OUString aURLStr( rURL );
+ OUString aPartName = aURLStr.getToken( 1, '/' );
Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY);
if(xPrSet.is())
{
@@ -242,7 +242,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString
aTitle <<= BibResId(RID_BIB_STR_FRAME_TITLE).toString();
xPrSet->setPropertyValue("Title", aTitle);
}
- if(aPartName.EqualsAscii("View") || aPartName.EqualsAscii("View1"))
+ if(aPartName == "View" || aPartName == "View1")
{
loadView(rFrame, rURL, rArgs, rListener);
}
@@ -421,14 +421,14 @@ Reference< XResultSet > BibliographyLoader::GetDataCursor() const
}
static OUString lcl_AddProperty(Reference< XNameAccess > xColumns,
- const Mapping* pMapping, const String& rColumnName)
+ const Mapping* pMapping, const OUString& rColumnName)
{
- String sColumnName(rColumnName);
+ OUString sColumnName(rColumnName);
if(pMapping)
{
for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++)
{
- if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == OUString(rColumnName))
+ if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == rColumnName)
{
sColumnName = pMapping->aColumnPairs[nEntry].sRealColumnName;
break;
@@ -462,7 +462,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw
if (!xColumns.is())
return aRet;
- String sIdentifierMapping = pDatMan->GetIdentifierMapping();
+ OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
OUString sId = sIdentifierMapping;
Reference< sdb::XColumn > xColumn;
if (xColumns->hasByName(sId))
@@ -480,7 +480,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw
const Mapping* pMapping = pConfig->GetMapping(aBibDesc);
for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++)
{
- const String sColName = pConfig->GetDefColumnName(
+ const OUString sColName = pConfig->GetDefColumnName(
nEntry);
pValues[nEntry].Name = sColName;
pValues[nEntry].Value <<= lcl_AddProperty(xColumns, pMapping, sColName);
diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index 9063b8031bd8..30023e2e36be 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -121,8 +121,8 @@ namespace bib
// "delayed" GetFocus() because GetFocus() is initially called before GeneralPage is created
m_pGeneralPage->GrabFocus();
- String sErrorString( m_pGeneralPage->GetErrorString() );
- if ( sErrorString.Len() )
+ OUString sErrorString( m_pGeneralPage->GetErrorString() );
+ if ( !sErrorString.isEmpty() )
{
sal_Bool bExecute = BibModul::GetConfig()->IsShowColumnAssignmentWarning();
if(!m_pDatMan->HasActiveConnection())
@@ -133,7 +133,7 @@ namespace bib
}
else if(bExecute)
{
- sErrorString += '\n';
+ sErrorString += "\n";
sErrorString += BIB_RESSTR(RID_MAP_QUESTION);
QueryBox aQuery( this, WB_YES_NO, sErrorString );
aQuery.SetDefaultCheckBoxText();
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index dbaa913ac0b5..30315f80b13b 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -261,7 +261,7 @@ class MappingDialog_Impl : public ModalDialog
FixedText aCustom5FT;
ListBox aCustom5LB;
ListBox* aListBoxes[COLUMN_COUNT];
- String sNone;
+ OUString sNone;
sal_Bool bModified;
@@ -398,8 +398,8 @@ MappingDialog_Impl::MappingDialog_Impl(Window* pParent, BibDataManager* pMan) :
aCustom5FT.SetText(BIB_RESSTR(ST_CUSTOM5));
aOKBT.SetClickHdl(LINK(this, MappingDialog_Impl, OkHdl));
- String sTitle = GetText();
- sTitle.SearchAndReplace(OUString("%1"), pDatMan->getActiveDataTable(), 0);
+ OUString sTitle = GetText();
+ sTitle = sTitle.replaceFirst("%1", pDatMan->getActiveDataTable());
SetText(sTitle);
aListBoxes[0] = &aIdentifierLB;
@@ -500,14 +500,14 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl)
if(bModified)
{
Mapping aNew;
- aNew.sTableName = String(pDatMan->getActiveDataTable());
- aNew.sURL = String(pDatMan->getActiveDataSource());
+ aNew.sTableName = pDatMan->getActiveDataTable();
+ aNew.sURL = pDatMan->getActiveDataSource();
sal_uInt16 nWriteIndex = 0;
BibConfig* pConfig = BibModul::GetConfig();
for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++)
{
- String sSel = aListBoxes[nEntry]->GetSelectEntry();
+ OUString sSel = aListBoxes[nEntry]->GetSelectEntry();
if(sSel != sNone)
{
aNew.aColumnPairs[nWriteIndex].sRealColumnName = sSel;
@@ -535,8 +535,8 @@ class DBChangeDialog_Impl : public ModalDialog
SvTabListBox aSelectionLB;
HeaderBar aSelectionHB;
DBChangeDialogConfig_Impl aConfig;
- String aEntryST;
- String aURLST;
+ OUString aEntryST;
+ OUString aURLST;
BibDataManager* pDatMan;
@@ -545,7 +545,7 @@ public:
DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan );
~DBChangeDialog_Impl();
- String GetCurrentURL()const;
+ OUString GetCurrentURL()const;
};
DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) :
@@ -607,9 +607,9 @@ DBChangeDialog_Impl::~DBChangeDialog_Impl()
{
}
-String DBChangeDialog_Impl::GetCurrentURL()const
+OUString DBChangeDialog_Impl::GetCurrentURL()const
{
- String sRet;
+ OUString sRet;
SvTreeListEntry* pEntry = aSelectionLB.FirstSelected();
if(pEntry)
{
@@ -647,8 +647,8 @@ void BibInterceptorHelper::ReleaseInterceptor()
{
Reference< XDispatch > xReturn;
- String aCommand( aURL.Path );
- if ( aCommand.EqualsAscii("FormSlots/ConfirmDeletion") )
+ OUString aCommand( aURL.Path );
+ if ( aCommand == "FormSlots/ConfirmDeletion" )
xReturn = xFormDispatch;
else
if ( xSlaveDispatchProvider.is() )
@@ -1042,9 +1042,9 @@ void BibDataManager::startQueryWith(const OUString& rQuery)
aQueryString+=getQueryField();
aQueryString+=aQuoteChar;
aQueryString+=" like '";
- String sQuery(rQuery);
- sQuery.SearchAndReplaceAll('?','_');
- sQuery.SearchAndReplaceAll('*','%');
+ OUString sQuery(rQuery);
+ sQuery = sQuery.replaceAll("?","_");
+ sQuery = sQuery.replaceAll("*","%");
aQueryString += sQuery;
aQueryString+="%'";
}
@@ -1587,8 +1587,8 @@ OUString BibDataManager::CreateDBChangeDialog(Window* pParent)
DBChangeDialog_Impl * pDlg = new DBChangeDialog_Impl(pParent, this );
if(RET_OK == pDlg->Execute())
{
- String sNewURL = pDlg->GetCurrentURL();
- if(sNewURL != String(getActiveDataSource()))
+ OUString sNewURL = pDlg->GetCurrentURL();
+ if(sNewURL != getActiveDataSource())
{
uRet = sNewURL;
}
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index f254d28db79d..8683d936f9ad 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -422,16 +422,16 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
Window* pParent = VCLUnoHelper::GetWindow( xWindow );
WaitObject aWaitObject( pParent );
- String aCommand( _rURL.Path);
- if(aCommand.EqualsAscii("Bib/Mapping"))
+ OUString aCommand( _rURL.Path);
+ if(aCommand == "Bib/Mapping")
{
pDatMan->CreateMappingDialog(pParent);
}
- else if(aCommand.EqualsAscii("Bib/source"))
+ else if(aCommand == "Bib/source")
{
ChangeDataSource(aArgs);
}
- else if(aCommand.EqualsAscii("Bib/sdbsource"))
+ else if(aCommand == "Bib/sdbsource")
{
OUString aURL = pDatMan->CreateDBChangeDialog(pParent);
if(!aURL.isEmpty())
@@ -450,7 +450,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
}
}
- else if(aCommand.EqualsAscii("Bib/autoFilter"))
+ else if(aCommand == "Bib/autoFilter")
{
sal_uInt16 nCount = aStatusListeners.size();
for ( sal_uInt16 n=0; n<nCount; n++ )
@@ -480,7 +480,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
pConfig->setQueryField(aQueryField);
pDatMan->startQueryWith(aQuery);
}
- else if(aCommand.EqualsAscii("Bib/standardFilter"))
+ else if(aCommand == "Bib/standardFilter")
{
try
{
@@ -518,17 +518,17 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
}
}
- else if(aCommand.EqualsAscii("Bib/removeFilter"))
+ else if(aCommand == "Bib/removeFilter")
{
RemoveFilter();
}
- else if( _rURL.Complete == "slot:5503" || aCommand.EqualsAscii("CloseDoc") )
+ else if( _rURL.Complete == "slot:5503" || aCommand == "CloseDoc" )
{
Application::PostUserEvent( STATIC_LINK( this, BibFrameController_Impl,
DisposeHdl ), 0 );
}
- else if(aCommand.EqualsAscii("Bib/InsertRecord"))
+ else if(aCommand == "Bib/InsertRecord")
{
Reference<form::runtime::XFormController > xFormCtrl = pDatMan->GetFormController();
if(SaveModified(xFormCtrl))
@@ -547,7 +547,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
}
}
- else if(aCommand.EqualsAscii("Bib/DeleteRecord"))
+ else if(aCommand == "Bib/DeleteRecord")
{
Reference< ::com::sun::star::sdbc::XResultSet > xCursor(pDatMan->getForm(), UNO_QUERY);
Reference< XResultSetUpdate > xUpdateCursor(xCursor, UNO_QUERY);
@@ -609,7 +609,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
}
}
- else if(aCommand.EqualsAscii("Cut"))
+ else if(aCommand == "Cut")
{
Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
if(pChild)
@@ -618,7 +618,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
pChild->KeyInput( aEvent );
}
}
- else if(aCommand.EqualsAscii("Copy"))
+ else if(aCommand == "Copy")
{
Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
if(pChild)
@@ -627,7 +627,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
pChild->KeyInput( aEvent );
}
}
- else if(aCommand.EqualsAscii("Paste"))
+ else if(aCommand == "Paste")
{
Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
if(pChild)
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 44bcb19b52a6..c42f004e1be6 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -391,8 +391,8 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan):
xFormCtrl->setContainer(xCtrlContnr);
xFormCtrl->activateTabOrder();
- if(sTableErrorString.Len())
- sTableErrorString.Insert(sErrorPrefix, 0);
+ if(!sTableErrorString.isEmpty())
+ sTableErrorString = sErrorPrefix + sTableErrorString;
}
//-----------------------------------------------------------------------------
BibGeneralPage::~BibGeneralPage()
@@ -432,7 +432,7 @@ void BibGeneralPage::CommitActiveControl()
}
//-----------------------------------------------------------------------------
void BibGeneralPage::AddControlWithError( const OUString& rColumnName, const ::Point& rPos, const ::Size& rSize,
- String& rErrorString, String aColumnUIName, const OString& sHelpId, sal_uInt16 nIndexInFTArray )
+ OUString& rErrorString, OUString aColumnUIName, const OString& sHelpId, sal_uInt16 nIndexInFTArray )
{
// adds also the XControl and creates a map entry in nFT2CtrlMap[] for mapping between control and FT
@@ -447,15 +447,15 @@ void BibGeneralPage::AddControlWithError( const OUString& rColumnName, const ::P
}
else
{
- if( rErrorString.Len() )
- rErrorString += '\n';
+ if( !rErrorString.isEmpty() )
+ rErrorString += "\n";
rErrorString += MnemonicGenerator::EraseAllMnemonicChars( aColumnUIName );
}
}
//-----------------------------------------------------------------------------
uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
- const String& rName,
+ const OUString& rName,
::Point rPos, ::Size rSize, const OString& sHelpId, sal_Int16& rIndex )
{
uno::Reference< awt::XControlModel > xCtrModel;
@@ -615,7 +615,7 @@ void BibGeneralPage::Resize()
void BibGeneralPage::InitFixedTexts( void )
{
- String aFixedStrings[ FIELD_COUNT ] =
+ OUString aFixedStrings[ FIELD_COUNT ] =
{
BIB_RESSTR( ST_IDENTIFIER ),
BIB_RESSTR( ST_AUTHTYPE ),
diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx
index f9b97db7f5ef..a0c3ee1f3c33 100644
--- a/extensions/source/bibliography/general.hxx
+++ b/extensions/source/bibliography/general.hxx
@@ -102,11 +102,11 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
Size aStdSize;
Point aBasePos;
- String aBibTypeArr[ TYPE_COUNT ];
- String sErrorPrefix;
- String sTableErrorString;
+ OUString aBibTypeArr[ TYPE_COUNT ];
+ OUString sErrorPrefix;
+ OUString sTableErrorString;
- String sTypeColumnName;
+ OUString sTypeColumnName;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
xCtrlContnr;
@@ -124,11 +124,11 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
BibDataManager* pDatMan;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
- AddXControl( const String& rName, Point aPos, Size aSize, const OString& sHelpId,
+ AddXControl( const OUString& rName, Point aPos, Size aSize, const OString& sHelpId,
sal_Int16& rIndex );
void AddControlWithError( const OUString& rColumnName, const Point& rPos,
- const Size& rSize, String& rErrorString, String aColumnUIName,
+ const Size& rSize, OUString& rErrorString, OUString aColumnUIName,
const OString& sHelpId, sal_uInt16 nIndexInFTArray );
void AdjustScrollbars();
@@ -143,7 +143,7 @@ public:
BibGeneralPage(Window* pParent, BibDataManager* pDatMan);
virtual ~BibGeneralPage();
- inline const String& GetErrorString() const;
+ inline const OUString& GetErrorString() const;
inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >&
GetTypeListBoxModel() const;
@@ -167,7 +167,7 @@ public:
};
-inline const String& BibGeneralPage::GetErrorString() const
+inline const OUString& BibGeneralPage::GetErrorString() const
{
return sTableErrorString;
}
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 0c3c90b1b6f9..9b5139c72ee0 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -107,7 +107,7 @@ void BibTBListBoxListener::statusChanged(const ::com::sun::star::frame::FeatureS
OUString aEntry;
for( sal_uInt32 i=0; i<nCount; i++ )
{
- aEntry = String(pStringArray[i]);
+ aEntry = pStringArray[i];
pToolBar->InsertSourceEntry(aEntry);
}
pToolBar->UpdateSourceList(sal_True);
@@ -144,7 +144,7 @@ void BibTBQueryMenuListener::statusChanged(const frame::FeatureStateEvent& rEvt)
sal_uInt32 nCount = pStringSeq->getLength();
for( sal_uInt32 i=0; i<nCount; i++ )
{
- sal_uInt16 nID=pToolBar->InsertFilterItem(String(pStringArray[i]));
+ sal_uInt16 nID = pToolBar->InsertFilterItem(pStringArray[i]);
if(pStringArray[i]==rEvt.FeatureDescriptor)
{
pToolBar->SelectFilterItem(nID);
@@ -173,7 +173,7 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw
uno::Any aState=rEvt.State;
if(aState.getValueType()==::getCppuType((const OUString*)0))
{
- String aStr = String(*(OUString*) aState.getValue());
+ OUString aStr = *(OUString*) aState.getValue();
pToolBar->SetQueryString(aStr);
}
}
@@ -468,7 +468,7 @@ IMPL_LINK( BibToolBar, SendSelHdl, Timer*,/*pT*/)
Sequence<PropertyValue> aPropVal(1);
PropertyValue* pPropertyVal = (PropertyValue*)aPropVal.getConstArray();
pPropertyVal[0].Name = "DataSourceName";
- String aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) );
+ OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) );
OUString aSelection = aEntry;
pPropertyVal[0].Value <<= aSelection;
SendDispatch(TBC_LB_SOURCE,aPropVal);
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index fea3a5c18e97..dd476337e57f 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -205,7 +205,7 @@ namespace dbp
if (0 == aFileDlg.Execute())
{
- String sDataSourceName = aFileDlg.GetPath();
+ OUString sDataSourceName = aFileDlg.GetPath();
::svt::OFileNotation aFileNotation(sDataSourceName);
sDataSourceName = aFileNotation.get(::svt::OFileNotation::N_SYSTEM);
m_aDatasource.InsertEntry(sDataSourceName);
@@ -416,19 +416,19 @@ namespace dbp
}
//---------------------------------------------------------------------
- void OMaybeListSelectionPage::implInitialize(const String& _rSelection)
+ void OMaybeListSelectionPage::implInitialize(const OUString& _rSelection)
{
DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::implInitialize: no controls announced!");
- sal_Bool bIsSelection = (0 != _rSelection.Len());
+ sal_Bool bIsSelection = ! _rSelection.isEmpty();
m_pYes->Check(bIsSelection);
m_pNo->Check(!bIsSelection);
m_pList->Enable(bIsSelection);
- m_pList->SelectEntry(bIsSelection ? _rSelection : String());
+ m_pList->SelectEntry(bIsSelection ? _rSelection : OUString());
}
//---------------------------------------------------------------------
- void OMaybeListSelectionPage::implCommit(String& _rSelection)
+ void OMaybeListSelectionPage::implCommit(OUString& _rSelection)
{
_rSelection = m_pYes->IsChecked() ? m_pList->GetSelectEntry() : OUString();
}
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 3d00eba2076c..ad201deb7a48 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -98,8 +98,8 @@ namespace dbp
void implEnableWindows();
- void implInitialize(const String& _rSelection);
- void implCommit(String& _rSelection);
+ void implInitialize(const OUString& _rSelection);
+ void implCommit(OUString& _rSelection);
};
//=====================================================================
@@ -119,14 +119,14 @@ namespace dbp
ODBFieldPage( OControlWizard* _pParent );
protected:
- void setDescriptionText(const String& _rDesc) { m_aDescription.SetText(_rDesc); }
+ void setDescriptionText(const OUString& _rDesc) { m_aDescription.SetText(_rDesc); }
// OWizardPage overridables
virtual void initializePage();
virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
// own overridables
- virtual String& getDBFieldSetting() = 0;
+ virtual OUString& getDBFieldSetting() = 0;
};
//.........................................................................
diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx
index ccd06a9157e4..5109454fd026 100644
--- a/extensions/source/dbpilots/controlwizard.hxx
+++ b/extensions/source/dbpilots/controlwizard.hxx
@@ -46,7 +46,7 @@ namespace dbp
//=====================================================================
struct OControlWizardSettings
{
- String sControlLabel;
+ OUString sControlLabel;
};
//=====================================================================
diff --git a/extensions/source/dbpilots/dbptypes.hxx b/extensions/source/dbpilots/dbptypes.hxx
index e9d26fbd9ff9..2f0aa392504e 100644
--- a/extensions/source/dbpilots/dbptypes.hxx
+++ b/extensions/source/dbpilots/dbptypes.hxx
@@ -28,9 +28,9 @@ namespace dbp
{
//.........................................................................
- DECLARE_STL_VECTOR( String, StringArray );
- DECLARE_STL_STDKEY_SET( String, StringBag );
- DECLARE_STL_STDKEY_MAP( sal_uInt32, String, MapInt2String );
+ DECLARE_STL_VECTOR( OUString, StringArray );
+ DECLARE_STL_STDKEY_SET( OUString, StringBag );
+ DECLARE_STL_STDKEY_MAP( sal_uInt32, OUString, MapInt2String );
//.........................................................................
} // namespace dbp
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index 4df071e8000b..2a61ab58a5bb 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -428,7 +428,7 @@ namespace dbp
}
// the text of the entry to move
- String sMovingEntry = bMoveRight ? m_aExistFields.GetEntry(nSelected) : m_aSelFields.GetEntry(nSelected);
+ OUString sMovingEntry = bMoveRight ? m_aExistFields.GetEntry(nSelected) : m_aSelFields.GetEntry(nSelected);
// insert the entry
nInsertPos = rMoveTo.InsertEntry(sMovingEntry, nInsertPos);
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 0754ffe4eb9a..7c3ec932edf5 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -238,7 +238,7 @@ namespace dbp
{
OGBWPage::initializePage();
- m_aRadioName.SetText(String());
+ m_aRadioName.SetText("");
// no need to initialize the list of radios here
// (we're the only one affecting this special setting, so it will be in the same state as last time this
@@ -281,7 +281,7 @@ namespace dbp
else
{
m_aExistingRadios.InsertEntry(m_aRadioName.GetText());
- m_aRadioName.SetText(String());
+ m_aRadioName.SetText("");
}
implCheckMoveButtons();
@@ -494,7 +494,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- String& OOptionDBFieldPage::getDBFieldSetting()
+ OUString& OOptionDBFieldPage::getDBFieldSetting()
{
return getSettings().sDBField;
}
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index 026e39e7ea4b..17626c5aa5d2 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -35,9 +35,9 @@ namespace dbp
{
StringArray aLabels;
StringArray aValues;
- String sDefaultField;
- String sDBField;
- String sName;
+ OUString sDefaultField;
+ OUString sDBField;
+ OUString sName;
};
//=====================================================================
@@ -186,7 +186,7 @@ namespace dbp
OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
// ODBFieldPage overridables
- virtual String& getDBFieldSetting();
+ virtual OUString& getDBFieldSetting();
};
//=====================================================================
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index ca189c3410ab..8c1510d15d11 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -350,7 +350,7 @@ namespace dbp
OListComboSettings& rSettings = getSettings();
rSettings.sListContentTable = m_aSelectTable.GetSelectEntry();
- if (!rSettings.sListContentTable.Len() && (::svt::WizardTypes::eTravelBackward != _eReason))
+ if (rSettings.sListContentTable.isEmpty() && (::svt::WizardTypes::eTravelBackward != _eReason))
// need to select a table
return sal_False;
@@ -521,7 +521,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- String& OComboDBFieldPage::getDBFieldSetting()
+ OUString& OComboDBFieldPage::getDBFieldSetting()
{
return getSettings().sLinkedFormField;
}
diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index d2c6eb844dc7..f807bea73d36 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -39,10 +39,10 @@ namespace dbp
//=====================================================================
struct OListComboSettings : public OControlWizardSettings
{
- String sListContentTable;
- String sListContentField;
- String sLinkedFormField;
- String sLinkedListField;
+ OUString sListContentTable;
+ OUString sListContentField;
+ OUString sLinkedFormField;
+ OUString sLinkedListField;
};
//=====================================================================
@@ -208,7 +208,7 @@ namespace dbp
virtual bool canAdvance() const;
// ODBFieldPage overridables
- virtual String& getDBFieldSetting();
+ virtual OUString& getDBFieldSetting();
};
//.........................................................................
diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx
index ef1754a002ad..34c3260daf81 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -132,7 +132,7 @@ namespace dbp
xRadioModel->setPropertyValue("DefaultState", makeAny(sal_Int16(1)));
// the connection to the database field
- if (0 != _rSettings.sDBField.Len())
+ if (!_rSettings.sDBField.isEmpty())
xRadioModel->setPropertyValue("DataField", makeAny(OUString(_rSettings.sDBField)));
// the name for the model
diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx
index 536547cd1e25..d415405029f7 100644
--- a/extensions/source/plugin/base/manager.cxx
+++ b/extensions/source/plugin/base/manager.cxx
@@ -84,8 +84,8 @@ const Sequence< OUString >& PluginManager::getAdditionalSearchPaths()
if( ! aPaths.getLength() )
{
SvtPathOptions aOptions;
- String aPluginPath( aOptions.GetPluginPath() );
- if( aPluginPath.Len() )
+ OUString aPluginPath( aOptions.GetPluginPath() );
+ if( !aPluginPath.isEmpty() )
{
sal_Int32 nPaths = comphelper::string::getTokenCount(aPluginPath, ';');
aPaths.realloc( nPaths );
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index b1f11d42c731..0a442498c18e 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -1030,8 +1030,8 @@ void PluginInputStream::load()
INetURLObject aUrl;
aUrl.SetSmartProtocol( INET_PROT_FILE );
aUrl.SetSmartURL(
- String( getStream()->url,
- ::sal::static_int_cast< sal_uInt16, size_t >( strlen( getStream()->url ) ),
+ OUString( getStream()->url,
+ strlen( getStream()->url ),
RTL_TEXTENCODING_MS_1252
) );
try
diff --git a/extensions/source/plugin/inc/plugin/plcom.hxx b/extensions/source/plugin/inc/plugin/plcom.hxx
index 0b8a6cad7dec..fc1e2a9f5466 100644
--- a/extensions/source/plugin/inc/plugin/plcom.hxx
+++ b/extensions/source/plugin/inc/plugin/plcom.hxx
@@ -37,8 +37,8 @@ class PluginComm
{
protected:
int m_nRefCount;
- OString m_aLibName;
- std::list< String > m_aFilesToDelete;
+ OString m_aLibName;
+ std::list< OUString > m_aFilesToDelete;
public:
PluginComm( const OString& rLibName, bool bReusable = true );
virtual ~PluginComm();
@@ -50,7 +50,7 @@ public:
const OString& getLibName() { return m_aLibName; }
void setLibName( const OString& rName ) { m_aLibName = rName; }
- void addFileToDelete( const String& filename )
+ void addFileToDelete( const OUString& filename )
{ m_aFilesToDelete.push_back( filename ); }
virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ) = 0;
diff --git a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
index f95e8470111c..3865011cd5ed 100644
--- a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
+++ b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
@@ -39,8 +39,8 @@ class UnxPluginComm : public PluginComm, public PluginConnector
private:
pid_t m_nCommPID;
public:
- UnxPluginComm( const String& mimetype,
- const String& library,
+ UnxPluginComm( const OUString& mimetype,
+ const OUString& library,
XLIB_Window aParent,
int nDescriptor1,
int nDescriptor2
diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx
index e20caa491c75..b08c3da37641 100644
--- a/extensions/source/plugin/unx/sysplug.cxx
+++ b/extensions/source/plugin/unx/sysplug.cxx
@@ -50,8 +50,8 @@
}
UnxPluginComm::UnxPluginComm(
- const String& /*mimetype*/,
- const String& library,
+ const OUString& /*mimetype*/,
+ const OUString& library,
XLIB_Window aParent,
int nDescriptor1,
int nDescriptor2
diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx
index dc0a92146d99..101ee1a40c42 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -549,7 +549,7 @@ namespace pcr
{
// find a nice name for it
OUString sBaseName(PcrRes(RID_STR_BINDING_UI_NAME).toString());
- sBaseName += OUString(" ");
+ sBaseName += " ";
OUString sNewName;
sal_Int32 nNumber = 1;
do
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 672ab9b3e285..ca9d93b1fef4 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -986,8 +986,8 @@ namespace pcr
nPropId = PROPERTY_ID_WORDBREAK;
}
- String sDisplayName = m_pInfoService->getPropertyTranslation( nPropId );
- if ( !sDisplayName.Len() )
+ OUString sDisplayName = m_pInfoService->getPropertyTranslation( nPropId );
+ if ( sDisplayName.isEmpty() )
{
OSL_FAIL( "FormComponentPropertyHandler::describePropertyLine: did getSupportedProperties not work properly?" );
throw UnknownPropertyException();
@@ -2606,7 +2606,7 @@ namespace pcr
{
OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );
- String sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
+ OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
ListSelectionDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
_rClearBeforeDialog.clear();
return ( RET_OK == aDialog.Execute() );
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index 0f9d6d59d35a..047747737de9 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -83,8 +83,8 @@ namespace pcr
/** retrieves the selected field name for either the master or the detail field
@return <TRUE/> if and only a valid field is selected
*/
- bool GetFieldName( LinkParticipant _eWhich, String& /* [out] */ _rName ) const;
- void SetFieldName( LinkParticipant _eWhich, const String& _rName );
+ bool GetFieldName( LinkParticipant _eWhich, OUString& /* [out] */ _rName ) const;
+ void SetFieldName( LinkParticipant _eWhich, const OUString& _rName );
void fillList( LinkParticipant _eWhich, const Sequence< OUString >& _rFieldNames );
@@ -120,15 +120,15 @@ namespace pcr
}
//------------------------------------------------------------------------
- bool FieldLinkRow::GetFieldName( LinkParticipant _eWhich, String& /* [out] */ _rName ) const
+ bool FieldLinkRow::GetFieldName( LinkParticipant _eWhich, OUString& /* [out] */ _rName ) const
{
const ComboBox* pBox = ( _eWhich == eDetailField ) ? &m_aDetailColumn : &m_aMasterColumn;
_rName = pBox->GetText();
- return _rName.Len() != 0;
+ return !_rName.isEmpty();
}
//------------------------------------------------------------------------
- void FieldLinkRow::SetFieldName( LinkParticipant _eWhich, const String& _rName )
+ void FieldLinkRow::SetFieldName( LinkParticipant _eWhich, const OUString& _rName )
{
ComboBox* pBox = ( _eWhich == eDetailField ) ? &m_aDetailColumn : &m_aMasterColumn;
pBox->SetText( _rName );
@@ -203,10 +203,10 @@ namespace pcr
for ( sal_Int32 i = 0; i < 4; ++i )
{
- String sDetailField, sMasterField;
+ OUString sDetailField, sMasterField;
aRows[ i ]->GetFieldName( FieldLinkRow::eDetailField, sDetailField );
aRows[ i ]->GetFieldName( FieldLinkRow::eMasterField, sMasterField );
- if ( !sDetailField.Len() && !sMasterField.Len() )
+ if ( sDetailField.isEmpty() && sMasterField.isEmpty() )
continue;
aDetailFields.push_back( sDetailField );
@@ -266,8 +266,8 @@ namespace pcr
void FormLinkDialog::initializeColumnLabels()
{
// label for the detail form
- String sDetailType = getFormDataSourceType( m_xDetailForm );
- if ( !sDetailType.Len() )
+ OUString sDetailType = getFormDataSourceType( m_xDetailForm );
+ if ( sDetailType.isEmpty() )
{
if ( m_sDetailLabel.isEmpty() )
{
@@ -279,8 +279,8 @@ namespace pcr
m_aDetailLabel.SetText( sDetailType );
// label for the master form
- String sMasterType = getFormDataSourceType( m_xMasterForm );
- if ( !sMasterType.Len() )
+ OUString sMasterType = getFormDataSourceType( m_xMasterForm );
+ if ( sMasterType.isEmpty() )
{
if ( m_sMasterLabel.isEmpty() )
{
@@ -349,7 +349,7 @@ namespace pcr
for ( sal_Int32 i = 0; ( i < 4 ) && bEnable; ++i )
{
- String sNotInterestedInRightNow;
+ OUString sNotInterestedInRightNow;
if ( aRows[ i ]->GetFieldName( FieldLinkRow::eDetailField, sNotInterestedInRightNow )
!= aRows[ i ]->GetFieldName( FieldLinkRow::eMasterField, sNotInterestedInRightNow )
)
@@ -360,9 +360,9 @@ namespace pcr
}
//------------------------------------------------------------------------
- String FormLinkDialog::getFormDataSourceType( const Reference< XPropertySet >& _rxForm ) const SAL_THROW(())
+ OUString FormLinkDialog::getFormDataSourceType( const Reference< XPropertySet >& _rxForm ) const SAL_THROW(())
{
- String sReturn;
+ OUString sReturn;
if ( !_rxForm.is() )
return sReturn;
@@ -424,11 +424,11 @@ namespace pcr
if ( aErrorInfo.isValid() )
{
- String sErrorMessage;
+ OUString sErrorMessage;
{
::svt::OLocalResourceAccess aStringAccess( PcrRes( RID_DLG_FORMLINKS ), RSC_MODALDIALOG );
sErrorMessage = PcrRes(STR_ERROR_RETRIEVING_COLUMNS).toString();
- sErrorMessage.SearchAndReplace(OUString('#'), sCommand);
+ sErrorMessage = sErrorMessage.replaceFirst("#", sCommand);
}
SQLContext aContext;
diff --git a/extensions/source/propctrlr/formlinkdialog.hxx b/extensions/source/propctrlr/formlinkdialog.hxx
index 48aa39db7213..80b3d0eb6caf 100644
--- a/extensions/source/propctrlr/formlinkdialog.hxx
+++ b/extensions/source/propctrlr/formlinkdialog.hxx
@@ -104,7 +104,7 @@ namespace pcr
::com::sun::star::uno::Sequence< OUString >& _rMasterFields
);
- String getFormDataSourceType(
+ OUString getFormDataSourceType(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxForm
) const SAL_THROW(());
diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx
index b460cff34bc2..971c0c7ac971 100644
--- a/extensions/source/propctrlr/formmetadata.cxx
+++ b/extensions/source/propctrlr/formmetadata.cxx
@@ -40,17 +40,17 @@ namespace pcr
//========================================================================
struct OPropertyInfoImpl
{
- String sName;
- String sTranslation;
- OString sHelpId;
+ OUString sName;
+ OUString sTranslation;
+ OString sHelpId;
sal_Int32 nId;
sal_uInt16 nPos;
sal_uInt32 nUIFlags;
OPropertyInfoImpl(
- const OUString& rName,
+ const OUString& rName,
sal_Int32 _nId,
- const String& aTranslation,
+ const OUString& aTranslation,
sal_uInt16 nPosId,
const OString&,
sal_uInt32 _nUIFlags);
@@ -58,7 +58,7 @@ namespace pcr
//------------------------------------------------------------------------
OPropertyInfoImpl::OPropertyInfoImpl(const OUString& _rName, sal_Int32 _nId,
- const String& aString, sal_uInt16 nP, const OString& sHid, sal_uInt32 _nUIFlags)
+ const OUString& aString, sal_uInt16 nP, const OString& sHid, sal_uInt32 _nUIFlags)
:sName(_rName)
,sTranslation(aString)
,sHelpId(sHid)
@@ -74,7 +74,7 @@ namespace pcr
{
bool operator()( const OPropertyInfoImpl& _rLHS, const OPropertyInfoImpl& _rRHS )
{
- return _rLHS.sName.CompareTo( _rRHS.sName ) == COMPARE_LESS;
+ return _rLHS.sName.compareTo( _rRHS.sName ) < 0;
}
};
@@ -363,24 +363,24 @@ namespace pcr
}
//------------------------------------------------------------------------
- sal_Int32 OPropertyInfoService::getPropertyId(const String& _rName) const
+ sal_Int32 OPropertyInfoService::getPropertyId(const OUString& _rName) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_rName);
return pInfo ? pInfo->nId : -1;
}
//------------------------------------------------------------------------
- String OPropertyInfoService::getPropertyName( sal_Int32 _nPropId )
+ OUString OPropertyInfoService::getPropertyName( sal_Int32 _nPropId )
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nPropId);
- return pInfo ? pInfo->sName : String();
+ return pInfo ? pInfo->sName : OUString();
}
//------------------------------------------------------------------------
- String OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId) const
+ OUString OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId) const
{
const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
- return (pInfo) ? pInfo->sTranslation : String();
+ return (pInfo) ? pInfo->sTranslation : OUString();
}
//------------------------------------------------------------------------
@@ -540,12 +540,12 @@ namespace pcr
}
//------------------------------------------------------------------------
- const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(const String& _rName)
+ const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(const OUString& _rName)
{
// Initialization
if(!s_pPropertyInfos)
getPropertyInfo();
- OPropertyInfoImpl aSearch(_rName, 0L, String(), 0, "", 0);
+ OPropertyInfoImpl aSearch(_rName, 0L, OUString(), 0, "", 0);
const OPropertyInfoImpl* pInfo = ::std::lower_bound(
s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() );
diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx
index 1f2340614c52..d290a8c93250 100644
--- a/extensions/source/propctrlr/formmetadata.hxx
+++ b/extensions/source/propctrlr/formmetadata.hxx
@@ -45,20 +45,20 @@ namespace pcr
public:
// IPropertyInfoService
- virtual sal_Int32 getPropertyId(const String& _rName) const;
- virtual String getPropertyTranslation(sal_Int32 _nId) const;
+ virtual sal_Int32 getPropertyId(const OUString& _rName) const;
+ virtual OUString getPropertyTranslation(sal_Int32 _nId) const;
virtual OString getPropertyHelpId(sal_Int32 _nId) const;
- virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const;
- virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const;
- virtual ::std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const;
- virtual String getPropertyName( sal_Int32 _nPropId );
+ virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const;
+ virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const;
+ virtual ::std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const;
+ virtual OUString getPropertyName( sal_Int32 _nPropId );
virtual sal_Bool isComposeable( const OUString& _rPropertyName ) const;
protected:
static const OPropertyInfoImpl* getPropertyInfo();
- static const OPropertyInfoImpl* getPropertyInfo(const String& _rName);
+ static const OPropertyInfoImpl* getPropertyInfo(const OUString& _rName);
static const OPropertyInfoImpl* getPropertyInfo(sal_Int32 _nId);
};
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 75b040df8d9f..9b4ac38deda8 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -38,7 +38,7 @@ namespace pcr
//====================================================================
//--------------------------------------------------------------------
ListSelectionDialog::ListSelectionDialog( Window* _pParent, const Reference< XPropertySet >& _rxListBox,
- const OUString& _rPropertyName, const String& _rPropertyUIName )
+ const OUString& _rPropertyName, const OUString& _rPropertyUIName )
:ModalDialog( _pParent, PcrRes( RID_DLG_SELECTION ) )
,m_aLabel ( this, PcrRes( FT_ENTRIES ) )
,m_aEntries ( this, PcrRes( LB_ENTRIES ) )
diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx
index 79c4e9c589c6..c62473b7ec61 100644
--- a/extensions/source/propctrlr/listselectiondlg.hxx
+++ b/extensions/source/propctrlr/listselectiondlg.hxx
@@ -53,7 +53,7 @@ namespace pcr
Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxListBox,
const OUString& _rPropertyName,
- const String& _rPropertyUIName
+ const OUString& _rPropertyUIName
);
// Dialog overridables
diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx
index a61dba03d233..096166d4e93f 100644
--- a/extensions/source/propctrlr/newdatatype.cxx
+++ b/extensions/source/propctrlr/newdatatype.cxx
@@ -58,9 +58,9 @@ namespace pcr
}
}
- String sNameBase( _rNameBase.copy( 0, nStripUntil ? nStripUntil + 1 : 0 ) );
- sNameBase.Append( ' ' );
- String sInitialName;
+ OUString sNameBase( _rNameBase.copy( 0, nStripUntil ? nStripUntil + 1 : 0 ) );
+ sNameBase += " ";
+ OUString sInitialName;
sal_Int32 nPostfixNumber = 1;
do
{
@@ -75,8 +75,8 @@ namespace pcr
//--------------------------------------------------------------------
IMPL_LINK( NewDataTypeDialog, OnNameModified, void*, /*_pNotInterestedIn*/ )
{
- String sCurrentName = GetName();
- bool bNameIsOK = ( sCurrentName.Len() > 0 )
+ OUString sCurrentName = GetName();
+ bool bNameIsOK = ( !sCurrentName.isEmpty() )
&& ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() );
m_aOK.Enable( bNameIsOK );
diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx
index b78fe3774e8a..511110810563 100644
--- a/extensions/source/propctrlr/newdatatype.hxx
+++ b/extensions/source/propctrlr/newdatatype.hxx
@@ -50,7 +50,7 @@ namespace pcr
public:
NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames );
- inline String GetName() const { return m_aName.GetText(); }
+ inline OUString GetName() const { return m_aName.GetText(); }
private:
DECL_LINK( OnNameModified, void* );
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index 0440de348a58..a35fbc0fdba2 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -206,7 +206,7 @@ namespace pcr
}
//------------------------------------------------------------------
- sal_uInt16 OPropertyEditor::AppendPage( const String & _rText, const OString& _rHelpId )
+ sal_uInt16 OPropertyEditor::AppendPage( const OUString & _rText, const OString& _rHelpId )
{
// obtain a new id
sal_uInt16 nId = m_nNextId++;
diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index d8883231554d..7e1340059c2d 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -88,7 +88,7 @@ namespace pcr
void SetHelpLineLimites( sal_Int32 _nMinLines, sal_Int32 _nMaxLines );
void SetHelpId( const OString& sHelpId );
- sal_uInt16 AppendPage( const String& r, const OString& _rHelpId );
+ sal_uInt16 AppendPage( const OUString& r, const OString& _rHelpId );
void SetPage( sal_uInt16 );
void RemovePage(sal_uInt16 nID);
sal_uInt16 GetCurPage();
diff --git a/extensions/source/propctrlr/propertyinfo.hxx b/extensions/source/propctrlr/propertyinfo.hxx
index 45bcbaed6986..597a06fb8b53 100644
--- a/extensions/source/propctrlr/propertyinfo.hxx
+++ b/extensions/source/propctrlr/propertyinfo.hxx
@@ -37,15 +37,15 @@ namespace pcr
class SAL_NO_VTABLE IPropertyInfoService
{
public:
- virtual sal_Int32 getPropertyId(const String& _rName) const = 0;
- virtual String getPropertyTranslation(sal_Int32 _nId) const = 0;
+ virtual sal_Int32 getPropertyId(const OUString& _rName) const = 0;
+ virtual OUString getPropertyTranslation(sal_Int32 _nId) const = 0;
virtual OString getPropertyHelpId(sal_Int32 _nId) const = 0;
- virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const = 0;
- virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const = 0;
- virtual ::std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const = 0;
+ virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const = 0;
+ virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const = 0;
+ virtual ::std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const = 0;
// this is only temporary, until the UNOization of the property browser is completed
- virtual String getPropertyName( sal_Int32 _nPropId ) = 0;
+ virtual OUString getPropertyName( sal_Int32 _nPropId ) = 0;
virtual ~IPropertyInfoService() { }
};
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 156b8bfe9ba4..50d409bb0f5c 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -82,7 +82,7 @@ namespace pcr
util::Time aUNOTime;
if ( !( _rValue >>= aUNOTime ) )
{
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
getTypedControlWindow()->SetEmptyTime();
}
else
@@ -134,7 +134,7 @@ namespace pcr
util::Date aUNODate;
if ( !( _rValue >>= aUNODate ) )
{
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
getTypedControlWindow()->SetEmptyDate();
}
else
@@ -273,7 +273,7 @@ namespace pcr
{
if ( !_rValue.hasValue() )
{
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
}
else
{
@@ -597,7 +597,7 @@ namespace pcr
{
if ( !_rValue.hasValue() )
{
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
getTypedControlWindow()->SetEmptyFieldValue();
}
else
@@ -648,19 +648,19 @@ namespace pcr
//==================================================================
#define LB_DEFAULT_COUNT 20
//------------------------------------------------------------------
- String MakeHexStr(sal_uInt32 nVal, sal_uInt32 nLength)
+ OUString MakeHexStr(sal_uInt32 nVal, sal_Int32 nLength)
{
- String aStr;
+ OUStringBuffer aStr;
while (nVal>0)
{
- char c=char(nVal & 0x000F);
- nVal>>=4;
- if (c<=9) c+='0';
- else c+='A'-10;
- aStr.Insert(c,0);
+ char c = char(nVal & 0x000F);
+ nVal >>= 4;
+ if (c<=9) c += '0';
+ else c += 'A' - 10;
+ aStr.insert(c,0);
}
- while (aStr.Len() < nLength) aStr.Insert('0',0);
- return aStr;
+ while (aStr.getLength() < nLength) aStr.insert('0',0);
+ return aStr.makeStringAndClear();
}
//------------------------------------------------------------------
@@ -713,7 +713,7 @@ namespace pcr
getTypedControlWindow()->SelectEntry( aRgbCol );
if ( !getTypedControlWindow()->IsEntrySelected( aRgbCol ) )
{ // the given color is not part of the list -> insert a new entry with the hex code of the color
- String aStr = OUString("0x");
+ OUString aStr("0x");
aStr += MakeHexStr(nColor,8);
getTypedControlWindow()->InsertEntry( aRgbCol, aStr );
getTypedControlWindow()->SelectEntry( aRgbCol );
@@ -1156,32 +1156,32 @@ namespace pcr
namespace
{
//..............................................................
- StlSyntaxSequence< OUString > lcl_convertMultiLineToList( const String& _rCompsedTextWithLineBreaks )
+ StlSyntaxSequence< OUString > lcl_convertMultiLineToList( const OUString& _rCompsedTextWithLineBreaks )
{
xub_StrLen nLines( comphelper::string::getTokenCount(_rCompsedTextWithLineBreaks, '\n') );
StlSyntaxSequence< OUString > aStrings( nLines );
StlSyntaxSequence< OUString >::iterator stringItem = aStrings.begin();
for ( xub_StrLen token = 0; token < nLines; ++token, ++stringItem )
- *stringItem = _rCompsedTextWithLineBreaks.GetToken( token, '\n' );
+ *stringItem = _rCompsedTextWithLineBreaks.getToken( token, '\n' );
return aStrings;
}
- String lcl_convertListToMultiLine( const StlSyntaxSequence< OUString >& _rStrings )
+ OUString lcl_convertListToMultiLine( const StlSyntaxSequence< OUString >& _rStrings )
{
- String sMultiLineText;
+ OUString sMultiLineText;
for ( StlSyntaxSequence< OUString >::const_iterator item = _rStrings.begin();
item != _rStrings.end();
)
{
- sMultiLineText += String( *item );
+ sMultiLineText += *item;
if ( ++item != _rStrings.end() )
- sMultiLineText += '\n';
+ sMultiLineText += "\n";
}
return sMultiLineText;
}
//..............................................................
- String lcl_convertListToDisplayText( const StlSyntaxSequence< OUString >& _rStrings )
+ OUString lcl_convertListToDisplayText( const StlSyntaxSequence< OUString >& _rStrings )
{
OUStringBuffer aComposed;
for ( StlSyntaxSequence< OUString >::const_iterator strings = _rStrings.begin();
@@ -1219,7 +1219,7 @@ namespace pcr
m_bDropdown=sal_True;
if ( m_nOperationMode == eMultiLineText )
m_pFloatingEdit->getEdit()->SetText( m_pImplEdit->GetText() );
- m_pImplEdit->SetText(String());
+ m_pImplEdit->SetText("");
}
else
{
@@ -1228,7 +1228,7 @@ namespace pcr
m_pFloatingEdit->Update();
// transfer the text from the floating edit to our own edit
- String sDisplayText( m_pFloatingEdit->getEdit()->GetText() );
+ OUString sDisplayText( m_pFloatingEdit->getEdit()->GetText() );
if ( m_nOperationMode == eStringList )
sDisplayText = lcl_convertListToDisplayText( lcl_convertMultiLineToList( sDisplayText ) );
@@ -1245,31 +1245,31 @@ namespace pcr
long DropDownEditControl::FindPos(long nSinglePos)
{
long nPos=0;
- String aOutput;
- String aStr=m_pFloatingEdit->getEdit()->GetText();
- String aStr1 = GetText();
+ OUString aOutput;
+ OUString aStr=m_pFloatingEdit->getEdit()->GetText();
+ OUString aStr1 = GetText();
- if ((nSinglePos == 0) || (nSinglePos == aStr1.Len()))
+ if ((nSinglePos == 0) || (nSinglePos == aStr1.getLength()))
{
return nSinglePos;
}
- if (aStr.Len()>0)
+ if (!aStr.isEmpty())
{
long nDiff=0;
sal_Int32 nCount = comphelper::string::getTokenCount(aStr, '\n');
- String aInput = aStr.GetToken(0,'\n' );
+ OUString aInput = aStr.getToken(0,'\n' );
- if (aInput.Len()>0)
+ if (!aInput.isEmpty())
{
- aOutput+='\"';
+ aOutput += "\"";
nDiff++;
- aOutput+=aInput;
- aOutput+='\"';
+ aOutput += aInput;
+ aOutput += "\"";
}
- if (nSinglePos <= aOutput.Len())
+ if (nSinglePos <= aOutput.getLength())
{
nPos=nSinglePos-nDiff;
}
@@ -1277,16 +1277,16 @@ namespace pcr
{
for (sal_Int32 i=1; i<nCount; ++i)
{
- aInput=aStr.GetToken((sal_uInt16)i, '\n');
- if (aInput.Len()>0)
+ aInput=aStr.getToken((sal_uInt16)i, '\n');
+ if (!aInput.isEmpty())
{
- aOutput += ';';
- aOutput += '\"';
+ aOutput += ";";
+ aOutput += "\"";
nDiff += 2;
aOutput += aInput;
- aOutput += '\"';
+ aOutput += "\"";
- if (nSinglePos <= aOutput.Len())
+ if (nSinglePos <= aOutput.getLength())
{
nPos=nSinglePos-nDiff;
break;
@@ -1302,8 +1302,8 @@ namespace pcr
IMPL_LINK( DropDownEditControl, ReturnHdl, OMultilineFloatingEdit*, /*pMEd*/)
{
- String aStr = m_pFloatingEdit->getEdit()->GetText();
- String aStr2 = GetText();
+ OUString aStr = m_pFloatingEdit->getEdit()->GetText();
+ OUString aStr2 = GetText();
ShowDropDown(sal_False);
if (aStr!=aStr2 || ( m_nOperationMode == eStringList ) )
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index 998aade8f033..ccc356a2d63b 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -334,7 +334,7 @@ namespace
template < class ElementType, class Transformer >
OUString composeSequenceElements( const Sequence< ElementType >& _rElements, const Transformer& _rTransformer )
{
- String sCompose;
+ OUString sCompose;
// loop through the elements and concatenate the string representations of the integers
// (separated by a line break)
@@ -342,9 +342,9 @@ namespace
const ElementType* pElementsEnd = pElements + _rElements.getLength();
for ( ; pElements != pElementsEnd; ++pElements )
{
- sCompose += String( _rTransformer( *pElements ) );
+ sCompose += OUString( _rTransformer( *pElements ) );
if ( pElements != pElementsEnd )
- sCompose += '\n';
+ sCompose += "\n";
}
return sCompose;
@@ -531,7 +531,7 @@ bool StringRepresentation::convertStringToGenericValue( const OUString& _rString
{
uno::Type aElementType = ::comphelper::getSequenceElementType( _rTargetType );
- String aStr( _rStringRep );
+ OUString aStr( _rStringRep );
switch ( aElementType.getTypeClass() )
{
case uno::TypeClass_STRING:
diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx
index d3a9f4ff2382..c0ca42f322a8 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -54,7 +54,7 @@ namespace pcr
if ((KEY_DELETE == nKey) || (KEY_BACKSPACE == nKey))
{
- SetText( String() );
+ SetText( "" );
if ( m_pHelper )
m_pHelper->ModifiedHdl( this );
return 1;
@@ -79,7 +79,7 @@ namespace pcr
{
TreatAsNumber( sal_False );
SetFormatter( NULL, sal_True );
- SetText( String() );
+ SetText( "" );
}
}
@@ -112,7 +112,7 @@ namespace pcr
getTypedControlWindow()->SetValue( pEntry ? getPreviewValue( *pEntry ) : 1234.56789 );
}
else
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
}
//------------------------------------------------------------------
double OFormatSampleControl::getPreviewValue( const SvNumberformat& i_rEntry )
@@ -193,7 +193,7 @@ namespace pcr
if ( _rValue >>= nValue )
getTypedControlWindow()->SetValue( nValue );
else
- getTypedControlWindow()->SetText(String());
+ getTypedControlWindow()->SetText("");
}
//------------------------------------------------------------------
@@ -256,7 +256,7 @@ namespace pcr
{
getTypedControlWindow()->TreatAsNumber(sal_False);
getTypedControlWindow()->SetFormatter(NULL, sal_True);
- getTypedControlWindow()->SetText(String());
+ getTypedControlWindow()->SetText("");
m_nLastDecimalDigits = 0;
}
}
@@ -289,7 +289,7 @@ namespace pcr
getTypedControlWindow()->DisplayURL( sURL );
}
else
- getTypedControlWindow()->SetText( String() );
+ getTypedControlWindow()->SetText( "" );
}
//------------------------------------------------------------------
diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index d13a4ee7120f..2594e02ee1e7 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -534,8 +534,8 @@ namespace pcr
}
// confirmation message
- String sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() );
- sConfirmation.SearchAndReplaceAscii( "#type#", pType->getName() );
+ OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() );
+ sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
QueryBox aQuery( NULL, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
if ( aQuery.Execute() != RET_YES )
return false;
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 7707dd1f19d7..1e9af527591d 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -339,7 +339,7 @@ void GridWindow::drawGrid()
// draw tickmarks
Point aPt = transform( fX, m_fMinY );
std::sprintf( pBuf, "%g", fX );
- String aMark( pBuf, osl_getThreadTextEncoding() );
+ OUString aMark( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
Size aTextSize( GetTextWidth( aMark ), GetTextHeight() );
aPt.X() -= aTextSize.Width()/2;
aPt.Y() += aTextSize.Height()/2;
@@ -352,7 +352,7 @@ void GridWindow::drawGrid()
// draw tickmarks
Point aPt = transform( m_fMinX, fY );
std::sprintf( pBuf, "%g", fY );
- String aMark( pBuf, osl_getThreadTextEncoding() );
+ OUString aMark( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
Size aTextSize( GetTextWidth( aMark ), GetTextHeight() );
aPt.X() -= aTextSize.Width() + 2;
aPt.Y() -= aTextSize.Height()/2;
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 35a4800ce890..52bafe842473 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -426,7 +426,7 @@ sal_Bool Sane::SetOptionValue( int n, sal_Bool bSet )
return sal_True;
}
-sal_Bool Sane::SetOptionValue( int n, const String& rSet )
+sal_Bool Sane::SetOptionValue( int n, const OUString& rSet )
{
if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING )
return sal_False;
@@ -980,15 +980,15 @@ static const char *ppUnits[] = {
"[usec]"
};
-String Sane::GetOptionUnitName( int n )
+OUString Sane::GetOptionUnitName( int n )
{
- String aText;
+ OUString aText;
SANE_Unit nUnit = mppOptions[n]->unit;
size_t nUnitAsSize = (size_t)nUnit;
if (nUnitAsSize >= SAL_N_ELEMENTS( ppUnits ))
- aText = OUString("[unknown units]");
+ aText = "[unknown units]";
else
- aText = String( ppUnits[ nUnit ], osl_getThreadTextEncoding() );
+ aText = OUString( ppUnits[ nUnit ], strlen(ppUnits[ nUnit ]), osl_getThreadTextEncoding() );
return aText;
}
diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx
index 06a7dc8f0e4c..3ecfa7660992 100644
--- a/extensions/source/scanner/sane.hxx
+++ b/extensions/source/scanner/sane.hxx
@@ -118,24 +118,24 @@ public:
{ return maHandle ? sal_True : sal_False; }
static int CountDevices()
{ return nDevices; }
- static String GetName( int n )
- { return String( ppDevices[n]->name ? ppDevices[n]->name : "", osl_getThreadTextEncoding() ); }
- static String GetVendor( int n )
- { return String( ppDevices[n]->vendor ? ppDevices[n]->vendor : "", osl_getThreadTextEncoding() ); }
- static String GetModel( int n )
- { return String( ppDevices[n]->model ? ppDevices[n]->model : "", osl_getThreadTextEncoding() ); }
- static String GetType( int n )
- { return String( ppDevices[n]->type ? ppDevices[n]->type : "", osl_getThreadTextEncoding() ); }
-
- String GetOptionName( int n )
- { return String( mppOptions[n]->name ? (char*)mppOptions[n]->name : "", osl_getThreadTextEncoding() ); }
- String GetOptionTitle( int n )
- { return String( mppOptions[n]->title ? (char*)mppOptions[n]->title : "", osl_getThreadTextEncoding() ); }
+ static OUString GetName( int n )
+ { return ppDevices[n]->name ? OUString( ppDevices[n]->name, strlen(ppDevices[n]->name), osl_getThreadTextEncoding() ) : OUString(); }
+ static OUString GetVendor( int n )
+ { return ppDevices[n]->vendor ? OUString( ppDevices[n]->vendor, strlen(ppDevices[n]->vendor), osl_getThreadTextEncoding() ) : OUString(); }
+ static OUString GetModel( int n )
+ { return ppDevices[n]->model ? OUString( ppDevices[n]->model, strlen(ppDevices[n]->model), osl_getThreadTextEncoding() ) : OUString(); }
+ static OUString GetType( int n )
+ { return ppDevices[n]->type ? OUString( ppDevices[n]->type, strlen(ppDevices[n]->type), osl_getThreadTextEncoding() ) : OUString(); }
+
+ OUString GetOptionName( int n )
+ { return mppOptions[n]->name ? OUString( (char*)mppOptions[n]->name, strlen((char*)mppOptions[n]->name), osl_getThreadTextEncoding() ) : OUString(); }
+ OUString GetOptionTitle( int n )
+ { return mppOptions[n]->title ? OUString( (char*)mppOptions[n]->title, strlen((char*)mppOptions[n]->title), osl_getThreadTextEncoding() ) : OUString(); }
SANE_Value_Type GetOptionType( int n )
{ return mppOptions[n]->type; }
SANE_Unit GetOptionUnit( int n )
{ return mppOptions[n]->unit; }
- String GetOptionUnitName( int n );
+ OUString GetOptionUnitName( int n );
SANE_Int GetOptionCap( int n )
{ return mppOptions[n]->cap; }
SANE_Constraint_Type GetOptionConstraintType( int n )
@@ -152,7 +152,7 @@ public:
sal_Bool GetOptionValue( int, double* );
sal_Bool SetOptionValue( int, sal_Bool );
- sal_Bool SetOptionValue( int, const String& );
+ sal_Bool SetOptionValue( int, const OUString& );
sal_Bool SetOptionValue( int, double, int nElement = 0 );
sal_Bool SetOptionValue( int, double* );
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 86f2a8fbb73c..d5e78f85bd05 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -364,7 +364,7 @@ void SaneDlg::InitFields()
sal_Bool bGroupRejected = sal_False;
for( i = 1; i < mrSane.CountOptions(); i++ )
{
- String aOption=mrSane.GetOptionName( i );
+ OUString aOption=mrSane.GetOptionName( i );
sal_Bool bInsertAdvanced =
mrSane.GetOptionCap( i ) & SANE_CAP_ADVANCED &&
! maAdvancedBox.IsChecked() ? sal_False : sal_True;
@@ -379,7 +379,7 @@ void SaneDlg::InitFields()
else
bGroupRejected = sal_True;
}
- else if( aOption.Len() &&
+ else if( !aOption.isEmpty() &&
! ( mrSane.GetOptionCap( i ) &
(
SANE_CAP_HARD_SELECT |
@@ -391,7 +391,7 @@ void SaneDlg::InitFields()
for( size_t n = 0; !bIsSpecial &&
n < SAL_N_ELEMENTS(ppSpecialOptions); n++ )
{
- if( aOption.EqualsAscii( ppSpecialOptions[n] ) )
+ if( aOption == OUString::createFromAscii(ppSpecialOptions[n]) )
bIsSpecial=sal_True;
}
if( ! bIsSpecial )
@@ -411,12 +411,11 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
{
if( pButton == &maDeviceInfoButton )
{
- String aString(SaneResId(RID_SANE_DEVICEINFO_TXT).toString());
- String aSR( RTL_CONSTASCII_USTRINGPARAM( "%s" ) );
- aString.SearchAndReplace( aSR, Sane::GetName( mrSane.GetDeviceNumber() ) );
- aString.SearchAndReplace( aSR, Sane::GetVendor( mrSane.GetDeviceNumber() ) );
- aString.SearchAndReplace( aSR, Sane::GetModel( mrSane.GetDeviceNumber() ) );
- aString.SearchAndReplace( aSR, Sane::GetType( mrSane.GetDeviceNumber() ) );
+ OUString aString(SaneResId(RID_SANE_DEVICEINFO_TXT).toString());
+ aString = aString.replaceFirst( "%s", Sane::GetName( mrSane.GetDeviceNumber() ) );
+ aString = aString.replaceFirst( "%s", Sane::GetVendor( mrSane.GetDeviceNumber() ) );
+ aString = aString.replaceFirst( "%s", Sane::GetModel( mrSane.GetDeviceNumber() ) );
+ aString = aString.replaceFirst( "%s", Sane::GetType( mrSane.GetDeviceNumber() ) );
InfoBox aInfoBox( this, aString );
aInfoBox.Execute();
}
@@ -489,9 +488,9 @@ IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox )
{
if( pListBox == &maDeviceBox && Sane::IsSane() && Sane::CountDevices() )
{
- String aNewDevice = maDeviceBox.GetSelectEntry();
+ OUString aNewDevice = maDeviceBox.GetSelectEntry();
int nNumber;
- if( aNewDevice.Equals( Sane::GetName( nNumber = mrSane.GetDeviceNumber() ) ) )
+ if( aNewDevice == Sane::GetName( nNumber = mrSane.GetDeviceNumber() ) )
{
mrSane.Close();
mrSane.Open( nNumber );
@@ -519,7 +518,7 @@ IMPL_LINK( SaneDlg, OptionsBoxSelectHdl, SvTreeListBox*, pBox )
{
if( pBox == &maOptionBox && Sane::IsSane() )
{
- String aOption =
+ OUString aOption =
maOptionBox.GetEntryText( maOptionBox.FirstSelected() );
int nOption = mrSane.GetOptionByName(OUStringToOString(aOption,
osl_getThreadTextEncoding()).getStr());
@@ -636,7 +635,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
else if( fValue > mfMax )
fValue = mfMax;
sprintf( pBuf, "%g", fValue );
- maNumericEdit.SetText( String( pBuf, osl_getThreadTextEncoding() ) );
+ maNumericEdit.SetText( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) );
}
mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement );
}
@@ -647,7 +646,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
double fValue;
mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement );
sprintf( pBuf, "%g", fValue );
- String aValue( pBuf, osl_getThreadTextEncoding() );
+ OUString aValue( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
maNumericEdit.SetText( aValue );
maQuantumRangeBox.SelectEntry( aValue );
}
@@ -833,7 +832,7 @@ void SaneDlg::EstablishStringRange()
const char** ppStrings = mrSane.GetStringConstraint( mnCurrentOption );
maStringRangeBox.Clear();
for( int i = 0; ppStrings[i] != 0; i++ )
- maStringRangeBox.InsertEntry( String( ppStrings[i], osl_getThreadTextEncoding() ) );
+ maStringRangeBox.InsertEntry( OUString( ppStrings[i], strlen(ppStrings[i]), osl_getThreadTextEncoding() ) );
OString aValue;
mrSane.GetOptionValue( mnCurrentOption, aValue );
maStringRangeBox.SelectEntry(OStringToOUString(aValue, osl_getThreadTextEncoding()));
@@ -867,17 +866,17 @@ void SaneDlg::EstablishQuantumRange()
for( int i = 0; i < nValues; i++ )
{
sprintf( pBuf, "%g", mpRange[ i ] );
- maQuantumRangeBox.InsertEntry( String( pBuf, osl_getThreadTextEncoding() ) );
+ maQuantumRangeBox.InsertEntry( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) );
}
double fValue;
if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement ) )
{
sprintf( pBuf, "%g", fValue );
- maQuantumRangeBox.SelectEntry( String( pBuf, osl_getThreadTextEncoding() ) );
+ maQuantumRangeBox.SelectEntry( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) );
}
maQuantumRangeBox.Show( sal_True );
- String aText( mrSane.GetOptionName( mnCurrentOption ) );
- aText += ' ';
+ OUString aText( mrSane.GetOptionName( mnCurrentOption ) );
+ aText += " ";
aText += mrSane.GetOptionUnitName( mnCurrentOption );
maOptionDescTxt.SetText( aText );
maOptionDescTxt.Show( sal_True );
@@ -894,18 +893,18 @@ void SaneDlg::EstablishNumericOption()
return;
char pBuf[256];
- String aText( mrSane.GetOptionName( mnCurrentOption ) );
- aText += ' ';
+ OUString aText( mrSane.GetOptionName( mnCurrentOption ) );
+ aText += " ";
aText += mrSane.GetOptionUnitName( mnCurrentOption );
if( mfMin != mfMax )
{
sprintf( pBuf, " < %g ; %g >", mfMin, mfMax );
- aText += String( pBuf, osl_getThreadTextEncoding() );
+ aText += OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
}
maOptionDescTxt.SetText( aText );
maOptionDescTxt.Show( sal_True );
sprintf( pBuf, "%g", fValue );
- maNumericEdit.SetText( String( pBuf, osl_getThreadTextEncoding() ) );
+ maNumericEdit.SetText( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) );
maNumericEdit.Show( sal_True );
}
@@ -1173,8 +1172,8 @@ sal_Bool SaneDlg::LoadState()
return sal_False;
const char* pEnv = getenv("HOME");
- String aFileName( pEnv ? pEnv : "", osl_getThreadTextEncoding() );
- aFileName += String( RTL_CONSTASCII_USTRINGPARAM( "/.so_sane_state" ) );
+ OUString aFileName = pEnv ? OUString(pEnv, strlen(pEnv), osl_getThreadTextEncoding() ) : OUString();
+ aFileName += "/.so_sane_state";
Config aConfig( aFileName );
if( ! aConfig.HasGroup( "SANE" ) )
return sal_False;