Kaydet (Commit) a566fd1c authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unusedmethods

Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1
Reviewed-on: https://gerrit.libreoffice.org/45386Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 411260d8
......@@ -177,18 +177,6 @@ bool SbiExprNode::IsLvalue()
return IsVariable();
}
// Identify of the depth of a tree
short SbiExprNode::GetDepth()
{
if( IsOperand() ) return 0;
else
{
return std::max(pLeft->GetDepth(), pRight->GetDepth()) + 1;
}
}
// Adjustment of a tree:
// 1. Constant Folding
// 2. Type-Adjustment
......
......@@ -136,7 +136,6 @@ public:
SbiSymDef* GetVar();
SbiSymDef* GetRealVar(); // last variable in x.y.z
SbiExprNode* GetRealNode(); // last node in x.y.z
short GetDepth(); // compute a tree's depth
const OUString& GetString() { return aStrVal; }
short GetNumber() { return (short)nVal; }
SbiExprList* GetParameters() { return aVar.pPar; }
......
......@@ -118,11 +118,6 @@ namespace connectivity
OEvoabResultSet( OCommonStatement *pStmt, OEvoabConnection *pConnection );
void construct( const QueryData& _rData );
css::uno::Reference< css::uno::XInterface > operator *()
{
return css::uno::Reference< css::uno::XInterface >(*static_cast<OResultSet_BASE*>(this));
}
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
......
......@@ -2155,45 +2155,6 @@ ToolbarSaveInData::~ToolbarSaveInData()
{
}
void ToolbarSaveInData::SetSystemStyle(
const OUString& rResourceURL,
sal_Int32 nStyle )
{
if ( rResourceURL.startsWith( "private" ) &&
m_xPersistentWindowState.is() &&
m_xPersistentWindowState->hasByName( rResourceURL ) )
{
try
{
uno::Sequence< beans::PropertyValue > aProps;
uno::Any a( m_xPersistentWindowState->getByName( rResourceURL ) );
if ( a >>= aProps )
{
for ( sal_Int32 i = 0; i < aProps.getLength(); ++i )
{
if ( aProps[ i ].Name == ITEM_DESCRIPTOR_STYLE )
{
aProps[ i ].Value <<= nStyle;
break;
}
}
}
uno::Reference< container::XNameReplace >
xNameReplace( m_xPersistentWindowState, uno::UNO_QUERY );
xNameReplace->replaceByName( rResourceURL, uno::Any( aProps ) );
}
catch ( uno::Exception& )
{
// do nothing, a default value is returned
SAL_WARN("cui.customize", "Exception setting toolbar style");
}
}
}
sal_Int32 ToolbarSaveInData::GetSystemStyle( const OUString& rResourceURL )
{
sal_Int32 result = 0;
......
......@@ -558,8 +558,6 @@ public:
sal_Int32 GetSystemStyle( const OUString& rResourceURL );
void SetSystemStyle( const OUString& rResourceURL, sal_Int32 nStyle );
SvxEntries* GetEntries() override;
void SetEntries( SvxEntries* ) override;
bool HasSettings() override;
......
......@@ -80,18 +80,6 @@ OO3ExtensionMigration::~OO3ExtensionMigration()
{
}
void OO3ExtensionMigration::checkAndCreateDirectory( INetURLObject const & rDirURL )
{
::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ) );
if ( aResult == ::osl::FileBase::E_NOENT )
{
INetURLObject aBaseURL( rDirURL );
aBaseURL.removeSegment();
checkAndCreateDirectory( aBaseURL );
::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ) );
}
}
void OO3ExtensionMigration::scanUserExtensions( const OUString& sSourceDir, TStringVector& aMigrateExtensions )
{
osl::Directory aScanRootDir( sSourceDir );
......
......@@ -78,7 +78,6 @@ namespace migration
SCANRESULT_DONTMIGRATE_EXTENSION
};
void checkAndCreateDirectory( INetURLObject const & rDirURL );
ScanResult scanExtensionFolder( const OUString& sExtFolder );
void scanUserExtensions( const OUString& sSourceDir, TStringVector& aMigrateExtensions );
bool scanDescriptionXml( const OUString& sDescriptionXmlFilePath );
......
......@@ -994,34 +994,6 @@ void SvxRTFItemStackType::SetStartPos( const EditPosition& rPos )
nSttCnt = rPos.GetCntIdx();
}
void SvxRTFItemStackType::MoveFullNode(const EditNodeIdx &rOldNode,
const EditNodeIdx &rNewNode)
{
bool bSameEndAsStart = (pSttNd == pEndNd);
if (pSttNd->GetIdx() == rOldNode.GetIdx())
{
delete pSttNd;
pSttNd = rNewNode.Clone();
if (bSameEndAsStart)
pEndNd = pSttNd;
}
if (!bSameEndAsStart && pEndNd->GetIdx() == rOldNode.GetIdx())
{
delete pEndNd;
pEndNd = rNewNode.Clone();
}
//And the same for all the children
sal_Int32 nCount = m_pChildList ? m_pChildList->size() : 0;
for (sal_Int32 i = 0; i < nCount; ++i)
{
auto const& pStk = (*m_pChildList)[i];
pStk->MoveFullNode(rOldNode, rNewNode);
}
}
void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser )
{
ENSURE_OR_RETURN_VOID(m_pChildList, "Compress: no ChildList" );
......
......@@ -64,14 +64,6 @@ void LocaleNode::print () const {
printf (">\n");
}
void LocaleNode::printR () const {
print();
for (size_t i=0;i<children.size();i++)
children[i]->printR();
printf ("\t");
print();
}
void LocaleNode::addChild ( LocaleNode * node) {
children.emplace_back(node);
node->parent = this;
......
......@@ -101,7 +101,6 @@ public:
LocaleNode * getChildAt (sal_Int32 idx) const { return children[idx].get(); };
const LocaleNode * findNode ( const sal_Char *name) const;
void print () const;
void printR () const;
virtual ~LocaleNode();
void addChild ( LocaleNode * node);
const LocaleNode* getRoot() const;
......
......@@ -336,9 +336,6 @@ public:
//bad, consider this deprecated.
void SetStartPos( const EditPosition& rPos );
void MoveFullNode(const EditNodeIdx &rOldNode,
const EditNodeIdx &rNewNode);
const EditNodeIdx& GetSttNode() const { return *pSttNd; }
const EditNodeIdx& GetEndNode() const { return *pEndNd; }
......
......@@ -78,7 +78,6 @@ public:
inline sal_uInt16 Count() const;
const SfxSlot* GetRealSlot( const SfxSlot * ) const;
const SfxSlot* GetRealSlot( sal_uInt16 nSlotId ) const;
const SfxSlot* GetSlot( sal_uInt16 nSlotId ) const;
const SfxSlot* GetSlot( const OUString& rCommand ) const;
......
......@@ -123,9 +123,6 @@ private:
bool mbTfHasChanged : 1;
bool mbIsSelected : 1;
public:
void SetBoundVolInvalid();
protected:
void SetTransformChanged();
virtual void NewObjectInserted(const E3dObject* p3DObj);
......
......@@ -140,9 +140,6 @@ public:
/// linked page or linked group object
virtual bool IsReadOnly() const;
/// count all objects including objects in Groups
size_t CountAllObjects() const;
/** Makes the object list flat, i.e. the object list content are
then tree leaves
......
......@@ -84,7 +84,6 @@ public:
TOOLS_DLLPUBLIC friend SvStream & WriteSvGlobalName( SvStream &, const SvGlobalName & );
bool operator < ( const SvGlobalName & rObj ) const;
SvGlobalName& operator += ( sal_uInt32 );
bool operator == ( const SvGlobalName & rObj ) const;
bool operator != ( const SvGlobalName & rObj ) const
......
......@@ -157,7 +157,6 @@ public:
void AddAction( MetaAction* pAction );
void AddAction( MetaAction* pAction, size_t nPos );
void RemoveAction( size_t nPos );
void push_back( MetaAction* pAction );
/**
* @param pAction takes ownership
......
......@@ -294,7 +294,6 @@ public:
virtual bool IsMenuBar() const = 0;
void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
bool HasValidEntries();
void UpdateNativeMenu();
......
......@@ -825,7 +825,6 @@ public:
void IncrementLockCount();
void DecrementLockCount();
bool IsLocked() const;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
......@@ -928,8 +927,6 @@ public:
void SetWindowRegionPixel();
void SetWindowRegionPixel( const vcl::Region& rRegion );
const vcl::Region& GetWindowRegionPixel() const;
bool IsWindowRegionPixel() const;
vcl::Region GetWindowClipRegionPixel() const;
vcl::Region GetPaintRegion() const;
bool IsInPaint() const;
......
......@@ -700,23 +700,6 @@ sal_uInt16 LwpDocument::GetNumberOfPagesBefore()
return nPageNumber;
}
/**
* @descr Get Max number of pages
*/
void LwpDocument::MaxNumberOfPages(sal_uInt16& nNumPages)
{
LwpDocument* pDivision = GetFirstDivision();
LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(m_DivInfo.obj().get());
if(pDivInfo)
nNumPages += pDivInfo->GetMaxNumberOfPages();
while(pDivision)
{
pDivision->MaxNumberOfPages(nNumPages);
pDivision = pDivision->GetNextDivision();
}
}
/**
* @descr Parse the frame which anchor is to page before parse other contents,
* This method is called when the document is root document.
......
......@@ -175,7 +175,6 @@ public:
void ParseFrameInPage(IXFStream* pOutputStream);
private:
void MaxNumberOfPages(sal_uInt16& nNumPages);
LwpDocument* ImplGetFirstDivisionWithContentsThatIsNotOLE();
void XFConvertFrameInPage(XFContentContainer* pCont);
static void ChangeStyleName();
......
......@@ -945,38 +945,6 @@ sal_uInt16 LwpMiddleLayout::GetScaleCenter()
return 0;
}
sal_uInt32 LwpMiddleLayout::GetScalePercentage()
{
if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is() && GetLayoutScale())
return GetLayoutScale()->GetScalePercentage()/10;//m_nScalePercentage 1000 = 100%
rtl::Reference<LwpObject> xBase(GetBasedOnStyle());
if (xBase.is())
return dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScalePercentage();
else
return 100;
}
double LwpMiddleLayout::GetScaleWidth()
{
if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is() && GetLayoutScale())
return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleWidth());
rtl::Reference<LwpObject> xBase(GetBasedOnStyle());
if (xBase.is())
return dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScaleWidth();
else
return 0;
}
double LwpMiddleLayout::GetScaleHeight()
{
if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj().is() && GetLayoutScale())
return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleHeight());
rtl::Reference<LwpObject> xBase(GetBasedOnStyle());
if (xBase.is())
return dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScaleHeight();
else
return 0;
}
bool LwpMiddleLayout::CanSizeRight()
{
sal_uInt8 RelType = GetRelativeType();
......
......@@ -364,9 +364,6 @@ public:
sal_uInt16 GetScaleMode();
sal_uInt16 GetScaleTile();
sal_uInt16 GetScaleCenter();
sal_uInt32 GetScalePercentage();
double GetScaleWidth();
double GetScaleHeight();
bool CanSizeRight();
virtual double GetWidth() override;
......
......@@ -180,7 +180,6 @@ public:
XFContentContainer* GetXFContainer();
void AddXFContent(XFContent* pCont);
void SetXFContainer(XFContentContainer* pCont);
void FindLayouts();// for register pagelayout
void RegisterTabStyle(XFParaStyle* pXFParaStyle);
LwpBulletStyleMgr* GetBulletStyleMgr();
......
......@@ -547,17 +547,6 @@ void LwpPara::OverrideParaNumbering(LwpParaProperty const * pProps)
m_pParaNumbering = std::move(pOver);
}
void LwpPara::FindLayouts()
{
m_Fribs.SetPara(this);
m_Fribs.FindLayouts();
LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext().obj().get());
if(pNextPara)
{
pNextPara->FindLayouts();
}
}
/**************************************************************************
* @descr: Get property according to the property type
**************************************************************************/
......
......@@ -127,8 +127,6 @@ namespace rptui
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
private:
void TogglePropertyListening(const css::uno::Reference< css::uno::XInterface>& Element);
void implSetModified();
void switchListening( const css::uno::Reference< css::container::XIndexAccess >& _rxContainer, bool _bStartListening );
......
......@@ -508,32 +508,6 @@ void OXUndoEnvironment::RemoveSection(const Reference< report::XSection > & _xSe
}
void OXUndoEnvironment::TogglePropertyListening(const Reference< XInterface > & Element)
{
// am Container horchen
Reference< XIndexAccess > xContainer(Element, UNO_QUERY);
if (xContainer.is())
{
Reference< XInterface > xInterface;
sal_Int32 nCount = xContainer->getCount();
for(sal_Int32 i = 0;i != nCount;++i)
{
xInterface.set(xContainer->getByIndex( i ),uno::UNO_QUERY);
TogglePropertyListening(xInterface);
}
}
Reference< XPropertySet > xSet(Element, UNO_QUERY);
if (xSet.is())
{
if (!m_pImpl->m_bReadOnly)
xSet->addPropertyChangeListener( OUString(), this );
else
xSet->removePropertyChangeListener( OUString(), this );
}
}
void OXUndoEnvironment::switchListening( const Reference< XIndexAccess >& _rxContainer, bool _bStartListening )
{
OSL_PRECOND( _rxContainer.is(), "OXUndoEnvironment::switchListening: invalid container!" );
......
......@@ -97,15 +97,10 @@ namespace rptui
void Clear();
private:
void TogglePropertyListening(const css::uno::Reference< css::uno::XInterface>& Element);
void switchListening( const css::uno::Reference< css::container::XIndexAccess >& _rxContainer, bool _bStartListening );
void switchListening( const css::uno::Reference< css::uno::XInterface >& _rxObject, bool _bStartListening );
DECL_LINK(SettingsChanged, VclSimpleEvent&, void );
private:
::std::vector< css::uno::Reference< css::container::XChild> >::const_iterator getSection(const css::uno::Reference< css::container::XChild>& _xContainer) const;
};
} // namespace rptui
......
......@@ -204,29 +204,6 @@ void OXReportControllerObserver::RemoveSection(const uno::Reference< report::XSe
}
void OXReportControllerObserver::TogglePropertyListening(const uno::Reference< uno::XInterface > & Element)
{
// listen at Container
uno::Reference< container::XIndexAccess > xContainer(Element, uno::UNO_QUERY);
if (xContainer.is())
{
uno::Reference< uno::XInterface > xInterface;
sal_Int32 nCount = xContainer->getCount();
for(sal_Int32 i = 0;i != nCount;++i)
{
xInterface.set(xContainer->getByIndex( i ),uno::UNO_QUERY);
TogglePropertyListening(xInterface);
}
}
uno::Reference< beans::XPropertySet > xSet(Element, uno::UNO_QUERY);
if (xSet.is())
{
xSet->addPropertyChangeListener( OUString(), this );
}
}
void OXReportControllerObserver::switchListening( const uno::Reference< container::XIndexAccess >& _rxContainer, bool _bStartListening )
{
OSL_PRECOND( _rxContainer.is(), "OXReportControllerObserver::switchListening: invalid container!" );
......@@ -324,21 +301,6 @@ void OXReportControllerObserver::RemoveElement(const uno::Reference< uno::XInter
}
::std::vector< uno::Reference< container::XChild> >::const_iterator OXReportControllerObserver::getSection(const uno::Reference<container::XChild>& _xContainer) const
{
::std::vector< uno::Reference< container::XChild> >::const_iterator aFind = m_pImpl->m_aSections.end();
if ( _xContainer.is() )
{
aFind = ::std::find(m_pImpl->m_aSections.begin(),m_pImpl->m_aSections.end(),_xContainer);
if ( aFind == m_pImpl->m_aSections.end() )
{
uno::Reference<container::XChild> xParent(_xContainer->getParent(),uno::UNO_QUERY);
aFind = getSection(xParent);
}
}
return aFind;
}
// XContainerListener
void SAL_CALL OXReportControllerObserver::elementInserted(const container::ContainerEvent& evt)
......
......@@ -153,43 +153,6 @@ public:
}
};
// ScRangeItem: manages an area of a table
class ScRangeItem : public SfxPoolItem
{
public:
inline ScRangeItem( const sal_uInt16 nWhich );
inline ScRangeItem( const ScRangeItem& rCpy );
inline ScRangeItem& operator=( const ScRangeItem &rCpy );
// "pure virtual methods" from SfxPoolItem
virtual bool operator==( const SfxPoolItem& ) const override;
virtual bool GetPresentation( SfxItemPresentation ePres,
MapUnit eCoreMetric,
MapUnit ePresMetric,
OUString &rText,
const IntlWrapper& rIntl ) const override;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
private:
ScRange aRange;
};
inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP )
: SfxPoolItem( nWhichP )
{
}
inline ScRangeItem::ScRangeItem( const ScRangeItem& rCpy )
: SfxPoolItem( rCpy.Which() ), aRange( rCpy.aRange )
{}
inline ScRangeItem& ScRangeItem::operator=( const ScRangeItem &rCpy )
{
aRange = rCpy.aRange;
return *this;
}
// page format item: contents of header and footer
#define SC_HF_LEFTAREA 1
......
......@@ -77,27 +77,10 @@ public:
void SetHeaders(bool bCol, bool bRow) { aPositioner.SetHeaders(bCol, bRow); }
bool HasColHeaders() const { return aPositioner.HasColHeaders(); }
bool HasRowHeaders() const { return aPositioner.HasRowHeaders(); }
const OUString& GetName() const { return aName; }
ScMemChart* CreateMemChart();
};
class ScChartCollection
{
typedef ::std::vector<std::unique_ptr<ScChartArray>> DataType;
DataType m_Data;
public:
ScChartCollection();
ScChartCollection(const ScChartCollection& rColl);
void clear();
size_t size() const;
bool empty() const;
ScChartArray* operator[](size_t nIndex);
const ScChartArray* operator[](size_t nIndex) const;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -125,7 +125,6 @@ struct ScAttrEntry;
class ScAutoFormatData;
class ScBroadcastAreaSlotMachine;
class ScChangeViewSettings;
class ScChartCollection;
class ScChartListenerCollection;
class ScClipOptions;
class ScConditionalFormat;
......@@ -364,7 +363,6 @@ private:
mutable ScRangeName* pRangeName;
ScDBCollection* pDBCollection;
ScDPCollection* pDPCollection;
ScChartCollection* pChartCollection;
std::unique_ptr< ScTemporaryChartLock > apTemporaryChartLock;
ScPatternAttr* pSelectionAttr; // Attributes of a block
ScFormulaCell* pFormulaTree; // formula tree (start)
......
......@@ -98,7 +98,6 @@ private:
SCCOLROW nSearchPos, size_t& rFindLevel, size_t& rFindIndex,
size_t nMaxLevel = SC_OL_MAXDEPTH);
void RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLevel);
void PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nStartLevel);
public:
......
......@@ -372,54 +372,6 @@ void ScProtectionAttr::SetHidePrint( bool bHPrint)
bHidePrint = bHPrint;
}
/**
* ScRangeItem - Table range
*/
bool ScRangeItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
return aRange == static_cast<const ScRangeItem&>(rAttr).aRange;
}
SfxPoolItem* ScRangeItem::Clone( SfxItemPool* ) const
{
return new ScRangeItem( *this );
}
bool ScRangeItem::GetPresentation
(
SfxItemPresentation ePres,
MapUnit /* eCoreUnit */,
MapUnit /* ePresUnit */,
OUString& rText,
const IntlWrapper& /* rIntl */
) const
{
rText.clear();
switch ( ePres )
{
case SfxItemPresentation::Complete:
rText = ScGlobal::GetRscString(STR_AREA) + ": ";
SAL_FALLTHROUGH;
case SfxItemPresentation::Nameless:
{
/* Always use OOo:A1 format */
rText += aRange.Format();
}
break;
default:
{
// added to avoid warnings
}
}
return true;
}
/**
* ScPageHFItem - Dates from the Head and Foot lines
*/
......
......@@ -244,7 +244,6 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
}
pDBCollection = new ScDBCollection(this);
pSelectionAttr = nullptr;
pChartCollection = new ScChartCollection;
apTemporaryChartLock.reset( new ScTemporaryChartLock(this) );
xColNameRanges = new ScRangePairList;
xRowNameRanges = new ScRangePairList;
......@@ -427,7 +426,6 @@ ScDocument::~ScDocument()
delete pDBCollection;
delete pSelectionAttr;
apTemporaryChartLock.reset();
delete pChartCollection;
DeleteDrawLayer();
delete pFormatExchangeList;
mpPrinter.disposeAndClear();
......
......@@ -317,60 +317,6 @@ bool ScOutlineArray::FindTouchedLevel(
return bFound;
}
void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLevel)
{
if ( nLevel >= nDepth )
return;
ScOutlineCollection& rColl = aCollections[nLevel];
ScOutlineCollection::iterator it = rColl.begin(), itEnd = rColl.end();
while (it != itEnd)
{
ScOutlineEntry *const pEntry = &it->second;
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
if (nStart >= nStartPos && nEnd <= nEndPos