diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 08:37:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 11:20:07 +0200 |
commit | c0cc59adca23580864a2e5cdadf66212246cbfcc (patch) | |
tree | 57413c8efb3ca4a59f3699592353da1c575e345d /vcl/source | |
parent | 4bf2052e9dbdfcd32a749747c918f2d714010633 (diff) |
loplugin:singlevalfields improvement
look for any kind of types, not just POD types, helps to find
smart pointer fields that are only assigned nullptr
Change-Id: I2d887e98db012f03b646e1023985bcc196285abc
Reviewed-on: https://gerrit.libreoffice.org/62382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 6 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 10 |
4 files changed, 8 insertions, 17 deletions
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index ef3545b5f511..76c8c35fd8b6 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -149,7 +149,6 @@ WMFWriter::WMFWriter() , eDstROP2(RasterOp::OverPaint) , eDstTextAlign(ALIGN_BASELINE) , eDstHorTextAlign(W_TA_LEFT) - , bDstIsClipping(false) , bHandleAllocated{} , nDstPenHandle(0) , nDstFontHandle(0) @@ -927,10 +926,6 @@ void WMFWriter::SetLineAndFillAttr() aDstFillColor = aSrcFillColor; CreateSelectDeleteBrush( aDstFillColor ); } - if ( bDstIsClipping ) { - bDstIsClipping=false; - aDstClipRegion=aSrcClipRegion; - } } void WMFWriter::SetAllAttr() @@ -1763,7 +1758,6 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, CreateSelectDeleteBrush( aDstFillColor ); aDstClipRegion = aSrcClipRegion = vcl::Region(); - bDstIsClipping = false; vcl::Font aFont; aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) ); diff --git a/vcl/source/filter/wmf/wmfwr.hxx b/vcl/source/filter/wmf/wmfwr.hxx index 8ae1f7547ff5..e0aeba713ac4 100644 --- a/vcl/source/filter/wmf/wmfwr.hxx +++ b/vcl/source/filter/wmf/wmfwr.hxx @@ -91,7 +91,6 @@ private: sal_uInt16 eDstHorTextAlign; - bool bDstIsClipping; // ???: not taken into account at the moment vcl::Region aDstClipRegion; // ???: not taken into account at the moment bool bHandleAllocated[MAXOBJECTHANDLES]; // which handles have been assigned sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // which handles are owned by diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index be9eaeac97af..e184fbcdf3a2 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -555,7 +555,7 @@ void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterControll PrintDialog::JobTabPage::JobTabPage( VclBuilder* pUIBuilder ) : maCollateBmp(SV_PRINT_COLLATE_BMP) , maNoCollateBmp(SV_PRINT_NOCOLLATE_BMP) - , mnCollateUIMode(0) + , mbCollateAlwaysOff(false) { pUIBuilder->get(mpPrinters, "printers"); pUIBuilder->get(mpStatusTxt, "status"); @@ -580,13 +580,13 @@ void PrintDialog::JobTabPage::readFromSettings() "CollateBox" ); if( aValue.equalsIgnoreAsciiCase("alwaysoff") ) { - mnCollateUIMode = 1; + mbCollateAlwaysOff = true; mpCollateBox->Check( false ); mpCollateBox->Enable( false ); } else { - mnCollateUIMode = 0; + mbCollateAlwaysOff = false; aValue = pItem->getValue( "PrintDialog", "Collate" ); mpCollateBox->Check( aValue.equalsIgnoreAsciiCase("true") ); @@ -1283,7 +1283,7 @@ void PrintDialog::DataChanged( const DataChangedEvent& i_rDCEvt ) void PrintDialog::checkControlDependencies() { if( maJobPage.mpCopyCountField->GetValue() > 1 ) - maJobPage.mpCollateBox->Enable( maJobPage.mnCollateUIMode == 0 ); + maJobPage.mpCollateBox->Enable( !maJobPage.mbCollateAlwaysOff ); else maJobPage.mpCollateBox->Enable( false ); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index aeaa0e9c86e6..660cc4222db6 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -49,13 +49,11 @@ public: ImplData(); VclPtr<VirtualDevice> mpVirDev; - long mnItemBorderWidth; }; StatusBar::ImplData::ImplData() { mpVirDev = nullptr; - mnItemBorderWidth = 0; } struct ImplStatusItem @@ -380,7 +378,7 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen // compute output region ImplStatusItem* pItem = mvItemList[nPos].get(); - long nW = mpImplData->mnItemBorderWidth + 1; + long nW = 1; tools::Rectangle aTextRect(aRect.Left() + nW, aRect.Top() + nW, aRect.Right() - nW, aRect.Bottom() - nW); @@ -1083,7 +1081,7 @@ tools::Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const { // get rectangle and subtract frame aRect = ImplGetItemRectPos( nPos ); - long nW = mpImplData->mnItemBorderWidth+1; + long nW = 1; aRect.AdjustTop(nW-1 ); aRect.AdjustBottom( -(nW-1) ); aRect.AdjustLeft(nW ); @@ -1105,7 +1103,7 @@ Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const // get rectangle ImplStatusItem* pItem = mvItemList[ nPos ].get(); tools::Rectangle aRect = ImplGetItemRectPos( nPos ); - long nW = mpImplData->mnItemBorderWidth + 1; + long nW = 1; tools::Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW, aRect.Right()-nW, aRect.Bottom()-nW ); Point aPos = ImplGetItemTextPos( aTextRect.GetSize(), @@ -1463,7 +1461,7 @@ Size StatusBar::CalcWindowSizePixel() const } } - nCalcHeight = nMinHeight+nBarTextOffset + 2*mpImplData->mnItemBorderWidth; + nCalcHeight = nMinHeight+nBarTextOffset; if( nCalcHeight < nProgressHeight+2 ) nCalcHeight = nProgressHeight+2; |