Kaydet (Commit) da95fc29 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:sequentialassign in embeddedobj..l10ntools

Change-Id: I69377e2f96a376a7a5ccaec268c4f92c00a250f7
Reviewed-on: https://gerrit.libreoffice.org/70705
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e7f9da36
......@@ -54,9 +54,7 @@ OSpecialEmbeddedObject::OSpecialEmbeddedObject( const uno::Reference< uno::XComp
uno::Any SAL_CALL OSpecialEmbeddedObject::queryInterface( const uno::Type& rType )
{
uno::Any aReturn;
aReturn = ::cppu::queryInterface( rType,
uno::Any aReturn = ::cppu::queryInterface( rType,
static_cast< embed::XEmbeddedObject* >( this ),
static_cast< embed::XInplaceObject* >( this ),
static_cast< embed::XVisualObject* >( this ),
......
......@@ -516,8 +516,7 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
if (hOptions.hyphenIndex - wBoundary.startPos < nStartPosWordEnd) nStartPosWordEnd = hOptions.hyphenIndex - wBoundary.startPos;
#define SPACE 0x0020
while (boundary_with_punctuation > wBoundary.endPos && Text[--boundary_with_punctuation] == SPACE);
uno::Reference< linguistic2::XHyphenatedWord > aHyphenatedWord;
aHyphenatedWord = hOptions.rHyphenator->hyphenate(Text.copy(wBoundary.startPos,
uno::Reference< linguistic2::XHyphenatedWord > aHyphenatedWord = hOptions.rHyphenator->hyphenate(Text.copy(wBoundary.startPos,
wBoundary.endPos - wBoundary.startPos), rLocale,
static_cast<sal_Int16>(hOptions.hyphenIndex - wBoundary.startPos - ((hOptions.hyphenIndex == wBoundary.endPos)? nStartPosWordEnd : 0)), hOptions.aHyphenationOptions);
if (aHyphenatedWord.is()) {
......
......@@ -80,9 +80,7 @@ TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale)
aLocale = rLocale;
OUString aPrefix("com.sun.star.i18n.TextConversion_");
Reference < XInterface > xI;
xI = m_xContext->getServiceManager()->createInstanceWithContext(
Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext(
aPrefix + LocaleDataImpl::getFirstLocaleServiceName( aLocale), m_xContext);
if (!xI.is())
{
......
......@@ -44,9 +44,7 @@ namespace i18npool {
TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xContext )
: TextConversionService("com.sun.star.i18n.TextConversion_ko")
{
Reference < XInterface > xI;
xI = xContext->getServiceManager()->createInstanceWithContext(
Reference < XInterface > xI = xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.i18n.ConversionDictionary_ko", xContext);
if ( xI.is() )
......
......@@ -32,6 +32,7 @@ class CXPathObjectPtr
CXPathObjectPtr(const CXPathObjectPtr&) = delete;
public:
CXPathObjectPtr();
CXPathObjectPtr(xmlXPathObject*);
~CXPathObjectPtr();
/** Takes ownership of xmlXPathObject
*/
......@@ -49,7 +50,7 @@ class CXPathContextPtr
CXPathContextPtr & operator = (const CXPathContextPtr&) = delete;
public:
CXPathContextPtr();
explicit CXPathContextPtr(xmlXPathContextPtr aContext);
CXPathContextPtr(xmlXPathContextPtr aContext);
CXPathContextPtr & operator = (xmlXPathContextPtr pObj);
~CXPathContextPtr();
operator xmlXPathContext* () const { return _object;}
......@@ -65,7 +66,7 @@ class CXmlDocPtr
public:
CXmlDocPtr & operator = (const CXmlDocPtr&);
CXmlDocPtr();
explicit CXmlDocPtr(xmlDoc* aDoc);
CXmlDocPtr(xmlDoc* aDoc);
/** Takes ownership of xmlDoc
*/
CXmlDocPtr & operator = (xmlDoc* pObj);
......@@ -82,7 +83,7 @@ class CXmlCharPtr
CXmlCharPtr & operator = (const CXmlCharPtr&) = delete;
public:
CXmlCharPtr();
explicit CXmlCharPtr(xmlChar* aDoc);
CXmlCharPtr(xmlChar* aDoc);
explicit CXmlCharPtr(const OUString &);
~CXmlCharPtr();
CXmlCharPtr & operator = (xmlChar* pObj);
......
......@@ -83,8 +83,7 @@ struct SameOrSubDirJREMap
{
if (s1 == s2.first)
return true;
OUString sSub;
sSub = s2.first + "/";
OUString sSub = s2.first + "/";
if (s1.match(sSub))
return true;
return false;
......
......@@ -66,8 +66,7 @@ static OString getElement(OString const & docPath,
JFW_E_ERROR,
"[Java framework] Error in function getElement (elements.cxx)");
CXPathObjectPtr pathObj;
pathObj = xmlXPathEvalExpression(pathExpression, context);
CXPathObjectPtr pathObj = xmlXPathEvalExpression(pathExpression, context);
OString sValue;
if (xmlXPathNodeSetIsEmpty(pathObj->nodesetval))
{
......@@ -288,8 +287,7 @@ void NodeJava::load()
{
if (xmlStrcmp(pOpt->name, reinterpret_cast<xmlChar const *>("param")) == 0)
{
CXmlCharPtr sOpt;
sOpt = xmlNodeListGetString(
CXmlCharPtr sOpt = xmlNodeListGetString(
docUser, pOpt->children, 1);
m_vmParameters->push_back(sOpt);
}
......@@ -314,8 +312,7 @@ void NodeJava::load()
{
if (xmlStrcmp(pLoc->name, reinterpret_cast<xmlChar const *>("location")) == 0)
{
CXmlCharPtr sLoc;
sLoc = xmlNodeListGetString(
CXmlCharPtr sLoc = xmlNodeListGetString(
docUser, pLoc->children, 1);
m_JRELocations->push_back(sLoc);
}
......@@ -704,8 +701,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
if (pJavaInfo->children == nullptr)
return;
//Get the xsi:nil attribute;
CXmlCharPtr sNil;
sNil = xmlGetNsProp(
CXmlCharPtr sNil = xmlGetNsProp(
pJavaInfo, reinterpret_cast<xmlChar const *>("nil"), reinterpret_cast<xmlChar const *>(NS_SCHEMA_INSTANCE));
if ( ! sNil)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
......@@ -720,8 +716,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
return;
//Get javaInfo@manuallySelected attribute
CXmlCharPtr sAutoSelect;
sAutoSelect = xmlGetProp(
CXmlCharPtr sAutoSelect = xmlGetProp(
pJavaInfo, reinterpret_cast<xmlChar const *>("autoSelect"));
if ( ! sAutoSelect)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
......@@ -739,8 +734,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
{
if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("vendor")) == 0)
{
CXmlCharPtr xmlVendor;
xmlVendor = xmlNodeListGetString(
CXmlCharPtr xmlVendor = xmlNodeListGetString(
pDoc, cur->children, 1);
if (! xmlVendor)
return;
......@@ -748,30 +742,26 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
}
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("location")) == 0)
{
CXmlCharPtr xmlLocation;
xmlLocation = xmlNodeListGetString(
CXmlCharPtr xmlLocation = xmlNodeListGetString(
pDoc, cur->children, 1);
sLocation = xmlLocation;
}
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("version")) == 0)
{
CXmlCharPtr xmlVersion;
xmlVersion = xmlNodeListGetString(
CXmlCharPtr xmlVersion = xmlNodeListGetString(
pDoc, cur->children, 1);
sVersion = xmlVersion;
}
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("features"))== 0)
{
CXmlCharPtr xmlFeatures;
xmlFeatures = xmlNodeListGetString(
CXmlCharPtr xmlFeatures = xmlNodeListGetString(
pDoc, cur->children, 1);
OUString sFeatures = xmlFeatures;
nFeatures = sFeatures.toInt64(16);
}
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("requirements")) == 0)
{
CXmlCharPtr xmlRequire;
xmlRequire = xmlNodeListGetString(
CXmlCharPtr xmlRequire = xmlNodeListGetString(
pDoc, cur->children, 1);
OUString sRequire = xmlRequire;
nRequirements = sRequire.toInt64(16);
......@@ -788,8 +778,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
}
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("vendorData")) == 0)
{
CXmlCharPtr xmlData;
xmlData = xmlNodeListGetString(
CXmlCharPtr xmlData = xmlNodeListGetString(
pDoc, cur->children, 1);
xmlChar* _data = static_cast<xmlChar*>(xmlData);
if (_data)
......@@ -804,8 +793,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
if (sVendor.isEmpty())
m_bEmptyNode = true;
//Get the javainfo attributes
CXmlCharPtr sVendorUpdate;
sVendorUpdate = xmlGetProp(pJavaInfo,
CXmlCharPtr sVendorUpdate = xmlGetProp(pJavaInfo,
reinterpret_cast<xmlChar const *>("vendorUpdate"));
if ( ! sVendorUpdate)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
......
......@@ -138,8 +138,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
"/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
osVendor + OString("\"]/jf:minVersion");
CXPathObjectPtr xPathObjectMin;
xPathObjectMin =
CXPathObjectPtr xPathObjectMin =
xmlXPathEvalExpression(reinterpret_cast<xmlChar const *>(sExpression.getStr()),
m_xmlPathContextVendorSettings);
if (xmlXPathNodeSetIsEmpty(xPathObjectMin->nodesetval))
......@@ -148,8 +147,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
}
else
{
CXmlCharPtr sVersion;
sVersion = xmlNodeListGetString(
CXmlCharPtr sVersion = xmlNodeListGetString(
m_xmlDocVendorSettings,
xPathObjectMin->nodesetval->nodeTab[0]->xmlChildrenNode, 1);
OString osVersion(sVersion);
......@@ -160,8 +158,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
//Get maxVersion
sExpression = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
osVendor + OString("\"]/jf:maxVersion");
CXPathObjectPtr xPathObjectMax;
xPathObjectMax = xmlXPathEvalExpression(
CXPathObjectPtr xPathObjectMax = xmlXPathEvalExpression(
reinterpret_cast<xmlChar const *>(sExpression.getStr()),
m_xmlPathContextVendorSettings);
if (xmlXPathNodeSetIsEmpty(xPathObjectMax->nodesetval))
......@@ -170,8 +167,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
}
else
{
CXmlCharPtr sVersion;
sVersion = xmlNodeListGetString(
CXmlCharPtr sVersion = xmlNodeListGetString(
m_xmlDocVendorSettings,
xPathObjectMax->nodesetval->nodeTab[0]->xmlChildrenNode, 1);
OString osVersion(sVersion);
......@@ -182,8 +178,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
//Get excludeVersions
sExpression = OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
osVendor + OString("\"]/jf:excludeVersions/jf:version");
CXPathObjectPtr xPathObjectVersions;
xPathObjectVersions =
CXPathObjectPtr xPathObjectVersions =
xmlXPathEvalExpression(reinterpret_cast<xmlChar const *>(sExpression.getStr()),
m_xmlPathContextVendorSettings);
if (!xmlXPathNodeSetIsEmpty(xPathObjectVersions->nodesetval))
......@@ -195,8 +190,7 @@ boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUStrin
{
if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("version")) == 0)
{
CXmlCharPtr sVersion;
sVersion = xmlNodeListGetString(
CXmlCharPtr sVersion = xmlNodeListGetString(
m_xmlDocVendorSettings, cur->xmlChildrenNode, 1);
OString osVersion(sVersion);
OUString usVersion = OStringToOUString(
......
......@@ -25,7 +25,9 @@ namespace jfw
CXPathObjectPtr::CXPathObjectPtr():_object(nullptr)
{
}
CXPathObjectPtr::CXPathObjectPtr(xmlXPathObject* pObj):_object(pObj)
{
}
CXPathObjectPtr::~CXPathObjectPtr()
{
xmlXPathFreeObject(_object);
......
......@@ -194,8 +194,6 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa
XMLElement* pXMLElement = nullptr;
MergeEntrys *pEntrys = nullptr;
pEntrys = nullptr;
if( !sCur.equalsIgnoreAsciiCase("en-US") ){
pXMLElement = (*aLangHM)[ "en-US" ];
if( pXMLElement == nullptr )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment