[Libreoffice-commits] core.git: 43 commits - accessibility/source cui/source editeng/source include/svtools include/vcl padmin/source sc/source sd/source starmath/source svtools/source svx/source sw/source vcl/generic vcl/headless vcl/inc vcl/source vcl/unx
Noel Grandin
noel at peralex.com
Mon Aug 12 03:00:01 PDT 2013
accessibility/source/extended/textwindowaccessibility.cxx | 18 -
cui/source/dialogs/cuigaldlg.cxx | 2
cui/source/factory/dlgfact.cxx | 4
cui/source/factory/dlgfact.hxx | 6
editeng/source/editeng/impedit2.cxx | 2
include/svtools/treelistbox.hxx | 8
include/vcl/FilterConfigItem.hxx | 2
include/vcl/abstdlg.hxx | 6
include/vcl/button.hxx | 6
include/vcl/cmdevt.hxx | 6
include/vcl/field.hxx | 2
include/vcl/fltcall.hxx | 2
include/vcl/font.hxx | 16
include/vcl/graphicfilter.hxx | 70 ++--
include/vcl/i18nhelp.hxx | 6
include/vcl/lstbox.hxx | 97 ++---
include/vcl/menu.hxx | 2
include/vcl/mnemonicengine.hxx | 6
include/vcl/outdev.hxx | 4
include/vcl/pdfextoutdevdata.hxx | 6
include/vcl/ppdparser.hxx | 70 ++--
include/vcl/quickselectionengine.hxx | 4
include/vcl/strhelper.hxx | 6
include/vcl/svapp.hxx | 4
include/vcl/textdata.hxx | 8
include/vcl/texteng.hxx | 54 +--
include/vcl/textview.hxx | 6
include/vcl/unohelp2.hxx | 8
include/vcl/vclmedit.hxx | 2
include/vcl/xtextedt.hxx | 20 -
padmin/source/padialog.cxx | 2
padmin/source/prtsetup.cxx | 8
sc/source/ui/sidebar/CellLineStyleControl.cxx | 18 -
sd/source/ui/unoidl/sddetect.cxx | 2
starmath/source/rect.cxx | 2
svtools/source/contnr/treelistbox.cxx | 8
svtools/source/control/ctrlbox.cxx | 2
svtools/source/control/ctrltool.cxx | 14
svtools/source/graphic/descriptor.cxx | 2
svtools/source/misc/sampletext.cxx | 36 +-
svx/source/core/graphichelper.cxx | 2
svx/source/xoutdev/_xoutbmp.cxx | 2
sw/source/core/inc/swfont.hxx | 8
sw/source/ui/dbui/mmaddressblockpage.cxx | 2
sw/source/ui/shells/annotsh.cxx | 2
sw/source/ui/shells/drwtxtsh.cxx | 2
sw/source/ui/shells/textsh.cxx | 2
vcl/generic/fontmanager/fontcache.cxx | 6
vcl/generic/print/genprnpsp.cxx | 8
vcl/generic/print/genpspgraphics.cxx | 6
vcl/generic/print/printerjob.cxx | 8
vcl/headless/svpprn.cxx | 16
vcl/inc/brdwin.hxx | 26 -
vcl/inc/fontcache.hxx | 2
vcl/inc/fontsubset.hxx | 2
vcl/inc/ilstbox.hxx | 4
vcl/inc/impfont.hxx | 6
vcl/inc/outfont.hxx | 14
vcl/inc/printdlg.hxx | 2
vcl/inc/unx/i18n_status.hxx | 10
vcl/inc/unx/wmadaptor.hxx | 6
vcl/source/app/dbggui.cxx | 8
vcl/source/app/i18nhelp.cxx | 24 -
vcl/source/app/settings.cxx | 2
vcl/source/app/svapp.cxx | 4
vcl/source/app/svdata.cxx | 4
vcl/source/app/unohelp2.cxx | 4
vcl/source/control/combobox.cxx | 8
vcl/source/control/ctrl.cxx | 4
vcl/source/control/edit.cxx | 2
vcl/source/control/field.cxx | 86 ++---
vcl/source/control/field2.cxx | 4
vcl/source/control/fixed.cxx | 4
vcl/source/control/ilstbox.cxx | 10
vcl/source/control/imgctrl.cxx | 4
vcl/source/control/quickselectionengine.cxx | 12
vcl/source/edit/textdata.cxx | 2
vcl/source/edit/textdoc.cxx | 38 +-
vcl/source/edit/textdoc.hxx | 14
vcl/source/edit/texteng.cxx | 159 ++++-----
vcl/source/edit/textundo.cxx | 4
vcl/source/edit/textview.cxx | 74 ++--
vcl/source/edit/vclmedit.cxx | 36 +-
vcl/source/edit/xtextedt.cxx | 22 -
vcl/source/filter/FilterConfigCache.cxx | 116 +++---
vcl/source/filter/FilterConfigCache.hxx | 54 +--
vcl/source/filter/FilterConfigItem.cxx | 2
vcl/source/filter/graphicfilter.cxx | 237 +++++++-------
vcl/source/filter/graphicfilter2.cxx | 34 +-
vcl/source/filter/sgvmain.cxx | 6
vcl/source/filter/sgvmain.hxx | 10
vcl/source/filter/sgvtext.cxx | 4
vcl/source/filter/wmf/emfwr.cxx | 20 -
vcl/source/filter/wmf/emfwr.hxx | 2
vcl/source/filter/wmf/enhwmf.cxx | 23 -
vcl/source/filter/wmf/winmtf.cxx | 10
vcl/source/filter/wmf/winmtf.hxx | 4
vcl/source/filter/wmf/winwmf.cxx | 14
vcl/source/filter/wmf/wmfwr.cxx | 32 -
vcl/source/filter/wmf/wmfwr.hxx | 8
vcl/source/fontsubset/cff.cxx | 2
vcl/source/gdi/bitmapex.cxx | 2
vcl/source/gdi/configsettings.cxx | 16
vcl/source/gdi/cvtsvm.cxx | 12
vcl/source/gdi/font.cxx | 12
vcl/source/gdi/gfxlink.cxx | 2
vcl/source/gdi/impgraph.cxx | 4
vcl/source/gdi/jobset.cxx | 14
vcl/source/gdi/outdev3.cxx | 108 +++---
vcl/source/gdi/pdfextoutdevdata.cxx | 6
vcl/source/gdi/pdfwriter_impl.cxx | 24 -
vcl/source/gdi/pdfwriter_impl2.cxx | 4
vcl/source/gdi/print2.cxx | 6
vcl/source/gdi/print3.cxx | 2
vcl/source/helper/strhelper.cxx | 16
vcl/source/window/abstdlg.cxx | 2
vcl/source/window/brdwin.cxx | 14
vcl/source/window/cmdevt.cxx | 6
vcl/source/window/dlgctrl.cxx | 10
vcl/source/window/menu.cxx | 45 +-
vcl/source/window/mnemonicengine.cxx | 2
vcl/source/window/printdlg.cxx | 16
vcl/source/window/status.cxx | 6
vcl/source/window/toolbox.cxx | 6
vcl/source/window/window.cxx | 46 +-
vcl/source/window/winproc.cxx | 4
vcl/unx/generic/app/i18n_cb.cxx | 4
vcl/unx/generic/app/i18n_ic.cxx | 2
vcl/unx/generic/app/i18n_status.cxx | 35 +-
vcl/unx/generic/app/saldisp.cxx | 42 +-
vcl/unx/generic/app/wmadaptor.cxx | 26 -
vcl/unx/generic/printer/cupsmgr.cxx | 4
vcl/unx/generic/printer/jobdata.cxx | 12
vcl/unx/generic/printer/ppdparser.cxx | 232 ++++++-------
vcl/unx/generic/printer/printerinfomanager.cxx | 34 +-
vcl/unx/generic/window/salframe.cxx | 8
vcl/unx/gtk/window/gtksalframe.cxx | 10
vcl/unx/gtk/window/gtksalmenu.cxx | 4
vcl/unx/kde/UnxFilePicker.cxx | 2
vcl/unx/kde/salnativewidgets-kde.cxx | 2
vcl/unx/kde4/KDE4FilePicker.cxx | 2
vcl/unx/kde4/KDESalFrame.cxx | 2
142 files changed, 1300 insertions(+), 1296 deletions(-)
New commits:
commit 59a5dcb2065c93e2b4bc95207f7f4e362ce3ee08
Author: Noel Grandin <noel at peralex.com>
Date: Mon Aug 12 11:55:56 2013 +0200
-WaE remove unused variables
Change-Id: I30f8175e35d15c8cce0b2e05de7741bb8feba410
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 4eaa1d6..a905cca 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -554,7 +554,6 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
{
const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
- const sal_Int32 nLen = aString.getLength();
if( !aString.isEmpty() )
{
@@ -580,7 +579,6 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
{
const MetaStretchTextAction& rTextAct = static_cast<const MetaStretchTextAction&>(rAct);
const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
- const sal_Int32 nLen = aString.getLength();
// #i16195# Literate copy from TextArray action, the
// semantics for the ImplLayout call are copied from the
commit afc15f40f2e6cb7c5f8979f1da65efd375144d99
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 14:15:08 2013 +0200
convert String to OUString in VCL
Change-Id: Ib5640b2db7963a7a8e8dabb2a8f5e5dc0410edec
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index 1d1a7f6..f25a518 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -513,7 +513,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data)
{
if( call_data->type == XIMTextType )
{
- String aText;
+ OUString aText;
if( call_data->data.text )
{
// XIM with text
@@ -538,7 +538,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data)
}
}
if( nLength )
- aText = String( pMBString, nLength, osl_getThreadTextEncoding() );
+ aText = OUString( pMBString, nLength, osl_getThreadTextEncoding() );
}
::vcl::I18NStatus::get().setStatusText( aText );
}
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index 7fa4e03..14fd5fc 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -47,7 +47,7 @@ static void sendEmptyCommit( SalFrame* pFrame )
SalExtTextInputEvent aEmptyEv;
aEmptyEv.mnTime = 0;
aEmptyEv.mpTextAttr = 0;
- aEmptyEv.maText = String();
+ aEmptyEv.maText = "";
aEmptyEv.mnCursorPos = 0;
aEmptyEv.mnCursorFlags = 0;
aEmptyEv.mnDeltaStart = 0;
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 75b2d2e..c7cf6e4 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -789,23 +789,23 @@ void SalDisplay::ModifierMapping()
OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
{
- String aStrMap;
- String aCustomKeyName;
+ OUString aStrMap;
+ OUString aCustomKeyName;
if( nKeyCode & KEY_MOD1 )
aStrMap += GetKeyNameFromKeySym( nCtrlKeySym_ );
if( nKeyCode & KEY_MOD2 )
{
- if( aStrMap.Len() )
- aStrMap += '+';
+ if( !aStrMap.isEmpty() )
+ aStrMap += "+";
aStrMap += GetKeyNameFromKeySym( nMod1KeySym_ );
}
if( nKeyCode & KEY_SHIFT )
{
- if( aStrMap.Len() )
- aStrMap += '+';
+ if( !aStrMap.isEmpty() )
+ aStrMap += "+";
aStrMap += GetKeyNameFromKeySym( nShiftKeySym_ );
}
nKeyCode &= 0x0FFF;
@@ -903,10 +903,10 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
nKeySym = GetServerVendor() == vendor_sun ? SunXK_Cut : XK_L10;
break;
case KEY_ADD:
- aCustomKeyName = '+';
+ aCustomKeyName = "+";
break;
case KEY_SUBTRACT:
- aCustomKeyName = '-';
+ aCustomKeyName = "-";
break;
case KEY_MULTIPLY:
nKeySym = XK_asterisk;
@@ -915,7 +915,7 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
nKeySym = XK_slash;
break;
case KEY_POINT:
- aCustomKeyName = '.';
+ aCustomKeyName = ".";
break;
case KEY_COMMA:
nKeySym = XK_comma;
@@ -942,13 +942,13 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
nKeySym = XK_grave;
break;
case KEY_BRACKETLEFT:
- aCustomKeyName = '[';
+ aCustomKeyName = "[";
break;
case KEY_BRACKETRIGHT:
- aCustomKeyName = ']';
+ aCustomKeyName = "]";
break;
case KEY_SEMICOLON:
- aCustomKeyName = ';';
+ aCustomKeyName = ";";
break;
default:
@@ -958,26 +958,26 @@ OUString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
if( nKeySym )
{
- String aKeyName = GetKeyNameFromKeySym( nKeySym );
- if( aKeyName.Len() )
+ OUString aKeyName = GetKeyNameFromKeySym( nKeySym );
+ if( !aKeyName.isEmpty() )
{
- if( aStrMap.Len() )
- aStrMap += '+';
+ if( !aStrMap.isEmpty() )
+ aStrMap += "+";
aStrMap += aKeyName;
}
else
- aStrMap.Erase();
+ aStrMap = "";
}
- else if (aCustomKeyName.Len())
+ else if (!aCustomKeyName.isEmpty())
{
// For semicolumn, bracket left and bracket right, it's better to use
// their keys than their names. (fdo#32891)
- if (aStrMap.Len())
- aStrMap += '+';
+ if (!aStrMap.isEmpty())
+ aStrMap += "+";
aStrMap += aCustomKeyName;
}
else
- aStrMap.Erase();
+ aStrMap = "";
return aStrMap;
}
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 8510196..e386d3d 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -517,7 +517,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
if( ! pNewParser )
{
// get the default PPD
- pNewParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) );
+ pNewParser = PPDParser::getParser( OUString( "SGENPRT" ) );
PrinterInfo& rInfo = m_aPrinters[ aPrinter ].m_aInfo;
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index d40fffd..47bb0f4 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -57,17 +57,17 @@ void JobData::setCollate( bool bCollate )
const PPDParser* pParser = m_aContext.getParser();
if( pParser )
{
- const PPDKey* pKey = pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) );
+ const PPDKey* pKey = pParser->getKey( OUString( "Collate" ) );
if( pKey )
{
const PPDValue* pVal = NULL;
if( bCollate )
- pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) );
+ pVal = pKey->getValue( OUString( "True" ) );
else
{
- pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "False" ) ) );
+ pVal = pKey->getValue( OUString( "False" ) );
if( ! pVal )
- pVal = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
+ pVal = pKey->getValue( OUString( "None" ) );
}
m_aContext.setValue( pKey, pVal );
}
@@ -81,7 +81,7 @@ bool JobData::setPaper( int i_nWidth, int i_nHeight )
{
OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
- const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDKey* pKey = m_pParser->getKey( OUString( "PageSize" ) );
const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
@@ -94,7 +94,7 @@ bool JobData::setPaperBin( int i_nPaperBin )
bool bSuccess = false;
if( m_pParser )
{
- const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ const PPDKey* pKey = m_pParser->getKey( OUString( "InputSlot" ) );
const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL;
bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index f3e7dc8..4e53c82 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -230,7 +230,7 @@ void PrinterInfoManager::initialize()
m_aGlobalDefaults = PrinterInfo();
// need a parser for the PPDContext. generic printer should do.
- m_aGlobalDefaults.m_pParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) );
+ m_aGlobalDefaults.m_pParser = PPDParser::getParser( OUString( "SGENPRT" ) );
m_aGlobalDefaults.m_aContext.setParser( m_aGlobalDefaults.m_pParser );
m_aGlobalDefaults.m_bPerformFontSubstitution = true;
m_bDisableCUPS = false;
@@ -249,7 +249,7 @@ void PrinterInfoManager::initialize()
for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it )
{
INetURLObject aFile( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
- aFile.Append( String( RTL_CONSTASCII_USTRINGPARAM( PRINT_FILENAME ) ) );
+ aFile.Append( OUString( PRINT_FILENAME ) );
Config aConfig( aFile.PathToFileName() );
if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) )
{
@@ -346,7 +346,7 @@ void PrinterInfoManager::initialize()
{
INetURLObject aDir( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
INetURLObject aFile( aDir );
- aFile.Append( String( RTL_CONSTASCII_USTRINGPARAM( PRINT_FILENAME ) ) );
+ aFile.Append( OUString( PRINT_FILENAME ) );
// check directory validity
OUString aUniPath;
@@ -578,8 +578,8 @@ void PrinterInfoManager::initialize()
// merge paper and font substitution from default printer,
// all else from global defaults
PrinterInfo aMergeInfo( m_aGlobalDefaults );
- aMergeInfo.m_aDriverName = String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) );
- aMergeInfo.m_aFeatures = String( RTL_CONSTASCII_USTRINGPARAM( "autoqueue" ) );
+ aMergeInfo.m_aDriverName = "SGENPRT";
+ aMergeInfo.m_aFeatures = "autoqueue";
if( !m_aDefaultPrinter.isEmpty() )
{
@@ -587,8 +587,8 @@ void PrinterInfoManager::initialize()
aMergeInfo.m_bPerformFontSubstitution = aDefaultInfo.m_bPerformFontSubstitution;
fillFontSubstitutions( aMergeInfo );
- const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
- const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( OUString( "PageSize" ) );
+ const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( OUString( "PageSize" ) );
const PPDValue* pDefValue = aDefaultInfo.m_aContext.getValue( pDefKey );
const PPDValue* pMergeValue = pMergeKey ? pMergeKey->getValue( pDefValue->m_aOption ) : NULL;
if( pMergeKey && pMergeValue )
@@ -598,16 +598,16 @@ void PrinterInfoManager::initialize()
getSystemPrintQueues();
for( ::std::list< SystemPrintQueue >::iterator it = m_aSystemPrintQueues.begin(); it != m_aSystemPrintQueues.end(); ++it )
{
- String aPrinterName( RTL_CONSTASCII_USTRINGPARAM( "<" ) );
- aPrinterName += String( it->m_aQueue );
- aPrinterName.Append( '>' );
+ OUString aPrinterName( "<" );
+ aPrinterName += it->m_aQueue;
+ aPrinterName += ">";
if( m_aPrinters.find( aPrinterName ) != m_aPrinters.end() )
// probably user made this one permanent in padmin
continue;
- String aCmd( m_aSystemPrintCommand );
- aCmd.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) ), it->m_aQueue );
+ OUString aCmd( m_aSystemPrintCommand );
+ aCmd = aCmd.replaceAll( "(PRINTER)", it->m_aQueue );
Printer aPrinter;
@@ -1070,11 +1070,11 @@ void PrinterInfoManager::getSystemPrintCommands( std::list< OUString >& rCommand
std::list< SystemPrintQueue >::const_iterator it;
rCommands.clear();
- String aPrinterConst( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) );
+ OUString aPrinterConst( "(PRINTER)" );
for( it = m_aSystemPrintQueues.begin(); it != m_aSystemPrintQueues.end(); ++it )
{
- String aCmd( m_aSystemPrintCommand );
- aCmd.SearchAndReplace( aPrinterConst, it->m_aQueue );
+ OUString aCmd( m_aSystemPrintCommand );
+ aCmd = aCmd.replaceAll( aPrinterConst, it->m_aQueue );
rCommands.push_back( aCmd );
}
}
@@ -1138,7 +1138,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const
if( ! rContext.getParser() )
return;
- const PPDKey* pPageSizeKey = rContext.getParser()->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDKey* pPageSizeKey = rContext.getParser()->getKey( OUString( "PageSize" ) );
if( ! pPageSizeKey )
return;
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index bff9da2..fd6aa07 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3907,7 +3907,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit()
SalExtTextInputEvent aEmptyEv;
aEmptyEv.mnTime = 0;
aEmptyEv.mpTextAttr = 0;
- aEmptyEv.maText = String();
+ aEmptyEv.maText = "";
aEmptyEv.mnCursorPos = 0;
aEmptyEv.mnCursorFlags = 0;
aEmptyEv.mnDeltaStart = 0;
@@ -4100,7 +4100,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
pThis->m_aInputEvent.mnTime = 0;
pThis->m_aInputEvent.mpTextAttr = 0;
- pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
+ pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 );
pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.getLength();
pThis->m_aInputEvent.mnCursorFlags = 0;
pThis->m_aInputEvent.mnDeltaStart = 0;
@@ -4144,7 +4144,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
if( ! aDel.isDeleted() )
{
// reset input event
- pThis->m_aInputEvent.maText = String();
+ pThis->m_aInputEvent.maText = "";
pThis->m_aInputEvent.mnCursorPos = 0;
pThis->updateIMSpotLocation();
}
@@ -4187,7 +4187,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL;
pThis->m_aInputEvent.mnTime = 0;
- pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
+ pThis->m_aInputEvent.maText = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 );
pThis->m_aInputEvent.mnCursorPos = nCursorPos;
pThis->m_aInputEvent.mnCursorFlags = 0;
pThis->m_aInputEvent.mnDeltaStart = 0;
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index c601af1..d224704 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -299,7 +299,7 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
g_lo_menu_insert_in_section( pLOMenu, nSection, nItemPos, "EMPTY STRING" );
// Get internal menu item values.
- String aText = pVCLMenu->GetItemText( nId );
+ OUString aText = pVCLMenu->GetItemText( nId );
sal_Bool itemEnabled = pVCLMenu->IsItemEnabled( nId );
KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId );
sal_Bool itemChecked = pVCLMenu->IsItemChecked( nId );
@@ -658,7 +658,7 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub
{
GtkSalMenuItem *pSalItem = maItems[ nPos ];
- String aItemCommand = mpVCLMenu->GetItemCommand( pSalItem->mnId );
+ OUString aItemCommand = mpVCLMenu->GetItemCommand( pSalItem->mnId );
gchar* aItemCommandStr = (gchar*) OUStringToOString( aItemCommand, RTL_TEXTENCODING_UTF8 ).getStr();
if ( g_strcmp0( aItemCommandStr, aCommand ) == 0 )
diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx
index 706d095..481ca96 100644
--- a/vcl/unx/kde/UnxFilePicker.cxx
+++ b/vcl/unx/kde/UnxFilePicker.cxx
@@ -918,7 +918,7 @@ void UnxFilePicker::sendAppendControlCommand( sal_Int16 nControlId )
aBuffer.appendAscii( " ", 1 );
appendEscaped( aBuffer, aType );
aBuffer.appendAscii( " ", 1 );
- appendEscaped( aBuffer, m_pResMgr? String( ResId( nTitleId, *m_pResMgr ) ): String() );
+ appendEscaped( aBuffer, m_pResMgr? OUString( ResId( nTitleId, *m_pResMgr ) ): OUString() );
sendCommand( aBuffer.makeStringAndClear() );
}
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index e1923ac..dfbdb42 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1765,7 +1765,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
QFontInfo qFontInfo( rQFont );
// set family name
- aInfo.m_aFamilyName = String( rQFont.family().utf8(), RTL_TEXTENCODING_UTF8 );
+ aInfo.m_aFamilyName = OUString( rQFont.family().utf8(), strlen( rQFont.family().utf8() ), RTL_TEXTENCODING_UTF8 );
// set italic
aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE );
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index e76c752..6ffb013 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -549,7 +549,7 @@ void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
if (_resMgr && resId != -1)
{
- OUString s = String(ResId( resId, *_resMgr ));
+ OUString s(ResId( resId, *_resMgr ));
label = toQString(s);
label.replace("~", "&");
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index be1fb61..71f9c56 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -90,7 +90,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
QFontInfo qFontInfo( rQFont );
// set family name
- aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 );
+ aInfo.m_aFamilyName = OUString( (const char *) rQFont.family().toUtf8(), strlen( (const char *) rQFont.family().toUtf8() ), RTL_TEXTENCODING_UTF8 );
// set italic
aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE );
commit db3f16317e0b0f931fdfcb6f19f8cc474bd70683
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 14:03:59 2013 +0200
convert String to OUString in VCL
Change-Id: Ie5c6874298641dc6fc1b6b4e2206a704acd7cc10
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index 6ecba23..f50db9a 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -97,7 +97,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->mnPaperBin = 0xffff;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( "InputSlot" ) );
+ pKey = rData.m_pParser->getKey( OUString( "InputSlot" ) );
if( pKey )
pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
@@ -117,7 +117,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( "Duplex" ) );
+ pKey = rData.m_pParser->getKey( OUString( "Duplex" ) );
if( pKey )
pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
@@ -231,8 +231,8 @@ void SvpSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
- String aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( aToken.CompareToAscii( "pdf=", 4 ) == COMPARE_EQUAL )
+ OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
+ if( aToken.startsWith( "pdf=" ) )
{
pInfo->maLocation = getPdfDir( rInfo );
break;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index c5de9ca..16841ec 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -527,9 +527,9 @@ void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRec
if ( !_pVector )
{
static MetricVector aCharRects;
- static String sDisplayText;
+ static OUString sDisplayText;
aCharRects.clear();
- sDisplayText = String();
+ sDisplayText = OUString();
_pVector = &aCharRects;
_pDisplayText = &sDisplayText;
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 7891e63..12d15a2 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1035,13 +1035,13 @@ static sal_uInt16 ImplCutMonthFromString( OUString& rStr, const CalendarWrapper&
// search for a month' name
for ( sal_uInt16 i=1; i <= 12; i++ )
{
- String aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
+ OUString aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
// long month name?
if ( ImplCutMonthName( rStr, aMonthName ) )
return i;
// short month name?
- String aAbbrevMonthName = rCalendarWrapper.getMonths()[i-1].AbbrevName;
+ OUString aAbbrevMonthName = rCalendarWrapper.getMonths()[i-1].AbbrevName;
if ( ImplCutMonthName( rStr, aAbbrevMonthName ) )
return i;
}
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index a7a1ba8..267bdcc 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -577,13 +577,13 @@ void FixedLine::ImplInitSettings( sal_Bool bFont,
void FixedLine::ImplDraw( bool bLayout )
{
Size aOutSize = GetOutputSizePixel();
- String aText = GetText();
+ OUString aText = GetText();
WinBits nWinStyle = GetStyle();
MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() )
+ if ( aText.isEmpty() )
{
if( !pVector )
{
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index cdc71fa..5b41fc6 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -99,8 +99,8 @@ void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Poi
const Rectangle aDrawRect( rPos, rSize );
if ( !*pImage )
{
- String sText( GetText() );
- if ( !sText.Len() )
+ OUString sText( GetText() );
+ if ( sText.isEmpty() )
return;
WinBits nWinStyle = GetStyle();
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 96ca07c..922cf18 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -119,9 +119,9 @@ public:
sal_Bool IsInsertMode() const;
- void InsertText( const String& rStr );
- String GetSelected() const;
- String GetSelected( LineEnd aSeparator ) const;
+ void InsertText( const OUString& rStr );
+ OUString GetSelected() const;
+ OUString GetSelected( LineEnd aSeparator ) const;
void SetSelection( const Selection& rSelection );
const Selection& GetSelection() const;
@@ -132,8 +132,8 @@ public:
void SetText( const OUString& rStr );
OUString GetText() const;
- String GetText( LineEnd aSeparator ) const;
- String GetTextLines( LineEnd aSeparator ) const;
+ OUString GetText( LineEnd aSeparator ) const;
+ OUString GetTextLines( LineEnd aSeparator ) const;
void Resize();
void GetFocus();
@@ -387,17 +387,17 @@ xub_StrLen ImpVclMEdit::GetMaxTextLen() const
mpTextWindow->GetTextEngine()->GetMaxTextLen());
}
-void ImpVclMEdit::InsertText( const String& rStr )
+void ImpVclMEdit::InsertText( const OUString& rStr )
{
mpTextWindow->GetTextView()->InsertText( rStr );
}
-String ImpVclMEdit::GetSelected() const
+OUString ImpVclMEdit::GetSelected() const
{
return mpTextWindow->GetTextView()->GetSelected();
}
-String ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextView()->GetSelected( aSeparator );
}
@@ -510,12 +510,12 @@ OUString ImpVclMEdit::GetText() const
return mpTextWindow->GetTextEngine()->GetText();
}
-String ImpVclMEdit::GetText( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetText( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextEngine()->GetText( aSeparator );
}
-String ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
+OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
{
return mpTextWindow->GetTextEngine()->GetTextLines( aSeparator );
}
@@ -567,17 +567,17 @@ void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
void ImpVclMEdit::SetSelection( const Selection& rSelection )
{
- String aText = mpTextWindow->GetTextEngine()->GetText();
+ OUString aText = mpTextWindow->GetTextEngine()->GetText();
Selection aNewSelection( rSelection );
if ( aNewSelection.Min() < 0 )
aNewSelection.Min() = 0;
- else if ( aNewSelection.Min() > aText.Len() )
- aNewSelection.Min() = aText.Len();
+ else if ( aNewSelection.Min() > aText.getLength() )
+ aNewSelection.Min() = aText.getLength();
if ( aNewSelection.Max() < 0 )
aNewSelection.Max() = 0;
- else if ( aNewSelection.Max() > aText.Len() )
- aNewSelection.Max() = aText.Len();
+ else if ( aNewSelection.Max() > aText.getLength() )
+ aNewSelection.Max() = aText.getLength();
long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
@@ -591,7 +591,7 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection )
if ( x == aNewSelection.Max() )
aTextSel.GetEnd() = TextPaM( nPara, nChar );
- if ( ( x < aText.Len() ) && ( aText.GetChar( x ) == '\n' ) )
+ if ( ( x < aText.getLength() ) && ( aText[ x ] == '\n' ) )
{
nPara++;
nChar = 0;
@@ -1137,7 +1137,7 @@ void VclMultiLineEdit::ReplaceSelected( const OUString& rStr )
void VclMultiLineEdit::DeleteSelected()
{
- pImpVclMEdit->InsertText( String() );
+ pImpVclMEdit->InsertText( OUString() );
}
OUString VclMultiLineEdit::GetSelected() const
diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx
index ceec23c..8de09ac 100644
--- a/vcl/source/edit/xtextedt.cxx
+++ b/vcl/source/edit/xtextedt.cxx
@@ -360,10 +360,10 @@ sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight )
else
{
// remove Tabs/Blanks
- String aText = GetTextEngine()->GetText( nPara );
- if ( aText.Len() && (
- ( aText.GetChar( 0 ) == '\t' ) ||
- ( aText.GetChar( 0 ) == ' ' ) ) )
+ OUString aText = GetTextEngine()->GetText( nPara );
+ if ( !aText.isEmpty() && (
+ ( aText[ 0 ] == '\t' ) ||
+ ( aText[ 0 ] == ' ' ) ) )
{
GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
bDone = sal_True;
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index 6f9a79f..bc3cc48 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -708,10 +708,10 @@ void BmapType::Draw(OutputDevice& rOut)
{
//ifstream aInp;
unsigned char nSgfTyp;
- sal_uInt16 nVersion;
- String aStr(
+ sal_uInt16 nVersion;
+ OUString aStr(
reinterpret_cast< char const * >(&Filename[ 1 ]),
- (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
+ (sal_Int32)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
INetURLObject aFNam( aStr );
SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 43e397c..e94fcb9 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -2330,7 +2330,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
rFSInfo.m_nCapHeight = rFSInfo.m_nAscent; // for top-flat capital letters
rFSInfo.m_nFontType = rEmitter.mbPfbSubset ? FontSubsetInfo::TYPE1_PFB : FontSubsetInfo::TYPE1_PFA;
- rFSInfo.m_aPSName = String( rEmitter.maSubsetName, RTL_TEXTENCODING_UTF8 );
+ rFSInfo.m_aPSName = OUString( rEmitter.maSubsetName, strlen(rEmitter.maSubsetName), RTL_TEXTENCODING_UTF8 );
return true;
}
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index b7dbf75..c1f141e 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -94,7 +94,7 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
pResMgr->ReadLong();
pResMgr->ReadLong();
- const String aFileName( pResMgr->ReadString() );
+ const OUString aFileName( pResMgr->ReadString() );
OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this, true ) )
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index 30b6f46..9b6dcdd 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -68,7 +68,7 @@ void SettingsConfigItem::Commit()
for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
{
- String aKeyName( group->first );
+ OUString aKeyName( group->first );
/*sal_Bool bAdded =*/ AddNode( OUString(), aKeyName );
Sequence< PropertyValue > aValues( group->second.size() );
PropertyValue* pValues = aValues.getArray();
@@ -76,9 +76,9 @@ void SettingsConfigItem::Commit()
SmallOUStrMap::const_iterator it;
for( it = group->second.begin(); it != group->second.end(); ++it )
{
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( it->first ) );
+ OUString aName( aKeyName );
+ aName += OUString('/');
+ aName += it->first;
pValues[nIndex].Name = aName;
pValues[nIndex].Handle = 0;
pValues[nIndex].Value <<= it->second;
@@ -110,16 +110,16 @@ void SettingsConfigItem::getValues()
OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
);
#endif
- String aKeyName( aNames.getConstArray()[j] );
+ OUString aKeyName( aNames.getConstArray()[j] );
Sequence< OUString > aKeys( GetNodeNames( aKeyName ) );
Sequence< OUString > aSettingsKeys( aKeys.getLength() );
const OUString* pFrom = aKeys.getConstArray();
OUString* pTo = aSettingsKeys.getArray();
for( int m = 0; m < aKeys.getLength(); m++ )
{
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( pFrom[m] ) );
+ OUString aName( aKeyName );
+ aName += OUString('/');
+ aName += pFrom[m];
pTo[m] = aName;
}
Sequence< Any > aValues( GetProperties( aSettingsKeys ) );
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 2334004..60fef66 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -258,9 +258,9 @@ void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
rOStm << (sal_Int16) GDI_RASTEROP_ACTION << (sal_Int32) 6 << nRasterOp;
}
-sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const String& rString )
+sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const OUString& rString )
{
- xub_StrLen nStringLen = rString.Len();
+ sal_Int32 nStringLen = rString.getLength();
if ( nStringLen )
{
sal_uInt32 nSize = ( nStringLen << 1 ) + 4;
@@ -786,7 +786,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
rIStm.Read( aName, 32 );
- aFont.SetName( String( aName, rIStm.GetStreamCharSet() ) );
+ aFont.SetName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) );
rIStm >> nWidth >> nHeight;
rIStm >> nCharOrient >> nLineOrient;
rIStm >> nCharSet >> nFamily >> nPitch >> nAlign >> nWeight >> nUnderline >> nStrikeout;
@@ -1681,7 +1681,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXT_ACTION ):
{
MetaTextAction* pAct = (MetaTextAction*) pAction;
- String aUniText( pAct->GetText() );
+ OUString aUniText( pAct->GetText() );
OString aText(OUStringToOString(aUniText,
rActualCharSet));
const sal_uLong nStrLen = aText.getLength();
@@ -1705,7 +1705,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction;
OString aText(OUStringToOString(pAct->GetText(),
rActualCharSet));
- String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() );
+ OUString aUniText = pAct->GetText().copy( pAct->GetIndex(), pAct->GetLen() );
sal_uLong nAryLen;
sal_uLong nLen = pAct->GetLen();
const sal_uLong nTextLen = aText.getLength();
@@ -1746,7 +1746,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_STRETCHTEXT_ACTION ):
{
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
- String aUniText( pAct->GetText() );
+ OUString aUniText( pAct->GetText() );
OString aText(OUStringToOString(aUniText,
rActualCharSet));
const sal_uLong nStrLen = aText.getLength();
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index e9de2a6..4dc576f 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -350,7 +350,7 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
if( bError )
{
osl_removeFile( maURL.pData );
- maURL = String();
+ maURL = "";
}
}
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6ef8d63..df6de2a 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1404,14 +1404,14 @@ sal_Bool ImpGraphic::ImplSwapIn()
if( ImplIsSwapOut() )
{
- String aSwapURL;
+ OUString aSwapURL;
if( mpSwapFile )
aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE );
else
aSwapURL = maDocFileURLStr;
- if( aSwapURL.Len() )
+ if( !aSwapURL.isEmpty() )
{
SvStream* pIStm = NULL;
try
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index e1e3e9b..868cabe 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -293,17 +293,17 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen );
while( rIStream.Tell() < nFirstPos + nLen )
{
- String aKey = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
- String aValue = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
- if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) )
+ OUString aKey = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
+ OUString aValue = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8);
+ if( aKey.equalsAscii( "COMPAT_DUPLEX_MODE" ) )
{
- if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) )
+ if( aValue.equalsAscii( "DUPLEX_UNKNOWN" ) )
pJobData->meDuplexMode = DUPLEX_UNKNOWN;
- else if( aValue.EqualsAscii( "DUPLEX_OFF" ) )
+ else if( aValue.equalsAscii( "DUPLEX_OFF" ) )
pJobData->meDuplexMode = DUPLEX_OFF;
- else if( aValue.EqualsAscii( "DUPLEX_SHORTEDGE" ) )
+ else if( aValue.equalsAscii( "DUPLEX_SHORTEDGE" ) )
pJobData->meDuplexMode = DUPLEX_SHORTEDGE;
- else if( aValue.EqualsAscii( "DUPLEX_LONGEDGE" ) )
+ else if( aValue.equalsAscii( "DUPLEX_LONGEDGE" ) )
pJobData->meDuplexMode = DUPLEX_LONGEDGE;
}
else
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index af46ba0..ed0acd8 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -151,14 +151,14 @@ void doTestCode()
aWriter.SetLineColor( Color( COL_LIGHTGREEN ) );
aWriter.DrawRect( Rectangle( Point( 2000, 200 ), Size( 8000, 3000 ) ), 5000, 2000 );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aWriter.SetLineColor( Color( COL_BLACK ) );
aWriter.SetFillColor( Color( COL_LIGHTBLUE ) );
Rectangle aRect( Point( 5000, 5000 ), Size( 6000, 3000 ) );
aWriter.DrawRect( aRect );
- aWriter.DrawText( aRect, String( "Link annot 1" ) );
+ aWriter.DrawText( aRect, OUString( "Link annot 1" ) );
sal_Int32 nFirstLink = aWriter.CreateLink( aRect );
PDFNote aNote;
aNote.Title = "A small test note";
@@ -199,7 +199,7 @@ void doTestCode()
aWriter.SetPageTransition( PDFWriter::WipeRightToLeft, 1500 );
aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.DrawText( Rectangle( Point( 4500, 1500 ), Size( 12000, 3000 ) ),
"Here's where all things come to an end ... well at least the paragaph from the last page.",
TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK
@@ -326,7 +326,7 @@ void doTestCode()
aWriter.NewPage( 595, 842 );
aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
- aWriter.SetFont( Font( String( "Times" ), Size( 0, 500 ) ) );
+ aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aRect = Rectangle( Point( 4500, 6000 ), Size( 6000, 1500 ) );
aWriter.DrawRect( aRect );
@@ -397,7 +397,7 @@ void doTestCode()
aRB1.BorderColor = Color( COL_LIGHTGREEN );
aRB1.BackgroundColor = Color( COL_LIGHTBLUE );
aRB1.TextColor = Color( COL_LIGHTRED );
- aRB1.TextFont = Font( String( "Courier" ), Size( 0, 800 ) );
+ aRB1.TextFont = Font( OUString( "Courier" ), Size( 0, 800 ) );
aWriter.CreateControl( aRB1 );
PDFWriter::RadioButtonWidget aRB2;
@@ -1757,7 +1757,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
m_aStructure[0].m_nParentElement = 0;
Font aFont;
- aFont.SetName( String( "Times" ) );
+ aFont.SetName( OUString( "Times" ) );
aFont.SetSize( Size( 0, 12 ) );
GraphicsState aState;
@@ -2310,7 +2310,7 @@ void PDFWriterImpl::endPage()
// reset the default font
Font aFont;
- aFont.SetName( String( "Times" ) );
+ aFont.SetName( OUString( "Times" ) );
aFont.SetSize( Size( 0, 12 ) );
m_aCurrentPDFState = m_aGraphicsStack.front();
@@ -4713,7 +4713,7 @@ void PDFWriterImpl::createDefaultPushButtonAppearance( PDFWidget& rButton, const
// (that is before endRedirect())
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetButtonTextColor() ), aDA );
- Font aDummyFont( String( "Helvetica" ), aFont.GetSize() );
+ Font aDummyFont( OUString( "Helvetica" ), aFont.GetSize() );
sal_Int32 nDummyBuiltin = getBestBuiltinFont( aDummyFont );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nDummyBuiltin].getNameObject() );
@@ -4975,7 +4975,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
- sal_Int32 nBest = getBestBuiltinFont( Font( String( "ZapfDingbats" ), aFont.GetSize() ) );
+ sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( " 0 Tf" );
@@ -5100,7 +5100,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
OStringBuffer aDA( 256 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
- sal_Int32 nBest = getBestBuiltinFont( Font( String( "ZapfDingbats" ), aFont.GetSize() ) );
+ sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) );
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( " 0 Tf" );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index c814b05..2c3df15 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -834,14 +834,14 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
case( META_TEXT_ACTION ):
{
const MetaTextAction* pA = (const MetaTextAction*) pAction;
- m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ m_rOuterFace.DrawText( pA->GetPoint(), pA->GetText().copy( pA->GetIndex(), pA->GetLen() ) );
}
break;
case( META_TEXTRECT_ACTION ):
{
const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ m_rOuterFace.DrawText( pA->GetRect(), pA->GetText(), pA->GetStyle() );
}
break;
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index a3f976b..366caa80 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -510,7 +510,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
if( pJobNameVal )
pJobNameVal->Value >>= aJobName;
- pController->getPrinter()->StartJob( String( aJobName ), pController );
+ pController->getPrinter()->StartJob( aJobName, pController );
pController->resetPaperToLastConfigured();
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx
index 8e0af16..9b1e59a 100644
--- a/vcl/source/window/abstdlg.cxx
+++ b/vcl/source/window/abstdlg.cxx
@@ -36,7 +36,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
FuncPtrCreateDialogFactory fp = 0;
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( CUI_DLL_NAME ),
+ if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, OUString( CUI_DLL_NAME ),
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = ( VclAbstractDialogFactory* (SAL_CALL*)() )
aDialogLibrary.getFunctionSymbol( OUString("CreateDialogFactory") );
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index c623130..7a4946d 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1115,15 +1115,15 @@ Window* Window::GetParentLabeledBy( const Window* ) const
// -----------------------------------------------------------------------
-static sal_Unicode getAccel( const String& rStr )
+static sal_Unicode getAccel( const OUString& rStr )
{
sal_Unicode nChar = 0;
- sal_uInt16 nPos = 0;
+ sal_Int32 nPos = 0;
do
{
- nPos = rStr.Search( '~', nPos );
- if( nPos != STRING_NOTFOUND && nPos < rStr.Len() )
- nChar = rStr.GetChar( ++nPos );
+ nPos = rStr.indexOf( '~', nPos );
+ if( nPos != -1 && nPos < rStr.getLength() )
+ nChar = rStr[ ++nPos ];
else
nChar = 0;
} while( nChar == '~' );
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 07f13e5..5b263c2 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -832,16 +832,16 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- String aCommand = GetItemCommand( nItemId );
+ OUString aCommand = GetItemCommand( nItemId );
OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || !aHelpId.isEmpty() )
+ if ( !aCommand.isEmpty() || !aHelpId.isEmpty() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( aCommand.Len() )
+ if ( !aCommand.isEmpty() )
pHelp->Start( aCommand, this );
else if ( !aHelpId.isEmpty() )
pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 8e9889b..8a83ece 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4326,16 +4326,16 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- String aCommand = GetItemCommand( nItemId );
+ OUString aCommand = GetItemCommand( nItemId );
OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || !aHelpId.isEmpty() )
+ if ( !aCommand.isEmpty() || !aHelpId.isEmpty() )
{
// If help is available then trigger it
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( aCommand.Len() )
+ if ( !aCommand.isEmpty() )
pHelp->Start( aCommand, this );
else if ( !aHelpId.isEmpty() )
pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fe0cd52..dec55d1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -409,7 +409,7 @@ bool Window::ImplCheckUIFont( const Font& rFont )
return true;
// create a text string using the localized text of important buttons
- String aTestText;
+ OUString aTestText;
static const StandardButtonType aTestButtons[] =
{
BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT,
@@ -420,13 +420,13 @@ bool Window::ImplCheckUIFont( const Font& rFont )
const int nTestButtonCount = SAL_N_ELEMENTS(aTestButtons);
for( int n = 0; n < nTestButtonCount; ++n )
{
- String aButtonStr = Button::GetStandardText( aTestButtons[n] );
+ OUString aButtonStr = Button::GetStandardText( aTestButtons[n] );
// #i115432# ignore mnemonic+accelerator part of each string
// TODO: use a string filtering method when it becomes available
- const int nLen = aButtonStr.Len();
+ const sal_Int32 nLen = aButtonStr.getLength();
bool bInside = false;
for( int i = 0; i < nLen; ++i ) {
- const sal_Unicode c = aButtonStr.GetChar( i );
+ const sal_Unicode c = aButtonStr[ i ];
if( (c == '('))
bInside = true;
if( (c == ')'))
@@ -434,14 +434,14 @@ bool Window::ImplCheckUIFont( const Font& rFont )
if( (c == '~')
|| (c == '(') || (c == ')')
|| ((c >= 'A') && (c <= 'Z') && bInside) )
- aButtonStr.SetChar( i, ' ' );
+ aButtonStr = aButtonStr.replaceAt( i, 1, " " );
}
// append sanitized button text to test string
- aTestText.Append( aButtonStr );
+ aTestText += aButtonStr;
}
const int nFirstChar = HasGlyphs( rFont, aTestText );
- const bool bUIFontOk = (nFirstChar >= aTestText.Len());
+ const bool bUIFontOk = (nFirstChar >= aTestText.getLength());
return bUIFontOk;
}
@@ -460,7 +460,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
// WTF, what makes Andale Sans UI a suitable cross-platform fallback font?
- String aUserInterfaceFont;
+ OUString aUserInterfaceFont;
bool bUseSystemFont = rSettings.GetStyleSettings().GetUseSystemUIFonts();
// check whether system UI font can display a typical UI text
@@ -470,27 +470,27 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
if ( !bUseSystemFont )
{
ImplInitFontList();
- String aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag() );
+ OUString aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag() );
sal_Int32 nIndex = 0;
while( nIndex != -1 )
{
- String aName( aConfigFont.GetToken( 0, ';', nIndex ) );
- if ( aName.Len() && mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aName ) )
+ OUString aName( aConfigFont.getToken( 0, ';', nIndex ) );
+ if ( !aName.isEmpty() && mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aName ) )
{
aUserInterfaceFont = aConfigFont;
break;
}
}
- if ( ! aUserInterfaceFont.Len() )
+ if ( aUserInterfaceFont.isEmpty() )
{
- String aFallbackFont ("Andale Sans UI" );
+ OUString aFallbackFont ("Andale Sans UI" );
if ( mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aFallbackFont ) )
aUserInterfaceFont = aFallbackFont;
}
}
- if ( !bUseSystemFont && aUserInterfaceFont.Len() )
+ if ( !bUseSystemFont && !aUserInterfaceFont.isEmpty() )
{
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
Font aFont = aStyleSettings.GetAppFont();
@@ -4925,23 +4925,23 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
if ( ImplGetParent() && !ImplIsOverlapWindow() )
aPos = ImplGetParent()->OutputToScreenPixel( aPos );
Rectangle aRect( aPos, GetSizePixel() );
- String aHelpText;
- if ( rStr.getLength() )
+ OUString aHelpText;
+ if ( !rStr.isEmpty() )
aHelpText = GetHelpText();
Help::ShowQuickHelp( this, aRect, rStr, aHelpText, QUICKHELP_CTRLTEXT );
}
}
else
{
- String aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
- if ( aStrHelpId.Len() == 0 && ImplGetParent() )
+ OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.isEmpty() && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( aStrHelpId.Len() > 0 )
+ if( !aStrHelpId.isEmpty() )
pHelp->Start( aStrHelpId, this );
else
pHelp->Start( OUString( OOO_HELP_INDEX ), this );
@@ -7917,7 +7917,7 @@ void Window::SetText( const OUString& rStr )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- String oldTitle( mpWindowImpl->maText );
+ OUString oldTitle( mpWindowImpl->maText );
mpWindowImpl->maText = rStr;
if ( mpWindowImpl->mpBorderWindow )
@@ -7993,8 +7993,8 @@ const OUString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- String aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
- bool bStrHelpId = (aStrHelpId.Len() > 0);
+ OUString aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ bool bStrHelpId = !aStrHelpId.isEmpty();
if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId )
{
@@ -9006,7 +9006,7 @@ void Window::SetAccessibleDescription( const OUString& rDescription )
OUString Window::GetAccessibleDescription() const
{
- String aAccessibleDescription;
+ OUString aAccessibleDescription;
if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleDescription )
{
aAccessibleDescription = *mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a5bc661..052395d 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -968,8 +968,8 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() )
{
- String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
- nCharCode = (sal_uInt16) aSep.GetChar(0);
+ OUString aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
+ nCharCode = (sal_uInt16) aSep[0];
}
}
commit 8129fffd1beefbc2844fcf3912c65290ce657d79
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 13:39:26 2013 +0200
convert XubString to OUString in VCL
Change-Id: I5002b4c237dd919210cb7edfef9f552688735154
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index cd05596..a882bb7 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1557,9 +1557,9 @@ void DbgDialogTest( Window* pWindow )
class DbgMessageBox : public ErrorBox
{
- String m_aMessage;
+ OUString m_aMessage;
public:
- DbgMessageBox( const String& rMessage ) :
+ DbgMessageBox( const OUString& rMessage ) :
ErrorBox( NULL, WB_YES_NO_CANCEL | WB_DEF_NO, rMessage ),
m_aMessage( rMessage )
{
@@ -1722,7 +1722,7 @@ void DbgPrintWindow( const char* pLine )
return;
bIn = true;
- SolarWindowPrinter aPrinter( String( pLine, RTL_TEXTENCODING_UTF8 ) );
+ SolarWindowPrinter aPrinter( OUString( pLine, strlen(pLine), RTL_TEXTENCODING_UTF8 ) );
TimeValue aTimeout; aTimeout.Seconds = 2; aTimeout.Nanosec = 0;
aPrinter.execute( aTimeout );
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 829cd96..82f0cb3 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -125,8 +125,8 @@ sal_Int32 vcl::I18nHelper::CompareString( const OUString& rStr1, const OUString&
}
- String aStr1( filterFormattingChars(rStr1) );
- String aStr2( filterFormattingChars(rStr2) );
+ OUString aStr1( filterFormattingChars(rStr1) );
+ OUString aStr2( filterFormattingChars(rStr2) );
return ImplGetTransliterationWrapper().compareString( aStr1, aStr2 );
}
@@ -143,8 +143,8 @@ sal_Bool vcl::I18nHelper::MatchString( const OUString& rStr1, const OUString& rS
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
- String aStr1( filterFormattingChars(rStr1) );
- String aStr2( filterFormattingChars(rStr2) );
+ OUString aStr1( filterFormattingChars(rStr1) );
+ OUString aStr2( filterFormattingChars(rStr2) );
return ImplGetTransliterationWrapper().isMatch( aStr1, aStr2 );
}
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 14ab944..0bd41d8 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -732,7 +732,7 @@ static BitmapEx readBitmapEx( const OUString& rPath )
// import the image
Graphic aGraphic;
- if ( GraphicFilter::LoadGraphic( aPath, String(), aGraphic ) != GRFILTER_OK )
+ if ( GraphicFilter::LoadGraphic( aPath, OUString(), aGraphic ) != GRFILTER_OK )
return BitmapEx();
return aGraphic.GetBitmapEx();
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index c3920db..f6e1f5c 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -213,7 +213,7 @@ FieldUnitStringList* ImplGetFieldUnits()
pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
for( sal_uInt32 i = 0; i < nUnits; i++ )
{
- std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
+ std::pair< OUString, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
}
}
@@ -237,7 +237,7 @@ FieldUnitStringList* ImplGetCleanedFieldUnits()
OUString aUnit( (*pUnits)[i].first );
aUnit = comphelper::string::remove(aUnit, ' ');
aUnit = aUnit.toAsciiLowerCase();
- std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
+ std::pair< OUString, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
}
}
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 994229a..bb304b1 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -876,9 +876,9 @@ void ComboBox::ImplUpdateFloatSelection()
mpImplLB->SetCallSelectionChangedHdl( sal_False );
if ( !IsMultiSelectionEnabled() )
{
- OUString aSearchStr( mpSubEdit->GetText() );
- sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
- sal_Bool bSelect = sal_True;
+ OUString aSearchStr( mpSubEdit->GetText() );
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_Bool bSelect = sal_True;
if ( mpImplLB->GetCurrentPos() != LISTBOX_ENTRY_NOTFOUND )
{
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 71fd319..4eaa1d6 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -556,7 +556,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
const OUString aString( rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()) );
const sal_Int32 nLen = aString.getLength();
- if( nLen )
+ if( !aString.isEmpty() )
{
// #105987# ImplLayout takes everything in logical coordinates
SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
@@ -587,7 +587,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
// OutDev::DrawStretchText() code. Unfortunately, also in
// this case, public outdev methods such as GetTextWidth()
// don't provide enough info.
- if( nLen )
+ if( !aString.isEmpty() )
{
// #105987# ImplLayout takes everything in logical coordinates
SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
commit e4ebe80be51fb33545091aa4f0bbc0ea2fe674f0
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 13:22:48 2013 +0200
fix an OUString conversion bug
that was introduced in commit 8905062428705cd9a321ec225ac32547712e3787
"Replace XubString with OUString (dbggui.cxx)"
Change-Id: Ica3ce4209ac23950aa46017c324160abccf03017
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index ec295aa..cd05596 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1343,7 +1343,7 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->IsVisible() )
{
int aWidth=0;
- if( nAccelPos != STRING_NOTFOUND )
+ if( nAccelPos != -1 )
{
aWidth = pChild->GetTextWidth( aText, 0, nAccelPos ) +
pChild->GetTextWidth( aText, nAccelPos+1, aText.getLength() - nAccelPos - 1);
commit 9268759a26b48e005a56b3be6a31534d1ef4ee9d
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 13:02:41 2013 +0200
convert vcl/source/filter/wmf/wmfhr.hxx from String to OUString
Change-Id: I125eb51d27164791d79ef4364b68096ec5f4c1d4
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 766d3de..abd218c 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -419,17 +419,17 @@ void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_In
/* if return value is true, then a complete unicode string and also a polygon replacement has been written,
so there is no more action necessary
*/
-bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const String& rUniStr, const sal_Int32* pDXAry )
+bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const OUString& rUniStr, const sal_Int32* pDXAry )
{
bool bEscapeUsed = false;
- sal_uInt32 i, nStringLen = rUniStr.Len();
+ sal_uInt32 i, nStringLen = rUniStr.getLength();
if ( nStringLen )
{
// first we will check if a comment is necessary
if ( aSrcFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) // symbol is always byte character, so there is no unicode loss
{
- const sal_Unicode* pBuf = rUniStr.GetBuffer();
+ const sal_Unicode* pBuf = rUniStr.getStr();
const rtl_TextEncoding aTextEncodingOrg = aSrcFont.GetCharSet();
OString aByteStr(OUStringToOString(rUniStr, aTextEncodingOrg));
OUString aUniStr2(OStringToOUString(aByteStr, aTextEncodingOrg));
@@ -442,7 +442,7 @@ bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const String& rUn
if ( i != nStringLen ) // after conversion the characters are not original,
{ // try again, with determining a better charset from unicode char
- pBuf = rUniStr.GetBuffer();
+ pBuf = rUniStr.getStr();
const sal_Unicode* pCheckChar = pBuf;
rtl_TextEncoding aTextEncoding = getBestMSEncodingByChar(*pCheckChar); // try the first character
for ( i = 1; i < nStringLen; i++)
@@ -493,7 +493,7 @@ bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const String& rUn
<< static_cast<sal_Int32>(aPt.Y())
<< nStringLen;
for ( i = 0; i < nStringLen; i++ )
- aMemoryStream << rUniStr.GetChar( (sal_uInt16)i );
+ aMemoryStream << rUniStr[ i ];
aMemoryStream << nDXCount;
for ( i = 0; i < nDXCount; i++ )
aMemoryStream << pDXAry[ i ];
@@ -518,9 +518,9 @@ bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const String& rUn
}
void WMFWriter::WMFRecord_ExtTextOut( const Point & rPoint,
- const String & rString, const sal_Int32 * pDXAry )
+ const OUString & rString, const sal_Int32 * pDXAry )
{
- sal_uInt16 nOriginalTextLen = rString.Len();
+ sal_Int32 nOriginalTextLen = rString.getLength();
if ( (nOriginalTextLen <= 1) || (pDXAry == NULL) )
{
@@ -532,7 +532,7 @@ void WMFWriter::WMFRecord_ExtTextOut( const Point & rPoint,
TrueExtTextOut(rPoint,rString,aByteString,pDXAry);
}
-void WMFWriter::TrueExtTextOut( const Point & rPoint, const String & rString,
+void WMFWriter::TrueExtTextOut( const Point & rPoint, const OUString & rString,
const OString& rByteString, const sal_Int32 * pDXAry )
{
WriteRecordHeader( 0, W_META_EXTTEXTOUT );
@@ -543,7 +543,7 @@ void WMFWriter::TrueExtTextOut( const Point & rPoint, const String & rString,
if ( nNewTextLen & 1 )
*pWMF << (sal_uInt8)0;
- sal_uInt16 nOriginalTextLen = rString.Len();
+ sal_Int32 nOriginalTextLen = rString.getLength();
sal_Int16* pConvertedDXAry = new sal_Int16[ nOriginalTextLen ];
sal_Int32 j = 0;
pConvertedDXAry[ j++ ] = (sal_Int16)ScaleWidth( pDXAry[ 0 ] );
@@ -557,7 +557,7 @@ void WMFWriter::TrueExtTextOut( const Point & rPoint, const String & rString,
*pWMF << nDx;
if ( nOriginalTextLen < nNewTextLen )
{
- sal_Unicode nUniChar = rString.GetChar(i);
+ sal_Unicode nUniChar = rString[i];
OString aTemp(&nUniChar, 1, aSrcFont.GetCharSet());
j = aTemp.getLength();
while ( --j > 0 )
@@ -815,7 +815,7 @@ void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize,
}
-void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const String & rStr)
+void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const OUString & rStr)
{
rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
OString aString(OUStringToOString(rStr, eChrSet));
@@ -1169,7 +1169,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
case META_TEXTRECT_ACTION:
{
const MetaTextRectAction * pA = (const MetaTextRectAction*)pMA;
- String aTemp( pA->GetText() );
+ OUString aTemp( pA->GetText() );
aSrcLineInfo = LineInfo();
SetAllAttr();
@@ -1182,7 +1182,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
case META_TEXT_ACTION:
{
const MetaTextAction * pA = (const MetaTextAction*) pMA;
- String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ OUString aTemp = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
aSrcLineInfo = LineInfo();
SetAllAttr();
if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, NULL ) )
@@ -1194,7 +1194,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
{
const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pMA;
- String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ OUString aTemp = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
aSrcLineInfo = LineInfo();
SetAllAttr();
if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, pA->GetDXArray() ) )
@@ -1205,13 +1205,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction* pA = (const MetaStretchTextAction *) pMA;
- String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ OUString aTemp = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
sal_uInt16 nLen,i;
sal_Int32 nNormSize;
pVirDev->SetFont( aSrcFont );
- nLen = aTemp.Len();
+ nLen = aTemp.getLength();
sal_Int32* pDXAry = nLen ? new sal_Int32[ nLen ] : NULL;
nNormSize = pVirDev->GetTextArray( aTemp, pDXAry );
for ( i = 0; i < ( nLen - 1 ); i++ )
diff --git a/vcl/source/filter/wmf/wmfwr.hxx b/vcl/source/filter/wmf/wmfwr.hxx
index 4d7c1e9..b427a00 100644
--- a/vcl/source/filter/wmf/wmfwr.hxx
+++ b/vcl/source/filter/wmf/wmfwr.hxx
@@ -154,10 +154,10 @@ private:
void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle);
void WMFRecord_Ellipse(const Rectangle & rRect);
void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData );
- bool WMFRecord_Escape_Unicode( const Point& rPoint, const String& rStr, const sal_Int32 * pDXAry );
- void WMFRecord_ExtTextOut(const Point & rPoint, const String & rString, const sal_Int32 * pDXAry);
+ bool WMFRecord_Escape_Unicode( const Point& rPoint, const OUString& rStr, const sal_Int32 * pDXAry );
+ void WMFRecord_ExtTextOut(const Point & rPoint, const OUString & rString, const sal_Int32 * pDXAry);
- void TrueExtTextOut(const Point & rPoint, const String & rString,
+ void TrueExtTextOut(const Point & rPoint, const OUString & rString,
const OString& rByteString, const sal_Int32 * pDXAry);
void TrueTextOut(const Point & rPoint, const OString& rString);
void WMFRecord_LineTo(const Point & rPoint);
@@ -180,7 +180,7 @@ private:
void WMFRecord_SetWindowExt(const Size & rSize);
void WMFRecord_SetWindowOrg(const Point & rPoint);
void WMFRecord_StretchDIB(const Point & rPoint, const Size & rSize, const Bitmap & rBitmap, sal_uInt32 nROP = 0UL );
- void WMFRecord_TextOut(const Point & rPoint, const String & rString);
+ void WMFRecord_TextOut(const Point & rPoint, const OUString & rString);
void WMFRecord_EndOfFile();
void WMFRecord_IntersectClipRect( const Rectangle& rRect);
commit 8fcc5df74adbbee655f54e80a64c6920fb05f1b8
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 12:00:18 2013 +0200
convert vcl/source/filter/wmf/winmtf.hxx from String to OUString
Change-Id: I4c670e53f83af7a0d99ec4135cb614d30811a3b8
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 11bc047..c09b317 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -1193,7 +1193,8 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
case EMR_EXTTEXTOUTW :
{
sal_Int32 nLeft, nTop, nRight, nBottom, ptlReferenceX, ptlReferenceY, nGfxMode, nXScale, nYScale;
- sal_uInt32 nCurPos, nLen, nOffString, nOptions, offDx;
+ sal_uInt32 nCurPos, nOffString, nOptions, offDx;
+ sal_Int32 nLen;
sal_Int32* pDX = NULL;
nCurPos = pWMF->Tell() - 8;
@@ -1211,7 +1212,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
DBG_ASSERT( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) == 0, "SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF" );
Point aPos( ptlReferenceX, ptlReferenceY );
- if ( nLen && ( nLen < SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
+ if ( nLen && nLen < static_cast<sal_Int32>( SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
{
if ( offDx && (( nCurPos + offDx + nLen * 4 ) <= nNextPos ) )
{
@@ -1219,33 +1220,33 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
if ( ( nLen * sizeof(sal_uInt32) ) <= ( nEndPos - pWMF->Tell() ) )
{
pDX = new sal_Int32[ nLen ];
- sal_uInt32 i;
+ sal_Int32 i;
for ( i = 0; i < nLen; i++ )
*pWMF >> pDX[ i ];
}
}
pWMF->Seek( nCurPos + nOffString );
- String aText;
+ OUString aText;
if ( bFlag )
{
- if ( nLen <= ( nEndPos - pWMF->Tell() ) )
+ if ( nLen <= static_cast<sal_Int32>( nEndPos - pWMF->Tell() ) )
{
sal_Char* pBuf = new sal_Char[ nLen ];
pWMF->Read( pBuf, nLen );
- aText = String( pBuf, (sal_uInt16)nLen, pOut->GetCharSet() );
+ aText = OUString( pBuf, (sal_uInt16)nLen, pOut->GetCharSet() );
delete[] pBuf;
- if ( aText.Len() != nLen )
+ if ( aText.getLength() != nLen )
{
sal_uInt16 i, j;
sal_Int32* pOldDx = pDX;
- pDX = new sal_Int32[ aText.Len() ];
- for ( i = 0, j = 0; i < aText.Len(); i++ )
+ pDX = new sal_Int32[ aText.getLength() ];
+ for ( i = 0, j = 0; i < aText.getLength(); i++ )
{
- sal_Unicode cUniChar = aText.GetChar(i);
+ sal_Unicode cUniChar = aText[i];
OString aCharacter(&cUniChar, 1, pOut->GetCharSet());
pDX[ i ] = 0;
- for (sal_Int32 k = 0; ( k < aCharacter.getLength() ) && ( j < nLen ) && ( i < aText.Len() ); ++k)
+ for (sal_Int32 k = 0; ( k < aCharacter.getLength() ) && ( j < nLen ) && ( i < aText.getLength() ); ++k)
pDX[ i ] += pOldDx[ j++ ];
}
delete[] pOldDx;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 62530c1..ff7fc2e 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1445,7 +1445,7 @@ void WinMtfOutput::DrawPolyBezier( Polygon& rPolygon, sal_Bool bTo, sal_Bool bRe
}
-void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry, sal_Bool bRecordPath, sal_Int32 nGfxMode )
+void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, sal_Int32* pDXArry, sal_Bool bRecordPath, sal_Int32 nGfxMode )
{
UpdateClipRegion();
rPosition = ImplMap( rPosition );
@@ -1454,7 +1454,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
if ( pDXArry )
{
- sal_Int32 i, nSum, nLen = rText.Len();
+ sal_Int32 i, nSum, nLen = rText.getLength();
for( i = 0, nSum = 0; i < nLen; i++ )
{
@@ -1557,8 +1557,8 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
aVDev.SetFont( maFont );
if( pDXArry )
{
- sal_uInt32 nLen = rText.Len();
- nTextWidth = aVDev.GetTextWidth( OUString(rText.GetChar( (sal_uInt16)( nLen - 1 ) )) );
+ sal_uInt32 nLen = rText.getLength();
+ nTextWidth = aVDev.GetTextWidth( OUString(rText[ nLen - 1 ]) );
if( nLen > 1 )
nTextWidth += pDXArry[ nLen - 2 ];
}
@@ -1601,7 +1601,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
SolarMutexGuard aGuard;
VirtualDevice aVDev;
- pDX = new sal_Int32[ rText.Len() ];
+ pDX = new sal_Int32[ rText.getLength() ];
aVDev.SetMapMode( MAP_100TH_MM );
aVDev.SetFont( maLatestFont );
aVDev.GetTextArray( rText, pDX, 0, STRING_LEN );
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 15c36a7..df64f2a 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -136,7 +136,7 @@ struct LOGFONTW
sal_uInt8 lfClipPrecision;
sal_uInt8 lfQuality;
sal_uInt8 lfPitchAndFamily;
- String alfFaceName;
+ OUString alfFaceName;
};
struct WMF_EXTERNALHEADER;
@@ -750,7 +750,7 @@ public:
);
void DrawText(
Point& rPosition,
- String& rString,
+ OUString& rString,
sal_Int32* pDXArry = NULL,
sal_Bool bRecordPath = sal_False,
sal_Int32 nGraphicsMode = GM_COMPATIBLE
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 6d3d4031..7796a90 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -454,7 +454,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
char* pChar = new char[ ( nLength + 1 ) &~ 1 ];
pWMF->Read( pChar, ( nLength + 1 ) &~ 1 );
- String aText( pChar, nLength, pOut->GetCharSet() );
+ OUString aText( pChar, nLength, pOut->GetCharSet() );
delete[] pChar;
Point aPosition( ReadYX() );
pOut->DrawText( aPosition, aText );
@@ -495,8 +495,8 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
}
char* pChar = new char[ ( nOriginalTextLen + 1 ) &~ 1 ];
pWMF->Read( pChar, ( nOriginalTextLen + 1 ) &~ 1 );
- String aText( pChar, (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain
- nNewTextLen = aText.Len(); // less character (japanese version), so the
+ OUString aText( pChar, (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain
+ nNewTextLen = aText.getLength(); // less character (japanese version), so the
delete[] pChar; // dxAry will not fit
if ( nNewTextLen )
@@ -518,7 +518,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
*pWMF >> nDx;
if ( nNewTextLen != nOriginalTextLen )
{
- sal_Unicode nUniChar = aText.GetChar(i);
+ sal_Unicode nUniChar = aText[i];
OString aTmp(&nUniChar, 1, pOut->GetCharSet());
if ( aTmp.getLength() > 1 )
{
@@ -808,7 +808,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
aLogFont.lfOrientation = lfOrientation;
aLogFont.lfWeight = lfWeight;
- CharSet eCharSet;
+ rtl_TextEncoding eCharSet;
if ( ( aLogFont.lfCharSet == OEM_CHARSET ) || ( aLogFont.lfCharSet == DEFAULT_CHARSET ) )
eCharSet = osl_getThreadTextEncoding();
else
@@ -817,7 +817,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
eCharSet = osl_getThreadTextEncoding();
if ( eCharSet == RTL_TEXTENCODING_SYMBOL )
eCharSet = RTL_TEXTENCODING_MS_1252;
- aLogFont.alfFaceName = String( lfFaceName, eCharSet );
+ aLogFont.alfFaceName = OUString( lfFaceName, strlen(lfFaceName), eCharSet );
pOut->CreateObject( GDI_FONT, new WinMtfFontStyle( aLogFont ) );
}
@@ -934,7 +934,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
if ( Application::GetDefaultDevice()->IsFontAvailable( pOut->GetFont().GetName() ) )
{
Point aPt;
- String aString;
+ OUString aString;
sal_uInt32 nStringLen, nDXCount;
sal_Int32* pDXAry = NULL;
SvMemoryStream aMemoryStream( nEscLen );
commit 924c2177416e61327b586be551428a1380f22133
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 11:48:26 2013 +0200
convert vcl/source/filter/wmg/emfwr.hxx from String to OUString
Change-Id: I5eb1c4dbccec0da5ebbef5fe15e03c368a32cfdd
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 55af302..bc1fee3 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -503,7 +503,7 @@ void EMFWriter::ImplCheckTextAttr()
if( mbTextChanged && ImplPrepareHandleSelect( mnTextHandle, TEXT_SELECT ) )
{
const Font& rFont = maVDev.GetFont();
- String aFontName( rFont.GetName() );
+ OUString aFontName( rFont.GetName() );
sal_Int32 nWeight;
sal_uInt16 i;
sal_uInt8 nPitchAndFamily;
@@ -556,7 +556,7 @@ void EMFWriter::ImplCheckTextAttr()
m_rStm << nPitchAndFamily;
for( i = 0; i < 32; i++ )
- m_rStm << (sal_Unicode) ( ( i < aFontName.Len() ) ? aFontName.GetChar( i ) : 0 );
+ m_rStm << (sal_Unicode) ( ( i < aFontName.getLength() ) ? aFontName[ i ] : 0 );
// dummy elfFullName
for( i = 0; i < 64; i++ )
@@ -870,9 +870,9 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
}
}
-void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth )
+void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString rText, const sal_Int32* pDXArray, sal_uInt32 nWidth )
{
- xub_StrLen nLen = rText.Len(), i;
+ sal_Int32 nLen = rText.getLength(), i;
if( nLen )
{
@@ -896,7 +896,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
if( nLen > 1 )
{
- nNormWidth = pDX[ nLen - 2 ] + maVDev.GetTextWidth( OUString(rText.GetChar( nLen - 1 )) );
+ nNormWidth = pDX[ nLen - 2 ] + maVDev.GetTextWidth( OUString(rText[ nLen - 1 ]) );
if( nWidth && nNormWidth && ( nWidth != nNormWidth ) )
{
@@ -920,7 +920,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
// write text
for( i = 0; i < nLen; i++ )
- m_rStm << (sal_Unicode)rText.GetChar( i );
+ m_rStm << (sal_Unicode)rText[ i ];
// padding word
if( nLen & 1 )
@@ -1353,7 +1353,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case META_TEXT_ACTION:
{
const MetaTextAction* pA = (const MetaTextAction*) pAction;
- const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
ImplCheckTextAttr();
ImplWriteTextRecord( pA->GetPoint(), aText, NULL, 0 );
@@ -1363,7 +1363,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case META_TEXTRECT_ACTION:
{
const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- const String aText( pA->GetText() );
+ const OUString aText( pA->GetText() );
ImplCheckTextAttr();
ImplWriteTextRecord( pA->GetRect().TopLeft(), aText, NULL, 0 );
@@ -1373,7 +1373,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case META_TEXTARRAY_ACTION:
{
const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
- const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
ImplCheckTextAttr();
ImplWriteTextRecord( pA->GetPoint(), aText, pA->GetDXArray(), 0 );
@@ -1383,7 +1383,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
- const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ const OUString aText = pA->GetText().copy( pA->GetIndex(), pA->GetLen() );
ImplCheckTextAttr();
ImplWriteTextRecord( pA->GetPoint(), aText, NULL, pA->GetWidth() );
diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx
index e778be1..d64fbe2 100644
--- a/vcl/source/filter/wmf/emfwr.hxx
+++ b/vcl/source/filter/wmf/emfwr.hxx
@@ -83,7 +83,7 @@ private:
void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose );
void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP );
- void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
+ void ImplWriteTextRecord( const Point& rPos, const OUString rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void ImplWrite( const GDIMetaFile& rMtf );
commit 47aaa1c0b1c1c589c80d9735deebbb784bfd7dd4
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 11:45:20 2013 +0200
convert vcl/source/filter/sgvmain.hxx from String to OUString
Change-Id: I9cca6e7d5f2849c8b180aa99021e964ebfc34dd1
diff --git a/vcl/source/filter/sgvmain.hxx b/vcl/source/filter/sgvmain.hxx
index 7d7d689..1de5de8 100644
--- a/vcl/source/filter/sgvmain.hxx
+++ b/vcl/source/filter/sgvmain.hxx
@@ -322,9 +322,9 @@ public:
sal_Bool Sans;
sal_Bool Serf;
sal_Bool Fixd;
- FontFamily SVFamil;
- CharSet SVChSet;
- String SVFName; // z.B. "Times New Roman" = 15 Chars
+ FontFamily SVFamil;
+ CharSet SVChSet;
+ OUString SVFName; // z.B. "Times New Roman" = 15 Chars
sal_uInt16 SVWidth; // Durchschnittliche Zeichenbreite in %
SgfFontOne();
void ReadOne(const OString& rID, OString& rDsc);
@@ -332,7 +332,7 @@ public:
class SgfFontLst {
public:
- String FNam; // vollst�ndiger Filename des Inifiles
+ OUString FNam; // vollst�ndiger Filename des Inifiles
SgfFontOne* pList; // Listenanfang
SgfFontOne* Last; // Listenende
sal_uInt32 LastID; // f�r schnelleren Zugriff bei Wiederholungen
@@ -340,7 +340,7 @@ public:
bool Tried;
SgfFontLst();
~SgfFontLst();
- void AssignFN(const String& rFName);
+ void AssignFN(const OUString& rFName);
void ReadList();
void RausList();
SgfFontOne* GetFontDesc(sal_uInt32 ID);
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index d9baff4..9ef6467 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -519,7 +519,7 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, bool Kapt, sal_u
Color aColor;
sal_uLong Grad;
sal_uLong Brei;
- String FNam;
+ OUString FNam;
sal_uInt16 StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
bool bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
@@ -1204,7 +1204,7 @@ void SgfFontLst::RausList()
LastLn=NULL;
}
-void SgfFontLst::AssignFN(const String& rFName)
+void SgfFontLst::AssignFN(const OUString& rFName)
{ FNam=rFName; }
void SgfFontLst::ReadList()
commit ebe636ca7208b8b81b2e51e2d4055c2eaec9ff67
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 7 11:42:08 2013 +0200
convert vcl/source/filter/FilterConfigCache.hxx from String to OUString
Change-Id: Ic5f30901033d65ddcdcd6dddc11a80c4dcdb0f25
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index fea57af..0d60b21 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -65,11 +65,11 @@ sal_Int32 FilterConfigCache::nIndTemplateName = -1;
sal_Bool FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString& rUserDataEntry )
{
bIsPixelFormat = bIsInternalFilter = sal_False;
- sFilterName = String( rUserDataEntry );
+ sFilterName = rUserDataEntry;
const char** pPtr;
for ( pPtr = InternalPixelFilterNameList; *pPtr && ( bIsInternalFilter == sal_False ); pPtr++ )
{
- if ( sFilterName.EqualsIgnoreCaseAscii( *pPtr ) )
+ if ( sFilterName.equalsIgnoreAsciiCase( OUString(*pPtr, strlen(*pPtr), RTL_TEXTENCODING_ASCII_US) ) )
{
bIsInternalFilter = sal_True;
bIsPixelFormat = sal_True;
@@ -77,31 +77,31 @@ sal_Bool FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUSt
}
for ( pPtr = InternalVectorFilterNameList; *pPtr && ( bIsInternalFilter == sal_False ); pPtr++ )
{
- if ( sFilterName.EqualsIgnoreCaseAscii( *pPtr ) )
+ if ( sFilterName.equalsIgnoreAsciiCase( OUString(*pPtr, strlen(*pPtr), RTL_TEXTENCODING_ASCII_US) ) )
bIsInternalFilter = sal_True;
}
if ( !bIsInternalFilter )
{
for ( pPtr = ExternalPixelFilterNameList; *pPtr && ( bIsPixelFormat == sal_False ); pPtr++ )
{
- if ( sFilterName.EqualsIgnoreCaseAscii( *pPtr ) )
+ if ( sFilterName.equalsIgnoreAsciiCase( OUString(*pPtr, strlen(*pPtr), RTL_TEXTENCODING_ASCII_US) ) )
bIsPixelFormat = sal_True;
}
OUString sTemp(SVLIBRARY("?"));
sal_Int32 nIndex = sTemp.indexOf(static_cast<sal_Unicode>('?'));
sFilterName = sTemp.replaceAt(nIndex, 1, sFilterName);
}
- return sFilterName.Len() != 0;
+ return ! sFilterName.isEmpty();
}
-String FilterConfigCache::FilterConfigCacheEntry::GetShortName()
+OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName()
{
- String aShortName;
+ OUString aShortName;
if ( lExtensionList.getLength() )
{
aShortName = lExtensionList[ 0 ];
- if ( aShortName.SearchAscii( "*.", 0 ) == 0 )
- aShortName.Erase( 0, 2 );
+ if ( aShortName.indexOf( "*." ) == 0 )
+ aShortName = aShortName.replaceAt( 0, 2, "" );
}
return aShortName;
}
@@ -208,8 +208,8 @@ void FilterConfigCache::ImplInit()
// The first extension will be used
// to generate our internal FilterType ( BMP, WMF ... )
- String aExtension( aEntry.GetShortName() );
- if (aExtension.Len() != 3)
+ OUString aExtension( aEntry.GetShortName() );
+ if (aExtension.getLength() != 3)
continue;
if ( aEntry.nFlags & 1 )
@@ -314,14 +314,14 @@ FilterConfigCache::~FilterConfigCache()
{
}
-String FilterConfigCache::GetImportFilterName( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFilterName( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].sFilterName;
- return String::EmptyString();
+ return OUString("");
}
-sal_uInt16 FilterConfigCache::GetImportFormatNumber( const String& rFormatName )
+sal_uInt16 FilterConfigCache::GetImportFormatNumber( const OUString& rFormatName )
{
CacheVector::const_iterator aIter, aEnd;
for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter)
@@ -333,7 +333,7 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumber( const String& rFormatName )
}
/// get the index of the filter that matches this extension
-sal_uInt16 FilterConfigCache::GetImportFormatNumberForExtension( const String& rExt )
+sal_uInt16 FilterConfigCache::GetImportFormatNumberForExtension( const OUString& rExt )
{
CacheVector::const_iterator aIter, aEnd;
for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter)
@@ -347,7 +347,7 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumberForExtension( const String& r
return GRFILTER_FORMAT_NOTFOUND;
}
-sal_uInt16 FilterConfigCache::GetImportFormatNumberForMediaType( const String& rMediaType )
+sal_uInt16 FilterConfigCache::GetImportFormatNumberForMediaType( const OUString& rMediaType )
{
CacheVector::const_iterator aIter, aEnd;
for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter)
@@ -358,19 +358,19 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumberForMediaType( const String& r
return sal::static_int_cast< sal_uInt16 >(aIter == aImport.end() ? GRFILTER_FORMAT_NOTFOUND : aIter - aImport.begin());
}
-sal_uInt16 FilterConfigCache::GetImportFormatNumberForShortName( const String& rShortName )
+sal_uInt16 FilterConfigCache::GetImportFormatNumberForShortName( const OUString& rShortName )
{
CacheVector::const_iterator aEnd;
CacheVector::iterator aIter;
for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter)
{
- if ( aIter->GetShortName().EqualsIgnoreCaseAscii( rShortName ) )
+ if ( aIter->GetShortName().equalsIgnoreAsciiCase( rShortName ) )
break;
}
return sal::static_int_cast< sal_uInt16 >(aIter == aImport.end() ? GRFILTER_FORMAT_NOTFOUND : aIter - aImport.begin());
}
-sal_uInt16 FilterConfigCache::GetImportFormatNumberForTypeName( const String& rType )
+sal_uInt16 FilterConfigCache::GetImportFormatNumberForTypeName( const OUString& rType )
{
CacheVector::const_iterator aIter, aEnd;
for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter)
@@ -381,53 +381,53 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumberForTypeName( const String& rT
return sal::static_int_cast< sal_uInt16 >(aIter == aImport.end() ? GRFILTER_FORMAT_NOTFOUND : aIter - aImport.begin());
}
-String FilterConfigCache::GetImportFormatName( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFormatName( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].sUIName;
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportFormatMediaType( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFormatMediaType( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].sMediaType;
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportFormatShortName( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFormatShortName( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].GetShortName();
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry )
+OUString FilterConfigCache::GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry )
{
if ( (nFormat < aImport.size()) && (nEntry < aImport[ nFormat ].lExtensionList.getLength()) )
return aImport[ nFormat ].lExtensionList[ nEntry ];
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportFilterType( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFilterType( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].sType;
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportFilterTypeName( sal_uInt16 nFormat )
+OUString FilterConfigCache::GetImportFilterTypeName( sal_uInt16 nFormat )
{
if( nFormat < aImport.size() )
return aImport[ nFormat ].sFilterType;
- return String::EmptyString();
+ return OUString("");
}
-String FilterConfigCache::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list