summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-07-01 10:33:48 -0500
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-02 07:31:30 +0000
commit6a08067902ddc0ec61a7c7b4b0035b303f643a50 (patch)
treecd49d1824cd169d9d224925b836eaa70de27414e
parent82a1d75ee59c46e6bb361b98c520cc4eff2e770c (diff)
OUString convertion for unotools
Change-Id: Ifae7f344e3827875e32afa3cda23c771f5735707 Reviewed-on: https://gerrit.libreoffice.org/4659 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--basic/source/classes/errobject.cxx2
-rw-r--r--basic/source/classes/image.cxx31
-rw-r--r--basic/source/comp/buffer.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx10
-rw-r--r--cui/source/options/optgdlg.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx4
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx4
-rw-r--r--desktop/source/migration/migration.cxx8
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx6
-rw-r--r--editeng/source/editeng/impedit4.cxx19
-rw-r--r--forms/source/xforms/computedexpression.cxx11
-rw-r--r--framework/source/services/autorecovery.cxx4
-rw-r--r--include/sfx2/docfile.hxx6
-rw-r--r--include/unotools/calendarwrapper.hxx7
-rw-r--r--include/unotools/charclass.hxx66
-rw-r--r--include/unotools/defaultoptions.hxx4
-rw-r--r--include/unotools/fontcfg.hxx18
-rw-r--r--include/unotools/fontcvt.hxx11
-rw-r--r--include/unotools/fontdefs.hxx6
-rw-r--r--include/unotools/pathoptions.hxx96
-rw-r--r--include/unotools/syslocaleoptions.hxx35
-rw-r--r--include/unotools/tempfile.hxx24
-rw-r--r--include/unotools/textsearch.hxx40
-rw-r--r--include/unotools/transliterationwrapper.hxx28
-rw-r--r--include/unotools/ucblockbytes.hxx34
-rw-r--r--include/unotools/ucbstreamhelper.hxx14
-rw-r--r--reportdesign/source/core/api/ReportEngineJFree.cxx8
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx14
-rw-r--r--sc/inc/patattr.hxx1
-rw-r--r--sc/source/core/data/dpcache.cxx7
-rw-r--r--sc/source/core/data/table3.cxx12
-rw-r--r--sc/source/core/data/table6.cxx22
-rw-r--r--sc/source/core/tool/interpr1.cxx14
-rw-r--r--sfx2/source/doc/docfile.cxx16
-rw-r--r--sot/source/sdstor/ucbstorage.cxx4
-rw-r--r--svl/source/numbers/zforlist.cxx12
-rw-r--r--svx/source/dialog/ctredlin.cxx12
-rw-r--r--svx/source/form/fmsrcimp.cxx4
-rw-r--r--sw/source/core/crsr/findtxt.cxx22
-rw-r--r--sw/source/core/crsr/paminit.cxx4
-rw-r--r--sw/source/core/doc/docglbl.cxx19
-rw-r--r--sw/source/core/doc/tblafmt.cxx2
-rw-r--r--sw/source/core/inc/pamtyp.hxx4
-rw-r--r--sw/source/filter/html/swhtml.cxx13
-rw-r--r--sw/source/ui/config/uinums.cxx2
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx11
-rw-r--r--sw/source/ui/index/cnttab.cxx18
-rw-r--r--sw/source/ui/misc/glosbib.cxx2
-rw-r--r--sw/source/ui/misc/glosdoc.cxx4
-rw-r--r--unotools/source/config/defaultoptions.cxx96
-rw-r--r--unotools/source/config/fontcfg.cxx87
-rw-r--r--unotools/source/config/pathoptions.cxx217
-rw-r--r--unotools/source/config/securityoptions.cxx7
-rw-r--r--unotools/source/config/syslocaleoptions.cxx75
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx13
-rw-r--r--unotools/source/i18n/charclass.cxx133
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx23
-rw-r--r--unotools/source/i18n/textsearch.cxx223
-rw-r--r--unotools/source/i18n/transliterationwrapper.cxx58
-rw-r--r--unotools/source/misc/fontcvt.cxx43
-rw-r--r--unotools/source/misc/fontdefs.cxx23
-rw-r--r--unotools/source/misc/syslocale.cxx11
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx112
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx54
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx24
-rw-r--r--vcl/source/edit/xtextedt.cxx12
-rw-r--r--vcl/source/gdi/font.cxx4
-rw-r--r--vcl/source/gdi/outdev3.cxx20
71 files changed, 954 insertions, 1008 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 8f52b1fce43b..d4bcac2afbb5 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -883,7 +883,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase
{
// Search lib in path
OUString aSearchFile = pInfo->GetRelStorageName();
- String aSearchFileOldFormat(aSearchFile);
+ OUString aSearchFileOldFormat(aSearchFile);
SvtPathOptions aPathCFG;
if( aPathCFG.SearchFile( aSearchFileOldFormat, SvtPathOptions::PATH_BASIC ) )
{
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx
index 139939d984ab..4043549be109 100644
--- a/basic/source/classes/errobject.cxx
+++ b/basic/source/classes/errobject.cxx
@@ -81,7 +81,7 @@ ErrObject::getNumber() throw (uno::RuntimeException)
void SAL_CALL
ErrObject::setNumber( ::sal_Int32 _number ) throw (uno::RuntimeException)
{
- GetSbData()->pInst->setErrorVB( _number, String() );
+ GetSbData()->pInst->setErrorVB( _number, OUString() );
OUString _description = GetSbData()->pInst->GetErrorMsg();
setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
}
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 8a4412d1b5c5..162fcd470dfb 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -19,6 +19,7 @@
#include <tools/stream.hxx>
#include <tools/tenccvt.hxx>
+#include <osl/thread.h>
#include <basic/sbx.hxx>
#include "sb.hxx"
#include <string.h> // memset() etc
@@ -120,7 +121,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
{
r >> nVersion >> nCharSet >> lDimBase
>> nFlags >> nReserved1 >> nReserved2 >> nReserved3;
- eCharSet = (CharSet) nCharSet;
+ eCharSet = nCharSet;
eCharSet = GetSOLoadTextEncoding( eCharSet );
bBadVer = ( nVersion > B_CURVERSION );
nDimBase = (sal_uInt16) lDimBase;
@@ -286,34 +287,8 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
if( !aOUSource.isEmpty() && SbiGood( r ) )
{
nPos = SbiOpenRecord( r, B_SOURCE, 1 );
- OUString aTmp;
- sal_Int32 nLen = aOUSource.getLength();
- const sal_Int32 nMaxUnitSize = STRING_MAXLEN - 1;
- if( nLen > STRING_MAXLEN )
- {
- aTmp = aOUSource.copy( 0, nMaxUnitSize );
- }
- else
- {
- aTmp = aOUSource;
- }
- r.WriteUniOrByteString( aTmp, eCharSet );
+ r.WriteUniOrByteString( aOUSource, eCharSet );
SbiCloseRecord( r, nPos );
-
- if( nLen > STRING_MAXLEN )
- {
- sal_Int32 nRemainingLen = nLen - nMaxUnitSize;
- sal_uInt16 nUnitCount = sal_uInt16( (nRemainingLen + nMaxUnitSize - 1) / nMaxUnitSize );
- nPos = SbiOpenRecord( r, B_EXTSOURCE, nUnitCount );
- for( sal_uInt16 i = 0 ; i < nUnitCount ; i++ )
- {
- sal_Int32 nCopyLen = (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen;
- OUString aTmp2 = aOUSource.copy( (i+1) * nMaxUnitSize, nCopyLen );
- nRemainingLen -= nCopyLen;
- r.WriteUniOrByteString( aTmp2, eCharSet );
- }
- SbiCloseRecord( r, nPos );
- }
}
// Binary data?
if( pCode && SbiGood( r ) )
diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx
index b08d352eb318..fa09ef9c144b 100644
--- a/basic/source/comp/buffer.cxx
+++ b/basic/source/comp/buffer.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
+#include <osl/thread.h>
#include "buffer.hxx"
#include "sbcomp.hxx"
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 4c2ffa97e661..ed731f1c29f0 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1583,8 +1583,8 @@ void SbiRuntime::StepLIKE()
}
SbxVariable* pRes = new SbxVariable;
utl::TextSearch aSearch(aSearchOpt);
- sal_uInt16 nStart=0, nEnd=value.getLength();
- int bRes = aSearch.SearchFrwrd(value, &nStart, &nEnd);
+ sal_Int32 nStart=0, nEnd=value.getLength();
+ int bRes = aSearch.SearchForward(value, &nStart, &nEnd);
pRes->PutBool( bRes != 0 );
PushVar( pRes );
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index cb767c9bf1fc..8caf763acdc7 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2492,12 +2492,10 @@ String ODbaseTable::createTempFile()
OUString aIdent = m_pConnection->getContent()->getIdentifier()->getContentIdentifier();
if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
aIdent += "/";
- String sTempName(aIdent);
- String sExt;
- sExt.AssignAscii(".");
- sExt += m_pConnection->getExtension();
- String sName(m_Name);
+ OUString sTempName(aIdent);
+ OUString sExt(OUString(".") + m_pConnection->getExtension());
+ OUString sName(m_Name);
TempFile aTempFile(sName,&sExt,&sTempName);
if(!aTempFile.IsValid())
getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE,*this);
@@ -2507,7 +2505,7 @@ String ODbaseTable::createTempFile()
aURL.SetURL(aTempFile.GetURL());
String sNewName(aURL.getName());
- sNewName.Erase(sNewName.Len() - sExt.Len());
+ sNewName.Erase(sNewName.Len() - sExt.getLength());
return sNewName;
}
// -----------------------------------------------------------------------------
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 6489201e24fc..e11eef5e6608 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1446,7 +1446,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
LocaleSettingHdl(m_pLocaleSettingLB);
// configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default
- String aAbbrev;
+ OUString aAbbrev;
LanguageType eLang;
const NfCurrencyEntry* pCurr = NULL;
sLang = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 5bf0c91279f1..51fd817b2aac 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -588,8 +588,8 @@ OUString PackageManagerImpl::insertToActivationLayer(
Reference<XCommandEnvironment> xCmdEnv(
sourceContent.getCommandEnvironment() );
- String baseDir(m_activePackages_expanded);
- ::utl::TempFile aTemp(&baseDir, sal_False);
+ OUString baseDir(m_activePackages_expanded);
+ ::utl::TempFile aTemp(&baseDir, false);
OUString tempEntry = aTemp.GetURL();
tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1);
OUString destFolder = makeURL( m_activePackages, tempEntry);
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 8c6cdfaf867e..398928432038 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -220,8 +220,8 @@ OUString PackageRegistryBackend::createFolder(
ucbhelper::Content dataContent;
::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
- const String baseDir(sDataFolder);
- const ::utl::TempFile aTemp(&baseDir, sal_True);
+ const OUString baseDir(sDataFolder);
+ const ::utl::TempFile aTemp(&baseDir, true);
const OUString url = aTemp.GetURL();
return sDataFolder + url.copy(url.lastIndexOf('/'));
}
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 2b361135da8d..932c9fb59853 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -647,12 +647,12 @@ strings_vr MigrationImpl::applyPatterns(const strings_v& vSet, const strings_v&
SearchParam param(*i_pat, SearchParam::SRCH_REGEXP);
TextSearch ts(param, LANGUAGE_DONTKNOW);
i_set = vSet.begin();
- xub_StrLen start = 0;
- xub_StrLen end = 0;
+ sal_Int32 start = 0;
+ sal_Int32 end = 0;
while (i_set != vSet.end())
{
- end = (xub_StrLen)(i_set->getLength());
- if (ts.SearchFrwrd(*i_set, &start, &end))
+ end = i_set->getLength();
+ if (ts.SearchForward(*i_set, &start, &end))
vrResult->push_back(*i_set);
++i_set;
}
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 75590a806f81..0f039d36b069 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -287,9 +287,9 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU
utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP);
utl::TextSearch ts(param, LANGUAGE_DONTKNOW);
- xub_StrLen start = 0;
- xub_StrLen end = static_cast<sal_uInt16>(sDescriptionXmlURL.getLength());
- if (ts.SearchFrwrd(sDescriptionXmlURL, &start, &end))
+ sal_Int32 start = 0;
+ sal_Int32 end = sDescriptionXmlURL.getLength();
+ if (ts.SearchForward(sDescriptionXmlURL, &start, &end))
return false;
}
}
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 7572014e54d8..dedd6b2c1497 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2608,8 +2608,8 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem,
ContentNode* pNode = aEditDoc.GetObject( nNode );
- sal_uInt16 nStartPos = 0;
- sal_uInt16 nEndPos = pNode->Len();
+ sal_Int32 nStartPos = 0;
+ sal_Int32 nEndPos = pNode->Len();
if ( nNode == nStartNode )
{
if ( bBack )
@@ -2626,16 +2626,21 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem,
}
// Searching ...
- XubString aParaStr( GetEditDoc().GetParaAsString( pNode ) );
+ OUString aParaStr( GetEditDoc().GetParaAsString( pNode ) );
bool bFound = false;
if ( bBack )
{
- Swapsal_uIt16s( nStartPos, nEndPos );
- bFound = aSearcher.SearchBkwrd( aParaStr, &nStartPos, &nEndPos);
+ sal_Int32 nTemp;
+ nTemp = nStartPos;
+ nStartPos = nEndPos;
+ nEndPos = nTemp;
+
+ bFound = aSearcher.SearchBackward( aParaStr, &nStartPos, &nEndPos);
}
else
- bFound = aSearcher.SearchFrwrd( aParaStr, &nStartPos, &nEndPos);
-
+ {
+ bFound = aSearcher.SearchForward( aParaStr, &nStartPos, &nEndPos);
+ }
if ( bFound )
{
rFoundSel.Min().SetNode( pNode );
diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx
index 184d91c61d96..306dbd98bb12 100644
--- a/forms/source/xforms/computedexpression.cxx
+++ b/forms/source/xforms/computedexpression.cxx
@@ -92,14 +92,13 @@ bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const
// call RegExp engine
SearchOptions aSearchOptions;
aSearchOptions.algorithmType = SearchAlgorithms_REGEXP;
- aSearchOptions.searchString = String( pExpression, RTL_TEXTENCODING_ASCII_US );
+ aSearchOptions.searchString = OUString( pExpression, strlen(pExpression), RTL_TEXTENCODING_ASCII_US );
utl::TextSearch aTextSearch( aSearchOptions );
- xub_StrLen nLength =
- static_cast<xub_StrLen>( msExpression.getLength() );
- xub_StrLen nStart = 0;
- xub_StrLen nEnd = nLength;
- int nSearch = aTextSearch.SearchFrwrd( msExpression, &nStart, &nEnd );
+ sal_Int32 nLength = msExpression.getLength();
+ sal_Int32 nStart = 0;
+ sal_Int32 nEnd = nLength;
+ int nSearch = aTextSearch.SearchForward( msExpression, &nStart, &nEnd );
// our expression is static only if 1) we found our regexp, and 2)
// the regexp goes from beginning to end.
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 24096470b5f0..1cc901a19fb7 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2801,8 +2801,8 @@ void AutoRecovery::implts_generateNewTempURL(const OUString& sBack
// TODO: Must we strip some illegal signes - if we use the title?
OUString sName(sUniqueName.makeStringAndClear());
- String sExtension(rInfo.Extension);
- String sPath(sBackupPath);
+ OUString sExtension(rInfo.Extension);
+ OUString sPath(sBackupPath);
::utl::TempFile aTempFile(sName, &sExtension, &sPath);
rInfo.NewTempURL = aTempFile.GetURL();
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index fcf7351f9c9f..7aa06a6b20b6 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -247,9 +247,9 @@ public:
SAL_DLLPRIVATE void DoBackup_Impl();
SAL_DLLPRIVATE void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent );
SAL_DLLPRIVATE void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent,
- const String& aPrefix,
- const String& aExtension,
- const String& aDestDir );
+ const OUString& aPrefix,
+ const OUString& aExtension,
+ const OUString& aDestDir );
SAL_DLLPRIVATE sal_Bool UseBackupToRestore_Impl( ::ucbhelper::Content& aOriginalContent,
const css::uno::Reference< css::ucb::XCommandEnvironment >& xComEnv );
diff --git a/include/unotools/calendarwrapper.hxx b/include/unotools/calendarwrapper.hxx
index d7e66dea0f33..2f3c48f4cc23 100644
--- a/include/unotools/calendarwrapper.hxx
+++ b/include/unotools/calendarwrapper.hxx
@@ -21,7 +21,6 @@
#define _UNOTOOLS_CALENDARWRAPPER_HXX
#include <tools/datetime.hxx>
-#include <tools/string.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/i18n/Calendar2.hpp>
@@ -73,13 +72,13 @@ public:
// wrapper implementations of XCalendar
void setValue( sal_Int16 nFieldIndex, sal_Int16 nValue );
- sal_Bool isValid() const;
+ bool isValid() const;
sal_Int16 getValue( sal_Int16 nFieldIndex ) const;
void addValue( sal_Int16 nFieldIndex, sal_Int32 nAmount );
sal_Int16 getFirstDayOfWeek() const;
sal_Int16 getNumberOfMonthsInYear() const;
sal_Int16 getNumberOfDaysInWeek() const;
- String getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const;
+ OUString getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const;
/** Convenience method to get timezone offset in milliseconds, taking both
fields ZONE_OFFSET and ZONE_OFFSET_SECOND_MILLIS into account. */
@@ -91,7 +90,7 @@ public:
// wrapper implementations of XExtendedCalendar
- String getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) const;
+ OUString getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) const;
// wrapper implementations of XCalendar3
diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 3ff83458b0af..1eb2954a0491 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -33,7 +33,7 @@
#include <osl/mutex.hxx>
#include <rtl/character.hxx>
-class String;
+
namespace com { namespace sun { namespace star {
namespace uno {
class XComponentContext;
@@ -93,48 +93,48 @@ public:
/// isdigit() on ascii values
- static inline sal_Bool isAsciiDigit( sal_Unicode c )
+ static inline bool isAsciiDigit( sal_Unicode c )
{
return rtl::isAsciiDigit( c );
}
/// isalpha() on ascii values
- static inline sal_Bool isAsciiAlpha( sal_Unicode c )
+ static inline bool isAsciiAlpha( sal_Unicode c )
{
return rtl::isAsciiAlpha( c );
}
/// isalnum() on ascii values
- static inline sal_Bool isAsciiAlphaNumeric( sal_Unicode c )
+ static inline bool isAsciiAlphaNumeric( sal_Unicode c )
{
return rtl::isAsciiAlphanumeric( c );
}
/// isdigit() on ascii values of entire string
- static sal_Bool isAsciiNumeric( const String& rStr );
+ static bool isAsciiNumeric( const OUString& rStr );
/// isalpha() on ascii values of entire string
- static sal_Bool isAsciiAlpha( const String& rStr );
+ static bool isAsciiAlpha( const OUString& rStr );
/// isalnum() on ascii values of entire string
- static sal_Bool isAsciiAlphaNumeric( const String& rStr );
+ static bool isAsciiAlphaNumeric( const OUString& rStr );
/// whether type is pure alpha or not, e.g. return of getStringType
- static inline sal_Bool isAlphaType( sal_Int32 nType )
+ static inline bool isAlphaType( sal_Int32 nType )
{
return ((nType & nCharClassAlphaType) != 0) &&
((nType & ~(nCharClassAlphaTypeMask)) == 0);
}
/// whether type is pure numeric or not, e.g. return of getStringType
- static inline sal_Bool isNumericType( sal_Int32 nType )
+ static inline bool isNumericType( sal_Int32 nType )
{
return ((nType & nCharClassNumericType) != 0) &&
((nType & ~(nCharClassNumericTypeMask)) == 0);
}
/// whether type is pure alphanumeric or not, e.g. return of getStringType
- static inline sal_Bool isAlphaNumericType( sal_Int32 nType )
+ static inline bool isAlphaNumericType( sal_Int32 nType )
{
return ((nType & (nCharClassAlphaType |
nCharClassNumericType)) != 0) &&
@@ -143,14 +143,14 @@ public:
}
/// whether type is pure letter or not, e.g. return of getStringType
- static inline sal_Bool isLetterType( sal_Int32 nType )
+ static inline bool isLetterType( sal_Int32 nType )
{
return ((nType & nCharClassLetterType) != 0) &&
((nType & ~(nCharClassLetterTypeMask)) == 0);
}
/// whether type is pure letternumeric or not, e.g. return of getStringType
- static inline sal_Bool isLetterNumericType( sal_Int32 nType )
+ static inline bool isLetterNumericType( sal_Int32 nType )
{
return ((nType & (nCharClassLetterType |
nCharClassNumericType)) != 0) &&
@@ -178,42 +178,42 @@ public:
return titlecase(_rStr, 0, _rStr.getLength());
}
- sal_Int16 getType( const String& rStr, xub_StrLen nPos ) const;
- sal_Int16 getCharacterDirection( const String& rStr, xub_StrLen nPos ) const;
- sal_Int16 getScript( const String& rStr, xub_StrLen nPos ) const;
- sal_Int32 getCharacterType( const String& rStr, xub_StrLen nPos ) const;
- sal_Int32 getStringType( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const;
+ sal_Int16 getType( const OUString& rStr, sal_Int32 nPos ) const;
+ sal_Int16 getCharacterDirection( const OUString& rStr, sal_Int32 nPos ) const;
+ sal_Int16 getScript( const OUString& rStr, sal_Int32 nPos ) const;
+ sal_Int32 getCharacterType( const OUString& rStr, sal_Int32 nPos ) const;
+ sal_Int32 getStringType( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const;
::com::sun::star::i18n::ParseResult parseAnyToken(
- const String& rStr,
+ const OUString& rStr,
sal_Int32 nPos,
sal_Int32 nStartCharFlags,
- const String& userDefinedCharactersStart,
+ const OUString& userDefinedCharactersStart,
sal_Int32 nContCharFlags,
- const String& userDefinedCharactersCont ) const;
+ const OUString& userDefinedCharactersCont ) const;
::com::sun::star::i18n::ParseResult parsePredefinedToken(
sal_Int32 nTokenType,
- const String& rStr,
+ const OUString& rStr,
sal_Int32 nPos,
sal_Int32 nStartCharFlags,
- const String& userDefinedCharactersStart,
+ const OUString& userDefinedCharactersStart,
sal_Int32 nContCharFlags,
- const String& userDefinedCharactersCont ) const;
+ const OUString& userDefinedCharactersCont ) const;
// Functionality of class International methods
- sal_Bool isAlpha( const String& rStr, xub_StrLen nPos ) const;
- sal_Bool isLetter( const String& rStr, xub_StrLen nPos ) const;
- sal_Bool isDigit( const String& rStr, xub_StrLen nPos ) const;
- sal_Bool isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const;
- sal_Bool isLetterNumeric( const String& rStr, xub_StrLen nPos ) const;
- sal_Bool isAlpha( const String& rStr ) const;
- sal_Bool isLetter( const String& rStr ) const;
- sal_Bool isNumeric( const String& rStr ) const;
- sal_Bool isAlphaNumeric( const String& rStr ) const;
- sal_Bool isLetterNumeric( const String& rStr ) const;
+ bool isAlpha( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isLetter( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isDigit( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isAlpha( const OUString& rStr ) const;
+ bool isLetter( const OUString& rStr ) const;
+ bool isNumeric( const OUString& rStr ) const;
+ bool isAlphaNumeric( const OUString& rStr ) const;
+ bool isLetterNumeric( const OUString& rStr ) const;
private:
diff --git a/include/unotools/defaultoptions.hxx b/include/unotools/defaultoptions.hxx
index 175fd3239f7a..692c1463010e 100644
--- a/include/unotools/defaultoptions.hxx
+++ b/include/unotools/defaultoptions.hxx
@@ -20,10 +20,10 @@
#define INCLUDED_unotools_DEFAULTOPTIONS_HXX
#include "unotools/unotoolsdllapi.h"
+#include <rtl/ustring.hxx>
#include "tools/solar.h"
#include <unotools/options.hxx>
-class String;
class SvtDefaultOptions_Impl;
// class SvtDefaultOptions -----------------------------------------------
@@ -39,7 +39,7 @@ public:
SvtDefaultOptions();
virtual ~SvtDefaultOptions();
- String GetDefaultPath( sal_uInt16 nId ) const;
+ OUString GetDefaultPath( sal_uInt16 nId ) const;
};
#endif // #ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
index 23ea55140655..3e7f0ac95200 100644
--- a/include/unotools/fontcfg.hxx
+++ b/include/unotools/fontcfg.hxx
@@ -20,7 +20,7 @@
#define _UNOTOOLS_FONTCFG_HXX
#include <unotools/unotoolsdllapi.h>
-#include <tools/string.hxx>
+#include <tools/solar.h>
#include <tools/fontenum.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -154,11 +154,11 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
struct UNOTOOLS_DLLPUBLIC FontNameAttr
{
- String Name;
- ::std::vector< String > Substitutions;
- ::std::vector< String > MSSubstitutions;
- ::std::vector< String > PSSubstitutions;
- ::std::vector< String > HTMLSubstitutions;
+ OUString Name;
+ ::std::vector< OUString > Substitutions;
+ ::std::vector< OUString > MSSubstitutions;
+ ::std::vector< OUString > PSSubstitutions;
+ ::std::vector< OUString > HTMLSubstitutions;
FontWeight Weight;
FontWidth Width;
unsigned long Type; // bitfield of IMPL_FONT_ATTR_*
@@ -190,7 +190,7 @@ private:
void fillSubstVector( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
const OUString& rType,
- std::vector< String >& rSubstVector ) const;
+ std::vector< OUString >& rSubstVector ) const;
FontWeight getSubstWeight( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
const OUString& rType ) const;
FontWidth getSubstWidth( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
@@ -205,13 +205,13 @@ public:
static FontSubstConfiguration& get();
const FontNameAttr* getSubstInfo(
- const String& rFontName,
+ const OUString& rFontName,
const com::sun::star::lang::Locale& rLocale =
com::sun::star::lang::Locale( OUString( "en" ),
OUString(),
OUString() )
) const;
- static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType );
+ static void getMapName( const OUString& rOrgName, OUString& rShortName, OUString& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType );
};
} // namespace utl
diff --git a/include/unotools/fontcvt.hxx b/include/unotools/fontcvt.hxx
index 6386e615951d..216ebcac101b 100644
--- a/include/unotools/fontcvt.hxx
+++ b/include/unotools/fontcvt.hxx
@@ -21,7 +21,8 @@
#define _UNOTOOLS_FONTCVT_HXX
#include <unotools/unotoolsdllapi.h>
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
// ------------------
// - FontToSubsFont -
@@ -32,10 +33,10 @@
#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((sal_uLong)0x00000004)
typedef void* FontToSubsFontConverter;
-UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, sal_uLong nFlags );
+UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const OUString& rFontName, sal_uLong nFlags );
UNOTOOLS_DLLPUBLIC void DestroyFontToSubsFontConverter( FontToSubsFontConverter hConverter );
UNOTOOLS_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar( FontToSubsFontConverter hConverter, sal_Unicode c );
-UNOTOOLS_DLLPUBLIC String GetFontToSubsFontName( FontToSubsFontConverter hConverter );
+UNOTOOLS_DLLPUBLIC OUString GetFontToSubsFontName( FontToSubsFontConverter hConverter );
// ---------------------------
// - StarSymbolToMSMultiFont -
@@ -48,7 +49,7 @@ public:
//mapped to. Sets rChar to the correct position for that font. If no
//match found, then no name is returned, and rChar is unchanged. If you
//want to convert a string, you don't want to use this.
- virtual String ConvertChar(sal_Unicode &rChar) = 0;
+ virtual OUString ConvertChar(sal_Unicode &rChar) = 0;
//Starts converting the string at position rIndex. It converts as much of
//the string that can be converted to the same symbol font and returns the
@@ -57,7 +58,7 @@ public:
//rString.Len() and handle each section as separate 8bit strings using
//separate fonts. Will return an empty string for a continous section
//that has no possible mapping.
- virtual String ConvertString(String &rString, xub_StrLen &rIndex) = 0;
+ virtual OUString ConvertString(OUString &rString, sal_Int32 &rIndex) = 0;
virtual ~StarSymbolToMSMultiFont() {}
};
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
index e57abd491057..1e88372a1548 100644
--- a/include/unotools/fontdefs.hxx
+++ b/include/unotools/fontdefs.hxx
@@ -21,7 +21,7 @@
#include <unotools/unotoolsdllapi.h>
#include <sal/types.h>
-#include <tools/string.hxx>
+#include <tools/solar.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -43,7 +43,7 @@ UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, sal_uLong nF
UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken );
-struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const String&) const; };
+struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const OUString&) const; };
// ---------------
// - ConvertChar -
@@ -57,7 +57,7 @@ public:
sal_Unicode (*mpCvtFunc)( sal_Unicode );
sal_Unicode RecodeChar( sal_Unicode c ) const;
void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
- static const ConvertChar* GetRecodeData( const String& rOrgFontName, const String& rMapFontName );
+ static const ConvertChar* GetRecodeData( const OUString& rOrgFontName, const OUString& rMapFontName );
};
diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx
index 8b5f9da48733..426524dbff8e 100644
--- a/include/unotools/pathoptions.hxx
+++ b/include/unotools/pathoptions.hxx
@@ -68,61 +68,61 @@ public:
virtual ~SvtPathOptions();
// get the paths, not const because of using a mutex
- const String& GetAddinPath() const;
- const String& GetAutoCorrectPath() const;
- const String& GetAutoTextPath() const;
- const String& GetBackupPath() const;
- const String& GetBasicPath() const;
- const String& GetBitmapPath() const;
- const String& GetConfigPath() const;
- const String& GetDictionaryPath() const;
- const String& GetFavoritesPath() const;
- const String& GetFilterPath() const;
- const String& GetGalleryPath() const;
- const String& GetGraphicPath() const;
- const String& GetHelpPath() const;
- const String& GetLinguisticPath() const;
- const String& GetModulePath() const;
- const String& GetPalettePath() const;
- const String& GetPluginPath() const;
- const String& GetStoragePath() const;
- const String& GetTempPath() const;
- const String& GetTemplatePath() const;
- const String& GetUserConfigPath() const;
- const String& GetWorkPath() const;
- const String& GetUIConfigPath() const;
- const String& GetFingerprintPath() const;
+ const OUString& GetAddinPath() const;
+ const OUString& GetAutoCorrectPath() const;
+ const OUString& GetAutoTextPath() const;
+ const OUString& GetBackupPath() const;
+ const OUString& GetBasicPath() const;
+ const OUString& GetBitmapPath() const;
+ const OUString& GetConfigPath() const;
+ const OUString& GetDictionaryPath() const;
+ const OUString& GetFavoritesPath() const;
+ const OUString& GetFilterPath() const;
+ const OUString& GetGalleryPath() const;
+ const OUString& GetGraphicPath() const;
+ const OUString& GetHelpPath() const;
+ const OUString& GetLinguisticPath() const;
+ const OUString& GetModulePath() const;
+ const OUString& GetPalettePath() const;
+ const OUString& GetPluginPath() const;
+ const OUString& GetStoragePath() const;
+ const OUString& GetTempPath() const;
+ const OUString& GetTemplatePath() const;
+ const OUString& GetUserConfigPath() const;
+ const OUString& GetWorkPath() const;
+ const OUString& GetUIConfigPath() const;
+ const OUString& GetFingerprintPath() const;
// set the paths
- void SetAddinPath( const String& rPath );
- void SetAutoCorrectPath( const String& rPath );
- void SetAutoTextPath( const String& rPath );
- void SetBackupPath( const String& rPath );
- void SetBasicPath( const String& rPath );
- void SetBitmapPath( const String& rPath );
- void SetConfigPath( const String& rPath );
- void SetDictionaryPath( const String& rPath );
- void SetFavoritesPath( const String& rPath );
- void SetFilterPath( const String& rPath );
- void SetGalleryPath( const String& rPath );
- void SetGraphicPath( const String& rPath );
- void SetHelpPath( const String& rPath );
- void SetLinguisticPath( const String& rPath );
- void SetModulePath( const String& rPath );
- void SetPalettePath( const String& rPath );
- void SetPluginPath( const String& rPath );
- void SetStoragePath( const String& rPath );
- void SetTempPath( const String& rPath );
- void SetTemplatePath( const String& rPath );
- void SetUserConfigPath( const String& rPath );
- void SetWorkPath( const String& rPath );
+ void SetAddinPath( const OUString& rPath );
+ void SetAutoCorrectPath( const OUString& rPath );
+ void SetAutoTextPath( const OUString& rPath );
+ void SetBackupPath( const OUString& rPath );
+ void SetBasicPath( const OUString& rPath );
+ void SetBitmapPath( const OUString& rPath );
+ void SetConfigPath( const OUString& rPath );
+ void SetDictionaryPath( const OUString& rPath );
+ void SetFavoritesPath( const OUString& rPath );
+ void SetFilterPath( const OUString& rPath );
+ void SetGalleryPath( const OUString& rPath );
+ void SetGraphicPath( const OUString& rPath );
+ void SetHelpPath( const OUString& rPath );
+ void SetLinguisticPath( const OUString& rPath );
+ void SetModulePath( const OUString& rPath );
+ void SetPalettePath( const OUString& rPath );
+ void SetPluginPath( const OUString& rPath );
+ void SetStoragePath( const OUString& rPath );
+ void SetTempPath( const OUString& rPath );
+ void SetTemplatePath( const OUString& rPath );
+ void SetUserConfigPath( const OUString& rPath );
+ void SetWorkPath( const OUString& rPath );
OUString SubstituteVariable( const OUString& rVar ) const;
OUString ExpandMacros( const OUString& rPath ) const;
OUString UseVariable( const OUString& rVar ) const;
- sal_Bool SearchFile( String& rIniFile, Paths ePath = PATH_USERCONFIG );
+ bool SearchFile( OUString& rIniFile, Paths ePath = PATH_USERCONFIG );
const LanguageTag& GetLanguageTag() const;
- sal_Bool IsReadonly() const;
+ bool IsReadonly() const;
};
#endif // #ifndef INCLUDED_unotools_PATHOPTIONS_HXX
diff --git a/include/unotools/syslocaleoptions.hxx b/include/unotools/syslocaleoptions.hxx
index 8c9378938ce0..9bf0578ee10f 100644
--- a/include/unotools/syslocaleoptions.hxx
+++ b/include/unotools/syslocaleoptions.hxx
@@ -27,7 +27,6 @@
#include <tools/link.hxx>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
-#include <tools/string.hxx>
#include <unotools/options.hxx>
// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined
@@ -64,7 +63,7 @@ public:
// ConfigItem methods
- sal_Bool IsModified();
+ bool IsModified();
void Commit();
/** Add a listener to react on config changes
@@ -88,16 +87,16 @@ public:
@ATTENTION
All SvtSysLocaleOptions instances point to exactly one refcounted
internal representation instance and broadcast blocks are counted.
- Thus if you issue a BlockBroadcasts(sal_True) you MUST issue a matching
- BlockBroadcasts(sal_False) or otherwise pending hints would never be
+ Thus if you issue a BlockBroadcasts(true) you MUST issue a matching
+ BlockBroadcasts(false) or otherwise pending hints would never be
broadcasted again.
*/
- virtual void BlockBroadcasts( bool bBlock );
+ virtual void BlockBroadcasts( bool bBlock );
// config value access methods
/// The config string may be empty to denote the SYSTEM locale
- const OUString& GetLocaleConfigString() const;
+ const OUString& GetLocaleConfigString() const;
void SetLocaleConfigString( const OUString& rStr );
/** Get locale set, if empty denotes SYSTEM locale, not resolved
to the real locale. */
@@ -111,39 +110,39 @@ public:
const LanguageTag& GetRealUILanguageTag() const;
/// The config string may be empty to denote the default currency of the locale
- const OUString& GetCurrencyConfigString() const;
+ const OUString& GetCurrencyConfigString() const;
void SetCurrencyConfigString( const OUString& rStr );
/** The config string may be empty to denote the default
DateAcceptancePatterns of the locale */
- const OUString& GetDatePatternsConfigString() const;
+ const OUString& GetDatePatternsConfigString() const;
void SetDatePatternsConfigString( const OUString& rStr );
// determine whether the decimal separator defined in the keyboard layout is used
// or the one approriate to the locale
- sal_Bool IsDecimalSeparatorAsLocale() const;
- void SetDecimalSeparatorAsLocale( sal_Bool bSet);
+ bool IsDecimalSeparatorAsLocale() const;
+ void SetDecimalSeparatorAsLocale( bool bSet);
// determine whether to ignore changes to the system keyboard/locale/language when
// determining the language for newly entered text
- sal_Bool IsIgnoreLanguageChange() const;
- void SetIgnoreLanguageChange( sal_Bool bSet);
+ bool IsIgnoreLanguageChange() const;
+ void SetIgnoreLanguageChange( bool bSet);
// convenience methods
/// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string
static void GetCurrencyAbbrevAndLanguage(
- String& rAbbrev,
+ OUString& rAbbrev,
LanguageType& eLang,
const OUString& rConfigString );
/// Create an USD-en-US or EUR-de-DE string
- static OUString CreateCurrencyConfigString(
- const String& rAbbrev,
+ static OUString CreateCurrencyConfigString(
+ const OUString& rAbbrev,
LanguageType eLang );
void GetCurrencyAbbrevAndLanguage(
- String& rAbbrev,
+ OUString& rAbbrev,
LanguageType& eLang ) const
{
GetCurrencyAbbrevAndLanguage( rAbbrev,
@@ -151,7 +150,7 @@ public:
}
void SetCurrencyAbbrevAndLanguage(
- const String& rAbbrev,
+ const OUString& rAbbrev,
LanguageType eLang )
{
SetCurrencyConfigString(
@@ -169,7 +168,7 @@ public:
static const Link& GetCurrencyChangeLink();
/** return the readonly state of the queried option. */
- sal_Bool IsReadOnly( EOption eOption ) const;
+ bool IsReadOnly( EOption eOption ) const;
};
#endif // INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 6cf2cb0cd98c..da3a472e8f60 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -48,7 +48,7 @@ struct TempFile_Impl;
class UNOTOOLS_DLLPUBLIC TempFile
{
TempFile_Impl* pImp;
- sal_Bool bKillingFileEnabled;
+ bool bKillingFileEnabled;
protected:
@@ -59,15 +59,15 @@ public:
The temporary object is created in the local file system, even if there is no UCB that can access it.
If the given folder is part of the local file system, the TempFile is created in this folder.
*/
- TempFile( const String* pParent=NULL, sal_Bool bDirectory=sal_False );
+ TempFile( const OUString* pParent=NULL, bool bDirectory=false );
/**
Same as above; additionally the name starts with some given characters followed by a counter ( example:
rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
*/
- TempFile( const String& rLeadingChars, const String* pExtension=NULL, const String* pParent=NULL,
- sal_Bool bDirectory=sal_False);
+ TempFile( const OUString& rLeadingChars, const OUString* pExtension=NULL, const OUString* pParent=NULL,
+ bool bDirectory=false);
/**
Same as above; additionally the name starts with some given characters followed by a counter ( example:
@@ -75,7 +75,7 @@ public:
The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
@param _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
*/
- TempFile( const String& rLeadingChars,sal_Bool _bStartWithZero, const String* pExtension=NULL, const String* pParent=NULL,sal_Bool bDirectory=sal_False);
+ TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false);
/**
TempFile will be removed from disk in dtor if EnableKillingTempFile was called before.
@@ -86,7 +86,7 @@ public:
/**
Returns sal_True if it has a valid file name.
*/
- sal_Bool IsValid() const;
+ bool IsValid() const;
/**
Returns the "UCB compatible" URL of the tempfile object.
@@ -96,7 +96,7 @@ public:
If no UCP is available for the local file system, an empty URL is returned. In this case you can't access
the file as a UCB content !
*/
- String GetURL() const;
+ OUString GetURL() const;
/**
Returns the "physical" name of the tempfile in host notation ( should only be used for 3rd party code
@@ -104,7 +104,7 @@ public:
If you want to have the URL, use the GetURL() method of this object, but never use any external
conversion functions for "physical" names into URLs.
*/
- String GetFileName() const;
+ OUString GetFileName() const;
/**
Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this
@@ -121,10 +121,10 @@ public:
/**
If enabled the file will be removed from disk when the dtor is called ( default is not enabled )
*/
- void EnableKillingFile( sal_Bool bEnable=sal_True )
+ void EnableKillingFile( bool bEnable=true )
{ bKillingFileEnabled = bEnable; }
- sal_Bool IsKillingFileEnabled() const
+ bool IsKillingFileEnabled() const
{ return bKillingFileEnabled; }
/**
@@ -133,7 +133,7 @@ public:
If you want to convert file name into a URL, always use class LocalFileHelper, but never use any
conversion functions of osl.
*/
- static String CreateTempName( const String* pParent=NULL );
+ static OUString CreateTempName( const OUString* pParent=NULL );
/**
The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the
@@ -144,7 +144,7 @@ public:
The return value of both methods is the complete "physical" name of the tempname base folder.
It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all.
*/
- static String SetTempNameBaseDirectory( const String &rBaseName );
+ static OUString SetTempNameBaseDirectory( const OUString &rBaseName );
};
}
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 0b826102cb91..0880c13ff3f4 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -22,7 +22,6 @@
#define _UNOTOOLS_TEXTSEARCH_HXX
#include <i18nlangtag/lang.h>
#include <rtl/ustring.hxx>
-#include <tools/string.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/XTextSearch.hpp>
@@ -52,8 +51,8 @@ public:
enum SearchType{ SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST };
private:
- String sSrchStr; // the search string
- String sReplaceStr; // the replace string
+ OUString sSrchStr; // the search string
+ OUString sReplaceStr; // the replace string
SearchType m_eSrchType; // search normal/regular/LevDist
@@ -73,16 +72,16 @@ private:
public:
SearchParam( const OUString &rText,
SearchType eSrchType = SearchParam::SRCH_NORMAL,
- sal_Bool bCaseSensitive = sal_True,
- sal_Bool bWordOnly = sal_False,
- sal_Bool bSearchInSelection = sal_False );
+ bool bCaseSensitive = true,
+ bool bWordOnly = false,
+ bool bSearchInSelection = false );
SearchParam( const SearchParam& );
~SearchParam();
- const String& GetSrchStr() const { return sSrchStr; }
- const String& GetReplaceStr() const { return sReplaceStr; }
+ const OUString& GetSrchStr() const { return sSrchStr; }
+ const OUString& GetReplaceStr() const { return sReplaceStr; }
SearchType GetSrchType() const { return m_eSrchType; }
int IsCaseSensitive() const { return m_bCaseSense; }
@@ -90,8 +89,8 @@ public:
int IsSrchWordOnly() const { return m_bWordOnly; }
- void SetSrchStr( const String& rStr ) { sSrchStr = rStr; }
- void SetReplaceStr( const String& rStr ) { sReplaceStr = rStr; }
+ void SetSrchStr( const OUString& rStr ) { sSrchStr = rStr; }
+ void SetReplaceStr( const OUString& rStr ) { sReplaceStr = rStr; }
void SetSrchType( SearchType eType ) { m_eSrchType = eType; }
void SetCaseSensitive( int bFlag ) { m_bCaseSense = bFlag; }
@@ -145,35 +144,32 @@ public:
pStart - start position for the search
pEnde - end position for the search
- RETURN values == sal_True: something is found
+ RETURN values == true: something is found
- pStart start pos of the found text,
- pStart end pos of the found text,
- pSrchResult - the search result with all found
positions. Is only filled with more positions
if the regular expression handles groups.
- == sal_False: nothing found, pStart,pEnde unchanged.
+ == false: nothing found, pStart,pEnde unchanged.
Definitions: start pos always inclusive, end pos always exclusive!
The position must always in the right direction!
search forward: start <= end
search backward: end <= start
*/
- int SearchFrwrd( const String &rStr,
- xub_StrLen* pStart, xub_StrLen* pEnde,
- ::com::sun::star::util::SearchResult* pSrchResult = 0 );
- sal_Bool SearchForward( const OUString &rStr,
- sal_Int32* pStart, sal_Int32* pEnd,
- ::com::sun::star::util::SearchResult* pRes = 0 );
- int SearchBkwrd( const String &rStr,
- xub_StrLen* pStart, xub_StrLen* pEnde,
- ::com::sun::star::util::SearchResult* pSrchResult = 0 );
+ bool SearchForward( const OUString &rStr,
+ sal_Int32* pStart, sal_Int32* pEnd,
+ ::com::sun::star::util::SearchResult* pRes = 0 );
+ bool SearchBackward( const OUString &rStr,
+ sal_Int32* pStart, sal_Int32* pEnd,
+ ::com::sun::star::util::SearchResult* pRes = 0 );
void SetLocale( const ::com::sun::star::util::SearchOptions& rOpt,
const ::com::sun::star::lang::Locale& rLocale );
/* replace back references in the replace string by the sub expressions from the search result */
- void ReplaceBackReferences( String& rReplaceStr, const String &rStr, const ::com::sun::star::util::SearchResult& rResult );
+ void ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const ::com::sun::star::util::SearchResult& rResult );
};
diff --git a/include/unotools/transliterationwrapper.hxx b/include/unotools/transliterationwrapper.hxx
index 6d64d40a92f1..fbc845b218be 100644
--- a/include/unotools/transliterationwrapper.hxx
+++ b/include/unotools/transliterationwrapper.hxx
@@ -20,7 +20,7 @@
#ifndef _UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
#define _UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
#include <tools/solar.h>
#include <i18nlangtag/languagetag.hxx>
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
@@ -40,7 +40,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
::com::sun::star::i18n::XExtendedTransliteration > xTrans;
LanguageTag aLanguageTag;
sal_uInt32 nType;
- mutable sal_Bool bFirstCall;
+ mutable bool bFirstCall;
// not implemented, prevent usage
TransliterationWrapper( const TransliterationWrapper& );
@@ -62,7 +62,7 @@ public:
sal_uInt32 getType() const { return nType; }
- sal_Bool needLanguageForTheMode() const;
+ bool needLanguageForTheMode() const;
/** set a new language and load the corresponding transliteration module if
needed for the mode set with nType in the ctor */
@@ -80,19 +80,19 @@ public:
those may load a different module and overwrite this setting. Only the
transliterate() method that takes no LanguageType parameter may be used
for a specific module loaded with this method. */
- void loadModuleByImplName( const String& rModuleName, sal_uInt16 nLang );
+ void loadModuleByImplName( const OUString& rModuleName, sal_uInt16 nLang );
/** This transliteration method corresponds with the loadModuleByImplName()
method. It relies on a module being loaded and does not try load one.
If for any reason the string can't be transliterated the original
string is returned. */
- String transliterate( const String& rStr,
- xub_StrLen nStart, xub_StrLen nLen,
+ OUString transliterate( const OUString& rStr,
+ sal_Int32 nStart, sal_Int32 nLen,
::com::sun::star::uno::Sequence <sal_Int32>* pOffset ) const;
// Wrapper implementations of class Transliteration
- String transliterate( const String& rStr, sal_uInt16 nLanguage,
- xub_StrLen nStart, xub_StrLen nLen,
+ OUString transliterate( const OUString& rStr, sal_uInt16 nLanguage,
+ sal_Int32 nStart, sal_Int32 nLen,
::com::sun::star::uno::Sequence <sal_Int32>* pOffset );
/** If two strings are equal per this transliteration.
@@ -103,11 +103,11 @@ public:
equals( "aab", 0, 3, nMatch1, "aaa", 0, 3, nMatch2 )
returns false and nMatch:=2 and nMatch2:=2
*/
- sal_Bool equals(
- const String& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
- const String& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const;
+ bool equals(
+ const OUString& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
+ const OUString& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const;
- sal_Int32 compareString( const String& rStr1, const String& rStr2 ) const;
+ sal_Int32 compareString( const OUString& rStr1, const OUString& rStr2 ) const;
// helpers
@@ -116,11 +116,11 @@ public:
one string is matching the start of the other. Use this method instead
of compareString()==0 because it is much faster.
*/
- sal_Bool isEqual( const String& rStr1, const String& rStr2 ) const;
+ bool isEqual( const OUString& rStr1, const OUString& rStr2 ) const;
/** If string rStr1 matches the start of string rStr2, i.e. "a" in "aaa"
*/
- sal_Bool isMatch( const String& rStr1, const String& rStr2 ) const;
+ bool isMatch( const OUString& rStr1, const OUString& rStr2 ) const;
};
diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx
index acd79928e3a8..6df93af9e7b9 100644
--- a/include/unotools/ucblockbytes.hxx
+++ b/include/unotools/ucblockbytes.hxx
@@ -28,11 +28,11 @@
#include <osl/thread.hxx>
#include <osl/conditn.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
#include <tools/stream.hxx>
#include <tools/link.hxx>
#include <tools/errcode.hxx>
#include <tools/datetime.hxx>
-#include <tools/string.hxx>
namespace com
{
@@ -69,7 +69,7 @@ SV_DECL_REF( UcbLockBytes )
class UcbLockBytesHandler : public SvRefBase
{
- sal_Bool m_bActive;
+ bool m_bActive;
public:
enum LoadHandlerItem
{
@@ -83,8 +83,8 @@ public:
{}
virtual void Handle( LoadHandlerItem nWhich, UcbLockBytesRef xLockBytes ) = 0;
- void Activate( sal_Bool bActivate = sal_True ) { m_bActive = bActivate; }
- sal_Bool IsActive() const { return m_bActive; }
+ void Activate( bool bActivate = true ) { m_bActive = bActivate; }
+ bool IsActive() const { return m_bActive; }
};
SV_DECL_IMPL_REF( UcbLockBytesHandler )
@@ -95,8 +95,8 @@ class UNOTOOLS_DLLPUBLIC UcbLockBytes : public virtual SvLockBytes
osl::Condition m_aTerminated;
osl::Mutex m_aMutex;
- String m_aContentType;
- String m_aRealURL;
+ OUString m_aContentType;
+ OUString m_aRealURL;
DateTime m_aExpireDate;
::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > m_xInputStream;
@@ -109,9 +109,9 @@ class UNOTOOLS_DLLPUBLIC UcbLockBytes : public virtual SvLockBytes
sal_uInt32 m_nSize;
ErrCode m_nError;
- sal_Bool m_bTerminated : 1;
- sal_Bool m_bDontClose : 1;
- sal_Bool m_bStreamValid : 1;
+ bool m_bTerminated;
+ bool m_bDontClose;
+ bool m_bStreamValid;
DECL_LINK( DataAvailHdl, void * );
@@ -145,16 +145,16 @@ public:
{ return m_nError; }
// the following properties are available when and after the first DataAvailable callback has been executed
- String GetContentType() const;
- String GetRealURL() const;
+ OUString GetContentType() const;
+ OUString GetRealURL() const;
DateTime GetExpireDate() const;
// calling this method delegates the responsibility to call closeinput to the caller!
::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > getInputStream();
- sal_Bool setInputStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > &rxInputStream,
- sal_Bool bSetXSeekable = sal_True );
- sal_Bool setStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > &rxStream );
+ bool setInputStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > &rxInputStream,
+ bool bSetXSeekable = true );
+ bool setStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > &rxStream );
void terminate_Impl (void);
::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > getInputStream_Impl() const
@@ -175,7 +175,7 @@ public:
return m_xSeekable;
}
- sal_Bool hasInputStream_Impl() const
+ bool hasInputStream_Impl() const
{
osl::MutexGuard aGuard( (const_cast< UcbLockBytes* >(this))->m_aMutex );
return m_xInputStream.is();
@@ -184,8 +184,8 @@ public:
void setDontClose_Impl()
{ m_bDontClose = sal_True; }
- void SetContentType_Impl( const String& rType ) { m_aContentType = rType; }
- void SetRealURL_Impl( const String& rURL ) { m_aRealURL = rURL; }
+ void SetContentType_Impl( const OUString& rType ) { m_aContentType = rType; }
+ void SetRealURL_Impl( const OUString& rURL ) { m_aRealURL = rURL; }
void SetExpireDate_Impl( const DateTime& rDateTime ) { m_aExpireDate = rDateTime; }
void SetStreamValid_Impl();
};
diff --git a/include/unotools/ucbstreamhelper.hxx b/include/unotools/ucbstreamhelper.hxx
index 85de1f36c741..44552d652cd1 100644
--- a/include/unotools/ucbstreamhelper.hxx
+++ b/include/unotools/ucbstreamhelper.hxx
@@ -53,13 +53,13 @@ namespace utl
class UNOTOOLS_DLLPUBLIC UcbStreamHelper : public SvStream
{
public:
- static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
- UcbLockBytesHandler* pHandler=0 );
- static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
- ::com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionHandler >,
- UcbLockBytesHandler* pHandler=0 );
- static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
- sal_Bool bFileExists,
+ static SvStream* CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ UcbLockBytesHandler* pHandler=0 );
+ static SvStream* CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ ::com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionHandler >,
+ UcbLockBytesHandler* pHandler=0 );
+ static SvStream* CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ bool bFileExists,
UcbLockBytesHandler* pHandler=0 );
static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream );
static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream );
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index e99d1440df61..c1cf2d4ca5f1 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -172,11 +172,9 @@ OUString OReportEngineJFree::getNewOutputName()
MimeConfigurationHelper aConfighelper(m_xContext);
const OUString sMimeType = m_xReport->getMimeType();
const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aConfighelper.GetDocServiceNameFromMediaType(sMimeType) );
- String sExt;
+ OUString sExt(".rpt");
if ( pFilter )
sExt = ::comphelper::string::stripStart(pFilter->GetDefaultExtension(), '*');
- else
- sExt = OUString(".rpt");
uno::Reference< embed::XStorage > xTemp = OStorageHelper::GetTemporaryStorage(/*sFileTemp,embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,*/ m_xContext);
utl::DisposableComponent aTemp(xTemp);
@@ -199,11 +197,11 @@ OUString OReportEngineJFree::getNewOutputName()
if ( !sName.Len() )
sName = m_xReport->getName();
{
- ::utl::TempFile aTestFile(sName,sal_False,&sExt);
+ ::utl::TempFile aTestFile(sName, false, &sExt);
if ( !aTestFile.IsValid() )
{
sName = RPT_RESSTRING(RID_STR_REPORT,m_xContext->getServiceManager());
- ::utl::TempFile aFile(sName,sal_False,&sExt);
+ ::utl::TempFile aFile(sName, false, &sExt);
sFileURL = aFile.GetURL();
}
else
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index db31b307098d..1b4e5a087f8a 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1871,13 +1871,13 @@ sal_Bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference<
{
aSearchOptions.searchString = aIter->m_sSearchString;
utl::TextSearch aTextSearch(aSearchOptions);
- xub_StrLen start = 0;
- xub_StrLen end = sFormula.Len();
- if ( aTextSearch.SearchFrwrd(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // default function found
+ sal_Int32 start = 0;
+ sal_Int32 end = sFormula.Len();
+ if ( aTextSearch.SearchForward(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // default function found
{
aSearchOptions.searchString = OUString("\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]");
utl::TextSearch aDataSearch(aSearchOptions);
- aDataSearch.SearchFrwrd(sFormula,&start,&end );
+ aDataSearch.SearchForward(sFormula,&start,&end );
++start;
_rDataField = sFormula.Copy(start,end-start-1);
_rsDefaultFunctionName = aIter->m_sName;
@@ -2088,9 +2088,9 @@ bool GeometryHandler::impl_isCounterFunction_throw(const OUString& _sQuotedFunct
aSearchOptions.searchFlag = 0x00000100;
aSearchOptions.searchString = m_aCounterFunction.m_sSearchString;
utl::TextSearch aTextSearch(aSearchOptions);
- xub_StrLen start = 0;
- xub_StrLen end = sFormula.Len();
- if ( aTextSearch.SearchFrwrd(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // counter function found
+ sal_Int32 start = 0;
+ sal_Int32 end = sFormula.Len();
+ if ( aTextSearch.SearchForward(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // counter function found
{
const uno::Reference< report::XGroup > xGroup(aFind.first->second.second,uno::UNO_QUERY);
if ( xGroup.is() )
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 90a0e6d4e21b..6b5fbf6f5fdf 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -24,6 +24,7 @@
#include <svl/itemset.hxx>
#include <unotools/fontcvt.hxx>
#include <editeng/svxenum.hxx>
+#include <tools/string.hxx>
#include "scdllapi.h"
class Font;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 17ab695c4f28..bff62bd964ac 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -534,10 +534,11 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
bool bTestRegExp = false;
if (bRealRegExp || bTestRegExp)
{
- xub_StrLen nStart = 0;
- xub_StrLen nEnd = aCellStr.Len();
+ sal_Int32 nStart = 0;
+ sal_Int32 nEnd = aCellStr.Len();
+
bool bMatch = (bool) rEntry.GetSearchTextPtr( rParam.bCaseSens )
- ->SearchFrwrd( aCellStr, &nStart, &nEnd );
+ ->SearchForward( aCellStr, &nStart, &nEnd );
// from 614 on, nEnd is behind the found text
if (bMatch && bMatchWholeCell
&& (nStart != 0 || nEnd != aCellStr.Len()))
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 03a0ca0c4148..eff2cd6f0a77 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1398,8 +1398,8 @@ public:
if ( bRealRegExp || bTestRegExp )
{
- xub_StrLen nStart = 0;
- xub_StrLen nEnd = aCellStr.getLength();
+ sal_Int32 nStart = 0;
+ sal_Int32 nEnd = aCellStr.getLength();
// from 614 on, nEnd is behind the found text
bool bMatch = false;
@@ -1407,13 +1407,13 @@ public:
{
nEnd = 0;
nStart = aCellStr.getLength();
- bMatch = (bool) rEntry.GetSearchTextPtr( mrParam.bCaseSens )
- ->SearchBkwrd( aCellStr, &nStart, &nEnd );
+ bMatch = rEntry.GetSearchTextPtr( mrParam.bCaseSens )
+ ->SearchBackward( aCellStr, &nStart, &nEnd );
}
else
{
- bMatch = (bool) rEntry.GetSearchTextPtr( mrParam.bCaseSens )
- ->SearchFrwrd( aCellStr, &nStart, &nEnd );
+ bMatch = rEntry.GetSearchTextPtr( mrParam.bCaseSens )
+ ->SearchForward( aCellStr, &nStart, &nEnd );
}
if ( bMatch && bMatchWholeCell
&& (nStart != 0 || nEnd != aCellStr.getLength()) )
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 7ee1b37ca853..9f6ae6202447 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -100,21 +100,21 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
default:
break;
}
- xub_StrLen nStart = 0;
- xub_StrLen nEnd = aString.getLength();
+ sal_Int32 nStart = 0;
+ sal_Int32 nEnd = aString.getLength();
::com::sun::star::util::SearchResult aSearchResult;
if (pSearchText)
{
if ( bDoBack )
{
- xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
- bFound = (bool)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd, &aSearchResult));
+ sal_Int32 nTemp=nStart; nStart=nEnd; nEnd=nTemp;
+ bFound = pSearchText->SearchBackward(aString, &nStart, &nEnd, &aSearchResult);
// change results to definition before 614:
--nEnd;
}
else
{
- bFound = (bool)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd, &aSearchResult));
+ bFound = pSearchText->SearchForward(aString, &nStart, &nEnd, &aSearchResult);
// change results to definition before 614:
--nEnd;
}
@@ -152,10 +152,10 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
{
// wenn der gefundene Text leer ist, nicht weitersuchen,
// sonst wuerde man nie mehr aufhoeren (#35410#)
- if ( nEnd < nStart || nEnd == STRING_MAXLEN )
+ if ( nEnd < nStart )
bRepeat = false;
- String sReplStr = rSearchItem.GetReplaceString();
+ OUString sReplStr = rSearchItem.GetReplaceString();
if (rSearchItem.GetRegExp())
{
pSearchText->ReplaceBackReferences( sReplStr, aString, aSearchResult );
@@ -180,7 +180,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
}
else
{
- nStart = sal::static_int_cast<xub_StrLen>( nStart + sReplStr.Len() );
+ nStart = nStart + sReplStr.getLength();
nEnd = aString.getLength();
}
@@ -191,14 +191,14 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
bRepeat = false;
else if (bDoBack)
{
- xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
- bRepeat = ((bool)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd, &aSearchResult)));
+ sal_Int32 nTemp=nStart; nStart=nEnd; nEnd=nTemp;
+ bRepeat = pSearchText->SearchBackward(aString, &nStart, &nEnd, &aSearchResult);
// change results to definition before 614:
--nEnd;
}
else
{
- bRepeat = ((bool)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd, &aSearchResult)));
+ bRepeat = pSearchText->SearchForward(aString, &nStart, &nEnd, &aSearchResult);
// change results to definition before 614:
--nEnd;
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9cb89ae23a4e..a88b542898f5 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -930,10 +930,10 @@ double ScInterpreter::CompareFunc( const ScCompare& rComp, ScCompareOptions* pOp
OSL_ENSURE(rEntry.GetQueryItem().maString.equals(*rComp.pVal[1]), "ScInterpreter::CompareFunc: broken options");
if (pOptions->bRegEx)
{
- xub_StrLen nStart = 0;
- xub_StrLen nStop = rComp.pVal[0]->Len();
+ sal_Int32 nStart = 0;
+ sal_Int32 nStop = rComp.pVal[0]->Len();
bool bMatch = rEntry.GetSearchTextPtr(
- !pOptions->bIgnoreCase)->SearchFrwrd( *rComp.pVal[0],
+ !pOptions->bIgnoreCase)->SearchForward( *rComp.pVal[0],
&nStart, &nStop);
if (bMatch && pOptions->bMatchWholeCell && (nStart != 0 || nStop != rComp.pVal[0]->Len()))
bMatch = false; // RegEx must match entire string.
@@ -8782,10 +8782,10 @@ void ScInterpreter::ScSearch()
}
else
fAnz = 1.0;
- String sStr = GetString();
+ OUString sStr = GetString();
OUString SearchStr = GetString();
- xub_StrLen nPos = (xub_StrLen) fAnz - 1;
- xub_StrLen nEndPos = sStr.Len();
+ sal_Int32 nPos = fAnz - 1;
+ sal_Int32 nEndPos = sStr.getLength();
if( nPos >= nEndPos )
PushNoValue();
else
@@ -8795,7 +8795,7 @@ void ScInterpreter::ScSearch()
utl::SearchParam::SRCH_REGEXP : utl::SearchParam::SRCH_NORMAL);
utl::SearchParam sPar(SearchStr, eSearchType, false, false, false);
utl::TextSearch sT( sPar, *ScGlobal::pCharClass );
- int nBool = sT.SearchFrwrd(sStr, &nPos, &nEndPos);
+ int nBool = sT.SearchForward(sStr, &nPos, &nEndPos);
if (!nBool)
PushNoValue();
else
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 25af1e48b852..121b13266936 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2085,9 +2085,9 @@ void SfxMedium::Transfer_Impl()
//------------------------------------------------------------------
void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent,
- const String& aPrefix,
- const String& aExtension,
- const String& aDestDir )
+ const OUString& aPrefix,
+ const OUString& aExtension,
+ const OUString& aDestDir )
{
SAL_INFO( "sfx2.doc", "sfx2 (mv76033) SfxMedium::DoInternalBackup_Impl( with destdir )" );
@@ -2155,9 +2155,9 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
INetURLObject::NO_DECODE );
sal_Int32 nPrefixLen = aFileName.lastIndexOf( '.' );
- String aPrefix = ( nPrefixLen == -1 ) ? aFileName : aFileName.copy( 0, nPrefixLen );
- String aExtension = ( nPrefixLen == -1 ) ? String() : String(aFileName.copy( nPrefixLen ));
- String aBakDir = SvtPathOptions().GetBackupPath();
+ OUString aPrefix = ( nPrefixLen == -1 ) ? aFileName : aFileName.copy( 0, nPrefixLen );
+ OUString aExtension = ( nPrefixLen == -1 ) ? OUString() : aFileName.copy( nPrefixLen );
+ OUString aBakDir = SvtPathOptions().GetBackupPath();
// create content for the parent folder ( = backup folder )
::ucbhelper::Content aContent;
@@ -3565,9 +3565,9 @@ OUString SfxMedium::CreateTempCopyWithExt( const OUString& aURL )
if ( !aURL.isEmpty() )
{
sal_Int32 nPrefixLen = aURL.lastIndexOf( '.' );
- String aExt = ( nPrefixLen == -1 ) ? String() : String( aURL.copy( nPrefixLen ) );
+ OUString aExt = ( nPrefixLen == -1 ) ? OUString() : aURL.copy( nPrefixLen );
- OUString aNewTempFileURL = ::utl::TempFile( String(), &aExt ).GetURL();
+ OUString aNewTempFileURL = ::utl::TempFile( OUString(), &aExt ).GetURL();
if ( !aNewTempFileURL.isEmpty() )
{
INetURLObject aSource( aURL );
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index f64fcc60c4b7..f36304414424 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -2274,7 +2274,7 @@ sal_Int16 UCBStorage_Impl::Commit()
if ( bRet )
{
// create a stream to write the manifest file - use a temp file
- String aURL( aNewSubFolder.getURL() );
+ OUString aURL( aNewSubFolder.getURL() );
::utl::TempFile* pTempFile = new ::utl::TempFile( &aURL );
// get the stream from the temp file and create an output stream wrapper
@@ -3182,7 +3182,7 @@ String UCBStorage::CreateLinkFile( const String& rName )
INetURLObject aFolderObj( rName );
String aName = aFolderObj.GetName();
aFolderObj.removeSegment();
- String aFolderURL( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString aFolderURL( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ) );
::utl::TempFile* pTempFile = new ::utl::TempFile( &aFolderURL );
// get the stream from the temp file
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index abfe9c94684c..2dba599fb4b8 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3274,7 +3274,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetLegacyOnlyCurrencyEntry( const OUSt
IMPL_STATIC_LINK_NOINSTANCE( SvNumberFormatter, CurrencyChangeLink, SAL_UNUSED_PARAMETER void*, EMPTYARG )
{
::osl::MutexGuard aGuard( GetMutex() );
- String aAbbrev;
+ OUString aAbbrev;
LanguageType eLang = LANGUAGE_SYSTEM;
SvtSysLocaleOptions().GetCurrencyAbbrevAndLanguage( aAbbrev, eLang );
SetDefaultSystemCurrency( aAbbrev, eLang );
@@ -3707,7 +3707,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
::comphelper::getProcessComponentContext(),
SvtSysLocale().GetLanguageTag() );
// get user configured currency
- String aConfiguredCurrencyAbbrev;
+ OUString aConfiguredCurrencyAbbrev;
LanguageType eConfiguredCurrencyLanguage = LANGUAGE_SYSTEM;
SvtSysLocaleOptions().GetCurrencyAbbrevAndLanguage(
aConfiguredCurrencyAbbrev, eConfiguredCurrencyLanguage );
@@ -3758,7 +3758,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
lcl_CheckCurrencySymbolPosition( *pEntry );
}
rCurrencyTable.insert( rCurrencyTable.begin() + nCurrencyPos++, pEntry );
- if ( !nSystemCurrencyPosition && (aConfiguredCurrencyAbbrev.Len() ?
+ if ( !nSystemCurrencyPosition && (!aConfiguredCurrencyAbbrev.isEmpty() ?
pEntry->GetBankSymbol() == OUString(aConfiguredCurrencyAbbrev) &&
pEntry->GetLanguage() == eConfiguredCurrencyLanguage : false) )
{
@@ -3803,7 +3803,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
{
rCurrencyTable.insert( rCurrencyTable.begin() + nCurrencyPos++, pEntry );
if ( !nSecondarySystemCurrencyPosition &&
- (aConfiguredCurrencyAbbrev.Len() ?
+ (!aConfiguredCurrencyAbbrev.isEmpty() ?
pEntry->GetBankSymbol() == OUString(aConfiguredCurrencyAbbrev) :
pEntry->GetLanguage() == eConfiguredCurrencyLanguage) )
{
@@ -3823,7 +3823,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
{
nSystemCurrencyPosition = nSecondarySystemCurrencyPosition;
}
- if ((aConfiguredCurrencyAbbrev.Len() && !nSystemCurrencyPosition) &&
+ if ((!aConfiguredCurrencyAbbrev.isEmpty() && !nSystemCurrencyPosition) &&
LocaleDataWrapper::areChecksEnabled())
{
LocaleDataWrapper::outputCheckMessage(
@@ -3834,7 +3834,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
{
nSystemCurrencyPosition = nMatchingSystemCurrencyPosition;
}
- if ((!aConfiguredCurrencyAbbrev.Len() && !nSystemCurrencyPosition) &&
+ if ((aConfiguredCurrencyAbbrev.isEmpty() && !nSystemCurrencyPosition) &&
LocaleDataWrapper::areChecksEnabled())
{
LocaleDataWrapper::outputCheckMessage(
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index b201d8dff1d6..e084b0451040 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -324,10 +324,10 @@ sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
}
if(bComment && nTheFlag)
{
- xub_StrLen nStartPos = 0;
- xub_StrLen nEndPos = pCommentStr->Len();
+ sal_Int32 nStartPos = 0;
+ sal_Int32 nEndPos = pCommentStr->Len();
- nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos);
+ nTheFlag=pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
}
return nTheFlag;
}
@@ -362,10 +362,10 @@ sal_Bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
if(bComment)
{
- xub_StrLen nStartPos = 0;
- xub_StrLen nEndPos = pCommentStr->Len();
+ sal_Int32 nStartPos = 0;
+ sal_Int32 nEndPos = pCommentStr->Len();
- nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos);
+ nTheFlag=pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
}
return nTheFlag;
}
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 2e393f0fdc08..747eea486e6d 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -603,8 +603,8 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const OUString
// (don't care about case here, this is done by the TextSearch object, 'cause we passed our case parameter to it)
- xub_StrLen nStart = 0, nEnd = (xub_StrLen)sCurrentCheck.getLength();
- bFound = aLocalEngine.SearchFrwrd(sCurrentCheck, &nStart, &nEnd);
+ sal_Int32 nStart = 0, nEnd = sCurrentCheck.getLength();
+ bFound = aLocalEngine.SearchForward(sCurrentCheck, &nStart, &nEnd);
// das heisst hier 'forward' aber das bezieht sich nur auf die Suche innerhalb von sCurrentCheck, hat also mit
// der Richtung meines Datensatz-Durchwanderns nix zu tun (darum kuemmert sich MoveField)
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 92f1249ec0bc..6f56e120f50a 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -478,11 +478,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
}
pScriptIter->Next();
}
-
+ sal_Int32 nProxyStart = nStart;
+ sal_Int32 nProxyEnd = nEnd;
if( nSearchScript == nCurrScript &&
- (rSTxt.*fnMove->fnSearch)( sCleanStr, &nStart, &nEnd, 0 ) &&
- !(bZeroMatch = (nStart == nEnd)))
+ (rSTxt.*fnMove->fnSearch)( sCleanStr, &nProxyStart, &nProxyEnd, 0 ) &&
+ !(bZeroMatch = (nProxyStart == nProxyEnd)))
{
+ nStart = (sal_uInt16)nProxyStart;
+ nEnd = (sal_uInt16)nProxyEnd;
// set section correctly
*GetPoint() = *pPam->GetPoint();
SetMark();
@@ -517,6 +520,11 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
bFound = true;
break;
}
+ else
+ {
+ nStart = (sal_uInt16)nProxyStart;
+ nEnd = (sal_uInt16)nProxyEnd;
+ }
nStart = nEnd;
}
@@ -664,12 +672,12 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam )
{
utl::TextSearch aSTxt( rSearchOpt );
const String& rStr = static_cast<const SwTxtNode*>(pTxtNode)->GetTxt();
- xub_StrLen nStart = pPam->Start()->nContent.GetIndex();
- xub_StrLen nEnd = pPam->End()->nContent.GetIndex();
+ sal_Int32 nStart = pPam->Start()->nContent.GetIndex();
+ sal_Int32 nEnd = pPam->End()->nContent.GetIndex();
SearchResult aResult;
- if( aSTxt.SearchFrwrd( rStr, &nStart, &nEnd, &aResult ) )
+ if( aSTxt.SearchForward( rStr, &nStart, &nEnd, &aResult ) )
{
- String aReplaceStr( rSearchOpt.replaceString );
+ OUString aReplaceStr( rSearchOpt.replaceString );
aSTxt.ReplaceBackReferences( aReplaceStr, rStr, aResult );
pRet = new String( aReplaceStr );
}
diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx
index 17fe0e0660f0..0e3e161462b8 100644
--- a/sw/source/core/crsr/paminit.cxx
+++ b/sw/source/core/crsr/paminit.cxx
@@ -28,7 +28,7 @@ static SwMoveFnCollection aFwrd = {
/* fnSections */ &GoEndSection,
/* fnCmpOp */ &SwPosition::operator<,
/* fnGetHint */ &GetFrwrdTxtHint,
- /* fnSearch */ &utl::TextSearch::SearchFrwrd,
+ /* fnSearch */ &utl::TextSearch::SearchForward,
/* fnSection */ &SwNodes::GoStartOfSection
};
@@ -39,7 +39,7 @@ static SwMoveFnCollection aBwrd = {
/* fnSections */ &GoStartSection,
/* fnCmpOp */ &SwPosition::operator>,
/* fnGetHint */ &GetBkwrdTxtHint,
- /* fnSearch */ &utl::TextSearch::SearchBkwrd,
+ /* fnSearch */ &utl::TextSearch::SearchBackward,
/* fnSection */ &SwNodes::GoEndOfSection
};
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 58dd0333b0b2..28eb1f48e1f1 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -214,16 +214,23 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c
GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
- String sExt = pFilter->GetSuffixes().getToken(0, ',');
- if( !sExt.Len() )
- sExt.AssignAscii( "sxw" );
- if( '.' != sExt.GetChar( 0 ) )
- sExt.Insert( '.', 0 );
+ OUString sExt = pFilter->GetSuffixes().getToken(0, ',');
+ if( sExt.isEmpty() )
+ {
+ sExt = ".sxw";
+ }
+ else
+ {
+ if( '.' != sExt[ 0 ] )
+ {
+ sExt = OUString(".") + sExt;
+ }
+ }
INetURLObject aEntry(rPath);
String sLeading(aEntry.GetBase());
aEntry.removeSegment();
- String sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
+ OUString sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
utl::TempFile aTemp(sLeading,&sExt,&sPath );
aTemp.EnableKillingFile();
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 2031563fa55c..53ccd9a930d1 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1122,7 +1122,7 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl()
sal_Bool SwTableAutoFmtTbl::Load()
{
sal_Bool bRet = sal_False;
- String sNm(OUString(sAutoTblFmtName));
+ OUString sNm(OUString(sAutoTblFmtName));
SvtPathOptions aOpt;
if( aOpt.SearchFile( sNm, SvtPathOptions::PATH_USERCONFIG ))
{
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index b20c4e9794a6..5fda2c657310 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -68,8 +68,8 @@ typedef void (*GoDoc)( SwPosition* );
typedef void (*GoSection)( SwPosition* );
typedef bool (SwPosition:: *CmpOp)( const SwPosition& ) const;
typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, xub_StrLen );
-typedef int (utl::TextSearch:: *SearchTxt)( const String&, xub_StrLen*,
- xub_StrLen*, ::com::sun::star::util::SearchResult* );
+typedef bool (utl::TextSearch:: *SearchTxt)( const OUString&, sal_Int32*,
+ sal_Int32*, ::com::sun::star::util::SearchResult* );
typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const;
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 4a5387b110c8..cf572e95a21b 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -144,23 +144,22 @@ HTMLReader::HTMLReader()
String HTMLReader::GetTemplateName() const
{
- String sTemplate("internal");
- sTemplate += INET_PATH_TOKEN;
- sTemplate.Append(String("html"));
- String sTemplateWithoutExt( sTemplate );
+ OUString sTemplate("internal/html");
+
+ OUString sTemplateWithoutExt( sTemplate );
// first search for OpenDocument Writer/Web template
- sTemplate.Append(String(".oth"));
+ sTemplate += ".oth";
SvtPathOptions aPathOpt;
// OpenDocument Writer/Web template (extension .oth)
- sal_Bool bSet = aPathOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
+ bool bSet = aPathOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
if( !bSet )
{
// no OpenDocument Writer/Web template found.
// search for OpenOffice.org Writer/Web template
sTemplate = sTemplateWithoutExt;
- sTemplate.Append(String(".stw"));
+ sTemplate += ".stw";
bSet = aPathOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
}
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index dc153b8ea5f8..b13461f6b90b 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -91,7 +91,7 @@ void SwBaseNumRules::Init()
for(sal_uInt16 i = 0; i < nMaxRules; ++i )
pNumRules[i] = 0;
- String sNm( sFileName );
+ OUString sNm( sFileName );
SvtPathOptions aOpt;
if( aOpt.SearchFile( sNm, SvtPathOptions::PATH_USERCONFIG ))
{
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 35c0b6f07071..438448187c86 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -399,7 +399,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
String sExt = OUString(".odb");
String sTmpName;
{
- String sHomePath(SvtPathOptions().GetWorkPath());
+ OUString sHomePath(SvtPathOptions().GetWorkPath());
utl::TempFile aTempFile(sFind , &sExt, &sHomePath);
aTempFile.EnableKillingFile(sal_True);
sTmpName = aTempFile.GetURL();
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 7870d63c9730..ee758760aed4 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -974,7 +974,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
{
nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0;
{
- String sPath(sSubject);
+ OUString sPath(sSubject);
String sAddress;
if( !bEMail && bColumnName )
@@ -1000,7 +1000,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
sLeading = aEntry.GetBase();
aEntry.removeSegment();
sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
- String sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*'));
+ OUString sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*'));
aTempFile = std::auto_ptr< utl::TempFile >(
new utl::TempFile(sLeading,&sExt,&sPath ));
if( bAsSingleFile )
@@ -1246,7 +1246,8 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
if( rMergeDescriptor.nMergeType != DBMGR_MERGE_MAILMERGE )
{
OSL_ENSURE( aTempFile.get(), "Temporary file not available" );
- INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL());
+ OUString sSub(sSubject);
+ INetURLObject aTempFileURL(bAsSingleFile ? sSub : aTempFile->GetURL());
SfxMedium* pDstMed = new SfxMedium(
aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
STREAM_STD_READWRITE );
@@ -2175,7 +2176,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
sfx2::FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
- String sHomePath(SvtPathOptions().GetWorkPath());
+ OUString sHomePath(SvtPathOptions().GetWorkPath());
aDlgHelper.SetDisplayDirectory( sHomePath );
Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
@@ -2335,7 +2336,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
Reference<XDocumentDataSource> xDS(xNewInstance, UNO_QUERY_THROW);
Reference<XStorable> xStore(xDS->getDatabaseDocument(), UNO_QUERY_THROW);
- String sOutputExt = OUString(".odb");
+ OUString sOutputExt = OUString(".odb");
String sTmpName;
{
utl::TempFile aTempFile(sNewName , &sOutputExt, &sHomePath);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index c2db5e7e91ca..c7525448b12a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -487,29 +487,28 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
if(!pExampleFrame && !bExampleCreated)
{
bExampleCreated = sal_True;
- String sTemplate(OUString("internal"));
- sTemplate += INET_PATH_TOKEN;
- sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM("idxexample") );
- String sTemplateWithoutExt( sTemplate );
- sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".odt") );
+ OUString sTemplate("internal/idxexample");
+
+ OUString sTemplateWithoutExt( sTemplate );
+ sTemplate += ".odt";
SvtPathOptions aOpt;
aOpt.SetTemplatePath(String("share/template/common"));
// 6.0 (extension .sxw)
- sal_Bool bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
+ bool bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
if( !bExist )
{
// 6.0 (extension .sxw)
sTemplate = sTemplateWithoutExt;
- sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".sxw") );
+ sTemplate += ".sxw";
bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
}
if( !bExist )
{
// 5.0 (extension .vor)
sTemplate = sTemplateWithoutExt;
- sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".sdw") );
+ sTemplate += ".sdw";
bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
}
@@ -524,8 +523,9 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
else
{
Link aLink(LINK(this, SwMultiTOXTabDialog, CreateExample_Hdl));
+ String sTemp(sTemplate);
pExampleFrame = new SwOneExampleFrame(
- aExampleContainerWIN, EX_SHOW_ONLINE_LAYOUT, &aLink, &sTemplate);
+ aExampleContainerWIN, EX_SHOW_ONLINE_LAYOUT, &aLink, &sTemp);
if(!pExampleFrame->IsServiceAvailable())
{
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 4ecc12e743db..8c8359368709 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -77,7 +77,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
for (size_t i = 0; i < rPathArr.size(); ++i)
{
- String sPath(rPathArr[i]);
+ OUString sPath(rPathArr[i]);
INetURLObject aTempURL(sPath);
sPath = aTempURL.GetMainURL(INetURLObject::DECODE_WITH_CHARSET );
m_pPathLB->InsertEntry(sPath);
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index 681be517b8b7..11c8dc87acf6 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -49,7 +49,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
// PUBLIC METHODES -------------------------------------------------------
-static String lcl_CheckFileName( const String& rNewFilePath,
+static String lcl_CheckFileName( const OUString& rNewFilePath,
const String& rNewGroupName )
{
String sRet;
@@ -77,7 +77,7 @@ static String lcl_CheckFileName( const String& rNewFilePath,
if( !bOk )
{
- String rSG = SwGlossaries::GetExtension();
+ OUString rSG = SwGlossaries::GetExtension();
//generate generic name
utl::TempFile aTemp(OUString("group"),
&rSG, &rNewFilePath );
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
index b31176cd6ed0..017d16308a25 100644
--- a/unotools/source/config/defaultoptions.cxx
+++ b/unotools/source/config/defaultoptions.cxx
@@ -67,32 +67,32 @@ using namespace com::sun::star::uno;
class SvtDefaultOptions_Impl : public utl::ConfigItem
{
public:
- String m_aAddinPath;
- String m_aAutoCorrectPath;
- String m_aAutoTextPath;
- String m_aBackupPath;
- String m_aBasicPath;
- String m_aBitmapPath;
- String m_aConfigPath;
- String m_aDictionaryPath;
- String m_aFavoritesPath;
- String m_aFilterPath;
- String m_aGalleryPath;
- String m_aGraphicPath;
- String m_aHelpPath;
- String m_aLinguisticPath;
- String m_aModulePath;
- String m_aPalettePath;
- String m_aPluginPath;
- String m_aTempPath;
- String m_aTemplatePath;
- String m_aUserConfigPath;
- String m_aWorkPath;
- String m_aUserDictionaryPath;
+ OUString m_aAddinPath;
+ OUString m_aAutoCorrectPath;
+ OUString m_aAutoTextPath;
+ OUString m_aBackupPath;
+ OUString m_aBasicPath;
+ OUString m_aBitmapPath;
+ OUString m_aConfigPath;
+ OUString m_aDictionaryPath;
+ OUString m_aFavoritesPath;
+ OUString m_aFilterPath;
+ OUString m_aGalleryPath;
+ OUString m_aGraphicPath;
+ OUString m_aHelpPath;
+ OUString m_aLinguisticPath;
+ OUString m_aModulePath;
+ OUString m_aPalettePath;
+ OUString m_aPluginPath;
+ OUString m_aTempPath;
+ OUString m_aTemplatePath;
+ OUString m_aUserConfigPath;
+ OUString m_aWorkPath;
+ OUString m_aUserDictionaryPath;
SvtDefaultOptions_Impl();
- String GetDefaultPath( sal_uInt16 nId ) const;
+ OUString GetDefaultPath( sal_uInt16 nId ) const;
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
};
@@ -102,7 +102,7 @@ public:
static SvtDefaultOptions_Impl* pOptions = NULL;
static sal_Int32 nRefCount = 0;
-typedef String SvtDefaultOptions_Impl:: *PathStrPtr;
+typedef OUString SvtDefaultOptions_Impl:: *PathStrPtr;
struct PathToDefaultMapping_Impl
{
@@ -185,7 +185,7 @@ void SvtDefaultOptions_Impl::Commit()
// class SvtDefaultOptions_Impl ------------------------------------------
-String SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const
+OUString SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const
{
OUString aRet;
sal_uInt16 nIdx = 0;
@@ -277,28 +277,28 @@ SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Pa
switch ( nProp )
{
- case DEFAULTPATH__ADDIN: m_aAddinPath = String( aFullPath ); break;
- case DEFAULTPATH__AUTOCORRECT: m_aAutoCorrectPath = String( aFullPath ); break;
- case DEFAULTPATH__AUTOTEXT: m_aAutoTextPath = String( aFullPath ); break;
- case DEFAULTPATH__BACKUP: m_aBackupPath = String( aFullPath ); break;
- case DEFAULTPATH__BASIC: m_aBasicPath = String( aFullPath ); break;
- case DEFAULTPATH__BITMAP: m_aBitmapPath = String( aFullPath ); break;
- case DEFAULTPATH__CONFIG: m_aConfigPath = String( aFullPath ); break;
- case DEFAULTPATH__DICTIONARY: m_aDictionaryPath = String( aFullPath ); break;
- case DEFAULTPATH__FAVORITES: m_aFavoritesPath = String( aFullPath ); break;
- case DEFAULTPATH__FILTER: m_aFilterPath = String( aFullPath ); break;
- case DEFAULTPATH__GALLERY: m_aGalleryPath = String( aFullPath ); break;
- case DEFAULTPATH__GRAPHIC: m_aGraphicPath = String( aFullPath ); break;
- case DEFAULTPATH__HELP: m_aHelpPath = String( aFullPath ); break;
- case DEFAULTPATH__LINGUISTIC: m_aLinguisticPath = String( aFullPath ); break;
- case DEFAULTPATH__MODULE: m_aModulePath = String( aFullPath ); break;
- case DEFAULTPATH__PALETTE: m_aPalettePath = String( aFullPath ); break;
- case DEFAULTPATH__PLUGIN: m_aPluginPath = String( aFullPath ); break;
- case DEFAULTPATH__TEMP: m_aTempPath = String( aFullPath ); break;
- case DEFAULTPATH__TEMPLATE: m_aTemplatePath = String( aFullPath ); break;
- case DEFAULTPATH__USERCONFIG: m_aUserConfigPath = String( aFullPath ); break;
- case DEFAULTPATH__WORK: m_aWorkPath = String( aFullPath ); break;
- case DEFAULTPATH__USERDICTIONARY: m_aUserDictionaryPath = String( aFullPath );break;
+ case DEFAULTPATH__ADDIN: m_aAddinPath = aFullPath; break;
+ case DEFAULTPATH__AUTOCORRECT: m_aAutoCorrectPath = aFullPath; break;
+ case DEFAULTPATH__AUTOTEXT: m_aAutoTextPath = aFullPath; break;
+ case DEFAULTPATH__BACKUP: m_aBackupPath = aFullPath; break;
+ case DEFAULTPATH__BASIC: m_aBasicPath = aFullPath; break;
+ case DEFAULTPATH__BITMAP: m_aBitmapPath = aFullPath; break;
+ case DEFAULTPATH__CONFIG: m_aConfigPath = aFullPath; break;
+ case DEFAULTPATH__DICTIONARY: m_aDictionaryPath = aFullPath; break;
+ case DEFAULTPATH__FAVORITES: m_aFavoritesPath = aFullPath; break;
+ case DEFAULTPATH__FILTER: m_aFilterPath = aFullPath; break;
+ case DEFAULTPATH__GALLERY: m_aGalleryPath = aFullPath; break;
+ case DEFAULTPATH__GRAPHIC: m_aGraphicPath = aFullPath; break;
+ case DEFAULTPATH__HELP: m_aHelpPath = aFullPath; break;
+ case DEFAULTPATH__LINGUISTIC: m_aLinguisticPath = aFullPath; break;
+ case DEFAULTPATH__MODULE: m_aModulePath = aFullPath; break;
+ case DEFAULTPATH__PALETTE: m_aPalettePath = aFullPath; break;
+ case DEFAULTPATH__PLUGIN: m_aPluginPath = aFullPath; break;
+ case DEFAULTPATH__TEMP: m_aTempPath = aFullPath; break;
+ case DEFAULTPATH__TEMPLATE: m_aTemplatePath = aFullPath; break;
+ case DEFAULTPATH__USERCONFIG: m_aUserConfigPath = aFullPath; break;
+ case DEFAULTPATH__WORK: m_aWorkPath = aFullPath; break;
+ case DEFAULTPATH__USERDICTIONARY: m_aUserDictionaryPath = aFullPath;break;
default:
SAL_WARN( "unotools.config", "invalid index to load a default path" );
@@ -340,7 +340,7 @@ SvtDefaultOptions::~SvtDefaultOptions()
// -----------------------------------------------------------------------
-String SvtDefaultOptions::GetDefaultPath( sal_uInt16 nId ) const
+OUString SvtDefaultOptions::GetDefaultPath( sal_uInt16 nId ) const
{
return pImp->GetDefaultPath( nId );
}
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index 9da6e05c0d67..e44b8d22ba69 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -649,12 +649,12 @@ static ImplFontAttrTypeSearchData const aImplTypeAttrSearchList[] =
// -----------------------------------------------------------------------
-static bool ImplKillLeading( String& rName, const char* const* ppStr )
+static bool ImplKillLeading( OUString& rName, const char* const* ppStr )
{
for(; *ppStr; ++ppStr )
{
const char* pStr = *ppStr;
- const sal_Unicode* pNameStr = rName.GetBuffer();
+ const sal_Unicode* pNameStr = rName.getStr();
while ( (*pNameStr == (sal_Unicode)(unsigned char)*pStr) && *pStr )
{
pNameStr++;
@@ -662,19 +662,19 @@ static bool ImplKillLeading( String& rName, const char* const* ppStr )
}
if ( !*pStr )
{
- xub_StrLen nLen = sal::static_int_cast<xub_StrLen>(pNameStr - rName.GetBuffer());
- rName.Erase( 0, nLen );
+ sal_Int32 nLen = (sal_Int32)(pNameStr - rName.getStr());
+ rName = rName.copy(nLen);
return true;
}
}
// special case for Baekmuk
// TODO: allow non-ASCII KillLeading list
- const sal_Unicode* pNameStr = rName.GetBuffer();
+ const sal_Unicode* pNameStr = rName.getStr();
if( (pNameStr[0]==0xBC31) && (pNameStr[1]==0xBC35) )
{
- xub_StrLen nLen = (pNameStr[2]==0x0020) ? 3 : 2;
- rName.Erase( 0, nLen );
+ sal_Int32 nLen = (pNameStr[2]==0x0020) ? 3 : 2;
+ rName = rName.copy(nLen);
return true;
}
@@ -683,13 +683,13 @@ static bool ImplKillLeading( String& rName, const char* const* ppStr )
// -----------------------------------------------------------------------
-static xub_StrLen ImplIsTrailing( const String& rName, const char* pStr )
+static sal_Int32 ImplIsTrailing( const OUString& rName, const char* pStr )
{
- xub_StrLen nStrLen = static_cast<xub_StrLen>( strlen( pStr ) );
- if( nStrLen >= rName.Len() )
+ sal_Int32 nStrLen = (sal_Int32)strlen( pStr );
+ if( nStrLen >= rName.getLength() )
return 0;
- const sal_Unicode* pEndName = rName.GetBuffer() + rName.Len();
+ const sal_Unicode* pEndName = rName.getStr() + rName.getLength();
const sal_Unicode* pNameStr = pEndName - nStrLen;
do if( *(pNameStr++) != *(pStr++) )
return 0;
@@ -700,14 +700,14 @@ static xub_StrLen ImplIsTrailing( const String& rName, const char* pStr )
// -----------------------------------------------------------------------
-static bool ImplKillTrailing( String& rName, const char* const* ppStr )
+static bool ImplKillTrailing( OUString& rName, const char* const* ppStr )
{
for(; *ppStr; ++ppStr )
{
- xub_StrLen nTrailLen = ImplIsTrailing( rName, *ppStr );
+ sal_Int32 nTrailLen = ImplIsTrailing( rName, *ppStr );
if( nTrailLen )
{
- rName.Erase( rName.Len()-nTrailLen );
+ rName = rName.copy(0, rName.getLength() - nTrailLen );
return true;
}
}
@@ -717,11 +717,11 @@ static bool ImplKillTrailing( String& rName, const char* const* ppStr )
// -----------------------------------------------------------------------
-static bool ImplKillTrailingWithExceptions( String& rName, const char* const* ppStr )
+static bool ImplKillTrailingWithExceptions( OUString& rName, const char* const* ppStr )
{
for(; *ppStr; ++ppStr )
{
- xub_StrLen nTrailLen = ImplIsTrailing( rName, *ppStr );
+ sal_Int32 nTrailLen = ImplIsTrailing( rName, *ppStr );
if( nTrailLen )
{
// check string match against string exceptions
@@ -729,7 +729,7 @@ static bool ImplKillTrailingWithExceptions( String& rName, const char* const* pp
if( ImplIsTrailing( rName, *ppStr ) )
return false;
- rName.Erase( rName.Len()-nTrailLen );
+ rName = rName.copy(0, rName.getLength() - nTrailLen );
return true;
}
else
@@ -744,23 +744,24 @@ static bool ImplKillTrailingWithExceptions( String& rName, const char* const* pp
// -----------------------------------------------------------------------
-static sal_Bool ImplFindAndErase( String& rName, const char* pStr )
+static bool ImplFindAndErase( OUString& rName, const char* pStr )
{
- xub_StrLen nPos = rName.SearchAscii( pStr );
- if ( nPos == STRING_NOTFOUND )
- return sal_False;
-
- const char* pTempStr = pStr;
- while ( *pTempStr )
- pTempStr++;
- rName.Erase( nPos, (xub_StrLen)(pTempStr-pStr) );
- return sal_True;
+ sal_Int32 nLen = (sal_Int32)strlen(pStr);
+ sal_Int32 nPos = rName.indexOfAsciiL(pStr, nLen );
+ if ( nPos < 0 )
+ return false;
+
+ OUStringBuffer sBuff(rName);
+ sBuff.remove(nPos, nLen);
+ rName = sBuff.makeStringAndClear();
+ return true;
}
// =======================================================================
-void FontSubstConfiguration::getMapName( const String& rOrgName, String& rShortName,
- String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType )
+void FontSubstConfiguration::getMapName( const OUString& rOrgName, OUString& rShortName,
+ OUString& rFamilyName, FontWeight& rWeight,
+ FontWidth& rWidth, sal_uLong& rType )
{
rShortName = rOrgName;
@@ -815,12 +816,13 @@ void FontSubstConfiguration::getMapName( const String& rOrgName, String& rShortN
// Remove numbers
// TODO: also remove localized and fullwidth digits
- xub_StrLen i = 0;
- while ( i < rFamilyName.Len() )
+ sal_Int32 i = 0;
+ OUStringBuffer sBuff(rFamilyName);
+ while ( i < sBuff.getLength() )
{
- sal_Unicode c = rFamilyName.GetChar( i );
+ sal_Unicode c = sBuff[ i ];
if ( (c >= 0x0030) && (c <= 0x0039) )
- rFamilyName.Erase( i, 1 );
+ sBuff.remove(i, 1);
else
i++;
}
@@ -830,7 +832,7 @@ void FontSubstConfiguration::getMapName( const String& rOrgName, String& rShortN
struct StrictStringSort : public ::std::binary_function< const FontNameAttr&, const FontNameAttr&, bool >
{
bool operator()( const FontNameAttr& rLeft, const FontNameAttr& rRight )
- { return rLeft.Name.CompareTo( rRight.Name ) == COMPARE_LESS ; }
+ { return rLeft.Name.compareTo( rRight.Name ) == -1 ; }
};
static const char* const pAttribNames[] =
@@ -910,7 +912,7 @@ static const enum_convert pWidthNames[] =
void FontSubstConfiguration::fillSubstVector( const com::sun::star::uno::Reference< XNameAccess > xFont,
const OUString& rType,
- std::vector< String >& rSubstVector ) const
+ std::vector< OUString >& rSubstVector ) const
{
try
{
@@ -1036,9 +1038,9 @@ unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::R
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
- String aToken( pLine->getToken( 0, ',', nIndex ) );
+ OUString aToken( pLine->getToken( 0, ',', nIndex ) );
for( int k = 0; k < 32; k++ )
- if( aToken.EqualsIgnoreCaseAscii( pAttribNames[k] ) )
+ if( aToken.equalsIgnoreAsciiCaseAscii( pAttribNames[k] ) )
{
type |= 1 << k;
break;
@@ -1137,15 +1139,14 @@ void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale
}
}
-const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontName, const Locale& rLocale ) const
+const FontNameAttr* FontSubstConfiguration::getSubstInfo( const OUString& rFontName, const Locale& rLocale ) const
{
- if( !rFontName.Len() )
+ if( rFontName.isEmpty() )
return NULL;
// search if a (language dep.) replacement table for the given font exists
// fallback is english
- String aSearchFont( rFontName );
- aSearchFont.ToLowerAscii();
+ OUString aSearchFont( rFontName.toAsciiLowerCase() );
FontNameAttr aSearchAttr;
aSearchAttr.Name = aSearchFont;
@@ -1172,8 +1173,8 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
const FontNameAttr& rFoundAttr = *it;
// a search for "abcblack" may match with an entry for "abc"
// the reverse is not a good idea (e.g. #i112731# alba->albani)
- if( rFoundAttr.Name.Len() <= aSearchFont.Len() )
- if( aSearchFont.CompareTo( rFoundAttr.Name, rFoundAttr.Name.Len() ) == COMPARE_EQUAL )
+ if( rFoundAttr.Name.getLength() <= aSearchFont.getLength() )
+ if( aSearchFont.startsWith( rFoundAttr.Name))
return &rFoundAttr;
}
}
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 1cd2c54bdf3d..2acbea03de3f 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -21,6 +21,7 @@
#include <unotools/configitem.hxx>
#include <unotools/configmgr.hxx>
#include <tools/urlobj.hxx>
+#include <tools/solar.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
@@ -104,7 +105,7 @@ class SvtPathOptions_Impl
{
private:
// Local variables to return const references
- std::vector< String > m_aPathArray;
+ std::vector< OUString > m_aPathArray;
Reference< XFastPropertySet > m_xPathSettings;
Reference< XStringSubstitution > m_xSubstVariables;
Reference< XMacroExpander > m_xMacroExpander;
@@ -112,63 +113,63 @@ class SvtPathOptions_Impl
VarNameToEnumMap m_aMapVarNamesToEnum;
LanguageTag m_aLanguageTag;
- String m_aEmptyString;
+ OUString m_aEmptyString;
mutable ::osl::Mutex m_aMutex;
public:
SvtPathOptions_Impl();
// get the paths, not const because of using a mutex
- const String& GetPath( SvtPathOptions::Paths );
- const String& GetAddinPath() { return GetPath( SvtPathOptions::PATH_ADDIN ); }
- const String& GetAutoCorrectPath() { return GetPath( SvtPathOptions::PATH_AUTOCORRECT ); }
- const String& GetAutoTextPath() { return GetPath( SvtPathOptions::PATH_AUTOTEXT ); }
- const String& GetBackupPath() { return GetPath( SvtPathOptions::PATH_BACKUP ); }
- const String& GetBasicPath() { return GetPath( SvtPathOptions::PATH_BASIC ); }
- const String& GetBitmapPath() { return GetPath( SvtPathOptions::PATH_BITMAP ); }
- const String& GetConfigPath() { return GetPath( SvtPathOptions::PATH_CONFIG ); }
- const String& GetDictionaryPath() { return GetPath( SvtPathOptions::PATH_DICTIONARY ); }
- const String& GetFavoritesPath() { return GetPath( SvtPathOptions::PATH_FAVORITES ); }
- const String& GetFilterPath() { return GetPath( SvtPathOptions::PATH_FILTER ); }
- const String& GetGalleryPath() { return GetPath( SvtPathOptions::PATH_GALLERY ); }
- const String& GetGraphicPath() { return GetPath( SvtPathOptions::PATH_GRAPHIC ); }
- const String& GetHelpPath() { return GetPath( SvtPathOptions::PATH_HELP ); }
- const String& GetLinguisticPath() { return GetPath( SvtPathOptions::PATH_LINGUISTIC ); }
- const String& GetModulePath() { return GetPath( SvtPathOptions::PATH_MODULE ); }
- const String& GetPalettePath() { return GetPath( SvtPathOptions::PATH_PALETTE ); }
- const String& GetPluginPath() { return GetPath( SvtPathOptions::PATH_PLUGIN ); }
- const String& GetStoragePath() { return GetPath( SvtPathOptions::PATH_STORAGE ); }
- const String& GetTempPath() { return GetPath( SvtPathOptions::PATH_TEMP ); }
- const String& GetTemplatePath() { return GetPath( SvtPathOptions::PATH_TEMPLATE ); }
- const String& GetUserConfigPath() { return GetPath( SvtPathOptions::PATH_USERCONFIG ); }
- const String& GetWorkPath() { return GetPath( SvtPathOptions::PATH_WORK ); }
- const String& GetUIConfigPath() { return GetPath( SvtPathOptions::PATH_UICONFIG ); }
- const String& GetFingerprintPath() { return GetPath( SvtPathOptions::PATH_FINGERPRINT ); }
+ const OUString& GetPath( SvtPathOptions::Paths );
+ const OUString& GetAddinPath() { return GetPath( SvtPathOptions::PATH_ADDIN ); }
+ const OUString& GetAutoCorrectPath() { return GetPath( SvtPathOptions::PATH_AUTOCORRECT ); }
+ const OUString& GetAutoTextPath() { return GetPath( SvtPathOptions::PATH_AUTOTEXT ); }
+ const OUString& GetBackupPath() { return GetPath( SvtPathOptions::PATH_BACKUP ); }
+ const OUString& GetBasicPath() { return GetPath( SvtPathOptions::PATH_BASIC ); }
+ const OUString& GetBitmapPath() { return GetPath( SvtPathOptions::PATH_BITMAP ); }
+ const OUString& GetConfigPath() { return GetPath( SvtPathOptions::PATH_CONFIG ); }
+ const OUString& GetDictionaryPath() { return GetPath( SvtPathOptions::PATH_DICTIONARY ); }
+ const OUString& GetFavoritesPath() { return GetPath( SvtPathOptions::PATH_FAVORITES ); }
+ const OUString& GetFilterPath() { return GetPath( SvtPathOptions::PATH_FILTER ); }
+ const OUString& GetGalleryPath() { return GetPath( SvtPathOptions::PATH_GALLERY ); }
+ const OUString& GetGraphicPath() { return GetPath( SvtPathOptions::PATH_GRAPHIC ); }
+ const OUString& GetHelpPath() { return GetPath( SvtPathOptions::PATH_HELP ); }
+ const OUString& GetLinguisticPath() { return GetPath( SvtPathOptions::PATH_LINGUISTIC ); }
+ const OUString& GetModulePath() { return GetPath( SvtPathOptions::PATH_MODULE ); }
+ const OUString& GetPalettePath() { return GetPath( SvtPathOptions::PATH_PALETTE ); }
+ const OUString& GetPluginPath() { return GetPath( SvtPathOptions::PATH_PLUGIN ); }
+ const OUString& GetStoragePath() { return GetPath( SvtPathOptions::PATH_STORAGE ); }
+ const OUString& GetTempPath() { return GetPath( SvtPathOptions::PATH_TEMP ); }
+ const OUString& GetTemplatePath() { return GetPath( SvtPathOptions::PATH_TEMPLATE ); }
+ const OUString& GetUserConfigPath() { return GetPath( SvtPathOptions::PATH_USERCONFIG ); }
+ const OUString& GetWorkPath() { return GetPath( SvtPathOptions::PATH_WORK ); }
+ const OUString& GetUIConfigPath() { return GetPath( SvtPathOptions::PATH_UICONFIG ); }
+ const OUString& GetFingerprintPath() { return GetPath( SvtPathOptions::PATH_FINGERPRINT ); }
// set the paths
- void SetPath( SvtPathOptions::Paths, const String& rNewPath );
- void SetAddinPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_ADDIN, rPath ); }
- void SetAutoCorrectPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_AUTOCORRECT, rPath ); }
- void SetAutoTextPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_AUTOTEXT, rPath ); }
- void SetBackupPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_BACKUP, rPath ); }
- void SetBasicPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_BASIC, rPath ); }
- void SetBitmapPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_BITMAP, rPath ); }
- void SetConfigPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_CONFIG, rPath ); }
- void SetDictionaryPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_DICTIONARY, rPath ); }
- void SetFavoritesPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_FAVORITES, rPath ); }
- void SetFilterPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_FILTER, rPath ); }
- void SetGalleryPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_GALLERY, rPath ); }
- void SetGraphicPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_GRAPHIC, rPath ); }
- void SetHelpPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_HELP, rPath ); }
- void SetLinguisticPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_LINGUISTIC, rPath ); }
- void SetModulePath( const String& rPath ) { SetPath( SvtPathOptions::PATH_MODULE, rPath ); }
- void SetPalettePath( const String& rPath ) { SetPath( SvtPathOptions::PATH_PALETTE, rPath ); }
- void SetPluginPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_PLUGIN, rPath ); }
- void SetStoragePath( const String& rPath ) { SetPath( SvtPathOptions::PATH_STORAGE, rPath ); }
- void SetTempPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_TEMP, rPath ); }
- void SetTemplatePath( const String& rPath ) { SetPath( SvtPathOptions::PATH_TEMPLATE, rPath ); }
- void SetUserConfigPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); }
- void SetWorkPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); }
+ void SetPath( SvtPathOptions::Paths, const OUString& rNewPath );
+ void SetAddinPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_ADDIN, rPath ); }
+ void SetAutoCorrectPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_AUTOCORRECT, rPath ); }
+ void SetAutoTextPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_AUTOTEXT, rPath ); }
+ void SetBackupPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_BACKUP, rPath ); }
+ void SetBasicPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_BASIC, rPath ); }
+ void SetBitmapPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_BITMAP, rPath ); }
+ void SetConfigPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_CONFIG, rPath ); }
+ void SetDictionaryPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_DICTIONARY, rPath ); }
+ void SetFavoritesPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_FAVORITES, rPath ); }
+ void SetFilterPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_FILTER, rPath ); }
+ void SetGalleryPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_GALLERY, rPath ); }
+ void SetGraphicPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_GRAPHIC, rPath ); }
+ void SetHelpPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_HELP, rPath ); }
+ void SetLinguisticPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_LINGUISTIC, rPath ); }
+ void SetModulePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_MODULE, rPath ); }
+ void SetPalettePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_PALETTE, rPath ); }
+ void SetPluginPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_PLUGIN, rPath ); }
+ void SetStoragePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_STORAGE, rPath ); }
+ void SetTempPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_TEMP, rPath ); }
+ void SetTemplatePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_TEMPLATE, rPath ); }
+ void SetUserConfigPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); }
+ void SetWorkPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); }
OUString SubstVar( const OUString& rVar ) const;
OUString ExpandMacros( const OUString& rPath ) const;
@@ -233,7 +234,7 @@ static VarNameAttribute aVarNameAttribute[] =
// class SvtPathOptions_Impl ---------------------------------------------
-const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Paths ePath )
+const OUString& SvtPathOptions_Impl::GetPath( SvtPathOptions::Paths ePath )
{
if ( ePath >= SvtPathOptions::PATH_COUNT )
return m_aEmptyString;
@@ -272,7 +273,7 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Paths ePath )
return m_aEmptyString;
}
-void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const String& rNewPath )
+void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const OUString& rNewPath )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -341,7 +342,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
OUString aWorkText = rVar;
// Convert the returned path to system path!
- sal_Bool bConvertLocal = sal_False;
+ bool bConvertLocal = false;
// Search for first occure of "$(...".
sal_Int32 nPosition = aWorkText.indexOf( SIGN_STARTVARIABLE ); // = first position of "$(" in string
@@ -367,7 +368,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
// Look for special variable that needs a system path.
VarNameToEnumMap::const_iterator pIter = m_aMapVarNamesToEnum.find( aSubString );
if ( pIter != m_aMapVarNamesToEnum.end() )
- bConvertLocal = sal_True;
+ bConvertLocal = true;
nPosition += nLength;
@@ -395,7 +396,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
}
}
- aWorkText = m_xSubstVariables->substituteVariables( rVar, sal_False );
+ aWorkText = m_xSubstVariables->substituteVariables( rVar, false );
if ( bConvertLocal )
{
@@ -495,320 +496,320 @@ SvtPathOptions::~SvtPathOptions()
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetAddinPath() const
+const OUString& SvtPathOptions::GetAddinPath() const
{
return pImp->GetAddinPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetAutoCorrectPath() const
+const OUString& SvtPathOptions::GetAutoCorrectPath() const
{
return pImp->GetAutoCorrectPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetAutoTextPath() const
+const OUString& SvtPathOptions::GetAutoTextPath() const
{
return pImp->GetAutoTextPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetBackupPath() const
+const OUString& SvtPathOptions::GetBackupPath() const
{
return pImp->GetBackupPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetBasicPath() const
+const OUString& SvtPathOptions::GetBasicPath() const
{
return pImp->GetBasicPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetBitmapPath() const
+const OUString& SvtPathOptions::GetBitmapPath() const
{
return pImp->GetBitmapPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetConfigPath() const
+const OUString& SvtPathOptions::GetConfigPath() const
{
return pImp->GetConfigPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetDictionaryPath() const
+const OUString& SvtPathOptions::GetDictionaryPath() const
{
return pImp->GetDictionaryPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetFavoritesPath() const
+const OUString& SvtPathOptions::GetFavoritesPath() const
{
return pImp->GetFavoritesPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetFilterPath() const
+const OUString& SvtPathOptions::GetFilterPath() const
{
return pImp->GetFilterPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetGalleryPath() const
+const OUString& SvtPathOptions::GetGalleryPath() const
{
return pImp->GetGalleryPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetGraphicPath() const
+const OUString& SvtPathOptions::GetGraphicPath() const
{
return pImp->GetGraphicPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetHelpPath() const
+const OUString& SvtPathOptions::GetHelpPath() const
{
return pImp->GetHelpPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetLinguisticPath() const
+const OUString& SvtPathOptions::GetLinguisticPath() const
{
return pImp->GetLinguisticPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetFingerprintPath() const
+const OUString& SvtPathOptions::GetFingerprintPath() const
{
return pImp->GetFingerprintPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetModulePath() const
+const OUString& SvtPathOptions::GetModulePath() const
{
return pImp->GetModulePath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetPalettePath() const
+const OUString& SvtPathOptions::GetPalettePath() const
{
return pImp->GetPalettePath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetPluginPath() const
+const OUString& SvtPathOptions::GetPluginPath() const
{
return pImp->GetPluginPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetStoragePath() const
+const OUString& SvtPathOptions::GetStoragePath() const
{
return pImp->GetStoragePath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetTempPath() const
+const OUString& SvtPathOptions::GetTempPath() const
{
return pImp->GetTempPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetTemplatePath() const
+const OUString& SvtPathOptions::GetTemplatePath() const
{
return pImp->GetTemplatePath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetUserConfigPath() const
+const OUString& SvtPathOptions::GetUserConfigPath() const
{
return pImp->GetUserConfigPath();
}
-const String& SvtPathOptions::GetUIConfigPath() const
+const OUString& SvtPathOptions::GetUIConfigPath() const
{
return pImp->GetUIConfigPath();
}
// -----------------------------------------------------------------------
-const String& SvtPathOptions::GetWorkPath() const
+const OUString& SvtPathOptions::GetWorkPath() const
{
return pImp->GetWorkPath();
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetAddinPath( const String& rPath )
+void SvtPathOptions::SetAddinPath( const OUString& rPath )
{
pImp->SetAddinPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetAutoCorrectPath( const String& rPath )
+void SvtPathOptions::SetAutoCorrectPath( const OUString& rPath )
{
pImp->SetAutoCorrectPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetAutoTextPath( const String& rPath )
+void SvtPathOptions::SetAutoTextPath( const OUString& rPath )
{
pImp->SetAutoTextPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetBackupPath( const String& rPath )
+void SvtPathOptions::SetBackupPath( const OUString& rPath )
{
pImp->SetBackupPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetBasicPath( const String& rPath )
+void SvtPathOptions::SetBasicPath( const OUString& rPath )
{
pImp->SetBasicPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetBitmapPath( const String& rPath )
+void SvtPathOptions::SetBitmapPath( const OUString& rPath )
{
pImp->SetBitmapPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetConfigPath( const String& rPath )
+void SvtPathOptions::SetConfigPath( const OUString& rPath )
{
pImp->SetConfigPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetDictionaryPath( const String& rPath )
+void SvtPathOptions::SetDictionaryPath( const OUString& rPath )
{
pImp->SetDictionaryPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetFavoritesPath( const String& rPath )
+void SvtPathOptions::SetFavoritesPath( const OUString& rPath )
{
pImp->SetFavoritesPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetFilterPath( const String& rPath )
+void SvtPathOptions::SetFilterPath( const OUString& rPath )
{
pImp->SetFilterPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetGalleryPath( const String& rPath )
+void SvtPathOptions::SetGalleryPath( const OUString& rPath )
{
pImp->SetGalleryPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetGraphicPath( const String& rPath )
+void SvtPathOptions::SetGraphicPath( const OUString& rPath )
{
pImp->SetGraphicPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetHelpPath( const String& rPath )
+void SvtPathOptions::SetHelpPath( const OUString& rPath )
{
pImp->SetHelpPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetLinguisticPath( const String& rPath )
+void SvtPathOptions::SetLinguisticPath( const OUString& rPath )
{
pImp->SetLinguisticPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetModulePath( const String& rPath )
+void SvtPathOptions::SetModulePath( const OUString& rPath )
{
pImp->SetModulePath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetPalettePath( const String& rPath )
+void SvtPathOptions::SetPalettePath( const OUString& rPath )
{
pImp->SetPalettePath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetPluginPath( const String& rPath )
+void SvtPathOptions::SetPluginPath( const OUString& rPath )
{
pImp->SetPluginPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetStoragePath( const String& rPath )
+void SvtPathOptions::SetStoragePath( const OUString& rPath )
{
pImp->SetStoragePath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetTempPath( const String& rPath )
+void SvtPathOptions::SetTempPath( const OUString& rPath )
{
pImp->SetTempPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetTemplatePath( const String& rPath )
+void SvtPathOptions::SetTemplatePath( const OUString& rPath )
{
pImp->SetTemplatePath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetUserConfigPath( const String& rPath )
+void SvtPathOptions::SetUserConfigPath( const OUString& rPath )
{
pImp->SetUserConfigPath( rPath );
}
// -----------------------------------------------------------------------
-void SvtPathOptions::SetWorkPath( const String& rPath )
+void SvtPathOptions::SetWorkPath( const OUString& rPath )
{
pImp->SetWorkPath( rPath );
}
@@ -836,24 +837,24 @@ OUString SvtPathOptions::UseVariable( const OUString& rPath ) const
// -----------------------------------------------------------------------
-sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Paths ePath )
+bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath )
{
// check parameter: empty inifile name?
- if ( !rIniFile.Len() )
+ if ( rIniFile.isEmpty() )
{
SAL_WARN( "unotools.config", "SvtPathOptions::SearchFile(): invalid parameter" );
- return sal_False;
+ return false;
}
OUString aIniFile = pImp->SubstVar( rIniFile );
- sal_Bool bRet = sal_False;
+ bool bRet = false;
switch ( ePath )
{
case PATH_USERCONFIG:
{
// path is a URL
- bRet = sal_True;
+ bRet = true;
INetURLObject aObj( GetUserConfigPath() );
sal_Int32 nIniIndex = 0;
@@ -912,12 +913,12 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Paths ePath )
sal_Int32 nPathIndex = 0;
do
{
- sal_Bool bIsURL = sal_True;
+ bool bIsURL = true;
OUString aPathToken = aPath.getToken( 0, SEARCHPATH_DELIMITER, nPathIndex );
INetURLObject aObj( aPathToken );
if ( aObj.HasError() )
{
- bIsURL = sal_False;
+ bIsURL = false;
OUString aURL;
if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) )
aObj.SetURL( aURL );
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index cd0e6c7ba2ed..3abe34af1a4c 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -704,9 +704,8 @@ void SvtSecurityOptions_Impl::Commit()
sal_Int32 nCnt = m_seqTrustedAuthors.getLength();
if( nCnt )
{
- String s;
- s.AppendAscii( CSTR_MACRO_TRUSTEDAUTHORS );
- s.AppendAscii( "/a" );
+ OUString s(CSTR_MACRO_TRUSTEDAUTHORS);
+ s += "/a";
Sequence< Sequence< com::sun::star::beans::PropertyValue > > lPropertyValuesSeq( nCnt );
for( sal_Int32 i = 0 ; i < nCnt ; ++i )
@@ -908,7 +907,7 @@ sal_Bool SvtSecurityOptions_Impl::IsSecureURL( const OUString& sURL ,
}
if ( !bState )
- bState = sRef.compareToAscii("private:user") == COMPARE_EQUAL;
+ bState = sRef.compareToAscii("private:user") == 0;
}
}
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index 372387f2b1e9..31879c400496 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -32,7 +32,7 @@
#include "itemholder1.hxx"
-#define CFG_READONLY_DEFAULT sal_False
+#define CFG_READONLY_DEFAULT false
using namespace osl;
using namespace utl;
@@ -56,15 +56,15 @@ class SvtSysLocaleOptions_Impl : public utl::ConfigItem
OUString m_aUILocaleString; // en-US or de-DE or empty for SYSTEM
OUString m_aCurrencyString; // USD-en-US or EUR-de-DE
OUString m_aDatePatternsString; // "Y-M-D;M-D"
- sal_Bool m_bDecimalSeparator; //use decimal separator same as locale
- sal_Bool m_bIgnoreLanguageChange; //OS language change doesn't affect LO document language
+ bool m_bDecimalSeparator; //use decimal separator same as locale
+ bool m_bIgnoreLanguageChange; //OS language change doesn't affect LO document language
- sal_Bool m_bROLocale;
- sal_Bool m_bROUILocale;
- sal_Bool m_bROCurrency;
- sal_Bool m_bRODatePatterns;
- sal_Bool m_bRODecimalSeparator;
- sal_Bool m_bROIgnoreLanguageChange;
+ bool m_bROLocale;
+ bool m_bROUILocale;
+ bool m_bROCurrency;
+ bool m_bRODatePatterns;
+ bool m_bRODecimalSeparator;
+ bool m_bROIgnoreLanguageChange;
static const Sequence< /* const */ OUString > GetPropertyNames();
void MakeRealLocale();
@@ -93,13 +93,13 @@ public:
{ return m_aDatePatternsString; }
void SetDatePatternsString( const OUString& rStr );
- sal_Bool IsDecimalSeparatorAsLocale() const { return m_bDecimalSeparator;}
- void SetDecimalSeparatorAsLocale( sal_Bool bSet);
+ bool IsDecimalSeparatorAsLocale() const { return m_bDecimalSeparator;}
+ void SetDecimalSeparatorAsLocale( bool bSet);
- sal_Bool IsIgnoreLanguageChange() const { return m_bIgnoreLanguageChange;}
- void SetIgnoreLanguageChange( sal_Bool bSet);
+ bool IsIgnoreLanguageChange() const { return m_bIgnoreLanguageChange;}
+ void SetIgnoreLanguageChange( bool bSet);
- sal_Bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const;
+ bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const;
const LanguageTag& GetRealLocale() { return m_aRealLocale; }
const LanguageTag& GetRealUILocale() { return m_aRealUILocale; }
};
@@ -145,13 +145,13 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
: ConfigItem( ROOTNODE_SYSLOCALE )
, m_aRealLocale( LANGUAGE_SYSTEM)
, m_aRealUILocale( LANGUAGE_SYSTEM)
- , m_bDecimalSeparator( sal_True )
+ , m_bDecimalSeparator( true )
, m_bROLocale(CFG_READONLY_DEFAULT)
, m_bROUILocale(CFG_READONLY_DEFAULT)
, m_bROCurrency(CFG_READONLY_DEFAULT)
, m_bRODatePatterns(CFG_READONLY_DEFAULT)
- , m_bRODecimalSeparator(sal_False)
- , m_bROIgnoreLanguageChange(sal_False)
+ , m_bRODecimalSeparator(false)
+ , m_bROIgnoreLanguageChange(false)
{
if ( IsValidConfigMgr() )
@@ -209,7 +209,7 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
break;
case PROPERTYHANDLE_DECIMALSEPARATOR:
{
- sal_Bool bValue = sal_Bool();
+ bool bValue = false;
if ( pValues[nProp] >>= bValue )
m_bDecimalSeparator = bValue;
else
@@ -233,7 +233,7 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
break;
case PROPERTYHANDLE_IGNORELANGCHANGE :
{
- sal_Bool bValue = sal_Bool();
+ bool bValue = false;
if ( pValues[nProp] >>= bValue )
m_bIgnoreLanguageChange = bValue;
else
@@ -289,9 +289,9 @@ void SvtSysLocaleOptions_Impl::MakeRealUILocale()
}
}
-sal_Bool SvtSysLocaleOptions_Impl::IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const
+bool SvtSysLocaleOptions_Impl::IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const
{
- sal_Bool bReadOnly = CFG_READONLY_DEFAULT;
+ bool bReadOnly = CFG_READONLY_DEFAULT;
switch(eOption)
{
case SvtSysLocaleOptions::E_LOCALE :
@@ -449,7 +449,7 @@ void SvtSysLocaleOptions_Impl::SetDatePatternsString( const OUString& rStr )
}
}
-void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet)
+void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( bool bSet)
{
if(bSet != m_bDecimalSeparator)
{
@@ -459,7 +459,7 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet)
}
}
-void SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange( sal_Bool bSet)
+void SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange( bool bSet)
{
if(bSet != m_bIgnoreLanguageChange)
{
@@ -572,7 +572,7 @@ Mutex& SvtSysLocaleOptions::GetMutex()
}
-sal_Bool SvtSysLocaleOptions::IsModified()
+bool SvtSysLocaleOptions::IsModified()
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsModified();
@@ -636,63 +636,64 @@ void SvtSysLocaleOptions::SetDatePatternsConfigString( const OUString& rStr )
pOptions->SetDatePatternsString( rStr );
}
-sal_Bool SvtSysLocaleOptions::IsDecimalSeparatorAsLocale() const
+bool SvtSysLocaleOptions::IsDecimalSeparatorAsLocale() const
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsDecimalSeparatorAsLocale();
}
-void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale( sal_Bool bSet)
+void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale( bool bSet)
{
MutexGuard aGuard( GetMutex() );
pOptions->SetDecimalSeparatorAsLocale(bSet);
}
-sal_Bool SvtSysLocaleOptions::IsIgnoreLanguageChange() const
+bool SvtSysLocaleOptions::IsIgnoreLanguageChange() const
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsIgnoreLanguageChange();
}
-void SvtSysLocaleOptions::SetIgnoreLanguageChange( sal_Bool bSet)
+void SvtSysLocaleOptions::SetIgnoreLanguageChange( bool bSet)
{
MutexGuard aGuard( GetMutex() );
pOptions->SetIgnoreLanguageChange(bSet);
}
-sal_Bool SvtSysLocaleOptions::IsReadOnly( EOption eOption ) const
+bool SvtSysLocaleOptions::IsReadOnly( EOption eOption ) const
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsReadOnly( eOption );
}
// static
-void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( String& rAbbrev,
- LanguageType& eLang, const OUString& rConfigString )
+void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( OUString& rAbbrev,
+ LanguageType& eLang,
+ const OUString& rConfigString )
{
sal_Int32 nDelim = rConfigString.indexOf( '-' );
if ( nDelim >= 0 )
{
rAbbrev = rConfigString.copy( 0, nDelim );
- String aIsoStr( rConfigString.copy( nDelim+1 ) );
+ OUString aIsoStr( rConfigString.copy( nDelim+1 ) );
eLang = LanguageTag( aIsoStr ).getLanguageType();
}
else
{
rAbbrev = rConfigString;
- eLang = (rAbbrev.Len() ? LANGUAGE_NONE : LANGUAGE_SYSTEM);
+ eLang = (rAbbrev.isEmpty() ? LANGUAGE_SYSTEM : LANGUAGE_NONE);
}
}
// static
OUString SvtSysLocaleOptions::CreateCurrencyConfigString(
- const String& rAbbrev, LanguageType eLang )
+ const OUString& rAbbrev, LanguageType eLang )
{
- String aIsoStr( LanguageTag( eLang ).getBcp47() );
- if ( aIsoStr.Len() )
+ OUString aIsoStr( LanguageTag( eLang ).getBcp47() );
+ if ( !aIsoStr.isEmpty() )
{
- OUStringBuffer aStr( rAbbrev.Len() + 1 + aIsoStr.Len() );
+ OUStringBuffer aStr( rAbbrev.getLength() + 1 + aIsoStr.getLength() );
aStr.append( rAbbrev );
aStr.append( sal_Unicode('-') );
aStr.append( aIsoStr );
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index 700a8d0d8500..c7b96eedbe29 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -19,7 +19,6 @@
#include <rtl/strbuf.hxx>
-#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <unotools/calendarwrapper.hxx>
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
@@ -260,7 +259,7 @@ void CalendarWrapper::setValue( sal_Int16 nFieldIndex, sal_Int16 nValue )
}
-sal_Bool CalendarWrapper::isValid() const
+bool CalendarWrapper::isValid() const
{
try
{
@@ -271,7 +270,7 @@ sal_Bool CalendarWrapper::isValid() const
{
SAL_WARN( "unotools.i18n", "isValue: Exception caught " << e.Message );
}
- return sal_False;
+ return false;
}
@@ -379,7 +378,7 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
}
-String CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const
+OUString CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const
{
try
{
@@ -390,13 +389,13 @@ String CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int
{
SAL_WARN( "unotools.i18n", "getDisplayName: Exception caught " << e.Message );
}
- return String();
+ return OUString();
}
// --- XExtendedCalendar -----------------------------------------------------
-String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) const
+OUString CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) const
{
try
{
@@ -407,7 +406,7 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
{
SAL_WARN( "unotools.i18n", "getDisplayString: Exception caught " << e.Message );
}
- return String();
+ return OUString();
}
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index 35f327238609..2b620262030c 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -20,7 +20,6 @@
#include <comphelper/processfactory.hxx>
#include <unotools/charclass.hxx>
-#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/i18n/CharacterClassification.hpp>
@@ -77,41 +76,47 @@ const ::com::sun::star::lang::Locale& CharClass::getMyLocale() const
// static
-sal_Bool CharClass::isAsciiNumeric( const String& rStr )
+bool CharClass::isAsciiNumeric( const OUString& rStr )
{
- if ( !rStr.Len() )
- return sal_False;
- const sal_Unicode* p = rStr.GetBuffer();
- const sal_Unicode* const pStop = p + rStr.Len();
+ if ( rStr.isEmpty() )
+ return false;
+ const sal_Unicode* p = rStr.getStr();
+ const sal_Unicode* const pStop = p + rStr.getLength();
+
do
{
if ( !isAsciiDigit( *p ) )
- return sal_False;
- } while ( ++p < pStop );
- return sal_True;
+ return false;
+ }
+ while ( ++p < pStop );
+
+ return true;
}
// static
-sal_Bool CharClass::isAsciiAlpha( const String& rStr )
+bool CharClass::isAsciiAlpha( const OUString& rStr )
{
- if ( !rStr.Len() )
- return sal_False;
- const sal_Unicode* p = rStr.GetBuffer();
- const sal_Unicode* const pStop = p + rStr.Len();
+ if ( rStr.isEmpty() )
+ return false;
+ const sal_Unicode* p = rStr.getStr();
+ const sal_Unicode* const pStop = p + rStr.getLength();
+
do
{
if ( !isAsciiAlpha( *p ) )
- return sal_False;
- } while ( ++p < pStop );
- return sal_True;
+ return false;
+ }
+ while ( ++p < pStop );
+
+ return true;
}
-sal_Bool CharClass::isAlpha( const String& rStr, xub_StrLen nPos ) const
+bool CharClass::isAlpha( const OUString& rStr, sal_Int32 nPos ) const
{
- sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode c = rStr[nPos];
if ( c < 128 )
return isAsciiAlpha( c );
@@ -119,22 +124,22 @@ sal_Bool CharClass::isAlpha( const String& rStr, xub_StrLen nPos ) const
{
if ( xCC.is() )
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
- nCharClassAlphaType) != 0;
+ nCharClassAlphaType) != 0;
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isAlpha: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isLetter( const String& rStr, xub_StrLen nPos ) const
+bool CharClass::isLetter( const OUString& rStr, sal_Int32 nPos ) const
{
- sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode c = rStr[nPos];
if ( c < 128 )
return isAsciiAlpha( c );
@@ -142,38 +147,38 @@ sal_Bool CharClass::isLetter( const String& rStr, xub_StrLen nPos ) const
{
if ( xCC.is() )
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
- nCharClassLetterType) != 0;
+ nCharClassLetterType) != 0;
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isLetter: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isLetter( const String& rStr ) const
+bool CharClass::isLetter( const OUString& rStr ) const
{
try
{
if ( xCC.is() )
- return isLetterType( xCC->getStringType( rStr, 0, rStr.Len(), getMyLocale() ) );
+ return isLetterType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isLetter: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isDigit( const String& rStr, xub_StrLen nPos ) const
+bool CharClass::isDigit( const OUString& rStr, sal_Int32 nPos ) const
{
- sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode c = rStr[ nPos ];
if ( c < 128 )
return isAsciiDigit( c );
@@ -181,38 +186,38 @@ sal_Bool CharClass::isDigit( const String& rStr, xub_StrLen nPos ) const
{
if ( xCC.is() )
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
- KCharacterType::DIGIT) != 0;
+ KCharacterType::DIGIT) != 0;
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isDigit: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isNumeric( const String& rStr ) const
+bool CharClass::isNumeric( const OUString& rStr ) const
{
try
{
if ( xCC.is() )
- return isNumericType( xCC->getStringType( rStr, 0, rStr.Len(), getMyLocale() ) );
+ return isNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isNumeric: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const
+bool CharClass::isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const
{
- sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode c = rStr[nPos];
if ( c < 128 )
return isAsciiAlphaNumeric( c );
@@ -222,19 +227,19 @@ sal_Bool CharClass::isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
(nCharClassAlphaType | KCharacterType::DIGIT)) != 0;
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isAlphaNumeric: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isLetterNumeric( const String& rStr, xub_StrLen nPos ) const
+bool CharClass::isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const
{
- sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode c = rStr[nPos];
if ( c < 128 )
return isAsciiAlphaNumeric( c );
@@ -242,31 +247,31 @@ sal_Bool CharClass::isLetterNumeric( const String& rStr, xub_StrLen nPos ) const
{
if ( xCC.is() )
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
- (nCharClassLetterType | KCharacterType::DIGIT)) != 0;
+ (nCharClassLetterType | KCharacterType::DIGIT)) != 0;
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isLetterNumeric: Exception caught!" );
- return sal_False;
+ return false;
}
}
-sal_Bool CharClass::isLetterNumeric( const String& rStr ) const
+bool CharClass::isLetterNumeric( const OUString& rStr ) const
{
try
{
if ( xCC.is() )
- return isLetterNumericType( xCC->getStringType( rStr, 0, rStr.Len(), getMyLocale() ) );
+ return isLetterNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
else
- return sal_False;
+ return false;
}
catch ( const Exception& )
{
SAL_WARN( "unotools.i18n", "isLetterNumeric: Exception caught!" );
- return sal_False;
+ return false;
}
}
@@ -318,7 +323,7 @@ OUString CharClass::lowercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n
}
}
-sal_Int16 CharClass::getType( const String& rStr, xub_StrLen nPos ) const
+sal_Int16 CharClass::getType( const OUString& rStr, sal_Int32 nPos ) const
{
try
{
@@ -335,7 +340,7 @@ sal_Int16 CharClass::getType( const String& rStr, xub_StrLen nPos ) const
}
-sal_Int16 CharClass::getCharacterDirection( const String& rStr, xub_StrLen nPos ) const
+sal_Int16 CharClass::getCharacterDirection( const OUString& rStr, sal_Int32 nPos ) const
{
try
{
@@ -352,7 +357,7 @@ sal_Int16 CharClass::getCharacterDirection( const String& rStr, xub_StrLen nPos
}
-sal_Int16 CharClass::getScript( const String& rStr, xub_StrLen nPos ) const
+sal_Int16 CharClass::getScript( const OUString& rStr, sal_Int32 nPos ) const
{
try
{
@@ -369,7 +374,7 @@ sal_Int16 CharClass::getScript( const String& rStr, xub_StrLen nPos ) const
}
-sal_Int32 CharClass::getCharacterType( const String& rStr, xub_StrLen nPos ) const
+sal_Int32 CharClass::getCharacterType( const OUString& rStr, sal_Int32 nPos ) const
{
try
{
@@ -386,7 +391,7 @@ sal_Int32 CharClass::getCharacterType( const String& rStr, xub_StrLen nPos ) con
}
-sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const
+sal_Int32 CharClass::getStringType( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const
{
try
{
@@ -404,12 +409,12 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
::com::sun::star::i18n::ParseResult CharClass::parseAnyToken(
- const String& rStr,
+ const OUString& rStr,
sal_Int32 nPos,
sal_Int32 nStartCharFlags,
- const String& userDefinedCharactersStart,
+ const OUString& userDefinedCharactersStart,
sal_Int32 nContCharFlags,
- const String& userDefinedCharactersCont ) const
+ const OUString& userDefinedCharactersCont ) const
{
try
{
@@ -430,12 +435,12 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
::com::sun::star::i18n::ParseResult CharClass::parsePredefinedToken(
sal_Int32 nTokenType,
- const String& rStr,
+ const OUString& rStr,
sal_Int32 nPos,
sal_Int32 nStartCharFlags,
- const String& userDefinedCharactersStart,
+ const OUString& userDefinedCharactersStart,
sal_Int32 nContCharFlags,
- const String& userDefinedCharactersCont ) const
+ const OUString& userDefinedCharactersCont ) const
{
try
{
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 82b55c1a3ffc..a0c800cdf176 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -26,7 +26,6 @@
#include <unotools/numberformatcodewrapper.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/digitgroupingiterator.hxx>
-#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <i18nlangtag/languagetag.hxx>
@@ -672,7 +671,7 @@ void LocaleDataWrapper::scanCurrFormatImpl( const OUString& rCode,
p = pStop;
break;
default:
- if (!nInSection && nSym == -1 && String(rCode).Equals( aCurrSymbol, (xub_StrLen)(p-pStr), aCurrSymbol.getLength()))
+ if (!nInSection && nSym == -1 && rCode.match(aCurrSymbol, (sal_Int32)(p - pStr)))
{ // currency symbol not surrounded by [$...]
nSym = p - pStr;
if (nBlank == -1 && pStr < p && *(p-1) == ' ')
@@ -1430,7 +1429,7 @@ OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCa
using namespace ::com::sun::star::i18n;
sal_Unicode aBuf[20];
sal_Unicode* pBuf;
- String aStr;
+ OUString aStr;
sal_Int16 nVal;
rCal.setGregorianDateTime( rDate );
// day of week
@@ -1455,25 +1454,13 @@ OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCa
switch ( getLongDateFormat() )
{
case DMY :
- aStr += aDay;
- aStr += getLongDateDaySep();
- aStr += aMonth;
- aStr += getLongDateMonthSep();
- aStr += aYear;
+ aStr += aDay + getLongDateDaySep() + aMonth + getLongDateMonthSep() + aYear;
break;
case MDY :
- aStr += aMonth;
- aStr += getLongDateMonthSep();
- aStr += aDay;
- aStr += getLongDateDaySep();
- aStr += aYear;
+ aStr += aMonth + getLongDateMonthSep() + aDay + getLongDateDaySep() + aYear;
break;
default: // YMD
- aStr += aYear;
- aStr += getLongDateYearSep();
- aStr += aMonth;
- aStr += getLongDateMonthSep();
- aStr += aDay;
+ aStr += aYear + getLongDateYearSep() + aMonth + getLongDateMonthSep() + aDay;
}
return aStr;
}
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index dfb871e70439..5e8327fdf42c 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -26,6 +26,7 @@
#include <comphelper/processfactory.hxx>
#include <unotools/textsearch.hxx>
#include <rtl/instance.hxx>
+#include <rtl/ustrbuf.hxx>
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
@@ -38,21 +39,21 @@ namespace utl
SearchParam::SearchParam( const OUString &rText,
SearchType eType,
- sal_Bool bCaseSensitive,
- sal_Bool bWrdOnly,
- sal_Bool bSearchInSel )
+ bool bCaseSensitive,
+ bool bWrdOnly,
+ bool bSearchInSel )
{
sSrchStr = rText;
- m_eSrchType = eType;
+ m_eSrchType = eType;
- m_bWordOnly = bWrdOnly;
- m_bSrchInSel = bSearchInSel;
- m_bCaseSense = bCaseSensitive;
+ m_bWordOnly = bWrdOnly;
+ m_bSrchInSel = bSearchInSel;
+ m_bCaseSense = bCaseSensitive;
nTransliterationFlags = 0;
// Parameters for weighted Levenshtein distance
- bLEV_Relaxed = sal_True;
+ bLEV_Relaxed = true;
nLEV_OtherX = 2;
nLEV_ShorterY = 1;
nLEV_LongerZ = 3;
@@ -62,11 +63,11 @@ SearchParam::SearchParam( const SearchParam& rParam )
{
sSrchStr = rParam.sSrchStr;
sReplaceStr = rParam.sReplaceStr;
- m_eSrchType = rParam.m_eSrchType;
+ m_eSrchType = rParam.m_eSrchType;
- m_bWordOnly = rParam.m_bWordOnly;
- m_bSrchInSel = rParam.m_bSrchInSel;
- m_bCaseSense = rParam.m_bCaseSense;
+ m_bWordOnly = rParam.m_bWordOnly;
+ m_bSrchInSel = rParam.m_bSrchInSel;
+ m_bCaseSense = rParam.m_bCaseSense;
bLEV_Relaxed = rParam.bLEV_Relaxed;
nLEV_OtherX = rParam.nLEV_OtherX;
@@ -206,51 +207,19 @@ TextSearch::~TextSearch()
* methods, such as ordinary string searching or regular expression
* matching, using the method pointer.
*/
-int TextSearch::SearchFrwrd( const String & rStr, xub_StrLen* pStart,
- xub_StrLen* pEnde, SearchResult* pRes )
-{
- int nRet = 0;
- try
- {
- if( xTextSearch.is() )
- {
- SearchResult aRet( xTextSearch->searchForward(
- rStr, *pStart, *pEnde ));
- if( aRet.subRegExpressions > 0 )
- {
- nRet = 1;
- // the XTextsearch returns in startOffset the higher position
- // and the endposition is always exclusive.
- // The caller of this function will have in startPos the
- // lower pos. and end
- *pStart = (xub_StrLen)aRet.startOffset[ 0 ];
- *pEnde = (xub_StrLen)aRet.endOffset[ 0 ];
- if( pRes )
- *pRes = aRet;
- }
- }
- }
- catch ( Exception& )
- {
- SAL_WARN( "unotools.i18n", "SearchForward: Exception caught!" );
- }
- return nRet;
-}
-
-sal_Bool TextSearch::SearchForward( const OUString &rStr,
+bool TextSearch::SearchForward( const OUString &rStr,
sal_Int32* pStart, sal_Int32* pEnd,
::com::sun::star::util::SearchResult* pRes)
{
- sal_Bool nRet = sal_False;
+ bool nRet = false;
try
{
if( xTextSearch.is() )
{
- SearchResult aRet( xTextSearch->searchForward(
- rStr, *pStart, *pEnd ));
+ SearchResult aRet( xTextSearch->searchForward( rStr, *pStart, *pEnd ));
if( aRet.subRegExpressions > 0 )
{
- nRet = sal_True;
+ nRet = true;
// the XTextsearch returns in startOffset the higher position
// and the endposition is always exclusive.
// The caller of this function will have in startPos the
@@ -270,25 +239,24 @@ sal_Bool TextSearch::SearchForward( const OUString &rStr,
}
-int TextSearch::SearchBkwrd( const String & rStr, xub_StrLen* pStart,
- xub_StrLen* pEnde, SearchResult* pRes )
+bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart,
+ sal_Int32* pEnde, SearchResult* pRes )
{
- int nRet = 0;
+ bool nRet = false;
try
{
if( xTextSearch.is() )
{
- SearchResult aRet( xTextSearch->searchBackward(
- rStr, *pStart, *pEnde ));
+ SearchResult aRet( xTextSearch->searchBackward( rStr, *pStart, *pEnde ));
if( aRet.subRegExpressions )
{
- nRet = 1;
+ nRet = true;
// the XTextsearch returns in startOffset the higher position
// and the endposition is always exclusive.
// The caller of this function will have in startPos the
// lower pos. and end
- *pEnde = (xub_StrLen)aRet.startOffset[ 0 ];
- *pStart = (xub_StrLen)aRet.endOffset[ 0 ];
+ *pEnde = aRet.startOffset[ 0 ];
+ *pStart = aRet.endOffset[ 0 ];
if( pRes )
*pRes = aRet;
}
@@ -301,103 +269,92 @@ int TextSearch::SearchBkwrd( const String & rStr, xub_StrLen* pStart,
return nRet;
}
-void TextSearch::ReplaceBackReferences( String& rReplaceStr, const String &rStr, const SearchResult& rResult )
+void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const SearchResult& rResult )
{
if( rResult.subRegExpressions > 0 )
{
- OUString sTab( '\t' );
- sal_Unicode sSrchChrs[] = {'\\', '&', '$', 0};
- String sTmp;
- xub_StrLen nPos = 0;
sal_Unicode sFndChar;
- while( STRING_NOTFOUND != ( nPos = rReplaceStr.SearchChar( sSrchChrs, nPos )) )
+ sal_Int32 i;
+ OUStringBuffer sBuff(rReplaceStr.getLength()*4);
+ for(i = 0; i < rReplaceStr.getLength(); i++)
{
- if( rReplaceStr.GetChar( nPos ) == '&')
+ if( rReplaceStr[i] == '&')
{
- sal_uInt16 nStart = (sal_uInt16)(rResult.startOffset[0]);
- sal_uInt16 nLength = (sal_uInt16)(rResult.endOffset[0] - rResult.startOffset[0]);
- rReplaceStr.Erase( nPos, 1 ); // delete ampersand
- // replace by found string
- rReplaceStr.Insert( rStr, nStart, nLength, nPos );
- // jump over
- nPos = nPos + nLength;
+ sal_Int32 nStart = rResult.startOffset[0];
+ sal_Int32 nLength = rResult.endOffset[0] - rResult.startOffset[0];
+ sBuff.append(rStr.getStr() + nStart, nLength);
}
- else if( rReplaceStr.GetChar( nPos ) == '$')
+ else if( rReplaceStr[i] == '$' && i < rReplaceStr.getLength() - 1)
{
- if( nPos + 1 < rReplaceStr.Len())
- {
- sFndChar = rReplaceStr.GetChar( nPos + 1 );
- switch(sFndChar)
- { // placeholder for a backward reference?
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
+ sFndChar = rReplaceStr[ i + 1 ];
+ switch(sFndChar)
+ { // placeholder for a backward reference?
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ int j = sFndChar - '0'; // index
+ if(j < rResult.subRegExpressions)
{
- rReplaceStr.Erase( nPos, 2 ); // delete both
- int i = sFndChar - '0'; // index
- if(i < rResult.subRegExpressions)
+ sal_Int32 nSttReg = rResult.startOffset[j];
+ sal_Int32 nRegLen = rResult.endOffset[j];
+ if( nRegLen > nSttReg )
{
- sal_uInt16 nSttReg = (sal_uInt16)(rResult.startOffset[i]);
- sal_uInt16 nRegLen = (sal_uInt16)(rResult.endOffset[i]);
- if( nRegLen > nSttReg )
- nRegLen = nRegLen - nSttReg;
- else
- {
- nRegLen = nSttReg - nRegLen;
- nSttReg = (sal_uInt16)(rResult.endOffset[i]);
- }
- // Copy reference from found string
- sTmp = rStr.Copy((sal_uInt16)nSttReg, (sal_uInt16)nRegLen);
- // insert
- rReplaceStr.Insert( sTmp, nPos );
- // and step over
- nPos = nPos + sTmp.Len();
+ nRegLen = nRegLen - nSttReg;
}
+ else
+ {
+ nRegLen = nSttReg - nRegLen;
+ nSttReg = rResult.endOffset[j];
+ }
+ // Copy reference from found string
+ sBuff.append(rStr.getStr() + nSttReg, nRegLen);
}
- break;
- default:
- nPos += 2; // leave both chars unchanged
- break;
+ i += 1;
}
+ break;
+ default:
+ sBuff.append(rReplaceStr[i]);
+ sBuff.append(rReplaceStr[i+1]);
+ i += 1;
+ break;
}
- else
- ++nPos;
}
- else
+ else if( rReplaceStr[i] == '\\' && i < rReplaceStr.getLength() - 1)
{
- // at least another character?
- if( nPos + 1 < rReplaceStr.Len())
+ sFndChar = rReplaceStr[ i+1 ];
+ switch(sFndChar)
{
- sFndChar = rReplaceStr.GetChar( nPos + 1 );
- switch(sFndChar)
- {
- case '\\':
- case '&':
- case '$':
- rReplaceStr.Erase( nPos, 1 );
- nPos++;
- break;
- case 't':
- rReplaceStr.Erase( nPos, 2 ); // delete both
- rReplaceStr.Insert( sTab, nPos ); // insert tabulator
- nPos++; // step over
- break;
- default:
- nPos += 2; // ignore both characters
- break;
- }
+ case '\\':
+ case '&':
+ case '$':
+ sBuff.append(sFndChar);
+ i+=1;
+ break;
+ case 't':
+ sBuff.append('\t');
+ i += 1;
+ break;
+ default:
+ sBuff.append(rReplaceStr[i]);
+ sBuff.append(rReplaceStr[i+1]);
+ i += 1;
+ break;
}
- else
- ++nPos;
+ }
+ else
+ {
+ sBuff.append(rReplaceStr[i]);
}
}
+ rReplaceStr = sBuff.makeStringAndClear();
}
}
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index 703c37e148cc..abaac0b1953d 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -44,12 +44,11 @@ TransliterationWrapper::~TransliterationWrapper()
}
-String TransliterationWrapper::transliterate(
- const String& rStr, sal_uInt16 nLang,
- xub_StrLen nStart, xub_StrLen nLen,
- Sequence <sal_Int32>* pOffset )
+OUString TransliterationWrapper::transliterate(const OUString& rStr, sal_uInt16 nLang,
+ sal_Int32 nStart, sal_Int32 nLen,
+ Sequence <sal_Int32>* pOffset )
{
- String sRet;
+ OUString sRet;
if( xTrans.is() )
{
try
@@ -70,12 +69,11 @@ String TransliterationWrapper::transliterate(
}
-String TransliterationWrapper::transliterate(
- const String& rStr,
- xub_StrLen nStart, xub_StrLen nLen,
- Sequence <sal_Int32>* pOffset ) const
+OUString TransliterationWrapper::transliterate( const OUString& rStr,
+ sal_Int32 nStart, sal_Int32 nLen,
+ Sequence <sal_Int32>* pOffset ) const
{
- String sRet( rStr );
+ OUString sRet( rStr );
if( xTrans.is() )
{
try
@@ -93,7 +91,7 @@ String TransliterationWrapper::transliterate(
return sRet;
}
-sal_Bool TransliterationWrapper::needLanguageForTheMode() const
+bool TransliterationWrapper::needLanguageForTheMode() const
{
return TransliterationModules_UPPERCASE_LOWERCASE == nType ||
TransliterationModules_LOWERCASE_UPPERCASE == nType ||
@@ -114,8 +112,8 @@ void TransliterationWrapper::setLanguageLocaleImpl( sal_uInt16 nLang )
void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang )
{
- sal_Bool bLoad = bFirstCall;
- bFirstCall = sal_False;
+ bool bLoad = bFirstCall;
+ bFirstCall = false;
if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::SENTENCE_CASE )
{
@@ -161,12 +159,12 @@ void TransliterationWrapper::loadModuleImpl() const
SAL_WARN( "unotools.i18n", "loadModuleImpl: Exception caught " << e.Message );
}
- bFirstCall = sal_False;
+ bFirstCall = false;
}
-void TransliterationWrapper::loadModuleByImplName(
- const String& rModuleName, sal_uInt16 nLang )
+void TransliterationWrapper::loadModuleByImplName(const OUString& rModuleName,
+ sal_uInt16 nLang )
{
try
{
@@ -183,13 +181,13 @@ void TransliterationWrapper::loadModuleByImplName(
SAL_WARN( "unotools.i18n", "loadModuleByImplName: Exception caught " << e.Message );
}
- bFirstCall = sal_False;
+ bFirstCall = false;
}
-sal_Bool TransliterationWrapper::equals(
- const String& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
- const String& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const
+bool TransliterationWrapper::equals(
+ const OUString& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
+ const OUString& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const
{
try
{
@@ -202,10 +200,10 @@ sal_Bool TransliterationWrapper::equals(
{
SAL_WARN( "unotools.i18n", "equals: Exception caught " << e.Message );
}
- return sal_False;
+ return false;
}
-sal_Int32 TransliterationWrapper::compareString( const String& rStr1, const String& rStr2 ) const
+sal_Int32 TransliterationWrapper::compareString( const OUString& rStr1, const OUString& rStr2 ) const
{
try
{
@@ -224,23 +222,23 @@ sal_Int32 TransliterationWrapper::compareString( const String& rStr1, const Stri
// --- helpers --------------------------------------------------------
-sal_Bool TransliterationWrapper::isEqual( const String& rStr1, const String& rStr2 ) const
+bool TransliterationWrapper::isEqual( const OUString& rStr1, const OUString& rStr2 ) const
{
sal_Int32 nMatch1, nMatch2;
- sal_Bool bMatch = equals(
- rStr1, 0, rStr1.Len(), nMatch1,
- rStr2, 0, rStr2.Len(), nMatch2 );
+ bool bMatch = equals(
+ rStr1, 0, rStr1.getLength(), nMatch1,
+ rStr2, 0, rStr2.getLength(), nMatch2 );
return bMatch;
}
-sal_Bool TransliterationWrapper::isMatch( const String& rStr1, const String& rStr2 ) const
+bool TransliterationWrapper::isMatch( const OUString& rStr1, const OUString& rStr2 ) const
{
sal_Int32 nMatch1, nMatch2;
equals(
- rStr1, 0, rStr1.Len(), nMatch1,
- rStr2, 0, rStr2.Len(), nMatch2 );
- return (nMatch1 <= nMatch2) && (nMatch1 == rStr1.Len());
+ rStr1, 0, rStr1.getLength(), nMatch1,
+ rStr2, 0, rStr2.getLength(), nMatch2 );
+ return (nMatch1 <= nMatch2) && (nMatch1 == rStr1.getLength());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 2b44624c39a2..f1156cbe16e2 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1049,8 +1049,8 @@ private:
::std::multimap<sal_Unicode, SymbolEntry> maMagicMap;
public:
StarSymbolToMSMultiFontImpl(bool bPerfectOnly);
- String ConvertChar(sal_Unicode &rChar);
- String ConvertString(String &rString, xub_StrLen& rIndex);
+ OUString ConvertChar(sal_Unicode &rChar);
+ OUString ConvertString(OUString &rString, sal_Int32& rIndex);
};
struct ExtraTable { sal_Unicode cStar; sal_uInt8 cMS;};
@@ -1237,9 +1237,9 @@ const char *SymbolFontToString(int nResult)
return *ppName;
}
-String StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
+OUString StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
{
- String sRet;
+ OUString sRet;
::std::multimap<sal_Unicode, SymbolEntry>::const_iterator aResult =
maMagicMap.find(rChar);
@@ -1247,32 +1247,33 @@ String StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
if (aResult != maMagicMap.end())
{
const SymbolEntry &rEntry = (*aResult).second;
- sRet.AssignAscii(SymbolFontToString(rEntry.eFont));
+ const char* pc = SymbolFontToString(rEntry.eFont);
+ sRet = OUString(pc, strlen(pc), RTL_TEXTENCODING_ASCII_US);
rChar = rEntry.cIndex;
}
return sRet;
}
-String StarSymbolToMSMultiFontImpl::ConvertString(String &rString,
- xub_StrLen& rIndex)
+OUString StarSymbolToMSMultiFontImpl::ConvertString(OUString &rString,
+ sal_Int32& rIndex)
{
typedef ::std::multimap<sal_Unicode, SymbolEntry>::iterator MI;
typedef ::std::pair<MI, MI> Result;
- String sRet;
+ OUString sRet;
- xub_StrLen nLen = rString.Len();
+ sal_Int32 nLen = rString.getLength();
if (rIndex >= nLen)
return sRet;
int nTotal = 0, nResult = 0;
::std::vector<Result> aPossibilities;
aPossibilities.reserve(nLen - rIndex);
- xub_StrLen nStart = rIndex;
+ sal_Int32 nStart = rIndex;
do
{
- Result aResult = maMagicMap.equal_range(rString.GetChar(rIndex));
+ Result aResult = maMagicMap.equal_range(rString[rIndex]);
int nBitfield = 0;
for (MI aIndex = aResult.first; aIndex != aResult.second; ++aIndex)
nBitfield |= aIndex->second.eFont;
@@ -1304,10 +1305,12 @@ String StarSymbolToMSMultiFontImpl::ConvertString(String &rString,
else
break;
}
- sRet.AssignAscii(SymbolFontToString(nI));
+ const char* pc = SymbolFontToString(nI);
+ sRet = OUString(pc, strlen(pc), RTL_TEXTENCODING_ASCII_US);
- xub_StrLen nSize = sal::static_int_cast<xub_StrLen>(aPossibilities.size());
- for(xub_StrLen nPos = 0; nPos < nSize; ++nPos)
+ sal_Int32 nSize = aPossibilities.size();
+ OUStringBuffer sBuff(rString);
+ for(sal_Int32 nPos = 0; nPos < nSize; ++nPos)
{
const Result &rResult = aPossibilities[nPos];
@@ -1315,11 +1318,12 @@ String StarSymbolToMSMultiFontImpl::ConvertString(String &rString,
{
if (aIndex->second.eFont == nI)
{
- rString.SetChar(nPos+nStart, aIndex->second.cIndex);
+ sBuff[nPos + nStart] = aIndex->second.cIndex;
break;
}
}
}
+ rString = sBuff.makeStringAndClear();
}
return sRet;
@@ -1432,7 +1436,7 @@ static ConvertChar aImplStarSymbolCvt = { NULL, "StarBats", ImplStarSymbolToStar
// -----------------------------------------------------------------------
-const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const String& rMapFontName )
+const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, const OUString& rMapFontName )
{
const ConvertChar* pCvt = NULL;
OUString aOrgName( rOrgFontName );
@@ -1478,8 +1482,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const
//=======================================================================
-FontToSubsFontConverter CreateFontToSubsFontConverter(
- const String& rOrgName, sal_uLong nFlags )
+FontToSubsFontConverter CreateFontToSubsFontConverter( const OUString& rOrgName, sal_uLong nFlags )
{
const ConvertChar* pCvt = NULL;
@@ -1529,10 +1532,10 @@ sal_Unicode ConvertFontToSubsFontChar(
// -----------------------------------------------------------------------
-String GetFontToSubsFontName( FontToSubsFontConverter hConverter )
+OUString GetFontToSubsFontName( FontToSubsFontConverter hConverter )
{
if ( !hConverter )
- return String();
+ return OUString();
const char* pName = ((ConvertChar*)hConverter)->mpSubsFontName;
return OUString::createFromAscii( pName );
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index b81a5b38c012..cdb8bd6568c6 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -473,19 +473,24 @@ OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex )
{
// no token delimiter found => handle last token
rIndex = -1;
- nTokenLen = STRING_LEN;
// optimize if the token string consists of just one token
if( !nTokenStart )
+ {
return rTokenStr;
+ }
+ else
+ {
+ nTokenLen = nStringLen - nTokenStart;
+ }
}
- return String( rTokenStr, nTokenStart, nTokenLen );
+ return OUString( rTokenStr.getStr() + nTokenStart, nTokenLen );
}
// =======================================================================
-static bool ImplIsFontToken( const OUString& rName, const String& rToken )
+static bool ImplIsFontToken( const OUString& rName, const OUString& rToken )
{
OUString aTempName;
sal_Int32 nIndex = 0;
@@ -502,7 +507,7 @@ static bool ImplIsFontToken( const OUString& rName, const String& rToken )
// -----------------------------------------------------------------------
-static void ImplAppendFontToken( OUString& rName, const String& rNewToken )
+static void ImplAppendFontToken( OUString& rName, const OUString& rNewToken )
{
if ( !rName.isEmpty() )
{
@@ -539,7 +544,7 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
{
for( int i = 0; i < 3; i++ )
{
- const ::std::vector< String >* pVector = NULL;
+ const ::std::vector< OUString >* pVector = NULL;
switch( i )
{
case 0:
@@ -557,7 +562,7 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
}
if( ! pVector )
continue;
- for( ::std::vector< String >::const_iterator it = pVector->begin(); it != pVector->end(); ++it )
+ for( ::std::vector< OUString >::const_iterator it = pVector->begin(); it != pVector->end(); ++it )
if( ! ImplIsFontToken( rName, *it ) )
{
ImplAppendFontToken( aName, *it );
@@ -576,12 +581,12 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
// -----------------------------------------------------------------------
// TODO: use a more generic String hash
-int FontNameHash::operator()( const String& rStr ) const
+int FontNameHash::operator()( const OUString& rStr ) const
{
// this simple hash just has to be good enough for font names
int nHash = 0;
- const int nLen = rStr.Len();
- const sal_Unicode* p = rStr.GetBuffer();
+ const int nLen = rStr.getLength();
+ const sal_Unicode* p = rStr.getStr();
switch( nLen )
{
default: nHash = (p[0]<<16) - (p[1]<<8) + p[2];
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index bf67a4d2cd6b..9ff0fc47c068 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -23,6 +23,7 @@
#include <comphelper/processfactory.hxx>
#include <rtl/tencinfo.h>
#include <rtl/locale.h>
+#include <osl/thread.h>
#include <osl/nlsupport.h>
#include <vector>
@@ -41,14 +42,14 @@ public:
LocaleDataWrapper* pLocaleData;
CharClass* pCharClass;
- SvtSysLocale_Impl();
- virtual ~SvtSysLocale_Impl();
+ SvtSysLocale_Impl();
+ virtual ~SvtSysLocale_Impl();
- CharClass* GetCharClass();
- virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+ CharClass* GetCharClass();
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
private:
- void setDateAcceptancePatternsConfig();
+ void setDateAcceptancePatternsConfig();
};
// -----------------------------------------------------------------------
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 798f61be5816..bbfe67f9254d 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -49,10 +49,10 @@ namespace utl
struct TempFile_Impl
{
- String aName;
- String aURL;
+ OUString aName;
+ OUString aURL;
SvStream* pStream;
- sal_Bool bIsDirectory;
+ bool bIsDirectory;
TempFile_Impl()
: pStream(0)
@@ -62,7 +62,7 @@ struct TempFile_Impl
OUString getParentName( const OUString& aFileName )
{
sal_Int32 lastIndex = aFileName.lastIndexOf( sal_Unicode('/') );
- OUString aParent = aFileName.copy( 0,lastIndex );
+ OUString aParent = aFileName.copy( 0, lastIndex );
if( aParent[ aParent.getLength()-1] == sal_Unicode(':') && aParent.getLength() == 6 )
aParent += OUString("/");
@@ -73,11 +73,11 @@ OUString getParentName( const OUString& aFileName )
return aParent;
}
-sal_Bool ensuredir( const OUString& rUnqPath )
+bool ensuredir( const OUString& rUnqPath )
{
OUString aPath;
if ( rUnqPath.isEmpty() )
- return sal_False;
+ return false;
// remove trailing slash
if ( rUnqPath[ rUnqPath.getLength() - 1 ] == sal_Unicode( '/' ) )
@@ -98,11 +98,11 @@ umask(old_mode);
#endif
aDirectory.close();
if( nError == osl::File::E_None )
- return sal_True;
+ return true;
// try to create the directory
nError = osl::Directory::create( aPath );
- sal_Bool bSuccess = ( nError == osl::File::E_None || nError == osl::FileBase::E_EXIST );
+ bool bSuccess = ( nError == osl::File::E_None || nError == osl::FileBase::E_EXIST );
if( !bSuccess )
{
// perhaps parent(s) don't exist
@@ -124,10 +124,10 @@ umask(old_mode);
return bSuccess;
}
-String ConstructTempDir_Impl( const String* pParent )
+OUString ConstructTempDir_Impl( const OUString* pParent )
{
- String aName;
- if ( pParent && pParent->Len() )
+ OUString aName;
+ if ( pParent && !pParent->isEmpty() )
{
com::sun::star::uno::Reference<
com::sun::star::ucb::XUniversalContentBroker > pBroker(
@@ -154,7 +154,7 @@ String ConstructTempDir_Impl( const String* pParent )
}
}
- if ( !aName.Len() )
+ if ( aName.isEmpty() )
{
OUString &rTempNameBase_Impl = TempNameBase_Impl::get();
if (rTempNameBase_Impl.isEmpty())
@@ -172,30 +172,29 @@ String ConstructTempDir_Impl( const String* pParent )
}
// Make sure that directory ends with a separator
- xub_StrLen i = aName.Len();
- if( i>0 && aName.GetChar(i-1) != '/' )
- aName += '/';
+ sal_Int32 i = aName.getLength();
+ if( i>0 && aName[i-1] != '/' )
+ aName += "/";
return aName;
}
-void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_True )
+void CreateTempName_Impl( OUString& rName, bool bKeep, bool bDir = true )
{
// add a suitable tempname
// 36 ** 6 == 2176782336
unsigned const nRadix = 36;
unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix);
- String aName( rName );
- aName += OUString( "lu" );
+ OUString aName = rName + "lu";
- rName.Erase();
+ rName = "";
static unsigned long u = Time::GetSystemTicks() % nMax;
for ( unsigned long nSeed = u; ++u != nSeed; )
{
u %= nMax;
- String aTmp( aName );
+ OUString aTmp( aName );
aTmp += OUString::valueOf(static_cast<sal_Int64>(u), nRadix);
- aTmp += OUString( ".tmp" );
+ aTmp += ".tmp" ;
if ( bDir )
{
@@ -252,26 +251,27 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
}
}
-void lcl_createName(TempFile_Impl& _rImpl,const String& rLeadingChars,sal_Bool _bStartWithZero, const String* pExtension, const String* pParent, sal_Bool bDirectory)
+void lcl_createName(TempFile_Impl& _rImpl,const OUString& rLeadingChars, bool _bStartWithZero,
+ const OUString* pExtension, const OUString* pParent, bool bDirectory)
{
_rImpl.bIsDirectory = bDirectory;
// get correct directory
- String aName = ConstructTempDir_Impl( pParent );
+ OUString aName = ConstructTempDir_Impl( pParent );
- sal_Bool bUseNumber = _bStartWithZero;
+ bool bUseNumber = _bStartWithZero;
// now use special naming scheme ( name takes leading chars and an index counting up from zero
aName += rLeadingChars;
for ( sal_Int32 i=0;; i++ )
{
- String aTmp( aName );
+ OUString aTmp( aName );
if ( bUseNumber )
aTmp += OUString::number( i );
- bUseNumber = sal_True;
+ bUseNumber = true;
if ( pExtension )
aTmp += *pExtension;
else
- aTmp += OUString( ".tmp" );
+ aTmp += ".tmp" ;
if ( bDirectory )
{
FileBase::RC err = Directory::create( aTmp );
@@ -320,24 +320,24 @@ umask(old_mode);
}
-String TempFile::CreateTempName( const String* pParent )
+OUString TempFile::CreateTempName( const OUString* pParent )
{
// get correct directory
- String aName = ConstructTempDir_Impl( pParent );
+ OUString aName = ConstructTempDir_Impl( pParent );
// get TempFile name with default naming scheme
- CreateTempName_Impl( aName, sal_False );
+ CreateTempName_Impl( aName, false );
// convert to file URL
OUString aTmp;
- if ( aName.Len() )
+ if ( !aName.isEmpty() )
FileBase::getSystemPathFromFileURL( aName, aTmp );
return aTmp;
}
-TempFile::TempFile( const String* pParent, sal_Bool bDirectory )
+TempFile::TempFile( const OUString* pParent, bool bDirectory )
: pImp( new TempFile_Impl )
- , bKillingFileEnabled( sal_False )
+ , bKillingFileEnabled( false )
{
pImp->bIsDirectory = bDirectory;
@@ -345,20 +345,20 @@ TempFile::TempFile( const String* pParent, sal_Bool bDirectory )
pImp->aName = ConstructTempDir_Impl( pParent );
// get TempFile with default naming scheme
- CreateTempName_Impl( pImp->aName, sal_True, bDirectory );
+ CreateTempName_Impl( pImp->aName, true, bDirectory );
}
-TempFile::TempFile( const String& rLeadingChars, const String* pExtension, const String* pParent, sal_Bool bDirectory)
+TempFile::TempFile( const OUString& rLeadingChars, const OUString* pExtension, const OUString* pParent, bool bDirectory)
: pImp( new TempFile_Impl )
- , bKillingFileEnabled( sal_False )
+ , bKillingFileEnabled( false )
{
- lcl_createName(*pImp,rLeadingChars,sal_True, pExtension, pParent, bDirectory);
+ lcl_createName(*pImp, rLeadingChars, true, pExtension, pParent, bDirectory);
}
-TempFile::TempFile( const String& rLeadingChars,sal_Bool _bStartWithZero, const String* pExtension, const String* pParent, sal_Bool bDirectory)
+TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero, const OUString* pExtension, const OUString* pParent, bool bDirectory)
: pImp( new TempFile_Impl )
- , bKillingFileEnabled( sal_False )
+ , bKillingFileEnabled( false )
{
- lcl_createName(*pImp,rLeadingChars,_bStartWithZero, pExtension, pParent, bDirectory);
+ lcl_createName(*pImp, rLeadingChars, _bStartWithZero, pExtension, pParent, bDirectory);
}
TempFile::~TempFile()
@@ -380,21 +380,21 @@ TempFile::~TempFile()
delete pImp;
}
-sal_Bool TempFile::IsValid() const
+bool TempFile::IsValid() const
{
- return pImp->aName.Len() != 0;
+ return !(pImp->aName.isEmpty());
}
-String TempFile::GetFileName() const
+OUString TempFile::GetFileName() const
{
OUString aTmp;
FileBase::getSystemPathFromFileURL( pImp->aName, aTmp );
return aTmp;
}
-String TempFile::GetURL() const
+OUString TempFile::GetURL() const
{
- if ( !pImp->aURL.Len() )
+ if ( pImp->aURL.isEmpty() )
{
OUString aTmp;
LocalFileHelper::ConvertPhysicalNameToURL( GetFileName(), aTmp );
@@ -408,8 +408,8 @@ SvStream* TempFile::GetStream( StreamMode eMode )
{
if ( !pImp->pStream )
{
- if ( GetURL().Len() )
- pImp->pStream = UcbStreamHelper::CreateStream( pImp->aURL, eMode, sal_True /* bFileExists */ );
+ if ( !GetURL().isEmpty() )
+ pImp->pStream = UcbStreamHelper::CreateStream( pImp->aURL, eMode, true /* bFileExists */ );
else
pImp->pStream = new SvMemoryStream( eMode );
}
@@ -426,37 +426,37 @@ void TempFile::CloseStream()
}
}
-String TempFile::SetTempNameBaseDirectory( const String &rBaseName )
+OUString TempFile::SetTempNameBaseDirectory( const OUString &rBaseName )
{
- if( !rBaseName.Len() )
- return String();
+ if( rBaseName.isEmpty() )
+ return OUString();
OUString aUnqPath( rBaseName );
// remove trailing slash
- if ( rBaseName.GetChar( rBaseName.Len() - 1 ) == sal_Unicode( '/' ) )
- aUnqPath = rBaseName.Copy( 0, rBaseName.Len() - 1 );
+ if ( rBaseName[ rBaseName.getLength() - 1 ] == sal_Unicode( '/' ) )
+ aUnqPath = rBaseName.copy( 0, rBaseName.getLength() - 1 );
// try to create the directory
- sal_Bool bRet = sal_False;
+ bool bRet = false;
osl::FileBase::RC err = osl::Directory::create( aUnqPath );
if ( err != FileBase::E_None && err != FileBase::E_EXIST )
// perhaps parent(s) don't exist
bRet = ensuredir( aUnqPath );
else
- bRet = sal_True;
+ bRet = true;
// failure to create base directory means returning an empty string
OUString aTmp;
if ( bRet )
{
// append own internal directory
- bRet = sal_True;
+ bRet = true;
OUString &rTempNameBase_Impl = TempNameBase_Impl::get();
rTempNameBase_Impl = rBaseName;
rTempNameBase_Impl += OUString('/');
- TempFile aBase( NULL, sal_True );
+ TempFile aBase( NULL, true );
if ( aBase.IsValid() )
// use it in case of success
rTempNameBase_Impl = aBase.pImp->aName;
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 73a10f77b9b1..ca4e57839389 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -194,10 +194,10 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
sal_Int32 k, m = aHead.getLength();
for (k = 0; k < m; k++)
{
- String aName( aHead[k].Name );
- String aValue( aHead[k].Value );
+ OUString aName( aHead[k].Name );
+ OUString aValue( aHead[k].Value );
- if (aName.CompareIgnoreCaseToAscii("Expires") == COMPARE_EQUAL)
+ if (aName.compareToIgnoreAsciiCaseAscii("Expires") == 0)
{
DateTime aExpires (0, 0);
if (INetRFC822Message::ParseDateField (aValue, aExpires))
@@ -878,7 +878,7 @@ void SAL_CALL Moderator::onTerminated()
Function for opening UCB contents synchronously,
but with handled timeout;
*/
-static sal_Bool _UCBOpenContentSync(
+static bool _UCBOpenContentSync(
UcbLockBytesRef xLockBytes,
Reference < XContent > xContent,
const Command& rArg,
@@ -888,7 +888,7 @@ static sal_Bool _UCBOpenContentSync(
UcbLockBytesHandlerRef xHandler );
-static sal_Bool UCBOpenContentSync(
+static bool UCBOpenContentSync(
UcbLockBytesRef xLockBytes,
Reference < XContent > xContent,
const Command& rArg,
@@ -917,8 +917,8 @@ static sal_Bool UCBOpenContentSync(
return _UCBOpenContentSync(
xLockBytes,xContent,rArg,xSink,xInteract,xProgress,xHandler);
- if ( (aScheme.compareToAscii( "http" ) != COMPARE_EQUAL) ||
- (aScheme.compareToAscii( "https" ) != COMPARE_EQUAL) )
+ if ( (aScheme.compareToAscii( "http" ) != 0) ||
+ (aScheme.compareToAscii( "https" ) != 0) )
xLockBytes->SetStreamValid_Impl();
Reference< XPropertiesChangeListener > xListener;
@@ -1137,7 +1137,7 @@ static sal_Bool UCBOpenContentSync(
/**
Function for opening UCB contents synchronously
*/
-static sal_Bool _UCBOpenContentSync(
+static bool _UCBOpenContentSync(
UcbLockBytesRef xLockBytes,
Reference < XContent > xContent,
const Command& rArg,
@@ -1154,7 +1154,7 @@ static sal_Bool _UCBOpenContentSync(
// http protocol must be handled in a special way: during the opening process the input stream may change
// only the last inputstream after notifying the document headers is valid
- if ( aScheme.compareToAscii("http") != COMPARE_EQUAL )
+ if ( aScheme.compareToAscii("http") != 0 )
xLockBytes->SetStreamValid_Impl();
Reference< XPropertiesChangeListener > xListener = new UcbPropertiesChangeListener_Impl( xLockBytes );
@@ -1235,11 +1235,11 @@ UcbLockBytes::UcbLockBytes( UcbLockBytesHandler* pHandler )
, m_pCommandThread( NULL )
, m_xHandler( pHandler )
, m_nError( ERRCODE_NONE )
- , m_bTerminated (sal_False)
- , m_bDontClose( sal_False )
- , m_bStreamValid (sal_False)
+ , m_bTerminated (false)
+ , m_bDontClose( false )
+ , m_bStreamValid (false)
{
- SetSynchronMode( sal_True );
+ SetSynchronMode( true );
}
//----------------------------------------------------------------------------
@@ -1280,19 +1280,19 @@ UcbLockBytes::~UcbLockBytes()
Reference < XInputStream > UcbLockBytes::getInputStream()
{
osl::MutexGuard aGuard( m_aMutex );
- m_bDontClose = sal_True;
+ m_bDontClose = true;
return m_xInputStream;
}
//----------------------------------------------------------------------------
-sal_Bool UcbLockBytes::setStream_Impl( const Reference<XStream>& aStream )
+bool UcbLockBytes::setStream_Impl( const Reference<XStream>& aStream )
{
osl::MutexGuard aGuard( m_aMutex );
if ( aStream.is() )
{
m_xOutputStream = aStream->getOutputStream();
- setInputStream_Impl( aStream->getInputStream(), sal_False );
+ setInputStream_Impl( aStream->getInputStream(), false );
m_xSeekable = Reference < XSeekable > ( aStream, UNO_QUERY );
}
else
@@ -1304,9 +1304,9 @@ sal_Bool UcbLockBytes::setStream_Impl( const Reference<XStream>& aStream )
return m_xInputStream.is();
}
-sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInputStream, sal_Bool bSetXSeekable )
+bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInputStream, bool bSetXSeekable )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
try
{
@@ -1345,7 +1345,7 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp
void UcbLockBytes::SetStreamValid_Impl()
{
- m_bStreamValid = sal_True;
+ m_bStreamValid = true;
if ( m_xInputStream.is() )
m_aInitialized.set();
}
@@ -1353,7 +1353,7 @@ void UcbLockBytes::SetStreamValid_Impl()
//----------------------------------------------------------------------------
void UcbLockBytes::terminate_Impl()
{
- m_bTerminated = sal_True;
+ m_bTerminated = true;
m_aInitialized.set();
m_aTerminated.set();
@@ -1637,13 +1637,13 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
Reference< XProgressHandler > xProgressHdl = new ProgressHandler_Impl( LINK( &xLockBytes, UcbLockBytes, DataAvailHdl ) );
- sal_Bool bError = UCBOpenContentSync( xLockBytes,
- xContent,
- aCommand,
- xSink,
- xInteractionHandler,
- xProgressHdl,
- pHandler );
+ bool bError = UCBOpenContentSync( xLockBytes,
+ xContent,
+ aCommand,
+ xSink,
+ xInteractionHandler,
+ xProgressHdl,
+ pHandler );
if ( xLockBytes->GetError() == ERRCODE_NONE && ( bError || !xLockBytes->getInputStream().is() ) )
{
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index e4c763cd2434..4c1d57619e8f 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
#include <unotools/ucblockbytes.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <comphelper/processfactory.hxx>
@@ -40,9 +40,9 @@ using namespace ::com::sun::star::beans;
namespace utl
{
-static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode,
- Reference < XInteractionHandler > xInteractionHandler,
- UcbLockBytesHandler* pHandler, sal_Bool bEnsureFileExists )
+static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ Reference < XInteractionHandler > xInteractionHandler,
+ UcbLockBytesHandler* pHandler, bool bEnsureFileExists )
{
SvStream* pStream = NULL;
Reference< XUniversalContentBroker > ucb(
@@ -140,22 +140,22 @@ static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode
//============================================================================
-SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode,
- UcbLockBytesHandler* pHandler )
+SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ UcbLockBytesHandler* pHandler )
{
return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, sal_True /* bEnsureFileExists */ );
}
-SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode,
- Reference < XInteractionHandler > xInteractionHandler,
- UcbLockBytesHandler* pHandler )
+SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ Reference < XInteractionHandler > xInteractionHandler,
+ UcbLockBytesHandler* pHandler )
{
return lcl_CreateStream( rFileName, eOpenMode, xInteractionHandler, pHandler, sal_True /* bEnsureFileExists */ );
}
-SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode,
- sal_Bool bFileExists,
- UcbLockBytesHandler* pHandler )
+SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+ bool bFileExists,
+ UcbLockBytesHandler* pHandler )
{
return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, !bFileExists );
}
diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx
index ace53c7de387..3cc021f7a20a 100644
--- a/vcl/source/edit/xtextedt.cxx
+++ b/vcl/source/edit/xtextedt.cxx
@@ -166,9 +166,9 @@ sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions&
bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
bForward ? nNode++ : nNode-- )
{
- String aText = GetText( nNode );
- sal_uInt16 nStartPos = 0;
- sal_uInt16 nEndPos = aText.Len();
+ OUString aText = GetText( nNode );
+ sal_Int32 nStartPos = 0;
+ sal_Int32 nEndPos = aText.getLength();
if ( nNode == nStartNode )
{
if ( bForward )
@@ -185,9 +185,9 @@ sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions&
}
if ( bForward )
- bFound = aSearcher.SearchFrwrd( aText, &nStartPos, &nEndPos );
+ bFound = aSearcher.SearchForward( aText, &nStartPos, &nEndPos );
else
- bFound = aSearcher.SearchBkwrd( aText, &nEndPos, &nStartPos );
+ bFound = aSearcher.SearchBackward( aText, &nEndPos, &nStartPos );
if ( bFound )
{
@@ -197,7 +197,7 @@ sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions&
rSel.GetEnd().GetIndex() = nEndPos;
// Select over the paragraph?
// FIXME This should be max long...
- if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 !
+ if( nEndPos == -1)
{
if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() )
{
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 94c64e10f806..eb678f62312a 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -153,8 +153,8 @@ void Impl_Font::AskConfig()
// prepare the FontSubst configuration lookup
const utl::FontSubstConfiguration& rFontSubst = utl::FontSubstConfiguration::get();
- String aShortName;
- String aFamilyName;
+ OUString aShortName;
+ OUString aFamilyName;
sal_uLong nType = 0;
FontWeight eWeight = WEIGHT_DONTKNOW;
FontWidth eWidthType = WIDTH_DONTKNOW;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 999f703ebf7c..6809232b0c1d 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1071,10 +1071,12 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
void ImplDevFontListData::InitMatchData( const utl::FontSubstConfiguration& rFontSubst,
const String& rSearchName )
{
- String aShortName;
+ OUString aShortName;
+ OUString aMatchFamilyName(maMatchFamilyName);
// get font attributes from the decorated font name
- rFontSubst.getMapName( rSearchName, aShortName, maMatchFamilyName,
+ rFontSubst.getMapName( rSearchName, aShortName, aMatchFamilyName,
meMatchWeight, meMatchWidth, mnMatchType );
+ maMatchFamilyName = aMatchFamilyName;
const FontNameAttr* pFontAttr = rFontSubst.getSubstInfo( rSearchName );
// eventually use the stripped name
if( !pFontAttr )
@@ -1483,7 +1485,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
ImplDevFontListData* pFoundData = NULL;
// use the font substitutions suggested by the FontNameAttr to find the font
- ::std::vector< String >::const_iterator it = rFontAttr.Substitutions.begin();
+ ::std::vector< OUString >::const_iterator it = rFontAttr.Substitutions.begin();
for(; it != rFontAttr.Substitutions.end(); ++it )
{
OUString aSearchName( *it );
@@ -2501,8 +2503,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
GetEnglishSearchFontName( aSearchName );
}
- String aSearchShortName;
- String aSearchFamilyName;
+ OUString aSearchShortName;
+ OUString aSearchFamilyName;
FontWeight eSearchWeight = rFSD.GetWeight();
FontWidth eSearchWidth = rFSD.GetWidthType();
sal_uLong nSearchType = 0;
@@ -2521,8 +2523,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
a korean bitmap font that is not suitable here. Use the font replacement table,
that automatically leads to the desired "HG Mincho Light J". Same story for
MS Gothic, there are thai and korean "Gothic" fonts, so we even prefer Andale */
- static String aMS_Mincho( "msmincho" );
- static String aMS_Gothic( "msgothic" );
+ static OUString aMS_Mincho( "msmincho" );
+ static OUString aMS_Gothic( "msgothic" );
if ((aSearchName != aMS_Mincho) && (aSearchName != aMS_Gothic))
// TODO: add heuristic to only throw out the fake ms* fonts
#endif
@@ -2574,8 +2576,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
aSearchName = rFSD.maTargetName;
GetEnglishSearchFontName( aSearchName );
- String aTempShortName;
- String aTempFamilyName;
+ OUString aTempShortName;
+ OUString aTempFamilyName;
sal_uLong nTempType = 0;
FontWeight eTempWeight = rFSD.GetWeight();
FontWidth eTempWidth = WIDTH_DONTKNOW;