About writeDBLoaderInfo function in dbloader.cxx (dbaccess module)

julien2412 serval2412 at yahoo.fr
Sat Aug 31 14:26:43 PDT 2013


Hello,

cppcheck reported this:
dbaccess/source/ui/browser/dbloader.cxx
167	redundantAssignment	style	Variable 'xNewKey' is reassigned a value
before the old one has been used

Here's the function:
    153 extern "C" void SAL_CALL writeDBLoaderInfo(void* pRegistryKey)
    154 {
    155     Reference< XRegistryKey> xKey(reinterpret_cast<
XRegistryKey*>(pRegistryKey));
    156 
    157     // register content loader for dispatch
    158     OUString aImpl("/");
    159     aImpl += DBContentLoader::getImplementationName_Static();
    160 
    161     OUString aImpltwo = aImpl;
    162     aImpltwo += "/UNO/Loader";
    163     Reference< XRegistryKey> xNewKey = xKey->createKey( aImpltwo );
    164     aImpltwo = aImpl;
    165     aImpltwo += "/Loader";
    166     Reference< XRegistryKey >  xLoaderKey = xKey->createKey(
aImpltwo );
    167     xNewKey = xLoaderKey->createKey( OUString("Pattern") );
    168     xNewKey->setAsciiValue( OUString(".component:DB*") );
    169 }
(see
http://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/browser/dbloader.cxx#153)

Indeed, xNewKey is reassigned. But now I don't know how it should be
changed.

Any idea?

Julien



--
View this message in context: http://nabble.documentfoundation.org/About-writeDBLoaderInfo-function-in-dbloader-cxx-dbaccess-module-tp4072511.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list