summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-06 09:04:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-06 10:47:15 +0100
commit9e087d4a3011aa98de6151aeda9cbb40b1fd21ef (patch)
tree0d6219941df2857fd63e1d9f913214af6804fb2e
parentd746e6f7cbc9e7225b965c1b506a0050dd386e53 (diff)
loplugin:unusedvariablecheck tweak to find more stuff
but leave the tweak commented out, since it generates false positives Change-Id: Iaf3f92414d2618f8780561f98765e33e282afe0c Reviewed-on: https://gerrit.libreoffice.org/82121 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--compilerplugins/clang/unusedvariablecheck.cxx16
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx2
-rw-r--r--drawinglayer/source/dumper/XShapeDumper.cxx6
-rw-r--r--framework/source/uielement/menubarmanager.cxx1
-rw-r--r--include/drawinglayer/XShapeDumper.hxx6
-rw-r--r--sc/source/core/data/funcdesc.cxx11
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx1
-rw-r--r--sc/source/filter/qpro/qproform.cxx2
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx1
-rw-r--r--sc/source/ui/view/dbfunc3.cxx1
-rw-r--r--sd/qa/unit/sdmodeltestbase.hxx1
-rw-r--r--sd/source/core/drawdoc4.cxx2
-rw-r--r--sdext/source/pdfimport/filterdet.cxx1
-rw-r--r--sdext/source/pdfimport/inc/pdfparse.hxx5
-rw-r--r--sdext/source/pdfimport/test/pdfunzip.cxx2
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx1
-rw-r--r--svx/source/sidebar/PanelFactory.cxx3
-rw-r--r--svx/source/svdraw/gradtrns.hxx5
-rw-r--r--svx/source/svdraw/svdhdl.cxx1
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
-rw-r--r--svx/source/svdraw/svdoedge.cxx1
-rw-r--r--sw/source/uibase/shells/frmsh.cxx1
-rw-r--r--sw/source/uibase/uiview/srcview.cxx1
-rw-r--r--uui/source/iahndl-ssl.cxx1
-rw-r--r--vcl/source/bitmap/bitmappaint.cxx2
-rw-r--r--vcl/source/gdi/dibtools.cxx1
28 files changed, 25 insertions, 56 deletions
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 6ecfdad87777..e9c54add6c0f 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -421,8 +421,6 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries
aPoint2.PositionY = aPoly.SequenceY[nPoly][nPoint];
aPoint2.PositionZ = aPoly.SequenceZ[nPoly][nPoint];
- Stripe aStripe( aPoint1, aPoint2, fDepth );
-
m_pShapeFactory->createStripe(xSeriesGroupShape_Shapes
, Stripe( aPoint1, aPoint2, fDepth )
, pSeries->getPropertiesOfSeries(), PropertyMapper::getPropertyNameMapForFilledSeriesProperties(), true, 1 );
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 8601e82e4803..0e4d1124847b 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2893,7 +2893,6 @@ OUString ChartView::dump()
uno::Reference< drawing::XShapes > xShape(xShapes->getByIndex(i), uno::UNO_QUERY);
if(xShape.is())
{
- XShapeDumper dumper;
OUString aString = XShapeDumper::dump(mxRootShape);
aBuffer.append(aString);
}
@@ -2902,7 +2901,6 @@ OUString ChartView::dump()
uno::Reference< drawing::XShape > xSingleShape(xShapes->getByIndex(i), uno::UNO_QUERY);
if(!xSingleShape.is())
continue;
- XShapeDumper dumper;
OUString aString = XShapeDumper::dump(xSingleShape);
aBuffer.append(aString);
}
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index 25af5438b465..07e5fe0b2ace 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -53,7 +53,21 @@ bool UnusedVariableCheck::VisitVarDecl( const VarDecl* var )
return true;
if( var->isDefinedOutsideFunctionOrMethod())
return true;
- if( loplugin::isExtraWarnUnusedType(var->getType()))
+
+ auto type = var->getType();
+ bool check = loplugin::isExtraWarnUnusedType(type);
+
+ // this chunk of logic generates false+, which is why we don't leave it on
+/*
+ if (!check && type->isRecordType())
+ {
+ auto recordDecl
+ = dyn_cast_or_null<CXXRecordDecl>(type->getAs<RecordType>()->getDecl());
+ if (recordDecl && recordDecl->hasDefinition() && recordDecl->hasTrivialDestructor())
+ check = true;
+ }
+*/
+ if(check)
{
if( const ParmVarDecl* param = dyn_cast< ParmVarDecl >( var ))
{
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 85df2321b40e..8908bc658ed1 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -734,8 +734,6 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef co
}
else // travel through the select column parse node
{
- ::comphelper::UStringMixEqual bCase(xMetaData->supportsMixedCaseQuotedIdentifiers());
-
OTableFieldDescRef aSelEntry = _pEntry;
sal_uInt16 nColumnId = aSelEntry->GetColumnId();
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index ecb5fd27c84d..9ffab8d333cc 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -47,12 +47,6 @@
#define DEBUG_DUMPER 0
using namespace com::sun::star;
-//class XShapeDumper
-
-XShapeDumper::XShapeDumper()
-{
-
-}
namespace {
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 41f358d819f9..316cd2e6d2c9 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -689,7 +689,6 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool )
if ( xDispatchProvider.is() )
{
- vcl::KeyCode aEmptyKeyCode;
SvtCommandOptions aCmdOptions;
for (auto const& menuItemHandler : m_aMenuItemHandlerVector)
{
diff --git a/include/drawinglayer/XShapeDumper.hxx b/include/drawinglayer/XShapeDumper.hxx
index 24603e0db60a..47f5b0c26e88 100644
--- a/include/drawinglayer/XShapeDumper.hxx
+++ b/include/drawinglayer/XShapeDumper.hxx
@@ -17,11 +17,9 @@ namespace com::sun::star::drawing { class XShape; }
namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::uno { template <typename > class Reference; }
-class DRAWINGLAYER_DLLPUBLIC XShapeDumper
+struct DRAWINGLAYER_DLLPUBLIC XShapeDumper
{
-
-public:
- XShapeDumper();
+ XShapeDumper() = delete;
static OUString dump(const css::uno::Reference<css::drawing::XShapes>& xPageShapes, bool bDumpInteropProperties=false);
static OUString dump(const css::uno::Reference<css::drawing::XShape>& xPageShapes, bool bDumpInteropProperties=false);
};
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 4679f3e029b4..abeccaba4b9f 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -88,11 +88,7 @@ struct ScFuncDescCore
sal_uInt8 const aOptionalArgs[7];
};
-class ScFuncRes
-{
-public:
- ScFuncRes(const ScFuncDescCore &rEntry, ScFuncDesc*, bool& rbSuppressed);
-};
+static void ScFuncRes(const ScFuncDescCore &rEntry, ScFuncDesc*, bool& rbSuppressed);
// class ScFuncDesc:
ScFuncDesc::ScFuncDesc() :
@@ -815,7 +811,7 @@ ScFunctionList::ScFunctionList()
pDesc = new ScFuncDesc;
bool bSuppressed = false;
- ScFuncRes aSubRes(*pEntry, pDesc, bSuppressed);
+ ScFuncRes(*pEntry, pDesc, bSuppressed);
// Instead of dealing with this exceptional case at 1001 places
// we simply don't add an entirely suppressed function to the
// list and delete it.
@@ -1185,8 +1181,7 @@ sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToke
return 0;
}
-// class ScFuncRes:
-ScFuncRes::ScFuncRes(const ScFuncDescCore &rEntry, ScFuncDesc* pDesc, bool& rbSuppressed)
+static void ScFuncRes(const ScFuncDescCore &rEntry, ScFuncDesc* pDesc, bool& rbSuppressed)
{
const sal_uInt16 nOpCode = rEntry.nOpCode;
sal_uInt16 nFunctionFlags = rEntry.nFunctionFlags;
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index cd7ff12d8d3c..03b35ef76e35 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -257,7 +257,6 @@ void SheetDataBuffer::setFormulaCell( const CellModel& rModel, const ApiTokenSeq
reading the formula definition it will be retried to insert the
formula via retryPendingSharedFormulaCell(). */
ScAddress aTokenAddr( aTokenInfo.First.Column, aTokenInfo.First.Row, aTokenInfo.First.Sheet );
- BinAddress aBaseAddr( aTokenAddr );
aTokens = resolveSharedFormula( aTokenAddr );
if( !aTokens.hasElements() )
{
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 142d09945e54..175f098463eb 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -72,7 +72,7 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
{
TokenId eParam[ nBufSize ];
sal_Int32 nCount;
- TokenId nPush, nPush1;
+ TokenId nPush;
bool bAddIn = false;
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index f06dbbe701b9..15b27350acdb 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -69,7 +69,6 @@ OUString SAL_CALL ScVbaPageSetup::getPrintArea()
const uno::Sequence< table::CellRangeAddress > aSeq = xPrintAreas->getPrintAreas();
if( aSeq.hasElements() )
{
- ScAddress::Details aDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRangeList aRangeList;
for( const auto& rRange : aSeq )
{
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 32875638d6cb..d25183400750 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -965,7 +965,6 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
{
// create date group dimensions
- ScDPNumGroupInfo aEmpty;
bool bFirst = true;
sal_Int32 nMask = 1;
for (sal_uInt16 nBit=0; nBit<32; nBit++)
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 28b41219325a..8fef3182ee3e 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -317,7 +317,6 @@ protected:
uno::Reference< drawing::XDrawPages > xDrawPages = xDrawPagesSupplier->getDrawPages();
CPPUNIT_ASSERT(xDrawPages.is());
- XShapeDumper aShapeDumper;
sal_Int32 nLength = xDrawPages->getCount();
for (sal_Int32 i = 0; i < nLength; ++i)
{
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index a8dd775a8cdd..b30359cf2d61 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -637,8 +637,6 @@ void SdDrawDocument::CreateDefaultCellStyles()
pSheet->SetHelpId( OUString(), HID_SD_CELL_STYLE_DEFAULT );
SfxItemSet& rISet = pSheet->GetItemSet();
- XHatch aNullHatch(COL_BLACK);
-
rISet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
rISet.Put(XFillColorItem(OUString(), Color(0x00ccccff)));
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index 9ef8cccd6b9d..8be4b5b183b3 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -478,7 +478,6 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString&
return xEmbed;
aPDFFile = OUStringToOString( aSysUPath, osl_getThreadTextEncoding() );
- pdfparse::PDFReader aParser;
std::unique_ptr<pdfparse::PDFEntry> pEntry( pdfparse::PDFReader::read( aPDFFile.getStr() ));
if( pEntry )
{
diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx
index 719766e7db98..af5fefe3af17 100644
--- a/sdext/source/pdfimport/inc/pdfparse.hxx
+++ b/sdext/source/pdfimport/inc/pdfparse.hxx
@@ -286,10 +286,9 @@ struct PDFPart : public PDFContainer
virtual PDFEntry* clone() const override;
};
-class PDFReader
+struct PDFReader
{
-public:
- PDFReader() {}
+ PDFReader() = delete;
static std::unique_ptr<PDFEntry> read( const char* pFileName );
#ifdef _WIN32
diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx
index e2a6602ad74a..7d27aaf3253d 100644
--- a/sdext/source/pdfimport/test/pdfunzip.cxx
+++ b/sdext/source/pdfimport/test/pdfunzip.cxx
@@ -214,8 +214,6 @@ typedef int(*PDFFileHdl)(const char*, const char*, PDFFile*);
static int handleFile( const char* pInFile, const char* pOutFile, const char* pPassword, PDFFileHdl pHdl )
{
-
- PDFReader aParser;
int nRet = 0;
std::unique_ptr<PDFEntry> pEntry = pdfparse::PDFReader::read( pInFile );
if( pEntry )
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 5ed16ac30702..abc3447cf973 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -910,7 +910,6 @@ static bool checkEncryption( const OUString& i_rPa
bool bSuccess = false;
OString aPDFFile = OUStringToOString( i_rPath, osl_getThreadTextEncoding() );
- pdfparse::PDFReader aParser;
std::unique_ptr<pdfparse::PDFEntry> pEntry( pdfparse::PDFReader::read( aPDFFile.getStr() ));
if( pEntry )
{
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index 78d0113001a2..a22a889a382a 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -103,9 +103,6 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
Reference<ui::XSidebar> xSidebar (aArguments.getOrDefault("Sidebar", Reference<ui::XSidebar>()));
const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0)));
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
- vcl::EnumContext aContext (
- aArguments.getOrDefault("ApplicationName", OUString()),
- aArguments.getOrDefault("ContextName", OUString()));
VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
if ( ! xParentWindow.is() || pParentWindow==nullptr)
diff --git a/svx/source/svdraw/gradtrns.hxx b/svx/source/svdraw/gradtrns.hxx
index 7e6e02f1854e..eee35582a9b0 100644
--- a/svx/source/svdraw/gradtrns.hxx
+++ b/svx/source/svdraw/gradtrns.hxx
@@ -40,10 +40,9 @@ public:
XGradient aGradient;
};
-class GradTransformer
+struct GradTransformer
{
-public:
- GradTransformer() {}
+ GradTransformer() = delete;
static void GradToVec(GradTransGradient const & rG, GradTransVector& rV,
const SdrObject* pObj);
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 7bbd56293a0d..e6fd42899721 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1371,7 +1371,6 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool
// from IAO positions and colors to gradient
const SfxItemSet& rSet = _pObj->GetMergedItemSet();
- GradTransformer aGradTransformer;
GradTransGradient aOldGradTransGradient;
GradTransGradient aGradTransGradient;
GradTransVector aGradTransVector;
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 332ef71b1bb9..a3fce9ec2821 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1318,7 +1318,6 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
}
// set values and transform to vector set
- GradTransformer aGradTransformer;
GradTransVector aGradTransVector;
GradTransGradient aGradTransGradient;
@@ -1359,7 +1358,6 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
if(eFillStyle == drawing::FillStyle_GRADIENT)
{
// set values and transform to vector set
- GradTransformer aGradTransformer;
GradTransVector aGradTransVector;
GradTransGradient aGradTransGradient;
Size aHdlSize(15, 15);
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index c2afd2195101..8b84492dd48f 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -2149,7 +2149,6 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
size_t no=pOL->GetObjCount();
bool bFnd = false;
SdrObjConnection aTestCon;
- SdrObjConnection aBestCon;
while (no>0 && !bFnd) {
// issue: group objects on different layers return LayerID=0!
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 50abc9c6f06f..14874c78f544 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1106,7 +1106,6 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
}
aBoxItem = aNewBox;
- SvxBorderLine aDestBorderLine;
if( aBoxItem->GetTop() != nullptr )
aBoxItem->SetLine(&aBorderLine, SvxBoxItemLine::TOP);
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 4d5ec2aaa874..33691a4d2cba 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -567,7 +567,6 @@ void SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
bool bRecursive)
{
TextView* pTextView = aEditWin->GetTextView();
- TextSelection aSel;
TextPaM aPaM;
bool bForward = !rSearchItem.GetBackward();
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index 74eaa40748ec..8046bd5a40cb 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -150,7 +150,6 @@ executeUnknownAuthDialog(
aArguments.push_back( getContentPart( rXCert->getSubjectName()) );
std::locale aResLocale(Translate::Create("uui"));
- ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale);
aMessage = Translate::get(STR_UUI_UNKNOWNAUTH_UNTRUSTED, aResLocale);
aMessage = UUIInteractionHelper::replaceMessageWithArguments(
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx
index 04b301d47d89..5c14e1476aca 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -1048,8 +1048,6 @@ bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine)
const long nWidth = std::min(pMaskAcc->Width(), pAcc->Width());
const long nHeight = std::min(pMaskAcc->Height(), pAcc->Height());
const Color aColBlack(COL_BLACK);
- BitmapColor aPixel;
- BitmapColor aMaskPixel;
const BitmapColor aWhite(pAcc->GetBestMatchingColor(COL_WHITE));
const BitmapColor aBlack(pAcc->GetBestMatchingColor(aColBlack));
const BitmapColor aMaskBlack(pMaskAcc->GetBestMatchingColor(aColBlack));
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 4728a43700d1..ce1df4a68a65 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1108,7 +1108,6 @@ bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess const & rAcc )
const sal_uLong nPalSize = nColors * 4UL;
std::unique_ptr<sal_uInt8[]> pEntries(new sal_uInt8[ nPalSize ]);
sal_uInt8* pTmpEntry = pEntries.get();
- BitmapColor aPalColor;
for( sal_uInt16 i = 0; i < nColors; i++ )
{