loplugin:expandablemethodds in basctl..chart2

Change-Id: I96f565a974fe3e316ae2ab04f8731b8bbfb87993
Reviewed-on: https://gerrit.libreoffice.org/29998
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-10-18 11:55:32 +02:00
parent 9e54e0708d
commit f019ee7cf9
15 changed files with 16 additions and 58 deletions

View File

@@ -49,10 +49,8 @@ void BreakPointList::reset()
void BreakPointList::transfer(BreakPointList & rList) void BreakPointList::transfer(BreakPointList & rList)
{ {
reset(); maBreakPoints.swap(rList.maBreakPoints);
for (size_t i = 0; i < rList.size(); ++i) rList.reset();
maBreakPoints.push_back( rList.at( i ) );
rList.clear();
} }
void BreakPointList::InsertSorted(BreakPoint* pNewBrk) void BreakPointList::InsertSorted(BreakPoint* pNewBrk)
@@ -159,11 +157,6 @@ const BreakPoint* BreakPointList::at(size_t i) const
return i < maBreakPoints.size() ? maBreakPoints[ i ] : nullptr; return i < maBreakPoints.size() ? maBreakPoints[ i ] : nullptr;
} }
void BreakPointList::clear()
{
maBreakPoints.clear();
}
} // namespace basctl } // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -72,7 +72,6 @@ public:
size_t size() const; size_t size() const;
BreakPoint* at(size_t i); BreakPoint* at(size_t i);
const BreakPoint* at(size_t i) const; const BreakPoint* at(size_t i) const;
void clear();
BreakPoint* remove(BreakPoint* ptr); BreakPoint* remove(BreakPoint* ptr);
}; };

View File

@@ -1100,7 +1100,7 @@ namespace basctl
{ {
const ScriptDocument aCheck = ScriptDocument( doc->xModel ); const ScriptDocument aCheck = ScriptDocument( doc->xModel );
if ( _rUrlOrCaption == aCheck.getTitle() if ( _rUrlOrCaption == aCheck.getTitle()
|| _rUrlOrCaption == aCheck.getURL() || _rUrlOrCaption == aCheck.m_pImpl->getURL()
) )
{ {
aDocument = aCheck; aDocument = aCheck;
@@ -1513,12 +1513,6 @@ namespace basctl
} }
OUString ScriptDocument::getURL() const
{
return m_pImpl->getURL();
}
bool ScriptDocument::isActive() const bool ScriptDocument::isActive() const
{ {
bool bIsActive( false ); bool bIsActive( false );

View File

@@ -471,12 +471,6 @@ namespace basctl
*/ */
OUString getTitle() const; OUString getTitle() const;
/** returns the URL of the document
to be used for valid documents only
*/
OUString getURL() const;
/** determines whether the document is currently the one-and-only application-wide active document /** determines whether the document is currently the one-and-only application-wide active document
*/ */
bool isActive() const; bool isActive() const;

View File

@@ -90,7 +90,6 @@ public:
bool IsUnderline() const { return bUnderline; } bool IsUnderline() const { return bUnderline; }
void SetSize( sal_uInt16 nS ) { nSize = nS; } void SetSize( sal_uInt16 nS ) { nSize = nS; }
sal_uInt16 GetSize() const { return nSize; } sal_uInt16 GetSize() const { return nSize; }
void SetFontName( const OUString& rName ) { aName = rName; }
const OUString& GetFontName() const { return aName; } const OUString& GetFontName() const { return aName; }
}; };

View File

@@ -108,7 +108,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
} }
} }
// special treatment for WITH // special treatment for WITH
else if( (pWithParent_ = GetWithParent()) != nullptr ) else if( (pWithParent_ = pWithParent) != nullptr )
{ {
eOp = SbiOpcode::ELEM_; // .-Term in WITH eOp = SbiOpcode::ELEM_; // .-Term in WITH
} }
@@ -141,12 +141,12 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
eOp = SbiOpcode::ELEM_; eOp = SbiOpcode::ELEM_;
} }
} }
else if( IsTypeOf() ) else if( eNodeType == SbxTYPEOF )
{ {
pLeft->Gen(rGen); pLeft->Gen(rGen);
rGen.Gen( SbiOpcode::TESTCLASS_, nTypeStrId ); rGen.Gen( SbiOpcode::TESTCLASS_, nTypeStrId );
} }
else if( IsNew() ) else if( eNodeType == SbxNEW )
{ {
rGen.Gen( SbiOpcode::CREATE_, 0, nTypeStrId ); rGen.Gen( SbiOpcode::CREATE_, 0, nTypeStrId );
} }

View File

@@ -223,9 +223,9 @@ void SbiExprNode::FoldConstants(SbiParser* pParser)
{ {
if( IsOperand() || eTok == LIKE ) return; if( IsOperand() || eTok == LIKE ) return;
if (IsUnary()) if (pLeft && !pRight)
FoldConstantsUnaryNode(pParser); FoldConstantsUnaryNode(pParser);
else if (IsBinary()) else if (pLeft && pRight)
FoldConstantsBinaryNode(pParser); FoldConstantsBinaryNode(pParser);
if( eNodeType == SbxNUMVAL ) if( eNodeType == SbxNUMVAL )

View File

@@ -109,10 +109,6 @@ class SbiExprNode final { // operators (and operands)
void CollectBits(); // converting numbers to strings void CollectBits(); // converting numbers to strings
bool IsOperand() bool IsOperand()
{ return eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW; } { return eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW; }
bool IsTypeOf()
{ return eNodeType == SbxTYPEOF; }
bool IsNew()
{ return eNodeType == SbxNEW; }
bool IsNumber(); bool IsNumber();
bool IsLvalue(); // true, if usable as Lvalue bool IsLvalue(); // true, if usable as Lvalue
void GenElement( SbiCodeGen&, SbiOpcode ); void GenElement( SbiCodeGen&, SbiOpcode );
@@ -132,12 +128,7 @@ public:
{ return eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL; } { return eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL; }
void ConvertToIntConstIfPossible(); void ConvertToIntConstIfPossible();
bool IsVariable(); bool IsVariable();
bool IsUnary()
{ return pLeft && !pRight; }
bool IsBinary()
{ return pLeft && pRight; }
SbiExprNode* GetWithParent() { return pWithParent; }
void SetWithParent( SbiExprNode* p ) { pWithParent = p; } void SetWithParent( SbiExprNode* p ) { pWithParent = p; }
SbxDataType GetType() { return eType; } SbxDataType GetType() { return eType; }

View File

@@ -202,7 +202,7 @@ void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, bool bWrite )
{ {
if( bWrite ) if( bWrite )
{ {
SetFontName( pVar->GetOUString() ); aName = pVar->GetOUString();
} }
else else
{ {

View File

@@ -40,7 +40,7 @@ FeatureCommandDispatchBase::~FeatureCommandDispatchBase()
void FeatureCommandDispatchBase::initialize() void FeatureCommandDispatchBase::initialize()
{ {
CommandDispatch::initialize(); CommandDispatch::initialize();
fillSupportedFeatures(); describeSupportedFeatures();
} }
bool FeatureCommandDispatchBase::isFeatureSupported( const OUString& rCommandURL ) bool FeatureCommandDispatchBase::isFeatureSupported( const OUString& rCommandURL )
@@ -95,11 +95,6 @@ void FeatureCommandDispatchBase::implDescribeSupportedFeature( const sal_Char* p
m_aSupportedFeatures[ aFeature.Command ] = aFeature; m_aSupportedFeatures[ aFeature.Command ] = aFeature;
} }
void FeatureCommandDispatchBase::fillSupportedFeatures()
{
describeSupportedFeatures();
}
} // namespace chart } // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -95,9 +95,6 @@ protected:
mutable SupportedFeatures m_aSupportedFeatures; mutable SupportedFeatures m_aSupportedFeatures;
sal_uInt16 m_nFeatureId; sal_uInt16 m_nFeatureId;
private:
void fillSupportedFeatures();
}; };
} // namespace chart } // namespace chart

View File

@@ -75,7 +75,7 @@ class CloseableLifeTimeManager : public LifeTimeManager
protected: protected:
css::util::XCloseable* m_pCloseable; css::util::XCloseable* m_pCloseable;
::osl::Condition m_aEndTryClosingCondition; ::osl::Condition m_aEndTryClosingCondition;
bool volatile m_bClosed; bool volatile m_bClosed;
bool volatile m_bInTryClose; bool volatile m_bInTryClose;
//the ownership between model and controller is not clear at first //the ownership between model and controller is not clear at first
@@ -100,10 +100,9 @@ OOO_DLLPUBLIC_CHARTTOOLS void g_addCloseListener( const css::uno::Referenc
protected: protected:
virtual bool impl_canStartApiCall() override; virtual bool impl_canStartApiCall() override;
virtual void impl_apiCallCountReachedNull() override; virtual void impl_apiCallCountReachedNull() override;
void impl_setOwnership( bool bDeliverOwnership, bool bMyVeto ); void impl_setOwnership( bool bDeliverOwnership, bool bMyVeto );
bool impl_shouldCloseAtNextChance() { return m_bOwnership;}
void impl_doClose(); void impl_doClose();
void impl_init() void impl_init()

View File

@@ -310,7 +310,7 @@ void CloseableLifeTimeManager::impl_apiCallCountReachedNull()
{ {
//Mutex needs to be acquired exactly ones //Mutex needs to be acquired exactly ones
//mutex will be released inbetween in impl_doClose() //mutex will be released inbetween in impl_doClose()
if( m_pCloseable && impl_shouldCloseAtNextChance() ) if( m_pCloseable && m_bOwnership )
impl_doClose(); impl_doClose();
} }

View File

@@ -58,14 +58,11 @@ class Stripe;
class AbstractShapeFactory class AbstractShapeFactory
{ {
protected: protected:
css::uno::Reference< css::lang::XMultiServiceFactory> m_xShapeFactory;
css::uno::Reference< css::lang::XMultiServiceFactory>
m_xShapeFactory;
public: public:
enum StackPosition { Top, Bottom }; enum StackPosition { Top, Bottom };
void setShapeFactory(css::uno::Reference< css::lang::XMultiServiceFactory> const & xFactory)
{ m_xShapeFactory = xFactory; }
static AbstractShapeFactory* getOrCreateShapeFactory(const css::uno::Reference< css::lang::XMultiServiceFactory>& xFactory); static AbstractShapeFactory* getOrCreateShapeFactory(const css::uno::Reference< css::lang::XMultiServiceFactory>& xFactory);

View File

@@ -97,14 +97,14 @@ AbstractShapeFactory* AbstractShapeFactory::getOrCreateShapeFactory(const uno::R
{ {
pShapeFactory = reinterpret_cast<getOpenglShapeFactory_>(fn)(); pShapeFactory = reinterpret_cast<getOpenglShapeFactory_>(fn)();
pShapeFactory->setShapeFactory(xFactory); pShapeFactory->m_xShapeFactory = xFactory;
} }
} }
#elif defined(IOS) || defined(ANDROID) // Library_chartopengl is not portable enough yet #elif defined(IOS) || defined(ANDROID) // Library_chartopengl is not portable enough yet
pShapeFactory = NULL; pShapeFactory = NULL;
#else #else
pShapeFactory = getOpenglShapeFactory(); pShapeFactory = getOpenglShapeFactory();
pShapeFactory->setShapeFactory(xFactory); pShapeFactory->m_xShapeFactory = xFactory;
#endif #endif
} }