Kaydet (Commit) fc0079ee authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:unusedmethods xmlhelp

Change-Id: Iaaeb6e6f928c6e40112b6c852a6868e1f4abdc47
Reviewed-on: https://gerrit.libreoffice.org/16793Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst c4e74d50
...@@ -30,20 +30,12 @@ namespace xmlsearch { ...@@ -30,20 +30,12 @@ namespace xmlsearch {
class XmlSearchException class XmlSearchException
{ {
public: public:
XmlSearchException( const OUString& message ) XmlSearchException( const OUString& message )
: _message( message ) : _message( message )
{ {
} }
OUString getMessage() const
{
return _message;
}
private: private:
OUString _message; OUString _message;
}; };
...@@ -52,7 +44,6 @@ namespace xmlsearch { ...@@ -52,7 +44,6 @@ namespace xmlsearch {
: public virtual XmlSearchException : public virtual XmlSearchException
{ {
public: public:
IOException( const OUString& message ) IOException( const OUString& message )
: XmlSearchException( message ) : XmlSearchException( message )
{ {
......
...@@ -28,26 +28,18 @@ namespace xmlsearch { ...@@ -28,26 +28,18 @@ namespace xmlsearch {
namespace qe { namespace qe {
class RoleFiller class RoleFiller
{ {
public: public:
static RoleFiller* STOP() { return &roleFiller_; } static RoleFiller* STOP() { return &roleFiller_; }
RoleFiller(); RoleFiller();
~RoleFiller(); ~RoleFiller();
void acquire() { ++m_nRefcount; }
void release() { if( ! --m_nRefcount ) delete this; }
private: private:
static RoleFiller roleFiller_; static RoleFiller roleFiller_;
sal_uInt32 m_nRefcount;
std::vector< RoleFiller* > fillers_; std::vector< RoleFiller* > fillers_;
}; };
} }
......
...@@ -32,87 +32,19 @@ namespace xmlsearch { ...@@ -32,87 +32,19 @@ namespace xmlsearch {
{ {
public: public:
QueryHit( sal_Int32 nColumns,double penalty,sal_Int32 doc,sal_Int32 begin,sal_Int32 end ) QueryHit( sal_Int32 nColumns )
: doc_( doc ), : matchesL_( 2*nColumns ),
begin_( begin ), matches_( new sal_Int32[ 2*nColumns ] )
end_( end ),
matchesL_( 2*nColumns ),
matches_( new sal_Int32[ 2*nColumns ] ),
penalty_( penalty )
{ {
memset( matches_, 0, sizeof( sal_Int32 ) * matchesL_ ); memset( matches_, 0, sizeof( sal_Int32 ) * matchesL_ );
} }
~QueryHit() { delete[] matches_; } ~QueryHit() { delete[] matches_; }
sal_Int32 getDocument() const { return doc_; }
sal_Int32 countOfMatches() const { return matchesL_; }
sal_Int32 getBegin() const { return begin_; }
sal_Int32 getEnd() const { return end_; }
double getPenalty() const { return penalty_; }
bool betterThan( const QueryHit* o )
{
if( penalty_ != o->penalty_ )
return penalty_ < o->penalty_;
else if( begin_ != o->begin_ )
return begin_ < o->begin_;
else if( end_ != o->end_ )
return end_ < o->end_;
else
return false;
}
bool worseThan( const QueryHit* o )
{
if( penalty_ != o->penalty_ )
return penalty_ > o->penalty_;
else if( begin_ != o->begin_ )
return begin_ > o->begin_;
else if( end_ != o->end_ )
return end_ > o->end_;
else
return false;
}
bool worseThan( double penalty,sal_Int32 begin,sal_Int32 end )
{
if( penalty_ != penalty )
return penalty_ > penalty;
else if( begin_ != begin )
return begin_ > begin;
else if( end_ != end )
return end_ > end;
else
return false;
}
bool compareTo( const QueryHit* o ) const
{
if( penalty_ != o->penalty_ )
return penalty_ < o->penalty_;
else if( begin_ != o->begin_ )
return begin_ < o->begin_;
else if( end_ != o->end_ )
return end_ < o->end_;
else
return false;
}
private: private:
sal_Int32 doc_,begin_,end_;
sal_Int32 matchesL_; sal_Int32 matchesL_;
sal_Int32 *matches_; // ...concept, word number, ... sal_Int32 *matches_; // ...concept, word number, ...
double penalty_;
}; // end class QueryHit }; // end class QueryHit
...@@ -120,23 +52,13 @@ namespace xmlsearch { ...@@ -120,23 +52,13 @@ namespace xmlsearch {
class QueryHitData class QueryHitData
{ {
public: public:
QueryHitData( const OUString& document, OUString* terms )
QueryHitData( double penalty,const OUString& document, OUString* terms ) : document_( document ),
: penalty_( penalty ),
document_( document ),
terms_( terms ) { } terms_( terms ) { }
~QueryHitData() { delete[] terms_; } ~QueryHitData() { delete[] terms_; }
OUString getDocument() const { return document_; }
double getPenalty() const { return penalty_; }
private: private:
double penalty_;
const OUString document_; const OUString document_;
OUString* terms_; OUString* terms_;
...@@ -147,7 +69,6 @@ namespace xmlsearch { ...@@ -147,7 +69,6 @@ namespace xmlsearch {
class PrefixTranslator class PrefixTranslator
{ {
public: public:
static PrefixTranslator* makePrefixTranslator( const OUString*,sal_Int32 ) static PrefixTranslator* makePrefixTranslator( const OUString*,sal_Int32 )
{ {
return 0; return 0;
......
...@@ -128,10 +128,6 @@ namespace chelp ...@@ -128,10 +128,6 @@ namespace chelp
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
getPropertyValues( const ::com::sun::star::uno::Sequence< getPropertyValues( const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property >& rProperties ); ::com::sun::star::beans::Property >& rProperties );
void setPropertyValues(
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue >& rValues );
}; };
} }
......
...@@ -85,8 +85,6 @@ namespace chelp { ...@@ -85,8 +85,6 @@ namespace chelp {
OUString get_title() const { return m_aTitle; } OUString get_title() const { return m_aTitle; }
OUString get_id() const { return m_aStartId; } OUString get_id() const { return m_aStartId; }
OUString get_program() const { return m_aProgramSwitch; } OUString get_program() const { return m_aProgramSwitch; }
OUString get_heading() const { return m_aHeading; }
OUString get_fulltext() const { return m_aFulltext; }
int get_order() const { return m_nOrder; } int get_order() const { return m_nOrder; }
}; // end class StaticModuleInformation }; // end class StaticModuleInformation
......
...@@ -119,14 +119,11 @@ namespace chelp { ...@@ -119,14 +119,11 @@ namespace chelp {
bool isPicture() const { return m_aModule == "picture"; } bool isPicture() const { return m_aModule == "picture"; }
bool isActive() const { return !m_aActive.isEmpty() && m_aActive == "true"; } bool isActive() const { return !m_aActive.isEmpty() && m_aActive == "true"; }
bool isQuery() const { return m_aId.isEmpty() && !m_aQuery.isEmpty(); } bool isQuery() const { return m_aId.isEmpty() && !m_aQuery.isEmpty(); }
bool isEntryForModule() const { return m_aId == "start" || m_bStart; }
bool isFile() const { return !m_aId.isEmpty(); } bool isFile() const { return !m_aId.isEmpty(); }
bool isModule() const { return m_aId.isEmpty() && !m_aModule.isEmpty(); } bool isModule() const { return m_aId.isEmpty() && !m_aModule.isEmpty(); }
bool isRoot() const { return m_aModule.isEmpty(); } bool isRoot() const { return m_aModule.isEmpty(); }
bool isErrorDocument(); bool isErrorDocument();
OUString get_url() const { return m_aURL; }
OUString get_id(); OUString get_id();
OUString get_tag(); OUString get_tag();
...@@ -157,8 +154,6 @@ namespace chelp { ...@@ -157,8 +154,6 @@ namespace chelp {
OUString get_language(); OUString get_language();
OUString get_device() const { return m_aDevice; }
OUString get_program(); OUString get_program();
OUString get_query() const { return m_aQuery; } OUString get_query() const { return m_aQuery; }
......
...@@ -29,8 +29,7 @@ RoleFiller RoleFiller::roleFiller_; ...@@ -29,8 +29,7 @@ RoleFiller RoleFiller::roleFiller_;
RoleFiller::RoleFiller() RoleFiller::RoleFiller()
: m_nRefcount( 0 ), : fillers_( 0 )
fillers_( 0 )
{ {
} }
......
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