You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/openoffice.org-3.2.0.ooo110...

32 lines
1.2 KiB

diff -ru svx.orig/source/unodraw/unoprov.cxx svx/source/unodraw/unoprov.cxx
--- svx.orig/source/unodraw/unoprov.cxx 2010-03-15 14:31:21.000000000 +0000
+++ svx/source/unodraw/unoprov.cxx 2010-03-15 15:17:05.000000000 +0000
@@ -1368,12 +1370,24 @@
bool SvxUnoConvertResourceString( USHORT* pSourceResIds, USHORT* pDestResIds, int nCount, String& rString ) throw()
{
- int i = 0;
+ //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't
+ //replace "Red Hat 1" with the translation of Red :-)
+ rtl::OUString sStr(rString);
+ const sal_Unicode *pStr = sStr.getStr();
+ sal_Int32 nLength = sStr.getLength();
+ while( nLength > 0 )
+ {
+ const sal_Unicode nChar = pStr[nLength-1];
+ if (nChar != '%' && (nChar < '0' || nChar > '9'))
+ break;
+ nLength--;
+ }
+ sStr = rtl::OUString(pStr, nLength).trim();
- for( i = 0; i < nCount; i++ )
+ for(int i = 0; i < nCount; ++i )
{
String aStrDefName = SVX_RESSTR( pSourceResIds[i] );
- if( rString.Search( aStrDefName ) == 0 )
+ if( sStr.equals( aStrDefName ) )
{
String aReplace = SVX_RESSTR( pDestResIds[i] );
rString.Replace( 0, aStrDefName.Len(), aReplace );