[Libreoffice-commits] .: 3 commits - svtools/source tools/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Sun Nov 14 13:17:16 PST 2010
svtools/source/contnr/templwin.cxx | 6 +++---
svtools/source/control/fmtfield.cxx | 2 +-
svtools/source/graphic/grfmgr.cxx | 2 +-
svtools/source/misc/imagemgr.cxx | 10 +++++-----
tools/inc/tools/string.hxx | 2 ++
5 files changed, 12 insertions(+), 10 deletions(-)
New commits:
commit 3566b43a033730ab533cc4453a3703c689b82052
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Nov 14 21:00:50 2010 +0000
Misuse of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index a1b0b6b..21508b6 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -174,7 +174,7 @@ void lcl_insertDateTimeEntry(SvtExtendedMultiLineEdit_Impl* i_pEditWin,
::comphelper::getProcessServiceFactory(),
Application::GetSettings().GetLocale() );
String aDateStr = aLocaleWrapper.getDate( aToolsDT );
- aDateStr += String( RTL_CONSTASCII_STRINGPARAM(", ") );
+ aDateStr += String( RTL_CONSTASCII_USTRINGPARAM(", ") );
aDateStr += aLocaleWrapper.getTime( aToolsDT );
i_pEditWin->InsertEntry( i_rName, aDateStr );
}
@@ -947,7 +947,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B
else
{
// can be removed if the database application change its URL
- String sServiceScheme( RTL_CONSTASCII_STRINGPARAM( "service:" ) );
+ String sServiceScheme( RTL_CONSTASCII_USTRINGPARAM( "service:" ) );
if ( rURL.Match( sServiceScheme ) != sServiceScheme.Len() )
// service URL has no default target
aTarget = ASCII_STR("_default");
@@ -1734,7 +1734,7 @@ void SvtDocumentTemplateDialog::InitImpl( )
if ( !bHideLink )
{
aMoreTemplatesLink.SetURL( String(
- RTL_CONSTASCII_STRINGPARAM( "http://templates.libreoffice.org/" ) ) );
+ RTL_CONSTASCII_USTRINGPARAM( "http://templates.libreoffice.org/" ) ) );
aMoreTemplatesLink.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OpenLinkHdl_Impl ) );
}
else
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 7c7d3d4..bf74abb 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -294,7 +294,7 @@ namespace validation
return sal_True;
// normalize the string
- String sNormalized( RTL_CONSTASCII_STRINGPARAM( "_") );
+ String sNormalized( RTL_CONSTASCII_USTRINGPARAM("_") );
sNormalized.Append( _rText );
sNormalized.AppendAscii( "_" );
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 9442d27..48beaa4 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -409,7 +409,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
{
String aURLPath = sURL.Copy( URL_PREFIX_PRIV_SOFFICE_LEN );
String aType = aURLPath.GetToken( 0, INET_PATH_TOKEN );
- if ( aType == String( RTL_CONSTASCII_STRINGPARAM("factory") ) )
+ if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("factory") ) )
{
// detect an image id for our "private:factory" urls
aExt = GetImageExtensionByFactory_Impl( sURL );
@@ -417,7 +417,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
nImage = GetImageId_Impl( aExt );
return nImage;
}
- else if ( aType == String( RTL_CONSTASCII_STRINGPARAM("image") ) )
+ else if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("image") ) )
nImage = (USHORT)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
}
else
@@ -706,7 +706,7 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig, BOOL bHighContra
void ReplaceStarOfficeVar( String& _rDescription )
{
- static String sVariable( RTL_CONSTASCII_STRINGPARAM( "%STAROFFICE" ) );
+ static String sVariable( RTL_CONSTASCII_USTRINGPARAM( "%STAROFFICE" ) );
static String sProductName;
if ( sProductName.Len() == 0 )
{
@@ -737,7 +737,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
{
String aURLPath = sURL.Copy( URL_PREFIX_PRIV_SOFFICE_LEN );
String aType = aURLPath.GetToken( 0, INET_PATH_TOKEN );
- if ( aType == String( RTL_CONSTASCII_STRINGPARAM("factory") ) )
+ if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("factory") ) )
{
sDescription = GetDescriptionByFactory_Impl( aURLPath.Copy( aURLPath.Search( INET_PATH_TOKEN ) + 1 ) );
bDetected = sal_True;
@@ -781,7 +781,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
if ( bShowExt )
{
- sDescription += String( RTL_CONSTASCII_STRINGPARAM(" (") );
+ sDescription += String( RTL_CONSTASCII_USTRINGPARAM(" (") );
sDescription += sExtension;
sDescription += ')';
}
commit 41093dde140275cccef14ecef32c37d20f3f45d9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Nov 14 20:59:02 2010 +0000
Make it harder to use the wrong constructor and pass strlen and encoding
i.e compile-time detect use of RTL_CONSTASCII_STRINGPARAM instead of
RTL_CONSTASCII_USTRINGPARAM
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index cb6b455..25cb2d4 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -474,6 +474,8 @@ private:
void operator +=(int); // not implemented; to detect misuses
// of operator +=(sal_Unicode)
+ //detect and reject use of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
+ TOOLS_DLLPRIVATE UniString( const sal_Char*, sal_Int32 );
public:
UniString();
UniString( const ResId& rResId );
commit efb7091eb917ed63dcdb618c8003fb9807024d94
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Nov 14 12:27:07 2010 +0000
RTL_CONSTASCII_USTRINGPARAM instead of RTL_CONSTASCII_STRINGPARAM
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index a624092..85c60b4 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1217,7 +1217,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
GraphicObject GraphicObject::CreateGraphicObjectFromURL( const ::rtl::OUString &rURL )
{
- const String aURL( rURL ), aPrefix( RTL_CONSTASCII_STRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX) );
+ const String aURL( rURL ), aPrefix( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX) );
if( aURL.Search( aPrefix ) == 0 )
{
// graphic manager url
More information about the Libreoffice-commits
mailing list