summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-11 15:56:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-12 10:31:25 +0100
commitf147b160aef1735d34c488353a7d4b875788a7e1 (patch)
treeab3bd613cf016cde906b3fdcbaab4246ca699e1e
parent718f540fb63af27c1336f89213444e9af753b8a9 (diff)
clang-analyzer-deadcode.DeadStores
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basic/source/classes/sbunoobj.cxx6
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx4
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx2
-rw-r--r--desktop/source/lib/init.cxx1
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx2
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx7
-rw-r--r--hwpfilter/source/hgzip.cxx3
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx6
-rw-r--r--oox/source/export/shapes.cxx4
-rw-r--r--sal/qa/osl/file/osl_File.cxx2
-rw-r--r--sc/source/core/data/column2.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx4
-rw-r--r--sc/source/core/data/fillinfo.cxx37
-rw-r--r--sc/source/core/tool/address.cxx4
-rw-r--r--sc/source/core/tool/compiler.cxx5
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx4
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx1
-rw-r--r--sc/source/ui/view/formatsh.cxx24
-rw-r--r--sc/source/ui/view/output2.cxx6
-rw-r--r--sd/source/filter/eppt/epptso.cxx12
-rw-r--r--sd/source/ui/view/drviews1.cxx5
-rw-r--r--sdext/source/pdfimport/filterdet.cxx15
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx4
-rw-r--r--svtools/source/svrtf/parrtf.cxx4
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx12
-rw-r--r--svx/source/accessibility/AccessibleFrameSelector.cxx3
-rw-r--r--svx/source/dialog/svxruler.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx1
-rw-r--r--sw/source/core/doc/tblrwcl.cxx1
-rw-r--r--sw/source/core/edit/ednumber.cxx10
-rw-r--r--sw/source/core/fields/authfld.cxx9
-rw-r--r--sw/source/core/frmedt/feshview.cxx8
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx2
-rw-r--r--sw/source/core/text/wrong.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx2
-rw-r--r--sw/source/uibase/shells/listsh.cxx3
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx3
-rw-r--r--tools/source/stream/strmunx.cxx4
-rw-r--r--ucb/source/cacher/cachedcontentresultset.cxx2
-rw-r--r--ucb/source/ucp/ftp/ftpdirp.cxx2
-rw-r--r--vcl/qt5/Qt5Widget.cxx6
-rw-r--r--vcl/source/app/svapp.cxx5
-rw-r--r--vcl/source/fontsubset/cff.cxx2
-rw-r--r--vcl/source/fontsubset/sft.cxx2
-rw-r--r--vcl/source/gdi/bitmapex.cxx2
-rw-r--r--vcl/source/outdev/outdevstate.cxx1
-rw-r--r--vcl/source/treelist/svimpbox.cxx3
-rw-r--r--vcl/source/window/printdlg.cxx4
-rw-r--r--vcl/unx/generic/app/i18n_xkb.cxx6
-rw-r--r--vcl/unx/generic/print/common_gfx.cxx4
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx4
56 files changed, 86 insertions, 205 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index ab3d5e54be40..4ba943acaf05 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4661,9 +4661,9 @@ void SbUnoStructRefObject::initMemberCache()
return;
typelib_TypeDescription * pTD = nullptr;
maMemberInfo.getType().getDescription(&pTD);
- typelib_CompoundTypeDescription * pCompTypeDescr = reinterpret_cast<typelib_CompoundTypeDescription *>(pTD);
- for ( pCompTypeDescr = reinterpret_cast<typelib_CompoundTypeDescription *>(pTD); pCompTypeDescr;
- pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
+ for ( typelib_CompoundTypeDescription * pCompTypeDescr = reinterpret_cast<typelib_CompoundTypeDescription *>(pTD);
+ pCompTypeDescr;
+ pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
{
typelib_TypeDescriptionReference ** ppTypeRefs = pCompTypeDescr->ppTypeRefs;
rtl_uString ** ppNames = pCompTypeDescr->ppMemberNames;
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 048fa1a8bb64..8543c0817762 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3389,7 +3389,7 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool)
if (nNumDigitsAfterDecimal > 0)
{
- sal_Int32 nActualDigits = nNumDigitsAfterDecimal;
+ sal_Int32 nActualDigits;
const sal_Int32 nSepPos = aResult.indexOf(decSep);
if (nSepPos == -1)
nActualDigits = 0;
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index e264f527c94b..24e3dba5ea35 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -310,8 +310,7 @@ static const double roundArray[] = {
|*
*/
-static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
- sal_Unicode cForceThousandSep )
+static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth )
{
short nExp = 0;
@@ -321,8 +320,6 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
sal_Unicode cDecimalSep, cThousandSep, cDecimalSepAlt;
ImpGetIntntlSep( cDecimalSep, cThousandSep, cDecimalSepAlt );
- if( cForceThousandSep )
- cThousandSep = cForceThousandSep;
// compute exponent
nExp = 0;
@@ -442,8 +439,7 @@ void ImpCvtNum( double nNum, short nPrec, OUString& rRes, bool bCoreString )
*p++ = '-';
}
double dMaxNumWithoutExp = (nPrec == 6) ? 1E6 : 1E14;
- myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum >= dMaxNumWithoutExp ) ) ? 4:0,
- cDecimalSep );
+ myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum >= dMaxNumWithoutExp ) ) ? 4:0 );
// remove trailing zeros
for( p = cBuf; *p &&( *p != 'E' ); p++ ) {}
q = p; p--;
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index b3b49fa02df8..5cc4b41a099f 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -120,10 +120,6 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
{
for( sal_Int32 nN=0; nN<m_aCategories.getLength(); nN++ )
m_xED_CrossesAtCategory->append_text(m_aCategories[nN]);
-
- sal_Int32 nCount = m_xED_CrossesAtCategory->get_count();
- if( nCount>30 )
- nCount=30;
}
if( m_xLB_CrossesAt->get_count() > 3 )
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 7445c95822e1..3e36d77eb29d 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1446,7 +1446,7 @@ Sequence< Reference<deployment::XPackage> > PackageManagerImpl::getExtensionsWit
sal_Int32 failedPrereq = dbData.failedPrerequisites.toInt32();
//If the installation failed for other reason then the license then we
//ignore it.
- if (failedPrereq ^= deployment::Prerequisites::LICENSE)
+ if (failedPrereq ^ deployment::Prerequisites::LICENSE)
continue;
//Prepare the URL to the extension
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0495fb9febc6..ed3bc77c2667 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2459,7 +2459,6 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
aFilterOptions = temp + aFilterOptions.copy(bIndex+12);
}
- aIndex = -1;
if ((aIndex = aFilterOptions.indexOf(",FullSheetPreview=")) >= 0)
{
int bIndex = aFilterOptions.indexOf("FULLSHEETPREVEND");
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a5cbdc97447b..352557c85e8a 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1848,7 +1848,7 @@ namespace accessibility
sal_Int32 nCurIndex=0, nLastIndex=0, nCurLineLen=0;
sal_Int32 nLastLineLen = 0, nBulletLen = 0;
// get the line before the line the index points into
- for( nLine=0, nCurIndex=0, nLastIndex=0; nLine<nLineCount; ++nLine )
+ for( nLine=0, nCurIndex=0; nLine<nLineCount; ++nLine )
{
nLastIndex = nCurIndex;
if (nLine == 0)
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index b78fbbbca5a3..bbd59c055d34 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -743,7 +743,6 @@ sal_uInt64 PictReader::ReadPixMapEtc( BitmapEx &rBitmap, bool bBaseAddr, bool bC
nWidth = nWidth - nBndX;
if (nWidth == 0)
return 0xffffffff;
- sal_uInt16 nDstBitCount = 1;
std::vector<Color> aPalette;
const bool bNotMonoChrome = (nRowBytes & 0x8000) != 0;
@@ -760,12 +759,6 @@ sal_uInt64 PictReader::ReadPixMapEtc( BitmapEx &rBitmap, bool bBaseAddr, bool bC
pPict->SeekRel( 8 );
nDataSize += 46;
- nDstBitCount = nPixelSize;
- if ( nDstBitCount > 8 )
- nDstBitCount = 24;
- else if ( nDstBitCount == 2 )
- nDstBitCount = 4;
-
if ( bColorTable )
{
pPict->SeekRel( 6 );
diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index d26ea22c8824..58d6ca015b89 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -153,7 +153,6 @@ size_t gz_read(gz_stream * file, voidp buf, unsigned len)
//printf("@@ gz_read : len : %d\t",len);
gz_stream *s = file;
Bytef *start = static_cast<Bytef *>(buf); /* starting point for crc computation */
- Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
if (s == nullptr)
return 0;
@@ -162,7 +161,7 @@ size_t gz_read(gz_stream * file, voidp buf, unsigned len)
if (s->z_err == Z_STREAM_END)
return 0; /* EOF */
- s->stream.next_out = next_out = static_cast<Bytef *>(buf);
+ s->stream.next_out = static_cast<Bytef *>(buf);
s->stream.avail_out = len;
while (s->stream.avail_out != 0)
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index d10db0953e47..ec986bcf9dcc 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -359,17 +359,17 @@ OUString NativeToAscii(const OUString& inStr,
} else {
if ((index = numberChar.indexOf(str[i])) >= 0)
newStr[count] = sal::static_int_cast<sal_Unicode>( (index % 10) + NUMBER_ZERO );
- else if ((index = separatorChar.indexOf(str[i])) >= 0 &&
+ else if (separatorChar.indexOf(str[i]) >= 0 &&
(i < nCount-1 && (numberChar.indexOf(str[i+1]) >= 0 ||
multiplierChar.indexOf(str[i+1]) >= 0)))
newStr[count] = SeparatorChar[NumberChar_HalfWidth];
- else if ((index = decimalChar.indexOf(str[i])) >= 0 &&
+ else if (decimalChar.indexOf(str[i]) >= 0 &&
(i < nCount-1 && (numberChar.indexOf(str[i+1]) >= 0 ||
multiplierChar.indexOf(str[i+1]) >= 0)))
// Only when decimal point is followed by numbers,
// it will be convert to ASCII decimal point
newStr[count] = DecimalChar[NumberChar_HalfWidth];
- else if ((index = minusChar.indexOf(str[i])) >= 0 &&
+ else if (minusChar.indexOf(str[i]) >= 0 &&
(i < nCount-1 && (numberChar.indexOf(str[i+1]) >= 0 ||
multiplierChar.indexOf(str[i+1]) >= 0)))
// Only when minus is followed by numbers,
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 0c00ad744bcc..4b2a66b89487 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1217,13 +1217,13 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
pFS->startElementNS(mnXmlNamespace, XML_nvPicPr);
OUString sName, sDescr, sURL;
- bool bHaveName, bHaveDesc, bHaveURL;
+ bool bHaveName, bHaveDesc;
if ( ( bHaveName= GetProperty( xShapeProps, "Name" ) ) )
mAny >>= sName;
if ( ( bHaveDesc = GetProperty( xShapeProps, "Description" ) ) )
mAny >>= sDescr;
- if ( ( bHaveURL = GetProperty( xShapeProps, "URL" ) ) )
+ if ( GetProperty( xShapeProps, "URL" ) )
mAny >>= sURL;
pFS->startElementNS( mnXmlNamespace, XML_cNvPr,
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 32a9509dd00d..dbe461ae3f53 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -351,7 +351,7 @@ static bool checkDirectory(const OUString& str, oslCheckMode nCheckMode)
break;
case oslCheckMode::WriteAccess:
((aUString += str) += aSlashURL) += aTmpName2;
- if ((rc = Directory::create(aUString)) == osl::FileBase::E_None)
+ if (Directory::create(aUString) == osl::FileBase::E_None)
{
bCheckResult = true;
rc = Directory::remove(aUString);
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 10e09421fa98..f00da7667514 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1748,7 +1748,7 @@ void ScColumn::CopyCellTextAttrsToDocument(SCROW nRow1, SCROW nRow2, ScColumn& r
// Specified range not found. Bail out.
return;
- size_t nBlockEnd = nBlockStart + itBlk->size;
+ size_t nBlockEnd;
size_t nOffsetInBlock = nRowPos - nBlockStart;
nRowPos = static_cast<size_t>(nRow2); // End row position.
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 3a0db48fc0d7..395bb62149d4 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -722,11 +722,11 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData&
if(bIsGrowing) // cell is growing larger
{
// To actually grow the image, we need to take the max
- fWidthFactor = fHeightFactor = std::max(fWidthFactor, fHeightFactor);
+ fWidthFactor = std::max(fWidthFactor, fHeightFactor);
}
else if(bIsShrinking) // cell is growing smaller, take the min
{
- fWidthFactor = fHeightFactor = std::min(fWidthFactor, fHeightFactor);
+ fWidthFactor = std::min(fWidthFactor, fHeightFactor);
}
// We don't want the image to become larger than the current cell
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 747d69b91fbb..2f27bffb78ec 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -373,27 +373,6 @@ void ScDocument::FillInfo(
bool bTabProtect = IsTabProtected(nTab);
- // for block marks of merged cells
- // with hidden first row/column
- bool bPaintMarks = false;
- SCCOL nBlockStartX = 0, nBlockEndX = 0;
- SCROW nBlockEndY = 0, nBlockStartY = 0;
- if (pMarkData && pMarkData->IsMarked())
- {
- ScRange aTmpRange;
- pMarkData->GetMarkArea(aTmpRange);
- if ( nTab >= aTmpRange.aStart.Tab() && nTab <= aTmpRange.aEnd.Tab() )
- {
- nBlockStartX = aTmpRange.aStart.Col();
- nBlockStartY = aTmpRange.aStart.Row();
- nBlockEndX = aTmpRange.aEnd.Col();
- nBlockEndY = aTmpRange.aEnd.Row();
- ExtendHidden( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY, nTab ); //? needed ?
- if (!pMarkData->IsMarkNegative())
- bPaintMarks = true;
- }
- }
-
// first only the entries for the entire column
nArrRow=0;
@@ -750,22 +729,6 @@ void ScDocument::FillInfo(
pInfo->pShadowAttr = static_cast<const SvxShadowItem*>(pItem);
if (pInfo->pShadowAttr != pDefShadow)
bAnyShadow = true;
-
- // Block marks - again with the original merge values
-
- bool bCellMarked = false;
- if (bPaintMarks)
- bCellMarked = ( nStartX >= nBlockStartX
- && nStartX <= nBlockEndX
- && nStartY >= nBlockStartY
- && nStartY <= nBlockEndY );
- if (pMarkData && pMarkData->IsMultiMarked() && !bCellMarked)
- {
- ScMarkArray aThisMarkArr(pMarkData->GetMarkArray( nStartX ));
- SCSIZE nIndex;
- if ( aThisMarkArr.Search( nStartY, nIndex ) )
- bCellMarked=aThisMarkArr.mvData[nIndex].bMarked;
- }
}
}
}
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 94c06efc7c8d..2c7b5b07a398 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1863,7 +1863,7 @@ void ScRange::ParseRows( const ScDocument* pDoc,
{
if( p[0] == ':')
{
- p = lcl_a1_get_row( pDoc, p+1, &aEnd, &ignored, nullptr);
+ lcl_a1_get_row( pDoc, p+1, &aEnd, &ignored, nullptr);
}
else
{
@@ -1880,7 +1880,7 @@ void ScRange::ParseRows( const ScDocument* pDoc,
{
if( p[1] == 'R' || p[1] == 'r' )
{
- p = lcl_r1c1_get_row( p+1, rDetails, &aEnd, &ignored );
+ lcl_r1c1_get_row( p+1, rDetails, &aEnd, &ignored );
}
}
else
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index b7e2a1f60f4b..8da7bbdd14b5 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4043,8 +4043,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
sal_Int32 nLen1 = aTmp1.getLength();
OUStringBuffer aSym;
OUString aTmp2;
- bool bLastAlp, bNextNum;
- bLastAlp = bNextNum = true;
+ bool bLastAlp = true;
sal_Int32 nStrip = 0;
sal_Int32 nCount = nRefs;
for ( sal_Int32 j=1; j<nCount; j++ )
@@ -4060,7 +4059,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
}
if ( nLen2 )
{
- bNextNum = CharClass::isAsciiNumeric( aTmp2 );
+ bool bNextNum = CharClass::isAsciiNumeric( aTmp2 );
if ( bLastAlp == bNextNum && nStrip < 1 )
{
// Must be alternating number/string, only
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7716a973fd6e..7f65d634c3fe 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3454,7 +3454,7 @@ void ScInterpreter::ScMacro()
{ // array( cols ) one line, several columns
pDimArray->GetDim32( 1, nCs, nCe );
nC = static_cast<SCSIZE>(nCe - nCs + 1);
- nRs = nRe = 0;
+ nRs = 0;
nR = 1;
nColIdx = 0;
nRowIdx = 1;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index f0d865e239b5..bc362f89bd17 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2432,9 +2432,7 @@ Label_RetryWithNewSep:
sal_Int32 nQuotes = 0;
while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
{
- const sal_Unicode *p, *pStart;
- p = pStart = aStr.getStr();
- p += nLastOffset;
+ const sal_Unicode * p = aStr.getStr() + nLastOffset;
while (*p)
{
if (nQuotes)
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 2ad2a0605f18..b5d64eedd903 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -366,7 +366,7 @@ void ScColRowNameRangesDlg::UpdateNames()
OUString strDelim(" --- ");
OUString aString = strDelim + ScResId( STR_COLUMN ) + strDelim;
m_xLbRange->append(OUString::number(nEntryDataDelim), aString);
- if ( (nCount = xColNameRanges->size()) > 0 )
+ if ( xColNameRanges->size() > 0 )
{
std::vector<const ScRangePair*> aSortArray(xColNameRanges->CreateNameSortedArray(
pDoc ));
@@ -405,7 +405,7 @@ void ScColRowNameRangesDlg::UpdateNames()
}
aString = strDelim + ScResId( STR_ROW ) + strDelim;
m_xLbRange->append(OUString::number(nEntryDataDelim), aString);
- if ( (nCount = xRowNameRanges->size()) > 0 )
+ if ( xRowNameRanges->size() > 0 )
{
std::vector<const ScRangePair*> aSortArray(xRowNameRanges->CreateNameSortedArray(
pDoc ));
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a28f9a2eabae..8195d4e8f3ec 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1756,7 +1756,6 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
aRange.aStart = ScAddress(nStartCol, nStartRow, nTab);
aRange.aEnd = ScAddress(nEndCol, nEndRow, nTab);
- pSelRange = &aRange;
table::CellRangeAddress aRangeAddress( nTab,
aRange.aStart.Col(), aRange.aStart.Row(),
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3ed5a2a48208..a83db735127c 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1169,19 +1169,17 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
//Just use eType to judge whether the command is fired for NUMBER/PERCENT/CURRENCY/SCIENTIFIC/FRACTION
//In sidebar, users can fire SID_NUMBER_FORMAT command by operating the related UI controls before they are disable
- if(eType == SvNumFormatType::ALL
- || eType == SvNumFormatType::NUMBER
- || eType == (SvNumFormatType::NUMBER | SvNumFormatType::DEFINED)
- || eType == SvNumFormatType::PERCENT
- || eType == (SvNumFormatType::PERCENT | SvNumFormatType::DEFINED)
- || eType == SvNumFormatType::CURRENCY
- || eType == (SvNumFormatType::CURRENCY | SvNumFormatType::DEFINED)
- || eType == SvNumFormatType::SCIENTIFIC
- || eType == (SvNumFormatType::SCIENTIFIC | SvNumFormatType::DEFINED)
- || eType == SvNumFormatType::FRACTION
- || eType == (SvNumFormatType::FRACTION | SvNumFormatType::DEFINED))
- eType = SvNumFormatType::ALL;
- else
+ if(!(eType == SvNumFormatType::ALL
+ || eType == SvNumFormatType::NUMBER
+ || eType == (SvNumFormatType::NUMBER | SvNumFormatType::DEFINED)
+ || eType == SvNumFormatType::PERCENT
+ || eType == (SvNumFormatType::PERCENT | SvNumFormatType::DEFINED)
+ || eType == SvNumFormatType::CURRENCY
+ || eType == (SvNumFormatType::CURRENCY | SvNumFormatType::DEFINED)
+ || eType == SvNumFormatType::SCIENTIFIC
+ || eType == (SvNumFormatType::SCIENTIFIC | SvNumFormatType::DEFINED)
+ || eType == SvNumFormatType::FRACTION
+ || eType == (SvNumFormatType::FRACTION | SvNumFormatType::DEFINED)))
pEntry = nullptr;
if(SfxItemState::SET == pReqArgs->GetItemState(nSlot, true, &pItem) && pEntry)
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 7f38fe353561..c50c3c06df94 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2958,8 +2958,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated.append(aCellStr);
- nEngineWidth = SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(),
- nNeededPixel, (nLeftM + nRightM ) );
+ SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(),
+ nNeededPixel, (nLeftM + nRightM ) );
nEngineHeight = rParam.mpEngine->GetTextHeight();
}
@@ -2970,7 +2970,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
if ( rParam.mbCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
{
- nEngineWidth = SetEngineTextAndGetWidth( rParam, "###", nNeededPixel, ( nLeftM + nRightM ) );
+ SetEngineTextAndGetWidth( rParam, "###", nNeededPixel, ( nLeftM + nRightM ) );
// No clip marks if "###" doesn't fit (same as in DrawStrings)
}
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 1cd19b23c1f8..0f5abc02cfbf 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -92,13 +92,9 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi
if ( rGraphicSize.Width() && rGraphicSize.Height() )
{
- Size aNewSize;
- bool changed = false;
if (aPrefSize.Width() == 0 || aPrefSize.Height() == 0)
{
aBmpEx.Scale(aPrefSize);
- aNewSize = aPrefSize;
- changed = true;
}
else
{
@@ -115,14 +111,8 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi
if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
{
aBmpEx.Scale( fXScale, fYScale );
- aNewSize = Size( static_cast<sal_Int32>(static_cast<double>(rGraphicSize.Width()) / fXScale + 0.5 ),
+ rGraphicSize = Size( static_cast<sal_Int32>(static_cast<double>(rGraphicSize.Width()) / fXScale + 0.5 ),
static_cast<sal_Int32>(static_cast<double>(rGraphicSize.Height()) / fYScale + 0.5 ) );
- changed = true;
- }
-
- if (changed)
- {
- rGraphicSize = aNewSize;
aMappedGraphic = Graphic( aBmpEx );
xGraphicObject.reset(new GraphicObject(aMappedGraphic));
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index e41f34a19774..734f1a03f34f 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -1283,12 +1283,9 @@ sal_Int8 DrawViewShell::AcceptDrop (
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* /*pTargetWindow*/,
- sal_uInt16 nPage,
+ sal_uInt16 /*nPage*/,
SdrLayerID nLayer )
{
- if( nPage != SDRPAGE_NOTFOUND )
- nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
-
if( SlideShow::IsRunning( GetViewShellBase() ) )
return DND_ACTION_NONE;
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index 004d2d813abf..b3fe676315fa 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -88,9 +88,9 @@ FileEmitContext::FileEmitContext( const OUString& rOr
m_xSeek.set(m_xOut, uno::UNO_QUERY_THROW );
oslFileError aErr = osl_File_E_None;
- if( (aErr=osl_openFile( rOrigFile.pData,
- &m_aReadHandle,
- osl_File_OpenFlag_Read )) == osl_File_E_None )
+ if( osl_openFile( rOrigFile.pData,
+ &m_aReadHandle,
+ osl_File_OpenFlag_Read ) == osl_File_E_None )
{
if( (aErr=osl_setFilePos( m_aReadHandle,
osl_Pos_End,
@@ -437,10 +437,9 @@ bool checkDocChecksum( const OUString& rInPDFFileURL,
::std::vector<unsigned char> nChecksum;
::comphelper::Hash aDigest(::comphelper::HashType::MD5);
oslFileHandle aRead = nullptr;
- oslFileError aErr = osl_File_E_None;
- if( (aErr = osl_openFile(rInPDFFileURL.pData,
- &aRead,
- osl_File_OpenFlag_Read )) == osl_File_E_None )
+ if( osl_openFile(rInPDFFileURL.pData,
+ &aRead,
+ osl_File_OpenFlag_Read ) == osl_File_E_None )
{
sal_uInt8 aBuf[4096];
sal_uInt32 nCur = 0;
@@ -448,7 +447,7 @@ bool checkDocChecksum( const OUString& rInPDFFileURL,
while( nCur < nBytes )
{
sal_uInt32 nPass = std::min<sal_uInt32>(nBytes - nCur, sizeof( aBuf ));
- if( (aErr = osl_readFile( aRead, aBuf, nPass, &nBytesRead)) != osl_File_E_None
+ if( osl_readFile( aRead, aBuf, nPass, &nBytesRead) != osl_File_E_None
|| nBytesRead == 0 )
{
break;
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 88cb3e1789ab..f8e24addeacb 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -538,13 +538,11 @@ void PDFDict::insertValue( const OString& rName, std::unique_ptr<PDFEntry> pValu
else
{
unsigned int nSub = m_aSubElements.size();
- bool bFound = false;
- for( unsigned int i = 0; i < nSub && !bFound; i++ )
+ for( unsigned int i = 0; i < nSub; i++ )
if( m_aSubElements[i].get() == it->second )
{
m_aSubElements[i] = std::move(pValue);
pValueTmp = m_aSubElements[i].get();
- bFound = true;
break;
}
}
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 16d3eb7146f4..a52b8ee4f3af 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -204,7 +204,7 @@ int SvRTFParser::GetNextToken_()
cAnsi = GetNextChar();
if( '\\' == cAnsi &&
- '\'' == ( cAnsi = GetNextChar() ))
+ '\'' == GetNextChar() )
// skip HexValue
GetHexValue();
nNextCh = GetNextChar();
@@ -441,7 +441,7 @@ void SvRTFParser::ScanText()
cAnsi = GetNextChar();
if( '\\' == cAnsi &&
- '\'' == ( cAnsi = GetNextChar() ))
+ '\'' == GetNextChar() )
// skip HexValue
GetHexValue();
nNextCh = GetNextChar();
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index a0cc092a8c04..dbdaa91ce536 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -1402,7 +1402,7 @@ namespace svt::table
case cursorSelectRow:
{
if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
- return bSuccess = false;
+ return false;
//pos is the position of the current row in the vector of selected rows, if current row is selected
int pos = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
//if current row is selected, it should be deselected, when ALT+SPACE are pressed
@@ -1423,7 +1423,7 @@ namespace svt::table
case cursorSelectRowUp:
{
if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
- return bSuccess = false;
+ return false;
else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
{
//if there are other selected rows, deselect them
@@ -1454,7 +1454,7 @@ namespace svt::table
if(m_nCurRow>0)
m_nCurRow--;
else
- return bSuccess = true;
+ return true;
//if nextRow already selected, deselect it, otherwise select it
if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
{
@@ -1537,7 +1537,7 @@ namespace svt::table
if(m_nCurRow<m_nRowCount-1)
m_nCurRow++;
else
- return bSuccess = true;
+ return true;
//if next row already selected, deselect it, otherwise select it
if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
{
@@ -1618,9 +1618,9 @@ namespace svt::table
case cursorSelectRowAreaBottom:
{
if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
- return bSuccess = false;
+ return false;
else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
- return bSuccess = false;
+ return false;
//select the region between the current and the last row
RowPos iter = m_nCurRow;
invalidateSelectedRegion( m_nCurRow, m_nRowCount-1 );
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx
index 238699a8188d..05b129e156ea 100644
--- a/svx/source/accessibility/AccessibleFrameSelector.cxx
+++ b/svx/source/accessibility/AccessibleFrameSelector.cxx
@@ -276,8 +276,7 @@ Reference< XAccessibleRelationSet > AccFrameSelectorChild::getAccessibleRelation
{
SolarMutexGuard aGuard;
IsValid();
- utl::AccessibleRelationSetHelper* pHelper;
- Reference< XAccessibleRelationSet > xRet = pHelper = new utl::AccessibleRelationSetHelper;
+ Reference< XAccessibleRelationSet > xRet = new utl::AccessibleRelationSetHelper;
return xRet;
}
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index f6725738ed07..84792e8058c6 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -2342,7 +2342,7 @@ void SvxRuler::PrepareProportional_Impl(RulerType eType)
if(bHorz)
lWidth = GetMargin2() - lWidth;
mxRulerImpl->nTotalDist = lWidth;
- lPos = lOrigLPos = mpBorders[nIdx].nPos;
+ lPos = mpBorders[nIdx].nPos;
for(sal_uInt16 i = nStartBorder; i < nEndBorder; ++i)
{
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 6182d99c3db2..c85b3555b674 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -327,7 +327,6 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
if (bTextEditHit || bTextEditSel)
{
eHit=SdrHitKind::TextEdit;
- bTextEditHit=true;
}
else if (pHdl!=nullptr)
{
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index d075c7015c55..f98197afa9ae 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3048,7 +3048,6 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy
// Is a nested Line (Box!)
pLines = &pLine->GetUpper()->GetTabLines();
nBaseLinePos = pLines->GetPos( pLine );
- pBaseLine = pLine;
[[fallthrough]];
case TableChgWidthHeightType::RowBottom:
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 650a88816ae4..0b96be07b05c 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -126,7 +126,6 @@ const SwNumRule* SwEditShell::GetOutlineNumRule() const
// paragraphs without numbering, with indentations
void SwEditShell::NoNum()
{
- bool bRet = true;
StartAllAction();
SwPaM* pCursor = GetCursor();
@@ -136,12 +135,12 @@ void SwEditShell::NoNum()
SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n )
- bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
+ GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
}
else
// sw_redlinehide: leave cursor as is, will be split at Point & apply to new node
- bRet = GetDoc()->NoNum( *pCursor );
+ GetDoc()->NoNum( *pCursor );
EndAllAction();
}
@@ -308,17 +307,16 @@ void SwEditShell::NumUpDown( bool bDown )
{
StartAllAction();
- bool bRet = true;
SwPaM* pCursor = GetCursor();
if( !pCursor->IsMultiSelection() )
- bRet = GetDoc()->NumUpDown(*pCursor, bDown, GetLayout());
+ GetDoc()->NumUpDown(*pCursor, bDown, GetLayout());
else
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n )
- bRet = bRet && GetDoc()->NumUpDown(aRangeArr.SetPam( n, aPam ), bDown, GetLayout());
+ GetDoc()->NumUpDown(aRangeArr.SetPam( n, aPam ), bDown, GetLayout());
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
}
GetDoc()->getIDocumentState().SetModified();
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 4e85e2243353..6e0af56c4a51 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -349,7 +349,6 @@ void SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
{
- bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR1:
@@ -381,8 +380,7 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_LOCALE:
{
css::lang::Locale aLocale;
- bRet = rAny >>= aLocale;
- if( bRet )
+ if( rAny >>= aLocale )
SetLanguage( LanguageTag::convertToLanguageType( aLocale ));
}
break;
@@ -390,8 +388,7 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_PROP_SEQ:
{
Sequence<PropertyValues> aSeq;
- bRet = rAny >>= aSeq;
- if( bRet )
+ if( rAny >>= aSeq )
{
m_SortKeyArr.clear();
const PropertyValues* pValues = aSeq.getConstArray();
@@ -409,8 +406,6 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
sal_Int16 nVal = -1; rValue.Value >>= nVal;
if(nVal >= 0 && nVal < AUTH_FIELD_END)
aSortKey.eField = static_cast<ToxAuthorityField>(nVal);
- else
- bRet = false;
}
else if(rValue.Name == UNO_NAME_IS_SORT_ASCENDING)
{
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 99ee92524af7..66d7fd61a919 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1005,14 +1005,6 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
// and again, for the still missing ends
switch (nSlotId)
{
- case SID_LINE_ARROW_CIRCLE:
- {
- long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
- if( nValue > 0 )
- nWidth = nValue * 3;
- }
- break;
-
case SID_LINE_CIRCLE_ARROW:
{
// circle start
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 0a19ebc7c4ae..fd4193918171 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -188,7 +188,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition()
// determine frame the object position has to be oriented at.
const SwTextFrame* pOrientFrame = &rAnchorTextFrame;
- const SwTextFrame* pAnchorFrameForVertPos = &rAnchorTextFrame;
+ const SwTextFrame* pAnchorFrameForVertPos;
{
// if object is at-character anchored, determine character-rectangle
// and frame, position has to be oriented at.
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 436214ea2e86..be570670593d 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -713,7 +713,6 @@ bool WrongListIterator::Check(TextFrameIndex & rStart, TextFrameIndex & rLen)
sw::Extent const& rExtentEnd(m_pMergedPara->extents[i]);
if (rExtentEnd.pNode != rExtent.pNode)
{
- nInLen = 0;
break;
}
// add gap too
@@ -721,7 +720,6 @@ bool WrongListIterator::Check(TextFrameIndex & rStart, TextFrameIndex & rLen)
if (nInLen <= rExtentEnd.nEnd - rExtentEnd.nStart)
{
nLen += nInLen;
- nInLen = 0;
break;
}
nLen += rExtentEnd.nEnd - rExtentEnd.nStart;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 379b9cf46264..d06072c6de5a 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3491,12 +3491,6 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const SwFormatRuby& rRuby, const MSWor
m_nRubyHeight = rHeight.GetHeight();
}
- if (pRubyText)
- nRubyScript
- = g_pBreakIt->GetBreakIter()->getScriptType(rNode.GetText(), pRubyText->GetStart());
- else
- nRubyScript = i18n::ScriptType::ASIAN;
-
const OUString &rText = rNode.GetText();
sal_uInt16 nScript = i18n::ScriptType::LATIN;
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 47e551f69c8e..4b6ee2d286b3 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -520,7 +520,7 @@ void InputEdit::UpdateRange(const OUString& rBoxes,
nEndPos = nStartPos;
while( nEndPos < nLen )
{
- if( cClose == (cCh = aActText[ nEndPos ]))
+ if( cClose == aActText[ nEndPos ] )
{
bFound = true;
break;
diff --git a/sw/source/uibase/shells/listsh.cxx b/sw/source/uibase/shells/listsh.cxx
index 1beb2bf489a9..a8d7eb91f8c7 100644
--- a/sw/source/uibase/shells/listsh.cxx
+++ b/sw/source/uibase/shells/listsh.cxx
@@ -60,12 +60,12 @@ static void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bU
{
const IDocumentOutlineNodes* pIDoc( rSh.getIDocumentOutlineNodesAccess() );
const int nActLevel = pIDoc->getOutlineLevel( nActPos );
- SwOutlineNodes::size_type nActEndPos = nActPos + 1;
SwOutlineNodes::difference_type nDir = 0;
if ( !bUp )
{
// Move down with subpoints:
+ SwOutlineNodes::size_type nActEndPos = nActPos + 1;
while ( nActEndPos < pIDoc->getOutlineNodesCount() &&
(!pIDoc->isOutlineInLayout(nActEndPos, *rSh.GetLayout())
|| nActLevel < pIDoc->getOutlineLevel(nActEndPos)))
@@ -94,7 +94,6 @@ static void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bU
// Move up with subpoints:
if ( nActPos > 0 )
{
- nActEndPos = nActPos;
SwOutlineNodes::size_type nDest = nActPos - 1;
while (nDest > 0 &&
(!pIDoc->isOutlineInLayout(nDest, *rSh.GetLayout())
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 8a61a99e3f3c..01c0d3cd2499 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -267,7 +267,6 @@ void MessBox::ImplPosControls()
Size aMEditSize;
long nTitleWidth;
long nButtonSize = ImplGetButtonSize();
- long nMaxWidth = GetDesktopRectPixel().GetWidth()-8;
long nMaxLineWidth;
long nWidth;
WinBits nWinStyle = WB_LEFT | WB_NOLABEL;
@@ -280,7 +279,7 @@ void MessBox::ImplPosControls()
OUString aMessText(maMessText.replaceAll("\t", " "));
//If window too small, we make dialog box be wider
- nMaxWidth = 630 * GetDPIScaleFactor();
+ long nMaxWidth = 630 * GetDPIScaleFactor();
// MessagBox should be at least as wide as to see the title
// Extra-Width for Close button, because Close button is set after this call
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index a0cfd7c09d74..9a55831e26f2 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -279,7 +279,7 @@ sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos)
}
if ( nPos != STREAM_SEEK_TO_END )
return nPos;
- rc = osl_getFilePos( pInstanceData->rHandle, &nNewPos );
+ osl_getFilePos( pInstanceData->rHandle, &nNewPos );
return nNewPos;
}
SetError( SVSTREAM_GENERALERROR );
@@ -438,7 +438,7 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nOpenMode )
if ( !LockFile() ) // whole file
{
- rc = osl_closeFile( nHandleTmp );
+ osl_closeFile( nHandleTmp );
bIsOpen = false;
m_isWritable = false;
pInstanceData->rHandle = nullptr;
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 833af4daf9f3..762d3f192bc1 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -167,7 +167,7 @@ sal_Int32 CachedContentResultSet::CCRS_Cache
return 0;
sal_Int32 nEnd = m_pResult->StartIndex;
if( m_pResult->Orientation )
- return nEnd += m_pResult->Rows.getLength() - 1;
+ return nEnd + m_pResult->Rows.getLength() - 1;
else
return nEnd;
}
diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx
index 723f78b51cef..69bea64ab0e8 100644
--- a/ucb/source/ucp/ftp/ftpdirp.cxx
+++ b/ucb/source/ucp/ftp/ftpdirp.cxx
@@ -845,7 +845,7 @@ bool FTPDirectoryParser::parseUNIX (
const char *pBuffer)
{
const char *p1, *p2;
- p1 = p2 = pBuffer;
+ p1 = pBuffer;
if (!((*p1 == '-') || (*p1 == 'd') || (*p1 == 'l')))
return false;
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 70f480364f57..5073dbff1a82 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -604,13 +604,11 @@ static bool lcl_retrieveSurrounding(sal_Int32& rPosition, sal_Int32& rAnchor, QS
TOOLS_WARN_EXCEPTION("vcl.qt5", "Exception in getting input method surrounding text");
}
- bool result = false;
if (xText.is())
{
rPosition = xText->getCaretPosition();
if (rPosition != -1)
{
- result = true;
if (pText)
*pText = toQString(xText->getText());
@@ -619,8 +617,6 @@ static bool lcl_retrieveSurrounding(sal_Int32& rPosition, sal_Int32& rAnchor, QS
if (nSelStart == nSelEnd)
{
rAnchor = rPosition;
- if (pSelection)
- result = false;
}
else
{
@@ -635,7 +631,7 @@ static bool lcl_retrieveSurrounding(sal_Int32& rPosition, sal_Int32& rAnchor, QS
}
}
- return result;
+ return false;
}
QVariant Qt5Widget::inputMethodQuery(Qt::InputMethodQuery property) const
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 14674da4ff3b..6e389da9c87a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -259,6 +259,9 @@ void Application::Abort( const OUString& rErrorText )
//HACK: Dump core iff --norestore command line argument is given (assuming
// this process is run by developers who are interested in cores, vs. end
// users who are not):
+#if OSL_DEBUG_LEVEL > 0
+ bool dumpCore = true;
+#else
bool dumpCore = false;
sal_uInt16 n = GetCommandLineParamCount();
for (sal_uInt16 i = 0; i != n; ++i) {
@@ -267,8 +270,6 @@ void Application::Abort( const OUString& rErrorText )
break;
}
}
-#if OSL_DEBUG_LEVEL > 0
- dumpCore = true;
#endif
SalAbort( rErrorText, dumpCore );
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 962f54b7bf70..b46beb79d55d 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -524,7 +524,7 @@ void CffSubsetterContext::readDictOp()
mbCIDFont = true;
} break;
case 't': // CharstringType
- nInt = popInt();
+ popInt();
break;
}
} else if( (c >= 32) || (c == 28) ) {
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 8c428653c1e9..02f5a4df9d68 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2431,7 +2431,7 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
info->linegap = XUnits(UPEm, GetInt16(table, HHEA_lineGap_offset));
}
- table = getTable(ttf, O_vhea);
+ getTable(ttf, O_vhea);
}
GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 6c1539bcb9bb..10f71cab4008 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -1396,7 +1396,7 @@ static Bitmap DetectEdges( const Bitmap& rBmp )
{
nXTmp = nX;
- nSum2 = lGray = pReadAcc->GetIndexFromData( pScanlineRead, nXTmp++ );
+ nSum2 = pReadAcc->GetIndexFromData( pScanlineRead, nXTmp++ );
nSum1 = -nSum2;
nSum2 += static_cast<long>(pReadAcc->GetIndexFromData( pScanlineRead, nXTmp++ )) << 1;
lGray = pReadAcc->GetIndexFromData( pScanlineRead, nXTmp );
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index 21da20adaac6..ccf92be1932d 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -494,7 +494,6 @@ void OutputDevice::SetFont( const vcl::Font& rNewFont )
else if ( mnDrawMode & DrawModeFlags::NoFill )
{
aTextFillColor = COL_TRANSPARENT;
- bTransFill = true;
}
aFont.SetFillColor( aTextFillColor );
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index b17bc6c37218..e1561ad12607 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -1983,11 +1983,10 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
if( !m_pCursor )
m_pCursor = m_pStartEntry;
- SvTreeListEntry* pEntry = GetEntry( aPos );
m_nFlags &= ~LBoxFlags::Filling;
m_pView->GrabFocus();
//fdo#82270 Grabbing focus can invalidate the entries, re-fetch
- pEntry = GetEntry(aPos);
+ SvTreeListEntry* pEntry = GetEntry(aPos);
// the entry can still be invalid!
if( !pEntry || !m_pView->GetViewData( pEntry ))
return;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0564ffa1a39d..68bf33771b8c 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -171,15 +171,13 @@ void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
// horizontal line
{
- auto nTop = aOffset.Y() - nTextHeight;
-
auto nWidth = rRenderContext.GetTextWidth(maHorzText);
auto nStart = aOffset.X() + (maPreviewSize.Width() - nWidth) / 2;
rRenderContext.DrawText(Point(nStart, aOffset.Y() - nTextHeight), maHorzText, 0, maHorzText.getLength());
DecorationView aDecoView(&rRenderContext);
- nTop = aOffset.Y() - (nTextHeight / 2);
+ auto nTop = aOffset.Y() - (nTextHeight / 2);
aDecoView.DrawSeparator(Point(aOffset.X(), nTop), Point(nStart - 2, nTop), false);
aDecoView.DrawSeparator(Point(nStart + nWidth + 2, nTop), Point(aOffset.X() + maPreviewSize.Width(), nTop), false);
}
diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx
index 06fc520fe229..db3c83752e5d 100644
--- a/vcl/unx/generic/app/i18n_xkb.cxx
+++ b/vcl/unx/generic/app/i18n_xkb.cxx
@@ -29,8 +29,6 @@ SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay )
: mbUseExtension(true)
, mnEventBase(0)
{
- sal_uInt32 nDefaultGroup = 0;
-
// allow user to set the default keyboard group idx or to disable the usage
// of x keyboard extension at all:
// setenv SAL_XKEYBOARDGROUP disables keyboard extension
@@ -40,10 +38,6 @@ SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay )
if ( pUseKeyboardExtension != nullptr )
{
mbUseExtension = pUseKeyboardExtension[0] != '\0' ;
- if ( mbUseExtension )
- nDefaultGroup = strtol( pUseKeyboardExtension, nullptr, 0 );
- if ( nDefaultGroup > XkbMaxKbdGroup )
- nDefaultGroup = 0;
}
// query XServer support for XKB Extension,
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index 1d318249528d..37aa3cbe2747 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -986,14 +986,14 @@ PrinterGfx::PSHexString (const unsigned char* pString, sal_Int16 nLen)
{
if (nChar >= (nMaxTextColumn - 1))
{
- nChar += psp::appendStr ("\n", pHexString);
+ psp::appendStr ("\n", pHexString);
WritePS (mpPageBody, pHexString.makeStringAndClear());
nChar = 0;
}
nChar += psp::getHexValueOf (static_cast<sal_Int32>(pString[i]), pHexString);
}
- nChar += psp::appendStr (">\n", pHexString);
+ psp::appendStr (">\n", pHexString);
WritePS (mpPageBody, pHexString.makeStringAndClear());
}
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 4345bb24cdbf..53a48e0e7863 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -182,8 +182,7 @@ void CertificateChooser::ImplInitialize()
{
}
- sal_Int32 nCertificates = xCerts.getLength();
- for( sal_Int32 nCert = nCertificates; nCert; )
+ for( sal_Int32 nCert = xCerts.getLength(); nCert; )
{
uno::Reference< security::XCertificate > xCert = xCerts[ --nCert ];
// Check if we have a private key for this...
@@ -192,7 +191,6 @@ void CertificateChooser::ImplInitialize()
if (!(nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY))
{
::comphelper::removeElementAt( xCerts, nCert );
- nCertificates = xCerts.getLength();
}
}