summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-11-14 21:03:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-11-14 21:15:05 +0000
commit02a17c2e7f05464968dbb500ed6a473d3b8b4332 (patch)
tree5e27f1f265d3a11da4a37e69ad1462778270118b /svx
parenta88f3005a817584e64f13fd996b3a90cda992115 (diff)
Misuse of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/datanavi.cxx8
-rw-r--r--svx/source/form/tbxform.cxx2
-rw-r--r--svx/source/svdraw/svdattr.cxx23
-rw-r--r--svx/source/svdraw/svdlayer.cxx6
-rw-r--r--svx/source/svdraw/svdmodel.cxx27
-rw-r--r--svx/source/svdraw/svdtrans.cxx63
-rw-r--r--svx/source/svdraw/svdundo.cxx12
7 files changed, 49 insertions, 92 deletions
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index dbfb62e59f..3d89f0e448 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -708,7 +708,7 @@ namespace svxform
{
try
{
- String sDelim( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ String sDelim( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
::rtl::OUString sTemp;
pNode->m_xPropSet->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sNewName += String( sTemp );
@@ -1031,7 +1031,7 @@ namespace svxform
{
try
{
- String sDelim( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ String sDelim( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
::rtl::OUString sName;
_rEntry->getPropertyValue( PN_BINDING_ID ) >>= sTemp;
sName += String( sTemp );
@@ -1336,7 +1336,7 @@ namespace svxform
{
Image aImage1 = rImageList.GetImage( IID_ELEMENT );
Image aImage2 = rImageList.GetImage( IID_ELEMENT );
- String sDelim( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ String sDelim( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
while ( xNum->hasMoreElements() )
{
Reference< XPropertySet > xPropSet;
@@ -3527,7 +3527,7 @@ namespace svxform
Reference < XEnumeration > xNum = xNumAccess->createEnumeration();
if ( xNum.is() && xNum->hasMoreElements() )
{
- String sDelim( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ String sDelim( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
while ( xNum->hasMoreElements() )
{
Reference< XPropertySet > xPropSet;
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 872a78ab35..8080486709 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -409,7 +409,7 @@ SvxFmTbxCtlRecTotal::~SvxFmTbxCtlRecTotal()
Window* SvxFmTbxCtlRecTotal::CreateItemWindow( Window* pParent )
{
pFixedText = new FixedText( pParent );
- String aSample( "123456", sizeof( "123456" ) - 1 );
+ String aSample(RTL_CONSTASCII_USTRINGPARAM("123456"));
Size aSize( pFixedText->GetTextWidth( aSample ), pFixedText->GetTextHeight( ) );
aSize.Width() += 12;
pFixedText->SetSizePixel( aSize );
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 6b0253b1e1..f027e777ea 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1416,10 +1416,8 @@ SfxItemPresentation __EXPORT SdrTextAniAmountItem::GetPresentation(
if(nValue < 0)
{
- sal_Char aText[] = "pixel";
-
rText = UniString::CreateFromInt32(-nValue);
- rText += UniString(aText, sizeof(aText-1));
+ rText += UniString(RTL_CONSTASCII_USTRINGPARAM("pixel"));
}
else
{
@@ -2046,14 +2044,9 @@ XubString __EXPORT SdrMeasureUnitItem::GetValueTextByPos(USHORT nPos) const
XubString aRetval;
if((FieldUnit)nPos == FUNIT_NONE)
- {
- sal_Char aText[] = "default";
- aRetval += UniString(aText, sizeof(aText-1));
- }
+ aRetval += UniString(RTL_CONSTASCII_USTRINGPARAM("default"));
else
- {
SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval);
- }
return aRetval;
}
@@ -2360,26 +2353,22 @@ XubString __EXPORT SdrGrafModeItem::GetValueTextByPos(UINT16 nPos) const
{
case 1:
{
- sal_Char aTextGreys[] = "Greys";
- aStr += UniString(aTextGreys, sizeof(aTextGreys-1));
+ aStr += UniString(RTL_CONSTASCII_USTRINGPARAM("Greys"));
break;
}
case 2:
{
- sal_Char aTextBlackWhite[] = "Black/White";
- aStr += UniString(aTextBlackWhite, sizeof(aTextBlackWhite-1));
+ aStr += UniString(RTL_CONSTASCII_USTRINGPARAM("Black/White"));
break;
}
case 3:
{
- sal_Char aTextWatermark[] = "Watermark";
- aStr += UniString(aTextWatermark, sizeof(aTextWatermark-1));
+ aStr += UniString(RTL_CONSTASCII_USTRINGPARAM("Watermark"));
break;
}
default:
{
- sal_Char aTextStandard[] = "Standard";
- aStr += UniString(aTextStandard, sizeof(aTextStandard-1));
+ aStr += UniString(RTL_CONSTASCII_USTRINGPARAM("Standard"));
break;
}
}
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx
index e7a2802586..7ac1a2ced7 100644
--- a/svx/source/svdraw/svdlayer.cxx
+++ b/svx/source/svdraw/svdlayer.cxx
@@ -243,8 +243,7 @@ SdrLayerAdmin::SdrLayerAdmin(SdrLayerAdmin* pNewParent):
aLSets(1024,16,16),
pModel(NULL)
{
- sal_Char aTextControls[] = "Controls";
- aControlLayerName = String(aTextControls, sizeof(aTextControls-1));
+ aControlLayerName = String(RTL_CONSTASCII_USTRINGPARAM("Controls"));
pParent=pNewParent;
}
@@ -254,8 +253,7 @@ SdrLayerAdmin::SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin):
pParent(NULL),
pModel(NULL)
{
- sal_Char aTextControls[] = "Controls";
- aControlLayerName = String(aTextControls, sizeof(aTextControls-1));
+ aControlLayerName = String(RTL_CONSTASCII_USTRINGPARAM("Controls"));
*this = rSrcLayerAdmin;
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 07028eb4f6..eee8feaca4 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1223,20 +1223,17 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_100TH_MM:
{
- sal_Char aText[] = "/100mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
break;
}
case FUNIT_MM :
{
- sal_Char aText[] = "mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
break;
}
case FUNIT_CM :
{
- sal_Char aText[] = "cm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
break;
}
case FUNIT_M :
@@ -1247,26 +1244,22 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_KM :
{
- sal_Char aText[] = "km";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("km"));
break;
}
case FUNIT_TWIP :
{
- sal_Char aText[] = "twip";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
break;
}
case FUNIT_POINT :
{
- sal_Char aText[] = "pt";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
break;
}
case FUNIT_PICA :
{
- sal_Char aText[] = "pica";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pica"));
break;
}
case FUNIT_INCH :
@@ -1277,14 +1270,12 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_FOOT :
{
- sal_Char aText[] = "ft";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("ft"));
break;
}
case FUNIT_MILE :
{
- sal_Char aText[] = "mile(s)";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mile(s)"));
break;
}
case FUNIT_PERCENT:
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 0b9905dc81..0084e0a8ac 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -1088,46 +1088,39 @@ void SdrFormatter::TakeUnitStr(MapUnit eUnit, XubString& rStr)
// Metrisch
case MAP_100TH_MM :
{
- sal_Char aText[] = "/100mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
break;
}
case MAP_10TH_MM :
{
- sal_Char aText[] = "/10mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/10mm"));
break;
}
case MAP_MM :
{
- sal_Char aText[] = "mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
break;
}
case MAP_CM :
{
- sal_Char aText[] = "cm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
break;
}
// Inch
case MAP_1000TH_INCH:
{
- sal_Char aText[] = "/1000\"";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/1000\""));
break;
}
case MAP_100TH_INCH :
{
- sal_Char aText[] = "/100\"";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100\""));
break;
}
case MAP_10TH_INCH :
{
- sal_Char aText[] = "/10\"";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/10\""));
break;
}
case MAP_INCH :
@@ -1138,34 +1131,29 @@ void SdrFormatter::TakeUnitStr(MapUnit eUnit, XubString& rStr)
}
case MAP_POINT :
{
- sal_Char aText[] = "pt";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
break;
}
case MAP_TWIP :
{
- sal_Char aText[] = "twip";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
break;
}
// Sonstiges
case MAP_PIXEL :
{
- sal_Char aText[] = "pixel";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pixel"));
break;
}
case MAP_SYSFONT :
{
- sal_Char aText[] = "sysfont";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("sysfont"));
break;
}
case MAP_APPFONT :
{
- sal_Char aText[] = "appfont";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("appfont"));
break;
}
case MAP_RELATIVE :
@@ -1193,20 +1181,17 @@ void SdrFormatter::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
// Metrisch
case FUNIT_100TH_MM:
{
- sal_Char aText[] = "/100mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("/100mm"));
break;
}
case FUNIT_MM :
{
- sal_Char aText[] = "mm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mm"));
break;
}
case FUNIT_CM :
{
- sal_Char aText[] = "cm";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("cm"));
break;
}
case FUNIT_M :
@@ -1217,28 +1202,24 @@ void SdrFormatter::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_KM :
{
- sal_Char aText[] = "km";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("km"));
break;
}
// Inch
case FUNIT_TWIP :
{
- sal_Char aText[] = "twip";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("twip"));
break;
}
case FUNIT_POINT :
{
- sal_Char aText[] = "pt";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pt"));
break;
}
case FUNIT_PICA :
{
- sal_Char aText[] = "pica";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("pica"));
break;
}
case FUNIT_INCH :
@@ -1249,14 +1230,12 @@ void SdrFormatter::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_FOOT :
{
- sal_Char aText[] = "ft";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("ft"));
break;
}
case FUNIT_MILE :
{
- sal_Char aText[] = "mile(s)";
- rStr = UniString(aText, sizeof(aText-1));
+ rStr = UniString(RTL_CONSTASCII_USTRINGPARAM("mile(s)"));
break;
}
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 542d475ba4..56e9dd98b8 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -160,8 +160,8 @@ void SdrUndoGroup::Redo()
XubString SdrUndoGroup::GetComment() const
{
XubString aRet(aComment);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText-1));
+
+ String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
aRet.SearchAndReplace(aSearchString, aObjDescription);
@@ -218,8 +218,8 @@ void SdrUndoGroup::SdrRepeat(SdrView& rView)
XubString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aRet(aComment);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText-1));
+
+ String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
aRet.SearchAndReplace(aSearchString, ImpGetResStr(STR_ObjNameSingulPlural));
@@ -249,8 +249,8 @@ SdrUndoObj::SdrUndoObj(SdrObject& rNewObj):
void SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, USHORT nStrCacheID, String& rStr, bool bRepeat )
{
rStr = ImpGetResStr(nStrCacheID);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText-1));
+
+ String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
xub_StrLen nPos = rStr.Search(aSearchString);