[Libreoffice-commits] core.git: 3 commits - embeddedobj/source i18npool/source jvmfwk/inc jvmfwk/plugins jvmfwk/source l10ntools/source linguistic/source lotuswordpro/source oox/source package/source pyuno/source reportdesign/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Apr 13 19:15:00 UTC 2019
embeddedobj/source/commonembedding/specialobject.cxx | 4 -
i18npool/source/breakiterator/breakiterator_unicode.cxx | 3 -
i18npool/source/textconversion/textconversionImpl.cxx | 4 -
i18npool/source/textconversion/textconversion_ko.cxx | 4 -
jvmfwk/inc/libxmlutil.hxx | 7 +--
jvmfwk/plugins/sunmajor/pluginlib/util.hxx | 3 -
jvmfwk/source/elements.cxx | 36 +++++-----------
jvmfwk/source/fwkbase.cxx | 18 ++------
jvmfwk/source/libxmlutil.cxx | 4 +
l10ntools/source/helpmerge.cxx | 2
linguistic/source/lngsvcmgr.cxx | 3 -
linguistic/source/spelldta.cxx | 3 -
linguistic/source/thesdsp.cxx | 3 -
lotuswordpro/source/filter/bencont.cxx | 4 -
lotuswordpro/source/filter/explode.cxx | 6 --
lotuswordpro/source/filter/lwpglobalmgr.cxx | 6 --
lotuswordpro/source/filter/lwppagelayout.cxx | 5 --
lotuswordpro/source/filter/lwpparastyle.cxx | 3 -
lotuswordpro/source/filter/lwptablelayout.cxx | 3 -
lotuswordpro/source/filter/lwptblformula.cxx | 3 -
lotuswordpro/source/filter/xfilter/xffont.cxx | 5 --
lotuswordpro/source/filter/xfilter/xfstylemanager.cxx | 4 -
oox/source/core/filterdetect.cxx | 3 -
oox/source/core/xmlfilterbase.cxx | 6 --
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 4 -
oox/source/export/chartexport.cxx | 3 -
oox/source/export/drawingml.cxx | 3 -
oox/source/helper/binaryoutputstream.cxx | 3 -
oox/source/vml/vmlshape.cxx | 3 -
package/source/xstor/ocompinstream.cxx | 4 -
package/source/xstor/ohierarchyholder.cxx | 8 ---
package/source/xstor/owriteablestream.cxx | 8 ---
package/source/xstor/xstorage.cxx | 4 -
pyuno/source/module/pyuno.cxx | 4 -
pyuno/source/module/pyuno_gc.cxx | 3 -
pyuno/source/module/pyuno_runtime.cxx | 3 -
reportdesign/source/ui/report/ReportController.cxx | 3 -
reportdesign/source/ui/report/ReportSection.cxx | 3 -
38 files changed, 64 insertions(+), 134 deletions(-)
New commits:
commit b6491f09e9dc3e41d571abce3c4f16467cb60c9c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Apr 13 14:56:54 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Apr 13 21:14:26 2019 +0200
loplugin:sequentialassign in oox..reportdesign
Change-Id: I59ef0a6da411b8af8bdf8d8efb1d733db7475d9c
Reviewed-on: https://gerrit.libreoffice.org/70707
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index b68f05160a62..59a4f605ab5c 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -316,8 +316,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
(according to the verifier), or with an empty string if
user has cancelled the password input dialog. */
PasswordVerifier aVerifier( aDecryptor );
- Sequence<NamedValue> aEncryptionData;
- aEncryptionData = rMediaDescriptor.requestAndVerifyDocPassword(
+ Sequence<NamedValue> aEncryptionData = rMediaDescriptor.requestAndVerifyDocPassword(
aVerifier,
comphelper::DocPasswordRequestType::MS,
&aDefaultPasswords );
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 8050c91b0d8e..632a3ce357b6 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -870,8 +870,7 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM
Reference<XStream> XmlFilterBase::implGetOutputStream( MediaDescriptor& rMediaDescriptor ) const
{
- Sequence< NamedValue > aMediaEncData;
- aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault(
+ Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault(
MediaDescriptor::PROP_ENCRYPTIONDATA(),
Sequence< NamedValue >() );
@@ -902,8 +901,7 @@ bool XmlFilterBase::implFinalizeExport( MediaDescriptor& rMediaDescriptor )
{
bool bRet = true;
- Sequence< NamedValue > aMediaEncData;
- aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault(
+ Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault(
MediaDescriptor::PROP_ENCRYPTIONDATA(),
Sequence< NamedValue >() );
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 7d64e82059af..7686ddf2413c 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -362,9 +362,7 @@ sal_Int32 ConditionAtom::getNodeCount() const
const dgm::Point* pPoint = getPresNode();
if (pPoint)
{
- OUString sNodeId = "";
-
- sNodeId
+ OUString sNodeId
= navigate(mrLayoutNode, XML_presOf, pPoint->msModelId, /*bSourceToDestination*/ false);
if (sNodeId.isEmpty())
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 5641d62119a1..15e9bca1c1c9 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2303,8 +2303,7 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen
pFS->writeEscaped( aCellRange );
pFS->endElement( FSNS( XML_c, XML_f ) );
- ::std::vector< double > aValues;
- aValues = lcl_getAllValuesFromSequence( xValueSeq );
+ ::std::vector< double > aValues = lcl_getAllValuesFromSequence( xValueSeq );
sal_Int32 ptCount = aValues.size();
pFS->startElement( FSNS( XML_c, XML_numCache ),
FSEND );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 1cebeaa84ec1..e259aa856906 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1316,8 +1316,7 @@ void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const
uno::Reference<graphic::XGraphic> xGraphic;
if (mAny.has<uno::Reference<awt::XBitmap>>())
{
- uno::Reference<awt::XBitmap> xBitmap;
- xBitmap = mAny.get<uno::Reference<awt::XBitmap>>();
+ uno::Reference<awt::XBitmap> xBitmap = mAny.get<uno::Reference<awt::XBitmap>>();
if (xBitmap.is())
xGraphic.set(xBitmap, uno::UNO_QUERY);
}
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index 43cf86277c1e..ccfd6e4ed9f2 100644
--- a/oox/source/helper/binaryoutputstream.cxx
+++ b/oox/source/helper/binaryoutputstream.cxx
@@ -109,8 +109,7 @@ BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding
void
BinaryOutputStream::writeUnicodeArray( const OUString& rString )
{
- OUString sBuf( rString );
- sBuf = sBuf.replace( '\0', '?' );
+ OUString sBuf = rString.replace( '\0', '?' );
#ifdef OSL_BIGENDIAN
// need a non-const buffer for swapping byte order
sal_Unicode notConst[sBuf.getLength()];
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 951c164b0b94..bc4e77818e18 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -678,8 +678,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
SdrObject* pShape = GetSdrObjectFromXShape( xShape );
if( pShape && getShapeType() >= 0 )
{
- OUString aShapeType;
- aShapeType = EnhancedCustomShapeTypeNames::Get( static_cast< MSO_SPT >(getShapeType()) );
+ OUString aShapeType = EnhancedCustomShapeTypeNames::Get( static_cast< MSO_SPT >(getShapeType()) );
//The resize autoshape to fit text attr of FontWork/Word-Art should always be false
//for the fallback geometry.
if(aShapeType.startsWith("fontwork"))
diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx
index 98592e61c590..52565b7933cf 100644
--- a/package/source/xstor/ocompinstream.cxx
+++ b/package/source/xstor/ocompinstream.cxx
@@ -74,10 +74,8 @@ OInputCompStream::~OInputCompStream()
uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType )
{
- uno::Any aReturn;
-
// common interfaces
- aReturn = ::cppu::queryInterface
+ uno::Any aReturn = ::cppu::queryInterface
( rType
, static_cast<io::XInputStream*> ( this )
, static_cast<io::XStream*> ( this )
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 20c613b8b8d2..76d8842fb497 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -92,9 +92,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea
uno::Reference< embed::XExtendedStorageStream > xResult;
- uno::Reference< embed::XStorage > xOwnStor;
-
- xOwnStor = m_xOwnStorage.is() ? m_xOwnStorage
+ uno::Reference< embed::XStorage > xOwnStor = m_xOwnStorage.is() ? m_xOwnStorage
: uno::Reference< embed::XStorage >( m_xWeakOwnStorage.get(), uno::UNO_QUERY_THROW );
if ( aListPath.empty() )
@@ -171,9 +169,7 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( std::vector<OUString>&
OUString aNextName = *(aListPath.begin());
aListPath.erase( aListPath.begin() );
- uno::Reference< embed::XStorage > xOwnStor;
-
- xOwnStor = m_xOwnStorage.is() ? m_xOwnStorage
+ uno::Reference< embed::XStorage > xOwnStor = m_xOwnStorage.is() ? m_xOwnStorage
: uno::Reference< embed::XStorage >( m_xWeakOwnStorage.get(), uno::UNO_QUERY_THROW );
if ( aListPath.empty() )
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index ee06fc0c398c..213c53efaf49 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -1267,9 +1267,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre
throw io::IOException();
}
- uno::Reference< io::XInputStream > xInStream;
-
- xInStream = GetTempFileAsInputStream(); //TODO:
+ uno::Reference< io::XInputStream > xInStream = GetTempFileAsInputStream(); //TODO:
if ( !xInStream.is() )
throw io::IOException();
@@ -1800,10 +1798,8 @@ void OWriteStream::ModifyParentUnlockMutex_Impl(osl::ClearableMutexGuard& aGuard
uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType )
{
- uno::Any aReturn;
-
// common interfaces
- aReturn = ::cppu::queryInterface
+ uno::Any aReturn = ::cppu::queryInterface
( rType
, static_cast<lang::XTypeProvider*> ( this )
, static_cast<io::XInputStream*> ( this )
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 28e20c43703a..c3033decefd6 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -2046,10 +2046,8 @@ void OStorage::MakeLinkToSubComponent_Impl( const uno::Reference< lang::XCompone
uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType )
{
- uno::Any aReturn;
-
// common interfaces
- aReturn = ::cppu::queryInterface
+ uno::Any aReturn = ::cppu::queryInterface
( rType
, static_cast<lang::XTypeProvider*> ( this )
, static_cast<embed::XStorage*> ( this )
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index a581d8335d76..bb176de4bfb5 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -573,9 +573,7 @@ static void lcl_getRowsColumns( PyUNO const * me, sal_Int32& nRows, sal_Int32& n
Sequence<short> aOutParamIndex;
Sequence<Any> aOutParam;
Sequence<Any> aParams;
- Any aRet;
-
- aRet = me->members->xInvocation->invoke ( "getRows", aParams, aOutParamIndex, aOutParam );
+ Any aRet = me->members->xInvocation->invoke ( "getRows", aParams, aOutParamIndex, aOutParam );
Reference< XIndexAccess > xIndexAccessRows( aRet, UNO_QUERY );
nRows = xIndexAccessRows->getCount();
aRet = me->members->xInvocation->invoke ( "getColumns", aParams, aOutParamIndex, aOutParam );
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index 170e32ef7619..1be9cd4ed69b 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -86,8 +86,7 @@ void GCThread::execute()
}
catch( const css::uno::RuntimeException & e )
{
- OString msg;
- msg = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US );
+ OString msg = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US );
fprintf( stderr, "Leaking python objects bridged to UNO for reason %s\n",msg.getStr());
}
}
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 53c7acb709b8..10f3ce953aac 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -512,8 +512,7 @@ PyRef Runtime::any2PyObject (const Any &a ) const
{
for ( i = 0; i < s.getLength (); i++)
{
- PyRef element;
- element = any2PyObject (tc->convertTo (s[i], s[i].getValueType() ));
+ PyRef element = any2PyObject (tc->convertTo (s[i], s[i].getValueType() ));
OSL_ASSERT( element.is() );
PyTuple_SetItem( tuple.get(), i, element.getAcquired() );
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index b78f70d7681c..d4c823561aa4 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1647,8 +1647,7 @@ void OReportController::impl_initialize( )
m_xFormatter->attachNumberFormatsSupplier(Reference< XNumberFormatsSupplier>(m_xReportDefinition,uno::UNO_QUERY));
utl::MediaDescriptor aDescriptor( m_xReportDefinition->getArgs() );
- OUString sHierarchicalDocumentName;
- sHierarchicalDocumentName = aDescriptor.getUnpackedValueOrDefault("HierarchicalDocumentName",sHierarchicalDocumentName);
+ OUString sHierarchicalDocumentName = aDescriptor.getUnpackedValueOrDefault("HierarchicalDocumentName",OUString());
if ( sHierarchicalDocumentName.isEmpty() && getConnection().is() )
{
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 9e49938e5484..43814411a25f 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -690,8 +690,7 @@ sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt )
)
{
if (!m_pParent) return DND_ACTION_NONE;
- sal_uInt16 nCurrentPosition = 0;
- nCurrentPosition = m_pParent->getViewsWindow()->getPosition(m_pParent);
+ sal_uInt16 nCurrentPosition = m_pParent->getViewsWindow()->getPosition(m_pParent);
if (_rEvt.mnAction == DND_ACTION_COPY )
{
// we must assure, we can't drop in the top section
commit 5e1719ff1ed5b4350684c3ed67b5375bb49e0223
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Apr 13 14:55:39 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Apr 13 21:14:21 2019 +0200
loplugin:sequentialassign in linguistic..lotuswordpro
Change-Id: Ic561f56e1cfe06de219bd7a257186107b5c152fb
Reviewed-on: https://gerrit.libreoffice.org/70706
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 7b46b4af5eba..0c8e8e92f6d5 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1704,8 +1704,7 @@ bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName )
for (sal_Int32 i = 0; i < nLen; ++i)
{
- uno::Sequence< OUString > aSvcImplNames;
- aSvcImplNames = pDsp->GetServiceList( pLocale[i] );
+ uno::Sequence< OUString > aSvcImplNames = pDsp->GetServiceList( pLocale[i] );
// build value to be written back to configuration
uno::Any aCfgAny;
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index b57a570b38d6..da7818d9acaf 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -125,8 +125,7 @@ void SeqRemoveNegEntries( std::vector< OUString > &rSeq,
{
std::vector< OUString > aNew;
// merge sequence without duplicates and empty strings in new empty sequence
- aNew = MergeProposalSeqs( aNew, rSeq );
- rSeq = aNew;
+ rSeq = MergeProposalSeqs( aNew, rSeq );
}
}
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index 3fdfe5c73da1..77522e0f77cd 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -122,8 +122,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
if (pEntry)
{
- OUString aChkWord( rTerm );
- aChkWord = aChkWord.replace( SVT_HARD_SPACE, ' ' );
+ OUString aChkWord = rTerm.replace( SVT_HARD_SPACE, ' ' );
RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
RemoveControlChars( aChkWord );
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index ceed08c55020..bef463deb767 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -219,9 +219,7 @@ LtcUtBenValueStream * LtcBenContainer::FindNextValueStreamWithPropertyName(const
return nullptr; // Property not exist
// Get current object
- CBenObject * pObj = nullptr;
-
- pObj =FindNextObjectWithProperty(pObj, pPropertyName->GetID()); // Get next object with same property name
+ CBenObject * pObj =FindNextObjectWithProperty(nullptr, pPropertyName->GetID()); // Get next object with same property name
if (nullptr == pObj)
return nullptr;
diff --git a/lotuswordpro/source/filter/explode.cxx b/lotuswordpro/source/filter/explode.cxx
index 731c6bc099d9..1815e406ea93 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -177,10 +177,8 @@ sal_uInt32 Decompression::ReadBits(sal_uInt16 iCount, sal_uInt32 & nBits)
return 1;
}
- sal_uInt32 val = 0; /* bit accumulator */
-
/* load at least need bits into val */
- val = m_nCurrent4Byte;
+ sal_uInt32 val = m_nCurrent4Byte; /* bit accumulator */
while (m_nBitsLeft < iCount)
{
if (m_nBytesLeft == 0)
@@ -188,7 +186,7 @@ sal_uInt32 Decompression::ReadBits(sal_uInt16 iCount, sal_uInt32 & nBits)
m_nBytesLeft = m_pInStream->ReadBytes(m_Buffer, CHUNK);
m_pBuffer = m_Buffer;
if (m_nBytesLeft == 0) return 1;
- }
+ }
val |= static_cast<sal_uInt32>(*m_pBuffer++) << m_nBitsLeft; /* load eight bits */
m_nBytesLeft --;
m_nBitsLeft += 8;
diff --git a/lotuswordpro/source/filter/lwpglobalmgr.cxx b/lotuswordpro/source/filter/lwpglobalmgr.cxx
index 7ccbb71f74db..05fa59033f0d 100644
--- a/lotuswordpro/source/filter/lwpglobalmgr.cxx
+++ b/lotuswordpro/source/filter/lwpglobalmgr.cxx
@@ -79,8 +79,7 @@ LwpGlobalMgr::~LwpGlobalMgr()
LwpGlobalMgr* LwpGlobalMgr::GetInstance(LwpSvStream* pSvStream)
{
sal_uInt32 nThreadID = osl::Thread::getCurrentIdentifier();
- std::map< sal_uInt32,LwpGlobalMgr* >::iterator iter;
- iter = m_ThreadMap.find(nThreadID);
+ auto iter = m_ThreadMap.find(nThreadID);
if (iter == m_ThreadMap.end())
{
LwpGlobalMgr* pInstance = new LwpGlobalMgr(pSvStream);
@@ -94,8 +93,7 @@ LwpGlobalMgr* LwpGlobalMgr::GetInstance(LwpSvStream* pSvStream)
void LwpGlobalMgr::DeleteInstance()
{
sal_uInt32 nThreadID = osl::Thread::getCurrentIdentifier();
- std::map< sal_uInt32,LwpGlobalMgr* >::iterator iter;
- iter = m_ThreadMap.find(nThreadID);
+ auto iter = m_ThreadMap.find(nThreadID);
if (iter != m_ThreadMap.end())
{
delete iter->second;
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 16173371c0d8..ac829d5df905 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -440,11 +440,8 @@ bool LwpPageLayout::HasFillerPageText(LwpFoundry const * pFoundry)
LwpLayout::UseWhenType eWhenType = GetUseWhenType();
if(eWhenType==LwpLayout::StartOnOddPage||eWhenType==LwpLayout::StartOnEvenPage)
{
- //get pagenumber
- sal_Int32 nPageNumber = 0;
-
//get the page number that current page layout inserted
- nPageNumber = GetPageNumber(FIRST_LAYOUTPAGENO)-1;
+ sal_Int32 nPageNumber = GetPageNumber(FIRST_LAYOUTPAGENO)-1;
if(nPageNumber>0)
{
diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx
index 89a0811d35a9..4afe02ae2d29 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -146,9 +146,8 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle)
{
assert(pParaStyle);
- LwpVirtualPiece *pPiece = nullptr;
//alignment:
- pPiece = dynamic_cast<LwpVirtualPiece*>(m_AlignmentStyle.obj().get());
+ LwpVirtualPiece *pPiece = dynamic_cast<LwpVirtualPiece*>(m_AlignmentStyle.obj().get());
if( pPiece )
{
LwpAlignmentOverride *pAlign = dynamic_cast<LwpAlignmentOverride*>(pPiece->GetOverride());
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index e7438cb27b0d..f14990156d01 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1400,8 +1400,7 @@ XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol)
std::pair<sal_uInt16,sal_uInt8> pos;
pos.first = nRow;
pos.second = nCol;
- std::map<std::pair<sal_uInt16,sal_uInt8>,XFCell*>::iterator iter;
- iter = m_CellsMap.find(pos);
+ auto iter = m_CellsMap.find(pos);
if (iter == m_CellsMap.end())
return nullptr;
return iter->second;
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx
index 26081262ad5b..e34544579802 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -340,8 +340,7 @@ OUString LwpFormulaInfo::Convert(LwpTableLayout* pCellsMap)
*/
void LwpFormulaInfo::Convert(XFCell * pCell,LwpTableLayout* pCellsMap)
{
- OUString aFormula;
- aFormula = Convert(pCellsMap);
+ OUString aFormula = Convert(pCellsMap);
if (!aFormula.isEmpty())
{
pCell->SetFormula(aFormula);
diff --git a/lotuswordpro/source/filter/xfilter/xffont.cxx b/lotuswordpro/source/filter/xfilter/xffont.cxx
index e7d4f9def7e1..96259c5dafa8 100644
--- a/lotuswordpro/source/filter/xfilter/xffont.cxx
+++ b/lotuswordpro/source/filter/xfilter/xffont.cxx
@@ -293,9 +293,8 @@ void XFFont::ToXml(IXFStream *pStrm)
((m_nFlag & XFFONT_FLAG_POSITION) && m_nPosition != 0)
)
{
- OUString tmp;
- tmp = OUString::number(m_nPosition) + "% ";
- tmp += OUString::number(m_nScale) + "%";
+ OUString tmp = OUString::number(m_nPosition) + "% "
+ + OUString::number(m_nScale) + "%";
pAttrList->AddAttribute("style:text-position", tmp );
}
diff --git a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx
index 5c42058f29eb..6cf81dbd5e30 100644
--- a/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfstylemanager.cxx
@@ -110,9 +110,7 @@ IXFStyleRet XFStyleManager::AddStyle(std::unique_ptr<IXFStyle> pStyle)
IXFStyleRet aRet;
assert(pStyle);
- OUString name;
-
- name = pStyle->GetStyleName();
+ OUString name = pStyle->GetStyleName();
if( pStyle->GetStyleFamily() == enumXFStyleText )
{
commit da95fc2983e9deea30b9b7148a6e10b5423ed3e1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Apr 13 14:54:59 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Apr 13 21:14:15 2019 +0200
loplugin:sequentialassign in embeddedobj..l10ntools
Change-Id: I69377e2f96a376a7a5ccaec268c4f92c00a250f7
Reviewed-on: https://gerrit.libreoffice.org/70705
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx
index 7b4a27ead172..a1e55d87debe 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -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 ),
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 1a6818bdae30..25b6c2e8b450 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -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()) {
diff --git a/i18npool/source/textconversion/textconversionImpl.cxx b/i18npool/source/textconversion/textconversionImpl.cxx
index fa9af75ff839..ecd1ee699b9f 100644
--- a/i18npool/source/textconversion/textconversionImpl.cxx
+++ b/i18npool/source/textconversion/textconversionImpl.cxx
@@ -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())
{
diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx
index 4e6ef770f613..6552135d1b91 100644
--- a/i18npool/source/textconversion/textconversion_ko.cxx
+++ b/i18npool/source/textconversion/textconversion_ko.cxx
@@ -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() )
diff --git a/jvmfwk/inc/libxmlutil.hxx b/jvmfwk/inc/libxmlutil.hxx
index 078d285ac78f..1730a59e99a9 100644
--- a/jvmfwk/inc/libxmlutil.hxx
+++ b/jvmfwk/inc/libxmlutil.hxx
@@ -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);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
index 02ee2a4f62ba..56e487b45b76 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
@@ -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;
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 4a9477c41db1..64373f31c8b0 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -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 at 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);
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 1ea13e8f0c42..0aed9857c966 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -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(
diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx
index 5f1ec5784eb5..2619e43331c4 100644
--- a/jvmfwk/source/libxmlutil.cxx
+++ b/jvmfwk/source/libxmlutil.cxx
@@ -25,7 +25,9 @@ namespace jfw
CXPathObjectPtr::CXPathObjectPtr():_object(nullptr)
{
}
-
+CXPathObjectPtr::CXPathObjectPtr(xmlXPathObject* pObj):_object(pObj)
+{
+}
CXPathObjectPtr::~CXPathObjectPtr()
{
xmlXPathFreeObject(_object);
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 058e79ae656e..ee442e91475b 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -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 )
More information about the Libreoffice-commits
mailing list