rpms/openoffice.org/devel openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch, NONE, 1.1
Caolan McNamara
caolanm at fedoraproject.org
Mon Mar 15 15:28:38 UTC 2010
Author: caolanm
Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22646/devel
Added Files:
openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch
Log Message:
Resolves: rhbz#573654 fix unwanted Red translation
openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch:
unoprov.cxx | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
--- NEW FILE openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch ---
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 );
More information about the scm-commits
mailing list