[Libreoffice-commits] core.git: 2 commits - comphelper/source oox/source sal/osl sal/rtl sax/source sc/source sd/source sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 29 18:56:49 UTC 2020
comphelper/source/container/embeddedobjectcontainer.cxx | 8 -
comphelper/source/misc/AccessibleImplementationHelper.cxx | 5
comphelper/source/misc/backupfilehelper.cxx | 8 -
comphelper/source/misc/docpasswordhelper.cxx | 18 +--
comphelper/source/misc/mimeconfighelper.cxx | 59 ++++-------
comphelper/source/misc/storagehelper.cxx | 11 --
comphelper/source/xml/ofopxmlhelper.cxx | 26 ++--
oox/source/drawingml/chart/converterbase.cxx | 2
sal/osl/unx/profile.cxx | 4
sal/rtl/cipher.cxx | 4
sax/source/expatwrap/saxwriter.cxx | 4
sax/source/expatwrap/xml2utf.cxx | 2
sax/source/tools/converter.cxx | 2
sc/source/core/data/column2.cxx | 2
sc/source/core/tool/chgtrack.cxx | 2
sc/source/core/tool/compare.cxx | 2
sc/source/core/tool/compiler.cxx | 10 -
sc/source/core/tool/interpr2.cxx | 4
sc/source/core/tool/interpr8.cxx | 2
sc/source/core/tool/refupdat.cxx | 12 +-
sc/source/core/tool/token.cxx | 2
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/docshell/impex.cxx | 2
sc/source/ui/unoobj/docuno.cxx | 4
sc/source/ui/view/cellsh.cxx | 2
sc/source/ui/view/cellsh1.cxx | 6 -
sc/source/ui/view/gridwin.cxx | 2
sc/source/ui/view/tabview2.cxx | 8 -
sd/source/core/stlsheet.cxx | 2
sd/source/filter/eppt/pptx-text.cxx | 2
sd/source/ui/app/tmplctrl.cxx | 2
sd/source/ui/dlg/navigatr.cxx | 4
sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 2
sd/source/ui/view/drviews3.cxx | 2
sd/source/ui/view/drviewsj.cxx | 2
sd/source/ui/view/sdview.cxx | 3
sw/source/core/doc/number.cxx | 3
37 files changed, 112 insertions(+), 125 deletions(-)
New commits:
commit 80f28e377db0ca04da57eed77d42f44cbdea363d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri May 29 11:36:45 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 29 20:56:17 2020 +0200
loplugin:simplifybool in oox..sd
Change-Id: I76cbd5d3e65f0b392d713a51607f5c88dae79593
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95101
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index d8f7b564904d..5a58401ae07d 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -401,7 +401,7 @@ void LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, doub
awt::Point aShapePos(
lclCalcPosition( aChartSize.Width, mrModel.mfX, mrModel.mnXMode ),
lclCalcPosition( aChartSize.Height, mrModel.mfY, mrModel.mnYMode ) );
- if( !((aShapePos.X >= 0) && (aShapePos.Y >= 0)) )
+ if( (aShapePos.X < 0) || (aShapePos.Y < 0) )
return;
bool bPropSet = false;
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index ce3742bc8a10..31cfc8575f73 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -306,7 +306,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
}
pFile = pProfile->m_pFile;
- if ( !( pFile != nullptr && pFile->m_Handle >= 0 ) )
+ if ( pFile == nullptr || pFile->m_Handle < 0 )
{
pthread_mutex_unlock(&(pProfile->m_AccessLock));
@@ -325,7 +325,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
static bool writeProfileImpl(osl_TFile* pFile)
{
- if ( !( pFile != nullptr && pFile->m_Handle >= 0 ) || ( pFile->m_pWriteBuf == nullptr ) )
+ if ( pFile == nullptr || pFile->m_Handle < 0 || pFile->m_pWriteBuf == nullptr )
{
return false;
}
diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx
index 34428654975f..db9b1bdd20bf 100644
--- a/sal/rtl/cipher.cxx
+++ b/sal/rtl/cipher.cxx
@@ -718,7 +718,7 @@ static rtlCipherError BF_update(
if (!pData || !pBuffer)
return rtl_Cipher_E_Argument;
- if (!((nDatLen > 0) && (nDatLen <= nBufLen)))
+ if ((nDatLen <= 0) || (nDatLen > nBufLen))
return rtl_Cipher_E_BufferSize;
/* Update. */
@@ -1265,7 +1265,7 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl(
if (!pData || !pBuffer)
return rtl_Cipher_E_Argument;
- if (!((0 < nDatLen) && (nDatLen <= nBufLen)))
+ if ((0 >= nDatLen) || (nDatLen > nBufLen))
return rtl_Cipher_E_BufferSize;
#if defined LIBO_CIPHER_OPENSSL_BACKEND
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index f4f4c4bae142..2fe579648ce5 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -464,7 +464,7 @@ bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr,
rPos = writeSequence();
// reset left-over surrogate
- if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) )
+ if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) )
{
OSL_ENSURE( nSurrogate != 0, "left-over Unicode surrogate" );
nSurrogate = 0;
@@ -901,7 +901,7 @@ sal_Int32 calcXMLByteLength( const OUString& rStr,
}
// surrogate processing
- if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) )
+ if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) )
nSurrogate = 0;
}
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index 420f90b6c3f0..9e531b13cfa6 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -117,7 +117,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence<sal_Int8> &seq , sal_In
void XMLFile2UTFConverter::removeEncoding( Sequence<sal_Int8> &seq )
{
const sal_Int8 *pSource = seq.getArray();
- if (!(seq.getLength() >= 5 && !strncmp(reinterpret_cast<const char *>(pSource), "<?xml", 5)))
+ if (seq.getLength() < 5 || strncmp(reinterpret_cast<const char *>(pSource), "<?xml", 5))
return;
// scan for encoding
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index ac6eba928526..1f070e0260e1 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -970,7 +970,7 @@ readUnsignedNumber(const OUString & rString,
while (nPos < rString.getLength())
{
const sal_Unicode c = rString[nPos];
- if (!(('0' <= c) && (c <= '9')))
+ if (('0' > c) || (c > '9'))
break;
++nPos;
}
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 61a756699081..9a45e48899f6 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -3531,7 +3531,7 @@ public:
const SCROW nRow1 = node.position;
const SCROW nRow2 = nRow1 + 1;
- if (! ((nRow2 < mnStartRow) || (nRow1 > mnEndRow)))
+ if ((nRow2 >= mnStartRow) && (nRow1 <= mnEndRow))
{
mnCount += WeightedCounter::getWeight(node);
}
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index a6524f95da7d..2e445d0247ed 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1003,7 +1003,7 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc )
switch ( GetType() )
{
case SC_CAT_DELETE_COLS :
- if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == pDoc->MaxCol()) )
+ if ( aRange.aStart.Col() != 0 || aRange.aEnd.Col() != pDoc->MaxCol() )
{ // Only if not TabDelete
bOk = pDoc->CanInsertCol( aRange ) && pDoc->InsertCol( aRange );
}
diff --git a/sc/source/core/tool/compare.cxx b/sc/source/core/tool/compare.cxx
index f1c5fa3979c8..6d7150003417 100644
--- a/sc/source/core/tool/compare.cxx
+++ b/sc/source/core/tool/compare.cxx
@@ -42,7 +42,7 @@ CompareOptions::CompareOptions( const ScDocument* pDoc, const ScQueryEntry& rEnt
{
// Wildcard and Regex search work only with equal or not equal.
if (eSearchType != utl::SearchParam::SearchType::Normal &&
- !(aQueryEntry.eOp == SC_EQUAL || aQueryEntry.eOp == SC_NOT_EQUAL))
+ aQueryEntry.eOp != SC_EQUAL && aQueryEntry.eOp != SC_NOT_EQUAL)
eSearchType = utl::SearchParam::SearchType::Normal;
// Interpreter functions usually are case insensitive, except the simple
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 9cdc0c8fc427..f94931dd3278 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3559,8 +3559,8 @@ bool ScCompiler::IsColRowName( const OUString& rName )
{
const ScRangePair & rR = (*pRL)[iPair];
const ScRange& rNameRange = rR.GetRange(0);
- if ( jThisTab && !(rNameRange.aStart.Tab() <= nThisTab &&
- nThisTab <= rNameRange.aEnd.Tab()) )
+ if ( jThisTab && (rNameRange.aStart.Tab() > nThisTab ||
+ nThisTab > rNameRange.aEnd.Tab()) )
continue; // for
ScCellIterator aIter( pDoc, rNameRange );
for (bool bHas = aIter.first(); bHas && !bInList; bHas = aIter.next())
@@ -3645,7 +3645,7 @@ bool ScCompiler::IsColRowName( const OUString& rName )
nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) );
nDistance = nD;
}
- else if ( !(nRow < aOne.Row() && nMyRow >= static_cast<long>(aOne.Row())) )
+ else if ( nRow >= aOne.Row() || nMyRow < static_cast<long>(aOne.Row()) )
{
// upper left, only if not further up than the
// current entry and nMyRow is below (CellIter
@@ -3709,7 +3709,7 @@ bool ScCompiler::IsColRowName( const OUString& rName )
nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) );
nDistance = nD;
}
- else if ( !(nRow < aOne.Row() && nMyRow >= static_cast<long>(aOne.Row())) )
+ else if ( nRow >= aOne.Row() || nMyRow < static_cast<long>(aOne.Row()) )
{
// upper left, only if not further up than the
// current entry and nMyRow is below (CellIter
@@ -4621,7 +4621,7 @@ std::unique_ptr<ScTokenArray> ScCompiler::CompileString( const OUString& rFormul
default:
break;
}
- if (!(eLastOp == ocOpen && eOp == ocClose) &&
+ if ((eLastOp != ocOpen || eOp != ocClose) &&
(eLastOp == ocOpen ||
eLastOp == ocSep ||
eLastOp == ocArrayRowSep ||
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 891fcbc7e798..de63442eaf0e 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -559,7 +559,7 @@ void ScInterpreter::ScNetWorkdays( bool bOOXML_Version )
{
while ( nRef < nMax && nSortArray.at( nRef ) < nDate1 )
nRef++;
- if ( !( nRef < nMax && nSortArray.at( nRef ) == nDate1 ) )
+ if ( nRef >= nMax || nSortArray.at( nRef ) != nDate1 )
nCnt++;
}
++nDate1;
@@ -613,7 +613,7 @@ void ScInterpreter::ScWorkday_MS()
while ( nRef < nMax && nSortArray.at( nRef ) < nDate )
nRef++;
- if ( !( nRef < nMax && nSortArray.at( nRef ) == nDate ) || nRef >= nMax )
+ if ( nRef >= nMax || nSortArray.at( nRef ) != nDate || nRef >= nMax )
nDays--;
}
}
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 9fc1e799884a..b9e09dfef564 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1241,7 +1241,7 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
// required arguments
double fPILevel = 0.0;
- if ( nParamCount < 3 && !( nParamCount == 2 && eETSType == etsSeason ) )
+ if ( nParamCount < 3 && ( nParamCount != 2 || eETSType != etsSeason ) )
{
PushParameterExpected();
return;
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index c1c1ffa19cd5..3dfe38634478 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -388,7 +388,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
{
if ( nDx && (theRow1 >= nRow1) && (theRow2 <= nRow2) &&
(theTab1 >= nTab1) && (theTab2 <= nTab2) &&
- !(theCol1 == nInt32Min && theCol2 == nInt32Max) )
+ (theCol1 != nInt32Min || theCol2 != nInt32Max) )
{
bCut1 = lcl_MoveBig( theCol1, nCol1, nDx );
bCut2 = lcl_MoveBig( theCol2, nCol1, nDx );
@@ -399,7 +399,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
}
if ( nDy && (theCol1 >= nCol1) && (theCol2 <= nCol2) &&
(theTab1 >= nTab1) && (theTab2 <= nTab2) &&
- !(theRow1 == nInt32Min && theRow2 == nInt32Max) )
+ (theRow1 != nInt32Min || theRow2 != nInt32Max) )
{
bCut1 = lcl_MoveBig( theRow1, nRow1, nDy );
bCut2 = lcl_MoveBig( theRow2, nRow1, nDy );
@@ -410,7 +410,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
}
if ( nDz && (theCol1 >= nCol1) && (theCol2 <= nCol2) &&
(theRow1 >= nRow1) && (theRow2 <= nRow2) &&
- !(theTab1 == nInt32Min && theTab2 == nInt32Max) )
+ (theTab1 != nInt32Min || theTab2 != nInt32Max) )
{
bCut1 = lcl_MoveBig( theTab1, nTab1, nDz );
bCut2 = lcl_MoveBig( theTab2, nTab1, nDz );
@@ -424,7 +424,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
{
if ( rWhere.In( rWhat ) )
{
- if ( nDx && !(theCol1 == nInt32Min && theCol2 == nInt32Max) )
+ if ( nDx && (theCol1 != nInt32Min || theCol2 != nInt32Max) )
{
bCut1 = lcl_MoveItCutBig( theCol1, nDx );
bCut2 = lcl_MoveItCutBig( theCol2, nDx );
@@ -433,7 +433,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
rWhat.aStart.SetCol( theCol1 );
rWhat.aEnd.SetCol( theCol2 );
}
- if ( nDy && !(theRow1 == nInt32Min && theRow2 == nInt32Max) )
+ if ( nDy && (theRow1 != nInt32Min || theRow2 != nInt32Max) )
{
bCut1 = lcl_MoveItCutBig( theRow1, nDy );
bCut2 = lcl_MoveItCutBig( theRow2, nDy );
@@ -442,7 +442,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode,
rWhat.aStart.SetRow( theRow1 );
rWhat.aEnd.SetRow( theRow2 );
}
- if ( nDz && !(theTab1 == nInt32Min && theTab2 == nInt32Max) )
+ if ( nDz && (theTab1 != nInt32Min || theTab2 != nInt32Max) )
{
bCut1 = lcl_MoveItCutBig( theTab1, nDz );
bCut2 = lcl_MoveItCutBig( theTab2, nDz );
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 545ddc8dce08..8f58651355ac 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2971,7 +2971,7 @@ bool expandRangeByEdge( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, co
// Edge-expansion is turned off.
return false;
- if (!(rSelectedRange.aStart.Tab() <= rRefRange.aStart.Tab() && rRefRange.aEnd.Tab() <= rSelectedRange.aEnd.Tab()))
+ if (rSelectedRange.aStart.Tab() > rRefRange.aStart.Tab() || rRefRange.aEnd.Tab() > rSelectedRange.aEnd.Tab())
// Sheet references not within selected range.
return false;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 96b3d6623364..f2d80f1d5bf9 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -301,7 +301,7 @@ void ScDocShell::AfterXMLLoading(bool bRet)
{
if ( *pNameBuffer == '\'' && *(pNameBuffer-1) != '\\' )
bQuote = false;
- else if( !(*pNameBuffer == '\\' && *(pNameBuffer+1) == '\'') )
+ else if( *pNameBuffer != '\\' || *(pNameBuffer+1) != '\'' )
aDocURLBuffer.append(*pNameBuffer); // If escaped quote: only quote in the name
++pNameBuffer;
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index c61144fab693..7912d7ec389a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1895,7 +1895,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
const sal_Unicode* q = p;
while( *q && *q != ';' )
q++;
- if ( !(*q == ';' && *(q+1) == 'I') && !bInvalidCol && !bInvalidRow )
+ if ( (*q != ';' || *(q+1) != 'I') && !bInvalidCol && !bInvalidRow )
{ // don't ignore value
if( bText )
{
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2a4153756eb1..276a2bd42dbf 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2857,8 +2857,8 @@ css::uno::Reference<css::uno::XInterface> ScModelObj::create(
// #i64497# If a chart is in a temporary document during clipboard paste,
// there should be no data provider, so that own data is used
bool bCreate =
- ! ( nType == ServiceType::CHDATAPROV &&
- ( pDocShell->GetCreateMode() == SfxObjectCreateMode::INTERNAL ));
+ ( nType != ServiceType::CHDATAPROV ||
+ ( pDocShell->GetCreateMode() != SfxObjectCreateMode::INTERNAL ));
// this should never happen, i.e. the temporary document should never be
// loaded, because this unlinks the data
assert(bCreate);
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index a9dfdc4db199..ff7e37538c08 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -1117,7 +1117,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
else
{
CommentCaptionState eState = pDoc->GetAllNoteCaptionsState( aRanges );
- bool bAllNotesInShown = !(eState == ALLHIDDEN || eState == MIXED);
+ bool bAllNotesInShown = (eState != ALLHIDDEN && eState != MIXED);
rSet.Put( SfxBoolItem( SID_TOGGLE_NOTES, bAllNotesInShown) );
}
}
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 4db57dc43f26..0ee0cc1b2f9d 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1381,9 +1381,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY );
pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, true );
- if ( !( pData->GetSimpleArea( nStartX, nStartY, nStartTab,
- nEndX, nEndY, nEndTab ) == SC_MARK_SIMPLE &&
- nStartTab == nEndTab ) )
+ if ( pData->GetSimpleArea( nStartX, nStartY, nStartTab,
+ nEndX, nEndY, nEndTab ) != SC_MARK_SIMPLE ||
+ nStartTab != nEndTab )
{
// the destination is not a simple range,
// assume the destination as the current cell
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1de54e8f03e5..284fc13a29a8 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -6056,7 +6056,7 @@ void ScGridWindow::UpdateCursorOverlay()
SCCOL nX2 = nX + rMerge.GetColMerge() - 1;
SCROW nY2 = nY + rMerge.GetRowMerge() - 1;
// Check if the middle or tail of the merged range is visible.
- if (!(maVisibleRange.mnCol1 <= nX2 && maVisibleRange.mnRow1 <= nY2))
+ if (maVisibleRange.mnCol1 > nX2 || maVisibleRange.mnRow1 > nY2)
return; // no visible part
}
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 97e5dd9babd9..bf78bc7f21ee 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -513,7 +513,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
SCCOL nColSpan = pMergeAttr->GetColMerge();
SCROW nRowSpan = pMergeAttr->GetRowMerge();
- if ( !( nCurX >= nBlockStartXOrig + nColSpan - 1 && nCurY >= nBlockStartYOrig + nRowSpan - 1 ) )
+ if ( nCurX < nBlockStartXOrig + nColSpan - 1 || nCurY < nBlockStartYOrig + nRowSpan - 1 )
{
nBlockStartX = nCurX >= nBlockStartXOrig ? nBlockStartXOrig : nBlockStartXOrig + nColSpan - 1;
nBlockStartY = nCurY >= nBlockStartYOrig ? nBlockStartYOrig : nBlockStartYOrig + nRowSpan - 1;
@@ -538,7 +538,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
SCCOL nColSpan = pMergeAttr->GetColMerge();
SCROW nRowSpan = pMergeAttr->GetRowMerge();
- if ( !( nBlockStartX >= nCurX + nColSpan - 1 && nBlockStartY >= nCurY + nRowSpan - 1 ) )
+ if ( nBlockStartX < nCurX + nColSpan - 1 || nBlockStartY < nCurY + nRowSpan - 1 )
{
if ( nBlockStartX <= nCurX + nColSpan - 1 )
{
@@ -550,8 +550,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
SCROW nCurYOffsetTemp = (nCurY < nCurY + nRowSpan - 1) ? nRowSpan - 1 : 0;
nCurYOffset = std::max(nCurYOffset, nCurYOffsetTemp);
}
- if ( !( nBlockStartX <= nCurX && nBlockStartY <= nCurY ) &&
- !( nBlockStartX > nCurX + nColSpan - 1 && nBlockStartY > nCurY + nRowSpan - 1 ) )
+ if ( ( nBlockStartX > nCurX || nBlockStartY > nCurY ) &&
+ ( nBlockStartX <= nCurX + nColSpan - 1 || nBlockStartY <= nCurY + nRowSpan - 1 ) )
{
nBlockStartXOffset = (nBlockStartX > nCurX && nBlockStartX <= nCurX + nColSpan - 1) ? nCurX - nBlockStartX : 0;
nBlockStartYOffset = (nBlockStartY > nCurY && nBlockStartY <= nCurY + nRowSpan - 1) ? nCurY - nBlockStartY : 0;
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index c19b87e67645..c766ac790f5e 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1316,7 +1316,7 @@ void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase const * pStyleS
SdStyleSheet* pRealSheet = static_cast<SdStyleSheet const *>(pStyleSheet)->GetRealStyleSheet();
pRealSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
- if( !((ePO >= PresentationObjects::Outline_1) && (ePO <= PresentationObjects::Outline_8)) )
+ if( (ePO < PresentationObjects::Outline_1) || (ePO > PresentationObjects::Outline_8) )
return;
OUString sStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " ");
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index 46311702b3e4..81b1df15356d 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -752,7 +752,7 @@ void ParagraphObj::ImplClear()
void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight )
{
- if ( !(( nNumberingType == SVX_NUM_BITMAP ) && ( nBulletId != 0xffff )) )
+ if ( ( nNumberingType != SVX_NUM_BITMAP ) || ( nBulletId == 0xffff ) )
return;
// calculate the bullet real size for this graphic
diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx
index fd9d27da3d1d..62d3ba6336a1 100644
--- a/sd/source/ui/app/tmplctrl.cxx
+++ b/sd/source/ui/app/tmplctrl.cxx
@@ -97,7 +97,7 @@ void SdTemplateControl::Paint( const UserDrawEvent& )
void SdTemplateControl::Command( const CommandEvent& rCEvt )
{
- if ( !(rCEvt.GetCommand() == CommandEventId::ContextMenu && !GetStatusBar().GetItemText( GetId() ).isEmpty()) )
+ if ( rCEvt.GetCommand() != CommandEventId::ContextMenu || GetStatusBar().GetItemText( GetId() ).isEmpty() )
return;
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 21185602e2bb..7dc5177fc8b2 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -673,7 +673,7 @@ SdNavigatorControllerItem::SdNavigatorControllerItem(
void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
SfxItemState eState, const SfxPoolItem* pItem )
{
- if( !(eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_STATE) )
+ if( eState < SfxItemState::DEFAULT || nSId != SID_NAVIGATOR_STATE )
return;
const SfxUInt32Item& rStateItem = dynamic_cast<const SfxUInt32Item&>(*pItem);
@@ -739,7 +739,7 @@ SdPageNameControllerItem::SdPageNameControllerItem(
void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
SfxItemState eState, const SfxPoolItem* pItem )
{
- if( !(eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_PAGENAME) )
+ if( eState < SfxItemState::DEFAULT || nSId != SID_NAVIGATOR_PAGENAME )
return;
// only if doc in LB is the active
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 932f8e6da24f..1efdd922277a 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -1386,7 +1386,7 @@ void MultiSelectionModeHandler::UpdateSelection()
maSecondCorner,
false,
false));
- if (!(nIndexUnderMouse>=0 && nIndexUnderMouse<nPageCount))
+ if (nIndexUnderMouse < 0 || nIndexUnderMouse >= nPageCount)
return;
if (mnAnchorIndex < 0)
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index f6358f3629c2..2883be985b46 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -148,7 +148,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
sal_Int32 nWhatPage = static_cast<sal_Int32>(pWhatPage->GetValue ());
PageKind nWhatKind = static_cast<PageKind>(pWhatKind->GetValue ());
- if (! (nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout))
+ if (nWhatKind < PageKind::Standard || nWhatKind > PageKind::Handout)
{
#if HAVE_FEATURE_SCRIPTING
StarBASIC::FatalError (ERRCODE_BASIC_BAD_PROP_VALUE);
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index 772cf4a48ddb..372cb555ebdf 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -141,7 +141,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
}
// If it is not a group object, we disable "ungroup"
- if(!(dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && nInv == SdrInventor::Default))
+ if(dynamic_cast< const SdrObjGroup *>( pObj ) == nullptr || nInv != SdrInventor::Default)
{
rSet.DisableItem(SID_UNGROUP);
}
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 12470903d5a3..28e163e5bebc 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -180,7 +180,8 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
{
const bool bDoCreateGeometry(pObject->getSdrPageFromSdrObject()->checkVisibility( rOriginal, rDisplayInfo, true ));
- if(!bDoCreateGeometry && !(( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == OBJ_PAGE )) )
+ if(!bDoCreateGeometry &&
+ (( pObject->GetObjInventor() != SdrInventor::Default ) || ( pObject->GetObjIdentifier() != OBJ_PAGE )) )
return xRetval;
PresObjKind eKind(PresObjKind::NONE);
commit 5f56f07e9278e357a079cbecb5366da98e36d97f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri May 29 14:04:44 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 29 20:56:06 2020 +0200
use for-range loop on Sequence
Change-Id: Ib2d7b21e0fa52087027c0b3b1d362693c7019ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 311edd303a86..2c3a6f937652 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -761,14 +761,14 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
if ( !xOrigInfo.is() )
throw uno::RuntimeException();
- uno::Sequence< beans::Property > aPropertiesList = xOrigInfo->getProperties();
- for ( sal_Int32 nInd = 0; nInd < aPropertiesList.getLength(); nInd++ )
+ const uno::Sequence< beans::Property > aPropertiesList = xOrigInfo->getProperties();
+ for ( const auto & p : aPropertiesList )
{
try
{
xTargetProps->setPropertyValue(
- aPropertiesList[nInd].Name,
- xOrigProps->getPropertyValue( aPropertiesList[nInd].Name ) );
+ p.Name,
+ xOrigProps->getPropertyValue( p.Name ) );
}
catch (const beans::PropertyVetoException&)
{
diff --git a/comphelper/source/misc/AccessibleImplementationHelper.cxx b/comphelper/source/misc/AccessibleImplementationHelper.cxx
index ceba64e04800..a45b6e5f3cd7 100644
--- a/comphelper/source/misc/AccessibleImplementationHelper.cxx
+++ b/comphelper/source/misc/AccessibleImplementationHelper.cxx
@@ -31,11 +31,10 @@ namespace comphelper
OUString GetkeyBindingStrByXkeyBinding(const Sequence<KeyStroke>& keySet)
{
OUStringBuffer buf;
- for (int iIndex = 0; iIndex < keySet.getLength(); iIndex++)
+ for (const auto& k : keySet)
{
- KeyStroke stroke = keySet[iIndex];
buf.append('\n');
- buf.append(stroke.KeyChar);
+ buf.append(k.KeyChar);
}
return buf.makeStringAndClear();
}
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx
index 5381f48a62aa..4476e7f17717 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -411,14 +411,10 @@ namespace
e.Context, anyEx );
}
- for (sal_Int32 i = 0; i < xAllPackages.getLength(); ++i)
+ for (const uno::Sequence< uno::Reference< deployment::XPackage > > & xPackageList : std::as_const(xAllPackages))
{
- uno::Sequence< uno::Reference< deployment::XPackage > > xPackageList = xAllPackages[i];
-
- for (sal_Int32 j = 0; j < xPackageList.getLength(); ++j)
+ for (const uno::Reference< deployment::XPackage > & xPackage : xPackageList)
{
- uno::Reference< deployment::XPackage > xPackage = xPackageList[j];
-
if (xPackage.is())
{
maEntries.emplace_back(xPackage);
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index 1b6f323eb458..4dd9c8312bee 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -119,16 +119,16 @@ bool DocPasswordHelper::IsModifyPasswordCorrect( const OUString& aPassword, cons
uno::Sequence< sal_Int8 > aHash;
sal_Int32 nCount = 0;
- for ( sal_Int32 nInd = 0; nInd < aInfo.getLength(); nInd++ )
+ for ( const auto & prop : aInfo )
{
- if ( aInfo[nInd].Name == "algorithm-name" )
- aInfo[nInd].Value >>= sAlgorithm;
- else if ( aInfo[nInd].Name == "salt" )
- aInfo[nInd].Value >>= aSalt;
- else if ( aInfo[nInd].Name == "iteration-count" )
- aInfo[nInd].Value >>= nCount;
- else if ( aInfo[nInd].Name == "hash" )
- aInfo[nInd].Value >>= aHash;
+ if ( prop.Name == "algorithm-name" )
+ prop.Value >>= sAlgorithm;
+ else if ( prop.Name == "salt" )
+ prop.Value >>= aSalt;
+ else if ( prop.Name == "iteration-count" )
+ prop.Value >>= nCount;
+ else if ( prop.Name == "hash" )
+ prop.Value >>= aHash;
}
if ( sAlgorithm == "PBKDF2" && aSalt.hasElements() && nCount > 0 && aHash.hasElements() )
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index d0858a89d578..b41b1d3850c7 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -203,9 +203,9 @@ OUString MimeConfigurationHelper::GetDocServiceNameFromFilter( const OUString& a
uno::Sequence< beans::PropertyValue > aFilterData;
if ( aFilterAnyData >>= aFilterData )
{
- for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ )
- if ( aFilterData[nInd].Name == "DocumentService" )
- aFilterData[nInd].Value >>= aDocServiceName;
+ for ( const auto & prop : std::as_const(aFilterData) )
+ if ( prop.Name == "DocumentService" )
+ prop.Value >>= aDocServiceName;
}
}
catch( uno::Exception& )
@@ -234,11 +234,11 @@ OUString MimeConfigurationHelper::GetDocServiceNameFromMediaType( const OUString
uno::Sequence< beans::PropertyValue > aType;
if ( xEnum->nextElement() >>= aType )
{
- for ( sal_Int32 nInd = 0; nInd < aType.getLength(); nInd++ )
+ for ( const auto & prop : std::as_const(aType) )
{
OUString aFilterName;
- if ( aType[nInd].Name == "PreferredFilter"
- && ( aType[nInd].Value >>= aFilterName ) && !aFilterName.isEmpty() )
+ if ( prop.Name == "PreferredFilter"
+ && ( prop.Value >>= aFilterName ) && !aFilterName.isEmpty() )
{
OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName );
if ( !aDocumentName.isEmpty() )
@@ -452,17 +452,17 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu
{
try
{
- uno::Sequence< OUString > aClassIDs = xObjConfig->getElementNames();
- for ( sal_Int32 nInd = 0; nInd < aClassIDs.getLength(); nInd++ )
+ const uno::Sequence< OUString > aClassIDs = xObjConfig->getElementNames();
+ for ( const OUString & id : aClassIDs )
{
uno::Reference< container::XNameAccess > xObjectProps;
OUString aEntryDocName;
- if ( ( xObjConfig->getByName( aClassIDs[nInd] ) >>= xObjectProps ) && xObjectProps.is()
+ if ( ( xObjConfig->getByName( id ) >>= xObjectProps ) && xObjectProps.is()
&& ( xObjectProps->getByName("ObjectDocumentServiceName") >>= aEntryDocName )
&& aEntryDocName == aDocName )
{
- return GetObjPropsFromConfigEntry( GetSequenceClassIDRepresentation( aClassIDs[nInd] ),
+ return GetObjPropsFromConfigEntry( GetSequenceClassIDRepresentation( id ),
xObjectProps );
}
}
@@ -518,13 +518,13 @@ OUString MimeConfigurationHelper::GetFactoryNameByDocumentName( const OUString&
{
try
{
- uno::Sequence< OUString > aClassIDs = xObjConfig->getElementNames();
- for ( sal_Int32 nInd = 0; nInd < aClassIDs.getLength(); nInd++ )
+ const uno::Sequence< OUString > aClassIDs = xObjConfig->getElementNames();
+ for ( const OUString & id : aClassIDs )
{
uno::Reference< container::XNameAccess > xObjectProps;
OUString aEntryDocName;
- if ( ( xObjConfig->getByName( aClassIDs[nInd] ) >>= xObjectProps ) && xObjectProps.is()
+ if ( ( xObjConfig->getByName( id ) >>= xObjectProps ) && xObjectProps.is()
&& ( xObjectProps->getByName( "ObjectDocumentServiceName" ) >>= aEntryDocName )
&& aEntryDocName == aDocName )
{
@@ -563,9 +563,9 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
{
OUString aFilterName;
- for ( sal_Int32 nInd = 0; nInd < aMediaDescr.getLength(); nInd++ )
- if ( aMediaDescr[nInd].Name == "FilterName" )
- aMediaDescr[nInd].Value >>= aFilterName;
+ for ( const auto & prop : std::as_const(aMediaDescr) )
+ if ( prop.Name == "FilterName" )
+ prop.Value >>= aFilterName;
if ( aFilterName.isEmpty() )
{
@@ -582,9 +582,9 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
OUString aTypeName = xTypeDetection->queryTypeByDescriptor( aTempMD, true );
// get FilterName
- for ( sal_Int32 nInd = 0; nInd < aTempMD.getLength(); nInd++ )
- if ( aTempMD[nInd].Name == "FilterName" )
- aTempMD[nInd].Value >>= aFilterName;
+ for ( const auto & prop : std::as_const(aTempMD) )
+ if ( prop.Name == "FilterName" )
+ prop.Value >>= aFilterName;
if ( !aFilterName.isEmpty() )
{
@@ -601,14 +601,14 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
if ( xNameAccess.is() && ( xNameAccess->getByName( aTypeName ) >>= aTypes ) )
{
- for ( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ )
+ for ( const auto & prop : std::as_const(aTypes) )
{
- if ( aTypes[nInd].Name == "PreferredFilter" && ( aTypes[nInd].Value >>= aFilterName ) )
+ if ( prop.Name == "PreferredFilter" && ( prop.Value >>= aFilterName ) )
{
sal_Int32 nOldLen = aMediaDescr.getLength();
aMediaDescr.realloc( nOldLen + 1 );
aMediaDescr[nOldLen].Name = "FilterName";
- aMediaDescr[ nOldLen ].Value = aTypes[nInd].Value;
+ aMediaDescr[ nOldLen ].Value = prop.Value;
break;
}
}
@@ -624,10 +624,10 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
uno::Sequence< beans::NamedValue >& aObject )
{
OUString aDocName;
- for ( sal_Int32 nInd = 0; nInd < aObject.getLength(); nInd++ )
- if ( aObject[nInd].Name == "ObjectDocumentServiceName" )
+ for ( const auto & nv : std::as_const(aObject) )
+ if ( nv.Name == "ObjectDocumentServiceName" )
{
- aObject[nInd].Value >>= aDocName;
+ nv.Value >>= aDocName;
break;
}
@@ -862,14 +862,7 @@ uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
bool MimeConfigurationHelper::ClassIDsEqual( const uno::Sequence< sal_Int8 >& aClassID1, const uno::Sequence< sal_Int8 >& aClassID2 )
{
- if ( aClassID1.getLength() != aClassID2.getLength() )
- return false;
-
- for ( sal_Int32 nInd = 0; nInd < aClassID1.getLength(); nInd++ )
- if ( aClassID1[nInd] != aClassID2[nInd] )
- return false;
-
- return true;
+ return aClassID1 == aClassID2;
}
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index e01e49b654b8..01cec5831223 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -474,7 +474,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreateGpgPackageEncryptionDat
comphelper::getProcessComponentContext()));
// fire up certificate chooser dialog - user can multi-select!
- uno::Sequence< uno::Reference< security::XCertificate > > xSignCertificates=
+ const uno::Sequence< uno::Reference< security::XCertificate > > xSignCertificates=
xSigner->chooseEncryptionCertificate();
if (!xSignCertificates.hasElements())
@@ -493,12 +493,11 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreateGpgPackageEncryptionDat
throw uno::RuntimeException("The GpgME library failed to initialize for the OpenPGP protocol.");
ctx->setArmor(false);
- const uno::Reference< security::XCertificate >* pCerts=xSignCertificates.getConstArray();
- for (sal_uInt32 i = 0, nNum = xSignCertificates.getLength(); i < nNum; i++, pCerts++)
+ for (const auto & cert : xSignCertificates)
{
uno::Sequence < sal_Int8 > aKeyID;
- if (pCerts->is())
- aKeyID = (*pCerts)->getSHA1Thumbprint();
+ if (cert.is())
+ aKeyID = cert->getSHA1Thumbprint();
std::vector<GpgME::Key> keys;
keys.push_back(
@@ -526,7 +525,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreateGpgPackageEncryptionDat
if(crypt_res.error() || !len)
throw lang::IllegalArgumentException(
"Not a suitable key, or failed to encrypt.",
- css::uno::Reference<css::uno::XInterface>(), i);
+ css::uno::Reference<css::uno::XInterface>(), -1);
uno::Sequence < sal_Int8 > aCipherValue(len);
result = cipher.seek(0,SEEK_SET);
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx
index 46785b35cbba..bde7bb00280e 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -156,21 +156,21 @@ void WriteRelationsInfoSequence(
xWriter->startDocument();
xWriter->startElement( aRelListElement, xRootAttrList );
- for ( sal_Int32 nInd = 0; nInd < aSequence.getLength(); nInd++ )
+ for ( const auto & i : aSequence )
{
AttributeList *pAttrList = new AttributeList;
uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList );
- for( sal_Int32 nSecInd = 0; nSecInd < aSequence[nInd].getLength(); nSecInd++ )
+ for( const beans::StringPair & pair : i )
{
- if ( !(aSequence[nInd][nSecInd].First == "Id"
- || aSequence[nInd][nSecInd].First == "Type"
- || aSequence[nInd][nSecInd].First == "TargetMode"
- || aSequence[nInd][nSecInd].First == "Target") )
+ if ( !(pair.First == "Id"
+ || pair.First == "Type"
+ || pair.First == "TargetMode"
+ || pair.First == "Target") )
{
// TODO/LATER: should the extensions be allowed?
throw lang::IllegalArgumentException();
}
- pAttrList->AddAttribute( aSequence[nInd][nSecInd].First, aCDATAString, aSequence[nInd][nSecInd].Second );
+ pAttrList->AddAttribute( pair.First, aCDATAString, pair.Second );
}
xWriter->startElement( aRelElement, xAttrList );
@@ -215,24 +215,24 @@ void WriteContentSequence(
xWriter->startDocument();
xWriter->startElement( aTypesElement, xRootAttrList );
- for ( sal_Int32 nInd = 0; nInd < aDefaultsSequence.getLength(); nInd++ )
+ for ( const beans::StringPair & pair : aDefaultsSequence )
{
AttributeList *pAttrList = new AttributeList;
uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList );
- pAttrList->AddAttribute( "Extension", aCDATAString, aDefaultsSequence[nInd].First );
- pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aDefaultsSequence[nInd].Second );
+ pAttrList->AddAttribute( "Extension", aCDATAString, pair.First );
+ pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second );
xWriter->startElement( aDefaultElement, xAttrList );
xWriter->ignorableWhitespace( aWhiteSpace );
xWriter->endElement( aDefaultElement );
}
- for ( sal_Int32 nInd = 0; nInd < aOverridesSequence.getLength(); nInd++ )
+ for ( const beans::StringPair & pair : aOverridesSequence )
{
AttributeList *pAttrList = new AttributeList;
uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList );
- pAttrList->AddAttribute( "PartName", aCDATAString, aOverridesSequence[nInd].First );
- pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aOverridesSequence[nInd].Second );
+ pAttrList->AddAttribute( "PartName", aCDATAString, pair.First );
+ pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second );
xWriter->startElement( aOverrideElement, xAttrList );
xWriter->ignorableWhitespace( aWhiteSpace );
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index d871a8033410..02c2512e7872 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1226,8 +1226,7 @@ namespace numfunc
void SwDefBulletConfig::LoadConfig()
{
uno::Sequence<OUString> aPropNames = GetPropNames();
- uno::Sequence<uno::Any> aValues =
- GetProperties( aPropNames );
+ uno::Sequence<uno::Any> aValues = GetProperties( aPropNames );
const uno::Any* pValues = aValues.getConstArray();
OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
"<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed");
More information about the Libreoffice-commits
mailing list