Skip to content

Commit

Permalink
loplugin:constmethod in idl,helpcompiler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Noel Grandin committed Oct 30, 2017
1 parent 4eec79b commit 9ee6031
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion configmgr/source/components.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
if (layer == -1) {
throw css::uno::RuntimeException(
Expand Down
2 changes: 1 addition & 1 deletion configmgr/source/components.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private:

void parseModificationLayer(int layer, OUString const & url);

int getExtensionLayer(bool shared);
int getExtensionLayer(bool shared) const;

typedef std::set< RootAccess * > WeakRootSet;

Expand Down
2 changes: 1 addition & 1 deletion helpcompiler/inc/BasCodeTagger.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class L10N_DLLPUBLIC LibXmlTreeWalker
LibXmlTreeWalker( xmlDocPtr doc );
void nextNode();
xmlNodePtr currentNode() { return m_pCurrentNode;}
bool end();
bool end() const;
void ignoreCurrNodesChildren();
};

Expand Down
2 changes: 1 addition & 1 deletion helpcompiler/source/BasCodeTagger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void LibXmlTreeWalker::ignoreCurrNodesChildren()
m_Queue.pop_back();
}

bool LibXmlTreeWalker::end()
bool LibXmlTreeWalker::end() const
{
return m_pCurrentNode->next == nullptr && m_Queue.empty();
}
Expand Down
2 changes: 1 addition & 1 deletion helpcompiler/source/HelpIndexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool HelpIndexer::scanForFiles(OUString const & path) {
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.

OUString path = "#HLP#" + d_module + "/" + fileName;
Expand Down
2 changes: 1 addition & 1 deletion idl/inc/database.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public:
void SetPath(const OUString &s) { aPath = s; }
SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; }

void Write(const OString& rText);
void Write(const OString& rText) const;
void WriteError( SvTokenStream & rInStm );
void SetError( const OString& rError, SvToken const & rTok );
void SetAndWriteError( SvTokenStream & rInStm, const OString& rError );
Expand Down
4 changes: 2 additions & 2 deletions idl/inc/slot.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ public:
virtual void Insert( SvSlotElementList& ) override;
void WriteSlotStubs( const OString& rShellName,
ByteStringList & rList,
SvStream & rOutStm );
SvStream & rOutStm ) const;
sal_uInt16 WriteSlotMap( const OString& rShellName,
sal_uInt16 nCount,
SvSlotElementList&,
size_t nStart,
SvIdlDataBase & rBase,
SvStream & rOutStm );
sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase,
SvStream & rOutStm );
SvStream & rOutStm ) const;
};

#endif // INCLUDED_IDL_INC_SLOT_HXX
Expand Down
2 changes: 1 addition & 1 deletion idl/inc/types.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public:

virtual bool Test( 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& );
};

Expand Down
4 changes: 2 additions & 2 deletions idl/source/objects/slot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static OString MakeSlotName( SvStringHashEntry const * pEntry )

void SvMetaSlot::WriteSlotStubs( const OString& rShellName,
ByteStringList & rList,
SvStream & rOutStm )
SvStream & rOutStm ) const
{
if ( !GetExport() && !GetHidden() )
return;
Expand Down Expand Up @@ -595,7 +595,7 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteCharPtr( " )," ) << endl;
}

sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm )
sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm ) const
{
if ( !GetExport() && !GetHidden() )
return 0;
Expand Down
2 changes: 1 addition & 1 deletion idl/source/objects/types.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
return bOk;
}

sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray )
sal_uLong SvMetaAttribute::MakeSfx( OStringBuffer& rAttrArray ) const
{
SvMetaType * pType = GetType();
DBG_ASSERT( pType, "no type for attribute" );
Expand Down
3 changes: 2 additions & 1 deletion idl/source/prj/database.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ SvMetaClass * SvIdlDataBase::FindKnownClass( const OString& aName )
}
return nullptr;
}
void SvIdlDataBase::Write(const OString& rText)

void SvIdlDataBase::Write(const OString& rText) const
{
if( nVerbosity != 0 )
fprintf( stdout, "%s", rText.getStr() );
Expand Down
8 changes: 4 additions & 4 deletions include/helpcompiler/HelpIndexer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class L10N_DLLPUBLIC HelpIndexer {
/**
* Get the error string (empty if no error occurred).
*/
OUString const & getErrorMessage() { return d_error;}
OUString const & getErrorMessage() const { return d_error;}

private:

Expand All @@ -71,17 +71,17 @@ class L10N_DLLPUBLIC HelpIndexer {
/**
* Scan for files in the given directory.
*/
bool scanForFiles(OUString const &path);
bool scanForFiles(OUString const &path);

/**
* 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.
*/
static lucene::util::Reader *helpFileReader(OUString const & path);
static lucene::util::Reader *helpFileReader(OUString const & path);
};

#endif
Expand Down
2 changes: 1 addition & 1 deletion mysqlc/source/mysqlc_connection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace connectivity
OConnection(MysqlCDriver& _rDriver, sql::Driver * cppDriver);
virtual ~OConnection();

rtl_TextEncoding getConnectionEncoding() { return m_settings.encoding; }
rtl_TextEncoding getConnectionEncoding() const { return m_settings.encoding; }


// OComponentHelper
Expand Down
2 changes: 1 addition & 1 deletion opencl/inc/opencl_device_selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class XmlWalker
mpCurrent = mpCurrent->next;
}

bool isValid()
bool isValid() const
{
return mpCurrent != nullptr;
}
Expand Down
8 changes: 4 additions & 4 deletions xmlscript/source/xmldlg_imexp/imp_share.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public:
sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;

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" )) ||
(XMLNS_DIALOGS_UID == nUid && rLocalName == "event" ));
Expand All @@ -144,7 +144,7 @@ public:
OUString const & rStyleId ) const;

css::uno::Reference< css::uno::XComponentContext >
const & getComponentContext() { return _xContext; }
const & getComponentContext() const { return _xContext; }
css::uno::Reference< css::util::XNumberFormatsSupplier >
const & getNumberFormatsSupplier();

Expand Down Expand Up @@ -179,7 +179,7 @@ public:

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
virtual void SAL_CALL startDocument(
Expand Down Expand Up @@ -269,7 +269,7 @@ class StyleElement
short _inited, _hasValue;

void setFontProperties(
css::uno::Reference< css::beans::XPropertySet > const & xProps );
css::uno::Reference< css::beans::XPropertySet > const & xProps ) const;

public:
virtual css::uno::Reference< css::xml::input::XElement >
Expand Down
2 changes: 1 addition & 1 deletion xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void StyleElement::importVisualEffectStyle(
}

void StyleElement::setFontProperties(
Reference< beans::XPropertySet > const & xProps )
Reference< beans::XPropertySet > const & xProps ) const
{
xProps->setPropertyValue("FontDescriptor", makeAny( _descr ) );
xProps->setPropertyValue("FontEmphasisMark", makeAny( _fontEmphasisMark ) );
Expand Down

0 comments on commit 9ee6031

Please sign in to comment.