Skip to content

Commit

Permalink
loplugin:unusedmethods vcl
Browse files Browse the repository at this point in the history
Change-Id: I53c66b7898f4e0a66e6172d22c6f782dadaf6589
Reviewed-on: https://gerrit.libreoffice.org/16975
Tested-by: Jenkins <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
  • Loading branch information
Noel Grandin authored and grandinj committed Jul 13, 2015
1 parent 5a24750 commit a6fed7a
Show file tree
Hide file tree
Showing 30 changed files with 14 additions and 170 deletions.
1 change: 1 addition & 0 deletions compilerplugins/clang/unusedmethods.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TODO need to handle places where the code takes the address of a method, that ne
as a use-site.
TODO deal with free functions and static methods
TODO track instantiations of template class constructor methods
TODO track instantiation of overridden methods when a template class is instantiated
*/

namespace {
Expand Down
1 change: 1 addition & 0 deletions compilerplugins/clang/unusedmethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"void comphelper::IEventProcessor::release()",
"void SotMutexHolder::acquire()",
"void SotMutexHolder::release()",
"class Rectangle ComboBox::GetDropDownPosSizePixel() const"
# only used by Windows build
"_Bool basegfx::B2ITuple::equalZero() const",
"class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const",
Expand Down
10 changes: 1 addition & 9 deletions include/vcl/builder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public:

vcl::Window* get_widget_root();

PopupMenu* get_menu(PopupMenu*& ret, const OString& sID);

//sID may not exist
PopupMenu* get_menu(const OString& sID);

Expand Down Expand Up @@ -432,13 +430,7 @@ inline T* VclBuilder::get(const OString& sID)
return static_cast<T*>(w);
}

inline PopupMenu* VclBuilder::get_menu(PopupMenu*& ret, const OString& sID)
{
ret = get_menu(sID);
SAL_WARN_IF(!ret, "vcl.layout", "menu \"" << sID.getStr() << "\" not found in .ui");
assert(ret);
return ret;
}


//helper baseclass to ease retro fitting dialogs/tabpages that load a resource
//to load a .ui file instead
Expand Down
1 change: 0 additions & 1 deletion include/vcl/ctrl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public:

vcl::Font GetUnzoomedControlPointFont() const;
void SetShowAccelerator (bool val);
bool GetShowAccelerator (void) const;
};

#endif // INCLUDED_VCL_CTRL_HXX
Expand Down
8 changes: 0 additions & 8 deletions include/vcl/field.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public:

const AllSettings& GetFieldSettings() const;

void SetErrorHdl( const Link<>& rLink ) { maErrorLink = rLink; }
const Link<>& GetErrorHdl() const { return maErrorLink; }

void SetEmptyFieldValue();
Expand Down Expand Up @@ -127,12 +126,10 @@ public:
const OString& GetEditMask() const { return m_aEditMask; }
const OUString& GetLiteralMask() const { return maLiteralMask; }

void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
sal_uInt16 GetFormatFlags() const { return mnFormatFlags; }

void SetString( const OUString& rStr );
OUString GetString() const;
bool IsStringModified() const { return !(GetString() == maFieldString ); }
};


Expand Down Expand Up @@ -209,7 +206,6 @@ public:
virtual sal_Int64 GetValue() const;
virtual OUString CreateFieldText( sal_Int64 nValue ) const;
bool IsValueModified() const;
sal_Int64 GetCorrectedValue() const { return mnCorrectedValue; }

sal_Int64 Normalize( sal_Int64 nValue ) const;
sal_Int64 Denormalize( sal_Int64 nValue ) const;
Expand Down Expand Up @@ -267,11 +263,9 @@ public:
virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
virtual sal_Int64 GetValue() const SAL_OVERRIDE;
virtual OUString CreateFieldText( sal_Int64 nValue ) const SAL_OVERRIDE;
using NumericFormatter::GetCorrectedValue;
sal_Int64 GetCorrectedValue( FieldUnit eOutUnit ) const;

void SetCustomConvertHdl( const Link<>& rLink ) { maCustomConvertLink = rLink; }
const Link<>& GetCustomConvertHdl() const { return maCustomConvertLink; }
};


Expand Down Expand Up @@ -371,7 +365,6 @@ public:
Date GetDate() const;
void SetEmptyDate();
bool IsEmptyDate() const;
Date GetCorrectedDate() const { return maCorrectedDate; }

void ResetLastDate() { maLastDate = Date( 0, 0, 0 ); }

Expand Down Expand Up @@ -456,7 +449,6 @@ public:
tools::Time GetTime() const;
void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
tools::Time GetCorrectedTime() const { return maCorrectedTime; }

static tools::Time GetInvalidTime() { return tools::Time( 99, 99, 99 ); }

Expand Down
7 changes: 0 additions & 7 deletions include/vcl/fixedhyper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ class VCL_DLLPUBLIC FixedHyperlink : public FixedText
*/
inline void SetClickHdl( const Link<>& rLink ) { m_aClickHdl = rLink; }

/** returns m_aClickHdl.
@return
m_aClickHdl
*/
inline const Link<>& GetClickHdl() const { return m_aClickHdl; }

// ::FixedHyperbaseLink

/** sets the URL of the hyperlink and uses it as tooltip. */
Expand Down
1 change: 0 additions & 1 deletion include/vcl/i18nhelp.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ private:
SAL_DLLPRIVATE void ImplDestroyWrappers();

protected:
::osl::Mutex& GetMutex() { return maMutex; }

SAL_DLLPRIVATE utl::TransliterationWrapper& ImplGetTransliterationWrapper() const;
SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
Expand Down
5 changes: 0 additions & 5 deletions include/vcl/image.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ private:
sal_uInt16 mnInitSize;
sal_uInt16 mnGrowSize;

SAL_DLLPRIVATE void ImplInitBitmapEx( const OUString& rUserImageName,
const ::std::vector< OUString >& rImageNames,
const OUString& rSymbolsStyle,
BitmapEx& rBmpEx,
const Color* pMaskColor ) const;
SAL_DLLPRIVATE void ImplInit( sal_uInt16 nItems, const Size &rSize );
SAL_DLLPRIVATE sal_uInt16 ImplGetImageId( const OUString& rImageName ) const;
};
Expand Down
1 change: 0 additions & 1 deletion include/vcl/menu.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ protected:

public:
SAL_DLLPRIVATE void ImplKillLayoutData() const;
SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const { return pStartedFrom; }

SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; }
#if defined(MACOSX)
Expand Down
3 changes: 0 additions & 3 deletions include/vcl/menubtn.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,14 @@ public:
void ExecuteMenu();

void SetMenuMode( sal_uInt16 nMode );
sal_uInt16 GetMenuMode() const { return mnMenuMode; }

void SetPopupMenu( PopupMenu* pNewMenu );
PopupMenu* GetPopupMenu() const { return mpMenu; }

sal_uInt16 GetCurItemId() const { return mnCurItemId; }
OString GetCurItemIdent() const;
void SetCurItemId( sal_uInt16 nItemId ) { mnCurItemId = nItemId; }

void SetActivateHdl( const Link<>& rLink ) { maActivateHdl = rLink; }
const Link<>& GetActivateHdl() const { return maActivateHdl; }
void SetSelectHdl( const Link<MenuButton *, void>& rLink ) { maSelectHdl = rLink; }
};

Expand Down
4 changes: 1 addition & 3 deletions include/vcl/msgbox.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ public:
const OUString& GetMessText() const { return maMessText; }

void SetImage( const Image& rImage ) { maImage = rImage; }
const Image& GetImage() const { return maImage; }

void SetCheckBoxText( const OUString& rText ) { maCheckBoxText = rText;}
const OUString& GetCheckBoxText() const { return maCheckBoxText;}
void SetCheckBoxState( bool bCheck );
bool GetCheckBoxState() const;
bool GetCheckBoxState() const;

virtual Size GetOptimalSize() const SAL_OVERRIDE;
};
Expand Down
22 changes: 2 additions & 20 deletions include/vcl/print.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,14 @@ class VCL_DLLPUBLIC PrinterPage
{
GDIMetaFile* mpMtf;
JobSetup maJobSetup;
bool mbNewJobSetup;

public:

PrinterPage() : mpMtf( new GDIMetaFile() ) {}
PrinterPage( GDIMetaFile* pMtf, bool bNewJobSetup, const JobSetup& rSetup ) :
mpMtf( pMtf ), maJobSetup( rSetup ), mbNewJobSetup( bNewJobSetup ) {}
PrinterPage( GDIMetaFile* pMtf, const JobSetup& rSetup ) :
mpMtf( pMtf ), maJobSetup( rSetup ) {}
~PrinterPage() { delete mpMtf; }

GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
const JobSetup& GetJobSetup() const { return maJobSetup; }
bool IsNewJobSetup() const { return mbNewJobSetup; }
};


Expand Down Expand Up @@ -267,9 +263,6 @@ public:
virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const SAL_OVERRIDE;

protected:

void SetSelfAsQueuePrinter( bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
bool IsQueuePrinter() const { return mbIsQueuePrinter; }
virtual void DrawDeviceMask ( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel ) SAL_OVERRIDE;
Expand Down Expand Up @@ -305,12 +298,9 @@ public:
static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
static OUString GetDefaultPrinterName();

void Error();

const OUString& GetName() const { return maPrinterName; }
const OUString& GetDriverName() const { return maDriver; }
bool IsDefPrinter() const { return mbDefPrinter; }
void SetDefPrinter(bool bDef) { mbDefPrinter = bDef; }
bool IsDisplayPrinter() const { return mpDisplayDev != nullptr; }
bool IsValid() const { return !IsDisplayPrinter(); }

Expand Down Expand Up @@ -366,16 +356,8 @@ public:

bool IsPrinting() const { return mbPrinting; }

const OUString& GetCurJobName() const { return maJobName; }
sal_uInt16 GetCurPage() const { return mnCurPage; }
bool IsJobActive() const { return mbJobActive; }

sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); }
sal_uLong GetErrorCode() const { return mnError; }

void SetErrorHdl( const Link<>& rLink ) { maErrorHdl = rLink; }
const Link<>& GetErrorHdl() const { return maErrorHdl; }

/** checks the printer list and updates it necessary
*
* sends a DataChanged event of type DataChangedEventType::PRINTER
Expand Down
2 changes: 0 additions & 2 deletions include/vcl/rendersettings.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public:

virtual ~RenderSettings()
{}

void Apply(vcl::RenderContext& rRenderContext);
};

}
Expand Down
1 change: 0 additions & 1 deletion include/vcl/scrbar.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ private:
SAL_DLLPRIVATE bool ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags);
SAL_DLLPRIVATE void ImplDragThumb( const Point& rMousePos );
SAL_DLLPRIVATE Size getCurrentCalcSize() const;
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
DECL_DLLPRIVATE_LINK_TYPED( ImplAutoTimerHdl, Timer*, void );

public:
Expand Down
1 change: 0 additions & 1 deletion include/vcl/seleng.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public:
// when the mouse is outside the area
void SetVisibleArea( const Rectangle& rNewArea )
{ aArea = rNewArea; }
const Rectangle& GetVisibleArea() const { return aArea; }

void SetAddMode( bool);
bool IsAddMode() const;
Expand Down
9 changes: 0 additions & 9 deletions include/vcl/slider.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,24 @@ public:
void Slide();
void EndSlide();

void EnableDrag( bool bEnable = true )
{ mbFullDrag = bEnable; }
bool IsDragEnabled() const { return mbFullDrag; }

void SetRangeMin(long nNewRange);
long GetRangeMin() const { return mnMinRange; }
void SetRangeMax(long nNewRange);
long GetRangeMax() const { return mnMaxRange; }
void SetRange( const Range& rRange );
Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
void SetThumbPos( long nThumbPos );
long GetThumbPos() const { return mnThumbPos; }
void SetLineSize( long nNewSize ) { mnLineSize = nNewSize; }
long GetLineSize() const { return mnLineSize; }
void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
long GetPageSize() const { return mnPageSize; }

long GetDelta() const { return mnDelta; }

Size CalcWindowSizePixel();

void SetLinkedField(VclPtr<NumericField> pField);

void SetSlideHdl( const Link<>& rLink ) { maSlideHdl = rLink; }
const Link<>& GetSlideHdl() const { return maSlideHdl; }
void SetEndSlideHdl( const Link<>& rLink ) { maEndSlideHdl = rLink; }
const Link<>& GetEndSlideHdl() const { return maEndSlideHdl; }
};

#endif // INCLUDED_VCL_SLIDER_HXX
Expand Down
3 changes: 0 additions & 3 deletions include/vcl/spinfld.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,10 @@ public:
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;

void SetUpHdl( const Link<>& rLink ) { maUpHdlLink = rLink; }
const Link<>& GetUpHdl() const { return maUpHdlLink; }
void SetDownHdl( const Link<>& rLink ) { maDownHdlLink = rLink; }
const Link<>& GetDownHdl() const { return maDownHdlLink; }
void SetFirstHdl( const Link<>& rLink ) { maFirstHdlLink = rLink; }
const Link<>& GetFirstHdl() const { return maFirstHdlLink; }
void SetLastHdl( const Link<>& rLink ) { maLastHdlLink = rLink; }
const Link<>& GetLastHdl() const { return maLastHdlLink; }

virtual Size CalcMinimumSize() const SAL_OVERRIDE;
virtual Size CalcMinimumSizeForText(const OUString &rString) const SAL_OVERRIDE;
Expand Down
7 changes: 1 addition & 6 deletions include/vcl/split.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,20 @@ public:

void SetDragRectPixel( const Rectangle& rDragRect,
vcl::Window* pRefWin = NULL );
const Rectangle& GetDragRectPixel() const { return maDragRect; }
vcl::Window* GetDragWindow() const { return mpRefWin; }

void SetSplitPosPixel( long nPos );
long GetSplitPosPixel() const { return mnSplitPos; }

bool IsHorizontal() const { return mbHorzSplit; }
bool IsHorizontal() const { return mbHorzSplit; }
void SetHorizontal(bool bNew);

// set the stepsize of the splitter for cursor movement
// the default is 10% of the reference window's width/height
void SetKeyboardStepSize( long nStepSize );

void SetStartSplitHdl( const Link<>& rLink ) { maStartSplitHdl = rLink; }
const Link<>& GetStartSplitHdl() const { return maStartSplitHdl; }
void SetSplitHdl( const Link<>& rLink ) { maSplitHdl = rLink; }
void SetEndSplitHdl( const Link<>& rLink ) { maEndSplitHdl = rLink; }
const Link<>& GetEndSplitHdl() const { return maEndSplitHdl; }
const Link<>& GetSplitHdl() const { return maSplitHdl; }
};

#endif // INCLUDED_VCL_SPLIT_HXX
Expand Down
Loading

0 comments on commit a6fed7a

Please sign in to comment.