[Libreoffice] [PATCH] RTL_CONSTASCII_USTRINGPARAM for calc (datefunc, analysis and solver)

2010-11-12 Thread Julien Nabet

Hello,

Here's a patch for calc
I think it's the last one for calc since i haven't seen other 
createFromAscii to remove which concerned litterals.


In datefunc, i tried to use the syntax :

rtl::OUString foo(RTL_CONSTASCII_STRINGPARAM(foo));

-OUString aImpl = OUString::createFromAscii( / );
+OUString aImpl(RTL_CONSTASCII_USTRINGPARAM( / ));

Hope it's ok and there wasn't other i missed.

Julien.
(LGPLv3+ / MPL)
diff --git a/scaddins/source/analysis/analysishelper.cxx 
b/scaddins/source/analysis/analysishelper.cxx
index bfebe6d..bf3c0f4 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -2850,7 +2850,7 @@ ScaAnyConverter::ScaAnyConverter( const uno::Reference 
lang::XMultiServiceFacto
 if( xServiceFact.is() )
 {
 uno::Reference uno::XInterface  xInstance = 
xServiceFact-createInstance(
-OUString::createFromAscii( com.sun.star.util.NumberFormatter ) );
+OUString(RTL_CONSTASCII_USTRINGPARAM( 
com.sun.star.util.NumberFormatter )) );
 xFormatter = uno::Reference util::XNumberFormatter ( xInstance, 
uno::UNO_QUERY );
 }
 }
diff --git a/scaddins/source/datefunc/datefunc.cxx 
b/scaddins/source/datefunc/datefunc.cxx
index 8a4f6a9..e350bc2 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -250,9 +250,9 @@ sal_Bool SAL_CALL component_writeInfo(
 {
 try
 {
-OUString aImpl = OUString::createFromAscii( / );
+OUString aImpl(RTL_CONSTASCII_USTRINGPARAM( / ));
 aImpl += ScaDateAddIn::getImplementationName_Static();
-aImpl += OUString::createFromAscii( /UNO/SERVICES );
+aImpl += OUString(RTL_CONSTASCII_USTRINGPARAM( /UNO/SERVICES ));
 
 uno::Reference registry::XRegistryKey  xNewKey(
 reinterpret_cast registry::XRegistryKey* ( pRegistryKey 
)-createKey( aImpl ) );
@@ -401,15 +401,15 @@ OUString ScaDateAddIn::GetFuncDescrStr( sal_uInt16 
nResId, sal_uInt16 nStrIndex
 
 OUString ScaDateAddIn::getImplementationName_Static()
 {
-return OUString::createFromAscii( MY_IMPLNAME );
+return OUString(RTL_CONSTASCII_USTRINGPARAM( MY_IMPLNAME ));
 }
 
 uno::Sequence OUString  ScaDateAddIn::getSupportedServiceNames_Static()
 {
 uno::Sequence OUString  aRet( 2 );
 OUString* pArray = aRet.getArray();
-pArray[0] = OUString::createFromAscii( ADDIN_SERVICE );
-pArray[1] = OUString::createFromAscii( MY_SERVICE );
+pArray[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( ADDIN_SERVICE ));
+pArray[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( MY_SERVICE ));
 return aRet;
 }
 
@@ -418,7 +418,7 @@ uno::Sequence OUString  
ScaDateAddIn::getSupportedServiceNames_Static()
 OUString SAL_CALL ScaDateAddIn::getServiceName() throw( uno::RuntimeException )
 {
 // name of specific AddIn service
-return OUString::createFromAscii( MY_SERVICE );
+return OUString(RTL_CONSTASCII_USTRINGPARAM( MY_SERVICE ));
 }
 
 // XServiceInfo
@@ -711,7 +711,7 @@ sal_Int32 GetNullDate( const uno::Reference 
beans::XPropertySet  xOptions )
 try
 {
 uno::Any aAny = xOptions-getPropertyValue(
-OUString::createFromAscii( NullDate 
) );
+OUString(RTL_CONSTASCII_USTRINGPARAM( 
NullDate )) );
 util::Date aDate;
 if ( aAny = aDate )
 return DateToDays( aDate.Day, aDate.Month, aDate.Year );
diff --git a/sccomp/source/solver/solver.cxx b/sccomp/source/solver/solver.cxx
index 380728e..fff803e 100644
--- a/sccomp/source/solver/solver.cxx
+++ b/sccomp/source/solver/solver.cxx
@@ -559,13 +559,13 @@ void SAL_CALL SolverComponent::solve() 
throw(uno::RuntimeException)
 uno::Sequence OUString  SolverComponent_getSupportedServiceNames()
 {
 uno::Sequence OUString  aServiceNames( 1 );
-aServiceNames[ 0 ] = OUString::createFromAscii( 
com.sun.star.sheet.Solver );
+aServiceNames[ 0 ] = OUString(RTL_CONSTASCII_USTRINGPARAM( 
com.sun.star.sheet.Solver ));
 return aServiceNames;
 }
 
 OUString SolverComponent_getImplementationName()
 {
-return OUString::createFromAscii( com.sun.star.comp.Calc.Solver );
+return OUString(RTL_CONSTASCII_USTRINGPARAM( 
com.sun.star.comp.Calc.Solver ));
 }
 
 OUString SAL_CALL SolverComponent::getImplementationName() 
throw(uno::RuntimeException)
@@ -614,7 +614,7 @@ extern C
 sal_Int32  nPos;
 
 xNewKey = reinterpret_cast registry::XRegistryKey * ( 
pRegistryKey )-createKey( SolverComponent_getImplementationName() );
-xNewKey = xNewKey-createKey( OUString::createFromAscii( 
/UNO/SERVICES ) );
+xNewKey = xNewKey-createKey( 
OUString(RTL_CONSTASCII_USTRINGPARAM( /UNO/SERVICES )) );
 const uno::Sequence OUString   rSNL1 = 
SolverComponent_getSupportedServiceNames();
  

Re: [Libreoffice] [PATCH] RTL_CONSTASCII_USTRINGPARAM for calc (datefunc, analysis and solver)

2010-11-12 Thread Kohei Yoshida
Hi Julien,

On Fri, 2010-11-12 at 14:02 +0100, Julien Nabet wrote:
 Hello,
 
 Here's a patch for calc

Applied and pushed.  Beautifully done. :-)

 I think it's the last one for calc since i haven't seen other 
 createFromAscii to remove which concerned litterals.
 
 In datefunc, i tried to use the syntax :
 
 rtl::OUString foo(RTL_CONSTASCII_STRINGPARAM(foo));
 
 -OUString aImpl = OUString::createFromAscii( / );
 +OUString aImpl(RTL_CONSTASCII_USTRINGPARAM( / ));
 
 Hope it's ok and there wasn't other i missed.

Yup, that's what we'd have expected.

Thanks a lot, and keep them coming!

Kohei


-- 
Kohei Yoshida, LibreOffice hacker, Calc
kyosh...@novell.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] RTL_CONSTASCII_USTRINGPARAM for calc (datefunc, analysis and solver)

2010-11-12 Thread Jonathan Aquilina
keep up the good work julien :)

On Fri, Nov 12, 2010 at 4:01 PM, Kohei Yoshida kyosh...@novell.com wrote:

 Hi Julien,

 On Fri, 2010-11-12 at 14:02 +0100, Julien Nabet wrote:
  Hello,
 
  Here's a patch for calc

 Applied and pushed.  Beautifully done. :-)

  I think it's the last one for calc since i haven't seen other
  createFromAscii to remove which concerned litterals.
 
  In datefunc, i tried to use the syntax :
 
  rtl::OUString foo(RTL_CONSTASCII_STRINGPARAM(foo));
 
  -OUString aImpl = OUString::createFromAscii( / );
  +OUString aImpl(RTL_CONSTASCII_USTRINGPARAM( / ));
 
  Hope it's ok and there wasn't other i missed.

 Yup, that's what we'd have expected.

 Thanks a lot, and keep them coming!

 Kohei


 --
 Kohei Yoshida, LibreOffice hacker, Calc
 kyosh...@novell.com

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice




-- 
Jonathan Aquilina
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice