View | Details | Raw Unified | Return to issue 110142
Collapse All | Expand All

(-)svx.orig/source/unodraw/unoprov.cxx (-3 / +15 lines)
Lines 1368-1379 Link Here
1368
1370
1369
bool SvxUnoConvertResourceString( USHORT* pSourceResIds, USHORT* pDestResIds, int nCount, String& rString ) throw()
1371
bool SvxUnoConvertResourceString( USHORT* pSourceResIds, USHORT* pDestResIds, int nCount, String& rString ) throw()
1370
{
1372
{
1371
	int i = 0;
1373
    //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't
1374
    //replace "Red Hat 1" with the translation of Red :-)
1375
    rtl::OUString sStr(rString);
1376
    const sal_Unicode *pStr = sStr.getStr();
1377
    sal_Int32 nLength = sStr.getLength();
1378
    while( nLength > 0 )
1379
    {
1380
        const sal_Unicode nChar = pStr[nLength-1];
1381
        if (nChar != '%' && (nChar < '0' || nChar > '9'))
1382
            break;
1383
        nLength--;
1384
    }
1385
    sStr = rtl::OUString(pStr, nLength).trim();
1372
1386
1373
	for( i = 0; i < nCount; i++ )
1387
	for(int i = 0; i < nCount; ++i )
1374
	{
1388
	{
1375
		String aStrDefName = SVX_RESSTR( pSourceResIds[i] );
1389
		String aStrDefName = SVX_RESSTR( pSourceResIds[i] );
1376
		if( rString.Search( aStrDefName ) == 0 )
1390
		if( sStr.equals( aStrDefName ) )
1377
		{
1391
		{
1378
			String aReplace = SVX_RESSTR( pDestResIds[i] );
1392
			String aReplace = SVX_RESSTR( pDestResIds[i] );
1379
			rString.Replace( 0, aStrDefName.Len(), aReplace );
1393
			rString.Replace( 0, aStrDefName.Len(), aReplace );

Return to issue 110142