Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.