diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-20 12:02:48 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-23 06:17:29 +0000 |
commit | 7b26389414b203a4f3225acf0c027b93bcb234ac (patch) | |
tree | 144aeb20c5e191840c4fb862106b0d0344d0260f | |
parent | 85ea267b7a8fbd5859569db6ef7ac8dd1bd9bcd1 (diff) |
clang-tidy clang-analyzer-deadcode.DeadStores
Change-Id: I7113a13ac36db5beef3a17e9849c1f5506df2374
Reviewed-on: https://gerrit.libreoffice.org/25194
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
34 files changed, 40 insertions, 123 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 4349d287c4b8..f4ccbb0501a5 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1317,8 +1317,8 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS uno::Sequence < beans::PropertyValue > aProps; // export sub streams for package, else full stream into a file - bool bWarn = false, bErr = false; - OUString sWarnFile, sErrFile; + bool bErr = false; + OUString sErrFile; uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY); if ( xProp.is() ) @@ -1373,49 +1373,28 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if( !bErr ) { xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("settings.xml"))); - if( !WriteThroughComponent( + WriteThroughComponent( xCom, "settings.xml", "com.sun.star.comp.report.XMLSettingsExporter", - aDelegatorArguments, aProps, _xStorageToSaveTo ) ) - { - if( !bWarn ) - { - bWarn = true; - sWarnFile = "settings.xml"; - } - } + aDelegatorArguments, aProps, _xStorageToSaveTo ); } if( !bErr ) { xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("meta.xml"))); - if( !WriteThroughComponent( + WriteThroughComponent( xCom, "meta.xml", "com.sun.star.comp.report.XMLMetaExporter", - aDelegatorArguments, aProps, _xStorageToSaveTo ) ) - { - if( !bWarn ) - { - bWarn = true; - sWarnFile = "meta.xml"; - } - } + aDelegatorArguments, aProps, _xStorageToSaveTo ); } if( !bErr ) { xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("styles.xml"))); - if( !WriteThroughComponent( + WriteThroughComponent( xCom, "styles.xml", "com.sun.star.comp.report.XMLStylesExporter", - aDelegatorArguments, aProps, _xStorageToSaveTo ) ) - { - if( !bWarn ) - { - bWarn = true; - sWarnFile = "styles.xml"; - } - } + aDelegatorArguments, aProps, _xStorageToSaveTo ); } if ( !bErr ) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 6ab1e188a649..ebb66a3cdba8 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -764,7 +764,6 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) TGrid::const_iterator aRowIter = aFind->second.begin(); TGrid::const_iterator aRowEnd = aFind->second.end(); - sal_Int32 nEmptyCellColSpan = 0; TGridStyleMap::const_iterator aRowFind = m_aRowStyleNames.find(_xSection.get()); TStringVec::const_iterator aHeightIter = aRowFind->second.begin(); OSL_ENSURE(aRowFind->second.size() == aFind->second.size(),"Different count for rows"); @@ -779,7 +778,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) { ::std::vector< TCell >::const_iterator aColIter = aRowIter->second.begin(); ::std::vector< TCell >::const_iterator aColEnd = aRowIter->second.end(); - nEmptyCellColSpan = 0; + sal_Int32 nEmptyCellColSpan = 0; for (; aColIter != aColEnd; ++aColIter) { bool bCoveredCell = false; @@ -964,12 +963,11 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) { SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true); } - nEmptyCellColSpan = 0; } } else { // empty rows - nEmptyCellColSpan = aRowIter->second.size(); + sal_Int32 nEmptyCellColSpan = aRowIter->second.size(); if ( nEmptyCellColSpan ) { { @@ -985,7 +983,6 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) { SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true); } - nEmptyCellColSpan = 0; } } } diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 02afdd1dce47..4341943b7a30 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -835,29 +835,27 @@ bool ScViewObjectModeItem::GetPresentation switch ( ePres ) { case SFX_ITEM_PRESENTATION_COMPLETE: - switch( Which() ) - { - case SID_SCATTR_PAGE_CHARTS: - rText = ScGlobal::GetRscString(STR_VOBJ_CHART) + aDel; - break; + switch( Which() ) + { + case SID_SCATTR_PAGE_CHARTS: + rText = ScGlobal::GetRscString(STR_VOBJ_CHART) + aDel; + break; - case SID_SCATTR_PAGE_OBJECTS: - rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT) + aDel; - break; + case SID_SCATTR_PAGE_OBJECTS: + rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT) + aDel; + break; - case SID_SCATTR_PAGE_DRAWINGS: - rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS) + aDel; - break; + case SID_SCATTR_PAGE_DRAWINGS: + rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS) + aDel; + break; - default: - ePres = SFX_ITEM_PRESENTATION_NAMELESS; // Default setting! - break; - } - SAL_FALLTHROUGH; + default: break; + } + SAL_FALLTHROUGH; case SFX_ITEM_PRESENTATION_NAMELESS: - rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue()); - return true; - break; + rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue()); + return true; + break; default: break; // added to avoid warnings diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 17c6d2263588..c50f0ede5378 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -507,7 +507,7 @@ void ScDocument::FillInfo( else nArrRow = 1; - SCROW nThisRow = nCurRow; // end of range + SCROW nThisRow; SCSIZE nIndex; (void) pThisAttrArr->Search( nCurRow, nIndex ); @@ -630,7 +630,6 @@ void ScDocument::FillInfo( ScMarkArray aThisMarkArr(pMarkData->GetMarkArray( nX )); nArrRow = 1; nCurRow = nRow1; // single rows - nThisRow = nRow1; // End of range if ( aThisMarkArr.Search( nRow1, nIndex ) ) { diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 7206a2e8a315..efe0c276494e 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2041,7 +2041,6 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) bSpaceLeft = pDocument->InsertRow( 0, nTab, MAXCOL, nTab, aRowEntry.nDestRow, 1 ); DBShowRow( aRowEntry.nDestRow, bBlockVis ); - bBlockVis = false; if ( rParam.bPagebreak && nRow < MAXROW && aRowEntry.nSubStartRow != nStartRow && nLevel == 0) SetRowBreak(aRowEntry.nSubStartRow, false, true); diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 80040a595654..d77d5f99524f 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1206,7 +1206,6 @@ void ScChangeActionMove::GetDescription( if (nPos >= 0) { aRsc = aRsc.replaceAt(nPos, 2, aTmpStr); - nPos += aTmpStr.getLength(); } OUStringBuffer aBuf(rStr); // append to the original string. @@ -1484,7 +1483,6 @@ void ScChangeActionContent::GetDescription( if (nPos >= 0) { aRsc = aRsc.replaceAt(nPos, 2, aTmpStr); - nPos += aTmpStr.getLength(); } OUStringBuffer aBuf(rStr); // append to the original string. diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 1a24e78828aa..bb1ad0e7a87a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4326,7 +4326,6 @@ void ScInterpreter::ScMatch() SCTAB nTab1 = 0; SCCOL nCol2 = 0; SCROW nRow2 = 0; - SCTAB nTab2 = 0; ScMatrixRef pMatSrc = nullptr; switch (GetStackType()) @@ -4335,10 +4334,10 @@ void ScInterpreter::ScMatch() PopSingleRef( nCol1, nRow1, nTab1); nCol2 = nCol1; nRow2 = nRow1; - nTab2 = nTab1; break; case svDoubleRef: { + SCTAB nTab2 = 0; PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); if (nTab1 != nTab2 || (nCol1 != nCol2 && nRow1 != nRow2)) { diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index f064faf0c2a2..1231d8072c03 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -150,7 +150,6 @@ FltError ImportExcel::Read() break; default:; } - eAkt = Z_Ende; break; } diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 5f4a65a3adc7..bc6e48b4afef 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2376,7 +2376,6 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : ScRange aUsedRange( 0, 0, nScTab, nLastUsedScCol, nLastUsedScRow, nScTab ); GetAddressConverter().ValidateRange( aUsedRange, true ); - nLastUsedScCol = aUsedRange.aEnd.Col(); nLastUsedScRow = aUsedRange.aEnd.Row(); // first row without any set attributes (height/hidden/...) diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index bc47e99c7301..7518ddffe37f 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -195,7 +195,7 @@ static OString lcl_makeHTMLColorTriplet(const Color& rColor) sal_Char* p = buf; p += sprintf( p, "%02X", rColor.GetRed() ); p += sprintf( p, "%02X", rColor.GetGreen() ); - p += sprintf( p, "%02X", rColor.GetBlue() ); + sprintf( p, "%02X", rColor.GetBlue() ); aStr.append(buf); aStr.append('\"'); return aStr.makeStringAndClear(); diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 91d9df86de01..d228d9f85072 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -556,7 +556,7 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi // mba: no relative URLs for clipboard! SfxMedium aMedium( xWorkStore, OUString() ); - bRet = pEmbObj->DoSaveObjectAs( aMedium, false ); + pEmbObj->DoSaveObjectAs( aMedium, false ); pEmbObj->DoSaveCompleted(); uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY ); @@ -571,8 +571,6 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi delete pSrcStm; } - bRet = true; - xWorkStore->dispose(); xWorkStore.clear(); rxOStm->Commit(); diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 0800da99f086..016e0e4f4bca 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -456,7 +456,7 @@ bool ScTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* p // mba: no relative URLs for clipboard! SfxMedium aMedium( xWorkStore, OUString() ); - bRet = pEmbObj->DoSaveObjectAs( aMedium, false ); + pEmbObj->DoSaveObjectAs( aMedium, false ); pEmbObj->DoSaveCompleted(); uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY ); diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 6d3717305fa5..eb0869882411 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -116,7 +116,6 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe SCTAB nStartTab = nTab; SCCOL nEndCol = rMarked.aEnd.Col(); SCROW nEndRow = rMarked.aEnd.Row(); - SCTAB nEndTab = rMarked.aEnd.Tab(); // Nicht einfach GetDBAtCursor: Der zusammenhaengende Datenbereich // fuer "unbenannt" (GetDataArea) kann neben dem Cursor legen, also muss auch ein // benannter DB-Bereich dort gesucht werden. @@ -189,14 +188,10 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe if ( bUseThis ) { pData->GetArea( nStartTab, nStartCol,nStartRow, nEndCol,nEndRow ); - nEndTab = nStartTab; } else if ( eMode == SC_DB_OLD ) { pData = nullptr; // nichts gefunden - nStartCol = nEndCol = nCol; - nStartRow = nEndRow = nRow; - nStartTab = nEndTab = nTab; } else { diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 86fe2a950693..72a7d2f6338b 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -630,8 +630,6 @@ void lcl_GetColumnTypes( } } } - bool bSdbLenAdjusted = false; - bool bSdbLenBad = false; // Field length. if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen ) { // Determine maximum field width. @@ -719,10 +717,7 @@ void lcl_GetColumnTypes( // To give the user what he wants we must subtract it here. //! CAVEAT! There is no way to define a numeric field with a length //! of 1 and no decimals! - if ( nFieldLen == 1 && nPrecision == 0 ) - bSdbLenBad = true; nFieldLen = SvDbaseConverter::ConvertPrecisionToOdbc( nFieldLen, nPrecision ); - bSdbLenAdjusted = true; } if ( nFieldLen > 254 ) { @@ -741,13 +736,6 @@ void lcl_GetColumnTypes( pColLengths[nField] = nFieldLen; pColScales[nField] = nPrecision; - // undo change to field length, reflect reality - if ( bSdbLenAdjusted ) - { - nFieldLen = SvDbaseConverter::ConvertPrecisionToDbase( nFieldLen, nPrecision ); - if ( bSdbLenBad && nFieldLen == 1 ) - nFieldLen = 2; // THIS is reality - } ++nField; } } diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index c4c1aac7c32a..9cb144bde0d4 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -444,12 +444,6 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) pView->EndDragObj( rMEvt.IsMod1() ); pView->ForceMarkedToAnotherPage(); - const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - if (rMarkList.GetMarkCount() == 1) - { - SdrMark* pMark = rMarkList.GetMark(0); - pObj = pMark->GetMarkedSdrObj(); - } bReturn = true; } else if (pView->IsAction() ) diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 4a7b14ff8a8b..e1b878953736 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1613,8 +1613,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt rSet.Get( ATTR_VALUE_FORMAT )).GetValue(); LanguageType eOldLang = static_cast<const SvxLanguageItem&>( rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); - nOldFormat = pFormatter-> - GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); + pFormatter->GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); sal_uInt32 nNewFormat = 0; *pValue >>= nNewFormat; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index eb8082f101a0..92f211e13d71 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -328,7 +328,6 @@ void ScEditShell::Execute( SfxRequest& rReq ) rBindings.Invalidate( SID_SET_SUPER_SCRIPT ); rBindings.Invalidate( SID_SET_SUB_SCRIPT ); } - bSetModified = false; } return; case SID_UNICODE_NOTATION_TOGGLE: diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 1c42deca1d1e..3f012e8857c0 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -5086,7 +5086,6 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) { //! clipping is not needed when on the left side of the window - bClip = true; // only output the rest! if (nStartX<nScrX) { long nDif = nScrX - nStartX; @@ -5101,7 +5100,6 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) if ( nClipStartY < nRowPosY ) { long nDif = nRowPosY - nClipStartY; - bClip = true; nClipStartY = nRowPosY; aClipSize.Height() -= nDif; } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 13bfe1042fde..67033a72a9e5 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1723,7 +1723,6 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, if (rDoc.SearchAndReplace(*pSearchItem, nCol, nRow, nTab, rMark, aMatchedRanges, aUndoStr, pUndoDoc.get())) { bFound = true; - bFirst = true; if (bAddUndo) { GetViewData().GetDocShell()->GetUndoManager()->AddUndoAction( diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 5f8b31abd807..cf01895789ae 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -334,7 +334,7 @@ void SdDrawDocument::InsertBookmark( if ( bOK && !rBookmarkList.empty() ) { // Insert all object bookmarks - bOK = InsertBookmarkAsObject(rBookmarkList, rExchangeList, bLink, + InsertBookmarkAsObject(rBookmarkList, rExchangeList, bLink, pBookmarkDocSh, pObjPos, bCalcObjCount); } } diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 6bf66d5f3329..ad2b802fa843 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -454,7 +454,6 @@ void Section::Read( SotStorageStream *pStrm ) { if ( nPropSize > nStrmSize ) { - nPropCount = 0; break; } pStrm->Seek( nPropOfs + nSecOfs ); @@ -520,7 +519,6 @@ void Section::Read( SotStorageStream *pStrm ) nSize -= pStrm->Tell(); if ( nSize > nStrmSize ) { - nPropCount = 0; break; } sal_uInt8* pBuf = new sal_uInt8[ nSize ]; diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index fd80a34d320d..bf9244440e76 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -569,7 +569,6 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno:: *pPos++ = nLastPos + 1; *pPara++ = nLastPara; - ndbg += 1; pText++; } else diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 43a18ad7a154..c01455adf983 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1657,7 +1657,6 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, if( !pSNd->GetSection().IsHidden() && !pSNd->IsContentHidden() ) { pSNd->MakeFrames( &aFrameIdx, &aDelRg.aEnd ); - pFrameNd = pSNd; break; } aDelRg.aStart = *pSNd->EndOfSectionNode(); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index c75e90dcc837..816e08172d12 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2025,7 +2025,6 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( bCallACorr ) { - bCallACorr = false; m_aDelPam.GetPoint()->nContent = nPos; SetRedlineText( STR_AUTOFMTREDL_USE_REPLACE ); if( m_aFlags.bAutoCorrect && diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 00599a1d7476..eda55e9de8af 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -1504,7 +1504,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const SwTwips nTextLeft = rFill.Left() + rLRSpace.GetTextLeft() + GetTextNode()->GetLeftMarginWithNum( true ); rFill.nLineWidth += rFill.bFirstLine ? nLeft : nTextLeft; - SwTwips nLeftTab = nLeft; + SwTwips nLeftTab; SwTwips nRightTab = nLeft; sal_uInt16 nSpaceCnt = 0; sal_uInt16 nTabCnt = 0; diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index b7f2129093c9..2259939b0e5f 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4295,7 +4295,6 @@ void WW8RStyle::ImportOldFormatStyles() { //more data than style slots, skip remainder rSt.SeekRel(cbChpx-nByteCount); - nByteCount += cbChpx-nByteCount; break; } @@ -4341,7 +4340,6 @@ void WW8RStyle::ImportOldFormatStyles() if (stcp == aPAPXOffsets.size()) { rSt.SeekRel(cbPapx-nByteCount); - nByteCount += cbPapx-nByteCount; break; } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index a72b08365fa3..ab18387cfa26 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -158,7 +158,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) nLen = MAX_FIELDLEN; long nOldPos = m_pStrm->Tell(); - nLen = m_pSBase->WW8ReadString( *m_pStrm, aVal, pB->GetStartPos(), nLen, + m_pSBase->WW8ReadString( *m_pStrm, aVal, pB->GetStartPos(), nLen, m_eStructCharSet ); m_pStrm->Seek( nOldPos ); @@ -1113,7 +1113,7 @@ long SwWW8ImplReader::Read_F_Tag( WW8FieldDesc* pF ) nL = MAX_FIELDLEN; // MaxLaenge, durch Quoten // max. 4* so gross OUString sFText; - nL = m_pSBase->WW8ReadString( *m_pStrm, sFText, + m_pSBase->WW8ReadString( *m_pStrm, sFText, m_pPlcxMan->GetCpOfs() + nStart, nL, m_eStructCharSet); OUString aTagText; @@ -1177,7 +1177,7 @@ OUString SwWW8ImplReader::GetFieldResult( WW8FieldDesc* pF ) // max. 4* as big OUString sRes; - nL = m_pSBase->WW8ReadString( *m_pStrm, sRes, m_pPlcxMan->GetCpOfs() + nStart, + m_pSBase->WW8ReadString( *m_pStrm, sRes, m_pPlcxMan->GetCpOfs() + nStart, nL, m_eStructCharSet ); m_pStrm->Seek( nOldPos ); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index efe00fa0ba0f..6bf744e2669d 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -6584,7 +6584,6 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd ) pStd->istdNext = ( a16Bit & 0xfff0 ) >> 4; if( 8 > nRead ) break; - a16Bit = 0; rSt.ReadUInt16( pStd->bchUpe ); // from Ver8 this two fields should be added: diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 65603cfb4a97..626781f31fbd 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -678,7 +678,7 @@ bool SwTransferable::WriteObject( tools::SvRef<SotStorageStream>& xStream, pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, false ); // mba: no BaseURL for clipboard SfxMedium aMedium( xWorkStore, OUString() ); - bRet = pEmbObj->DoSaveObjectAs( aMedium, false ); + pEmbObj->DoSaveObjectAs( aMedium, false ); pEmbObj->DoSaveCompleted(); uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY ); @@ -693,8 +693,6 @@ bool SwTransferable::WriteObject( tools::SvRef<SotStorageStream>& xStream, pSrcStm.reset(); } - bRet = true; - xWorkStore->dispose(); xWorkStore.clear(); xStream->Commit(); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 343772631d37..434ab27ef89a 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -2528,7 +2528,6 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_NumOff: // shell change - so record in advance rSh.DelNumRules(); - eKeyState = eNextKeyState; break; case KS_OutlineLvOff: // delete autofmt outlinelevel later break; diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index cab2f7649949..d9622958af09 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -283,9 +283,6 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, IllegalArgumentException, WrappedTargetException) { bool bVal; - if ( rInfo.mnHandle != HANDLE_PRINTSET_ANNOTATION_MODE && - rInfo.mnHandle != HANDLE_PRINTSET_FAX_NAME ) - bVal = *static_cast<sal_Bool const *>(rValue.getValue()); switch( rInfo.mnHandle ) { diff --git a/sw/source/uibase/utlui/prcntfld.cxx b/sw/source/uibase/utlui/prcntfld.cxx index 1234f805753a..fc29014faca3 100644 --- a/sw/source/uibase/utlui/prcntfld.cxx +++ b/sw/source/uibase/utlui/prcntfld.cxx @@ -173,11 +173,6 @@ void PercentField::SetMax(sal_Int64 nNewMax, FieldUnit eInUnit) { if (m_pField->GetUnit() != FUNIT_CUSTOM) m_pField->SetMax(nNewMax, eInUnit); - else - { - if (eInUnit == FUNIT_NONE) - eInUnit = eOldUnit; - } } sal_Int64 PercentField::NormalizePercent(sal_Int64 nValue) diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index fe0d61b004c8..f566769fe678 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -359,7 +359,6 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) { rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>( rFooterSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue()); - nFirstShare = rPageDesc.IsFirstShared() ? 1 : 0; } } else diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index 1dd165c71cb3..4defb8b64f99 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -923,7 +923,7 @@ void SwWrtShell::SelectNextPrevHyperlink( bool bNext ) SttEndDoc(true); else SttEndDoc(false); - bRet = SwCursorShell::SelectNxtPrvHyperlink( bNext ); + SwCursorShell::SelectNxtPrvHyperlink( bNext ); } EndAction(); |