Kaydet (Commit) fe630f3b authored tarafından Caolán McNamara's avatar Caolán McNamara

callcatcher: update list, add README, remove some newly unused code

üst 9c2dee67
......@@ -78,34 +78,6 @@ namespace cppcanvas
class TransparencyGroupAction : public Action, private ::boost::noncopyable
{
public:
/** Create new transparency group action.
@param rGroupMtf
Metafile that groups all actions to be rendered
transparent
@param rParms
Render parameters
@param rDstPoint
Left, top edge of destination, in current state
coordinate system
@param rDstSize
Size of the transparency group object, in current
state coordinate system.
@param nAlpha
Alpha value, must be in the range [0,1]
*/
TransparencyGroupAction( MtfAutoPtr& rGroupMtf,
const Renderer::Parameters& rParms,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
double nAlpha,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState );
/** Create new transparency group action.
@param rGroupMtf
......@@ -180,40 +152,6 @@ namespace cppcanvas
aLocalTransformation );
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
TransparencyGroupAction::TransparencyGroupAction( MtfAutoPtr& rGroupMtf,
const Renderer::Parameters& rParms,
const ::basegfx::B2DPoint& rDstPoint,
const ::basegfx::B2DVector& rDstSize,
double nAlpha,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState ) :
mpGroupMtf( rGroupMtf ),
mpAlphaGradient(),
maParms( rParms ),
maDstSize( rDstSize ),
mxBufferBitmap(),
maLastTransformation(),
mpCanvas( rCanvas ),
maState(),
mnAlpha( nAlpha )
{
tools::initRenderState(maState,rState);
implSetupTransform( maState, rDstPoint );
// correct clip (which is relative to original transform)
tools::modifyClip( maState,
rState,
rCanvas,
rDstPoint,
NULL,
NULL );
maLastSubset.mnSubsetBegin = 0;
maLastSubset.mnSubsetEnd = -1;
}
SAL_WNODEPRECATED_DECLARATIONS_POP
SAL_WNODEPRECATED_DECLARATIONS_PUSH
TransparencyGroupAction::TransparencyGroupAction( MtfAutoPtr& rGroupMtf,
GradientAutoPtr& rAlphaGradient,
......
......@@ -97,10 +97,6 @@ void PlacesListBox::AppendPlace( PlacePtr pPlace )
}
}
sal_Int32 PlacesListBox::GetNbPlaces() {
return maPlaces.size();
}
sal_Int32 PlacesListBox::GetNbEditablePlaces() {
return mnNbEditables;
}
......
......@@ -96,7 +96,6 @@ class PlacesListBox : public Control
void AppendPlace( PlacePtr pPlace );
void RemovePlace( sal_uInt16 nPos );
void RemoveSelectedPlace();
sal_Int32 GetNbPlaces();
sal_Int32 GetNbEditablePlaces();
bool IsUpdated();
const std::vector<PlacePtr>& GetPlaces();
......
......@@ -324,41 +324,6 @@ namespace
return aWorkPathObj.GetMainURL( INetURLObject::NO_DECODE );
}
//---------------------------------------------------------------------
void convertStringListToUrls( const rtl::OUString& _rColonSeparatedList, ::std::vector< String >& _rTokens )
{
const sal_Unicode cSeparator =
#if defined(WNT)
';'
#else
':'
#endif
;
sal_Int32 nIndex = 0;
do
{
// the current token in the list
rtl::OUString sCurrentToken = _rColonSeparatedList.getToken( 0, cSeparator, nIndex );
if ( !sCurrentToken.isEmpty() )
{
INetURLObject aCurrentURL;
rtl::OUString sURL;
if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCurrentToken, sURL ) )
aCurrentURL = INetURLObject( sURL );
else
{
// smart URL parsing, assuming FILE protocol
aCurrentURL = INetURLObject( sCurrentToken, INET_PROT_FILE );
}
aCurrentURL.removeFinalSlash( );
_rTokens.push_back( aCurrentURL.GetMainURL( INetURLObject::NO_DECODE ) );
}
}
while ( nIndex >= 0 );
}
//---------------------------------------------------------------------
struct RemoveFinalSlash : public ::std::unary_function< String, void >
{
......
......@@ -264,76 +264,6 @@ void SvtUpButton_Impl::Click()
GetDialogParent()->PrevLevel_Impl();
}
//=============================================================================
//= SvtTravelButton_Impl
//=============================================================================
//-----------------------------------------------------------------------------
SvtTravelButton_Impl::SvtTravelButton_Impl( SvtFileDialog* pParent, const ResId& rResId )
:SvtFileDialogURLSelector ( pParent, rResId, IMG_FILEDLG_BTN_STD )
{
SetDropDown( 0 ); // by default, don't drop down, as we don't have favourites
}
//-----------------------------------------------------------------------------
void SvtTravelButton_Impl::SetFavouriteLocations( const ::std::vector< String >& _rLocations )
{
m_aFavourites = _rLocations;
// enable the drop down if and only if we have favourites
SetDropDown( m_aFavourites.empty() ? 0 : PUSHBUTTON_DROPDOWN_TOOLBOX );
}
//-----------------------------------------------------------------------------
SvtTravelButton_Impl::~SvtTravelButton_Impl()
{
}
//-----------------------------------------------------------------------------
void SvtTravelButton_Impl::FillURLMenu( PopupMenu* _pMenu )
{
if ( m_aFavourites.empty() )
// though we claimed that we do not want to have a drop down button
// in this case, VCL nevertheless behaves as if we had one .... :(
return;
_pMenu->Clear();
sal_uInt16 nItemId = 1;
String sDisplayName;
::std::vector< String >::const_iterator aLoop;
for ( aLoop = m_aFavourites.begin(); aLoop != m_aFavourites.end(); ++aLoop, ++nItemId )
{
if ( GetDialogParent()->isUrlAllowed( *aLoop ) )
{
Image aImage = SvFileInformationManager::GetImage( INetURLObject(*aLoop) );
if ( LocalFileHelper::ConvertURLToSystemPath(*aLoop, sDisplayName) )
_pMenu->InsertItem( nItemId, sDisplayName, aImage );
else
_pMenu->InsertItem( nItemId, *aLoop, aImage );
}
}
}
//-----------------------------------------------------------------------------
void SvtTravelButton_Impl::Select()
{
sal_uInt16 nId = GetCurItemId();
if ( nId )
{
--nId;
DBG_ASSERT( nId < m_aFavourites.size(), "SvtTravelButton_Impl::Select: invalid index!" );
if ( nId < m_aFavourites.size() )
OpenURL( m_aFavourites[ nId ] );
}
}
//-----------------------------------------------------------------------------
void SvtTravelButton_Impl::Click()
{
OpenURL( GetDialogParent()->GetStandardDir() );
}
//*****************************************************************************
// SvtExpFileDlg_Impl
//*****************************************************************************
......
......@@ -126,23 +126,6 @@ protected:
virtual void Click();
};
class SvtTravelButton_Impl : public SvtFileDialogURLSelector
{
private:
::std::vector< String > m_aFavourites;
public:
SvtTravelButton_Impl( SvtFileDialog* pParent, const ResId& rResId );
~SvtTravelButton_Impl();
void SetFavouriteLocations( const ::std::vector< String >& _rLocations );
protected:
virtual void FillURLMenu( PopupMenu* _pMenu );
virtual void Select();
virtual void Click();
};
typedef sal_uInt8 SvtFileDlgState;
#define FILEDLG_STATE_NONE ((SvtFileDlgState)0x00)
......
......@@ -110,9 +110,6 @@ private:
AnimatorAccess& mrAnimatorAccess;
::boost::function<double(double)> maAccelerationFunction;
Rectangle GetInnerBoundingBox (
const view::Layouter& rLayouter,
const sal_Int32 nIndex) const;
void RestartAnimation (void);
};
typedef ::boost::shared_ptr<PageObjectRun> SharedPageObjectRun;
......@@ -382,33 +379,6 @@ PageObjectRun::~PageObjectRun (void)
{
}
Rectangle PageObjectRun::GetInnerBoundingBox (
const view::Layouter& rLayouter,
const sal_Int32 nIndex) const
{
model::SharedPageDescriptor pDescriptor (
mrAnimatorAccess.GetModel().GetPageDescriptor(nIndex));
if (pDescriptor)
if (pDescriptor->HasState(model::PageDescriptor::ST_Selected))
return rLayouter.GetPageObjectLayouter()->GetBoundingBox(
pDescriptor,
PageObjectLayouter::PageObject,
PageObjectLayouter::ModelCoordinateSystem);
else
return rLayouter.GetPageObjectLayouter()->GetBoundingBox(
pDescriptor,
PageObjectLayouter::Preview,
PageObjectLayouter::ModelCoordinateSystem);
else
return Rectangle();
}
void PageObjectRun::UpdateOffsets(
const InsertPosition& rInsertPosition,
const view::Layouter& rLayouter)
......
......@@ -156,8 +156,6 @@ public:
void setActiveCell( const sdr::table::CellPos& rPos );
void getActiveCellPos( sdr::table::CellPos& rPos ) const;
sal_Int32 getRowCount() const;
sal_Int32 getColumnCount() const;
void getCellBounds( const sdr::table::CellPos& rPos, ::Rectangle& rCellRect );
const SfxItemSet& GetActiveCellItemSet() const;
......
......@@ -579,16 +579,6 @@ SfxStyleSheet* Cell::GetStyleSheet() const
// -----------------------------------------------------------------------------
SfxStyleSheetPool* Cell::GetStyleSheetPool() const
{
if( mpProperties && mpProperties->GetStyleSheet() )
return dynamic_cast< SfxStyleSheetPool* >( &mpProperties->GetStyleSheet()->GetPool() );
else
return 0;
}
// -----------------------------------------------------------------------------
const Rectangle& Cell::GetCurrentBoundRect() const
{
return maCellRect;
......
......@@ -89,7 +89,6 @@ public:
OutlinerParaObject* GetEditOutlinerParaObject() const;
SVX_DLLPRIVATE void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr );
SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const;
SfxStyleSheetPool* GetStyleSheetPool() const;
SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const;
SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
......
......@@ -1506,20 +1506,6 @@ const CellRef& SdrTableObj::getActiveCell() const
// --------------------------------------------------------------------
sal_Int32 SdrTableObj::getRowCount() const
{
return mpImpl ? mpImpl->getRowCount() : 0;
}
// --------------------------------------------------------------------
sal_Int32 SdrTableObj::getColumnCount() const
{
return mpImpl ? mpImpl->getColumnCount() : 0;
}
// --------------------------------------------------------------------
void SdrTableObj::setActiveCell( const CellPos& rPos )
{
if( mpImpl && mpImpl->mxTable.is() ) try
......
......@@ -1054,13 +1054,6 @@ sal_Bool UnoControlModel::supportsService( const ::rtl::OUString& rServiceName )
return Sequence< ::rtl::OUString >( &sName, 1 );
}
// ::cppu::OPropertySetHelper
::cppu::IPropertyArrayHelper& UnoControlModel::getInfoHelper()
{
OSL_FAIL( "UnoControlModel::getInfoHelper() not possible!" );
return *(::cppu::IPropertyArrayHelper*) NULL;
}
// ------------------------------------------------------------------
template <class TYPE>
sal_Bool convertType(Any& _rConvertedValue, const Any& _rNewValueTest, const TYPE* /* _pTypeDisambiguation */)
......
unusedcode.easy is generated via callcatcher[1] and filtered to remove some
tricky edge-cases (see Makefile), e.g. anything which could plausibly be
dlsymed or any symbol defined in an external library bundled into LibreOffice
which doesn't happen to get used by LibreOffice.
unusedcode.easy is generated on an x86_64 --enable-debug --enable-dbgutil
configuration.
Code listed as unused is code that gcc outputs but that nothing calls
(or takes the address of).
a) It's possible that some other platform or configuration uses the code,
so manual inspection is always required.
b) At the time of writing the majority of unused code now originates via
macros, mostly from pre-STL containers, see [2] for killing two birds
with one stone.
c) callcatcher ignores virtuals. But implementations of "pure virtuals"
are not actually virtual methods. If something is declared pure virtual
and provides an impl and that base-class impl is not explicitly called
anywhere, then that impl can go away.
d) gcc will only emit code for inlines if those inlines are used, so
sometimes something is listed correctly as unused but some inline
code takes a pointer or reference to something which cannot be
instantiated so removal of some method/class fails at build time because
gcc never emits any code for the the unused inline but trips over it at
compile time after an attempt at removal. i.e. generally the inline method
can go as well because nothing calls it either, a double win.
e) if a constructor is listed as unused, and it's the *only* ctor in the class,
then no object of that class can be construsted, so the whole thing is
unused, which can lead to a whole cascade of tricky but logical fallout.
f) there's more actually unused code then what's listed. The idea is that what's
listed is definitely unused under the generation configuration, not that
it's a list of all unused code. If the count of unused easy hits 0 then
we can have a look at the non-easy and if that hits 0, then strip out
code from the "release" binaries which only makes sense in debug/dbgutil
configurations, and then tackle unused virtual method slots :-)
[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
[2] https://bugs.freedesktop.org/show_bug.cgi?id=38832
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment