loplugin:constmethod in idl,helpcompiler

Change-Id: I9b328fc0a3ebdd15a646ee6dab800ffbadb1aaef
Reviewed-on: https://gerrit.libreoffice.org/44050
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-10-30 11:45:58 +02:00
parent 4eec79bb37
commit 9ee60319c6
16 changed files with 25 additions and 24 deletions

View File

@ -878,7 +878,7 @@ void Components::parseModificationLayer(int layer, OUString const & url) {
} }
} }
int Components::getExtensionLayer(bool shared) { int Components::getExtensionLayer(bool shared) const {
int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_; int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_;
if (layer == -1) { if (layer == -1) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(

View File

@ -139,7 +139,7 @@ private:
void parseModificationLayer(int layer, OUString const & url); void parseModificationLayer(int layer, OUString const & url);
int getExtensionLayer(bool shared); int getExtensionLayer(bool shared) const;
typedef std::set< RootAccess * > WeakRootSet; typedef std::set< RootAccess * > WeakRootSet;

View File

@ -56,7 +56,7 @@ class L10N_DLLPUBLIC LibXmlTreeWalker
LibXmlTreeWalker( xmlDocPtr doc ); LibXmlTreeWalker( xmlDocPtr doc );
void nextNode(); void nextNode();
xmlNodePtr currentNode() { return m_pCurrentNode;} xmlNodePtr currentNode() { return m_pCurrentNode;}
bool end(); bool end() const;
void ignoreCurrNodesChildren(); void ignoreCurrNodesChildren();
}; };

View File

@ -43,7 +43,7 @@ void LibXmlTreeWalker::ignoreCurrNodesChildren()
m_Queue.pop_back(); m_Queue.pop_back();
} }
bool LibXmlTreeWalker::end() bool LibXmlTreeWalker::end() const
{ {
return m_pCurrentNode->next == nullptr && m_Queue.empty(); return m_pCurrentNode->next == nullptr && m_Queue.empty();
} }

View File

@ -110,7 +110,7 @@ bool HelpIndexer::scanForFiles(OUString const & path) {
return true; return true;
} }
void HelpIndexer::helpDocument(OUString const & fileName, Document *doc) { void HelpIndexer::helpDocument(OUString const & fileName, Document *doc) const {
// Add the help path as an indexed, untokenized field. // Add the help path as an indexed, untokenized field.
OUString path = "#HLP#" + d_module + "/" + fileName; OUString path = "#HLP#" + d_module + "/" + fileName;

View File

@ -112,7 +112,7 @@ public:
void SetPath(const OUString &s) { aPath = s; } void SetPath(const OUString &s) { aPath = s; }
SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; } SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; }
void Write(const OString& rText); void Write(const OString& rText) const;
void WriteError( SvTokenStream & rInStm ); void WriteError( SvTokenStream & rInStm );
void SetError( const OString& rError, SvToken const & rTok ); void SetError( const OString& rError, SvToken const & rTok );
void SetAndWriteError( SvTokenStream & rInStm, const OString& rError ); void SetAndWriteError( SvTokenStream & rInStm, const OString& rError );

View File

@ -120,7 +120,7 @@ public:
virtual void Insert( SvSlotElementList& ) override; virtual void Insert( SvSlotElementList& ) override;
void WriteSlotStubs( const OString& rShellName, void WriteSlotStubs( const OString& rShellName,
ByteStringList & rList, ByteStringList & rList,
SvStream & rOutStm ); SvStream & rOutStm ) const;
sal_uInt16 WriteSlotMap( const OString& rShellName, sal_uInt16 WriteSlotMap( const OString& rShellName,
sal_uInt16 nCount, sal_uInt16 nCount,
SvSlotElementList&, SvSlotElementList&,
@ -128,7 +128,7 @@ public:
SvIdlDataBase & rBase, SvIdlDataBase & rBase,
SvStream & rOutStm ); SvStream & rOutStm );
sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase,
SvStream & rOutStm ); SvStream & rOutStm ) const;
}; };
#endif // INCLUDED_IDL_INC_SLOT_HXX #endif // INCLUDED_IDL_INC_SLOT_HXX

View File

@ -43,7 +43,7 @@ public:
virtual bool Test( SvTokenStream & rInStm ) override; virtual bool Test( SvTokenStream & rInStm ) override;
virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
sal_uLong MakeSfx( OStringBuffer& rAtrrArray ); sal_uLong MakeSfx( OStringBuffer& rAtrrArray ) const;
virtual void Insert( SvSlotElementList& ); virtual void Insert( SvSlotElementList& );
}; };

View File

@ -355,7 +355,7 @@ static OString MakeSlotName( SvStringHashEntry const * pEntry )
void SvMetaSlot::WriteSlotStubs( const OString& rShellName, void SvMetaSlot::WriteSlotStubs( const OString& rShellName,
ByteStringList & rList, ByteStringList & rList,
SvStream & rOutStm ) SvStream & rOutStm ) const
{ {
if ( !GetExport() && !GetHidden() ) if ( !GetExport() && !GetHidden() )
return; return;
@ -595,7 +595,7 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteCharPtr( " )," ) << endl; rOutStm.WriteCharPtr( " )," ) << endl;
} }
sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm ) sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm ) const
{ {
if ( !GetExport() && !GetHidden() ) if ( !GetExport() && !GetHidden() )
return 0; return 0;

View File

@ -96,7 +96,7 @@ bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
return bOk; return bOk;
} }
sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray ) sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray ) const
{ {
SvMetaType * pType = GetType(); SvMetaType * pType = GetType();
DBG_ASSERT( pType, "no type for attribute" ); DBG_ASSERT( pType, "no type for attribute" );

View File

@ -366,7 +366,8 @@ SvMetaClass * SvIdlDataBase::FindKnownClass( const OString& aName )
} }
return nullptr; return nullptr;
} }
void SvIdlDataBase::Write(const OString& rText)
void SvIdlDataBase::Write(const OString& rText) const
{ {
if( nVerbosity != 0 ) if( nVerbosity != 0 )
fprintf( stdout, "%s", rText.getStr() ); fprintf( stdout, "%s", rText.getStr() );

View File

@ -59,7 +59,7 @@ class L10N_DLLPUBLIC HelpIndexer {
/** /**
* Get the error string (empty if no error occurred). * Get the error string (empty if no error occurred).
*/ */
OUString const & getErrorMessage() { return d_error;} OUString const & getErrorMessage() const { return d_error;}
private: private:
@ -76,7 +76,7 @@ class L10N_DLLPUBLIC HelpIndexer {
/** /**
* Fill the Document with information on the given help file. * Fill the Document with information on the given help file.
*/ */
void helpDocument(OUString const & fileName, lucene::document::Document *doc); void helpDocument(OUString const & fileName, lucene::document::Document *doc) const;
/** /**
* Create a reader for the given file, and create an "empty" reader in case the file doesn't exist. * Create a reader for the given file, and create an "empty" reader in case the file doesn't exist.

View File

@ -119,7 +119,7 @@ namespace connectivity
OConnection(MysqlCDriver& _rDriver, sql::Driver * cppDriver); OConnection(MysqlCDriver& _rDriver, sql::Driver * cppDriver);
virtual ~OConnection(); virtual ~OConnection();
rtl_TextEncoding getConnectionEncoding() { return m_settings.encoding; } rtl_TextEncoding getConnectionEncoding() const { return m_settings.encoding; }
// OComponentHelper // OComponentHelper

View File

@ -395,7 +395,7 @@ public:
mpCurrent = mpCurrent->next; mpCurrent = mpCurrent->next;
} }
bool isValid() bool isValid() const
{ {
return mpCurrent != nullptr; return mpCurrent != nullptr;
} }

View File

@ -131,7 +131,7 @@ public:
sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID; sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
bool isEventElement( bool isEventElement(
sal_Int32 nUid, OUString const & rLocalName ) sal_Int32 nUid, OUString const & rLocalName ) const
{ {
return ((XMLNS_SCRIPT_UID == nUid && (rLocalName == "event" || rLocalName == "listener-event" )) || return ((XMLNS_SCRIPT_UID == nUid && (rLocalName == "event" || rLocalName == "listener-event" )) ||
(XMLNS_DIALOGS_UID == nUid && rLocalName == "event" )); (XMLNS_DIALOGS_UID == nUid && rLocalName == "event" ));
@ -144,7 +144,7 @@ public:
OUString const & rStyleId ) const; OUString const & rStyleId ) const;
css::uno::Reference< css::uno::XComponentContext > css::uno::Reference< css::uno::XComponentContext >
const & getComponentContext() { return _xContext; } const & getComponentContext() const { return _xContext; }
css::uno::Reference< css::util::XNumberFormatsSupplier > css::uno::Reference< css::util::XNumberFormatsSupplier >
const & getNumberFormatsSupplier(); const & getNumberFormatsSupplier();
@ -179,7 +179,7 @@ public:
virtual ~DialogImport() override; virtual ~DialogImport() override;
const css::uno::Reference< css::frame::XModel >& getDocOwner() { return _xDoc; } const css::uno::Reference< css::frame::XModel >& getDocOwner() const { return _xDoc; }
// XRoot // XRoot
virtual void SAL_CALL startDocument( virtual void SAL_CALL startDocument(
@ -269,7 +269,7 @@ class StyleElement
short _inited, _hasValue; short _inited, _hasValue;
void setFontProperties( void setFontProperties(
css::uno::Reference< css::beans::XPropertySet > const & xProps ); css::uno::Reference< css::beans::XPropertySet > const & xProps ) const;
public: public:
virtual css::uno::Reference< css::xml::input::XElement > virtual css::uno::Reference< css::xml::input::XElement >

View File

@ -274,7 +274,7 @@ void StyleElement::importVisualEffectStyle(
} }
void StyleElement::setFontProperties( void StyleElement::setFontProperties(
Reference< beans::XPropertySet > const & xProps ) Reference< beans::XPropertySet > const & xProps ) const
{ {
xProps->setPropertyValue("FontDescriptor", makeAny( _descr ) ); xProps->setPropertyValue("FontDescriptor", makeAny( _descr ) );
xProps->setPropertyValue("FontEmphasisMark", makeAny( _fontEmphasisMark ) ); xProps->setPropertyValue("FontEmphasisMark", makeAny( _fontEmphasisMark ) );