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 {
class XmlSearchException
{
public:
XmlSearchException( const OUString& message )
: _message( message )
{
}
OUString getMessage() const
{
return _message;
}
private:
OUString _message;
};
......@@ -52,7 +44,6 @@ namespace xmlsearch {
: public virtual XmlSearchException
{
public:
IOException( const OUString& message )
: XmlSearchException( message )
{
......
......@@ -28,26 +28,18 @@ namespace xmlsearch {
namespace qe {
class RoleFiller
{
public:
static RoleFiller* STOP() { return &roleFiller_; }
RoleFiller();
~RoleFiller();
void acquire() { ++m_nRefcount; }
void release() { if( ! --m_nRefcount ) delete this; }
private:
static RoleFiller roleFiller_;
sal_uInt32 m_nRefcount;
std::vector< RoleFiller* > fillers_;
};
}
......
......@@ -32,87 +32,19 @@ namespace xmlsearch {
{
public:
QueryHit( sal_Int32 nColumns,double penalty,sal_Int32 doc,sal_Int32 begin,sal_Int32 end )
: doc_( doc ),
begin_( begin ),
end_( end ),
matchesL_( 2*nColumns ),
matches_( new sal_Int32[ 2*nColumns ] ),
penalty_( penalty )
QueryHit( sal_Int32 nColumns )
: matchesL_( 2*nColumns ),
matches_( new sal_Int32[ 2*nColumns ] )
{
memset( matches_, 0, sizeof( sal_Int32 ) * matchesL_ );
}
~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:
sal_Int32 doc_,begin_,end_;
sal_Int32 matchesL_;
sal_Int32 *matches_; // ...concept, word number, ...
double penalty_;
}; // end class QueryHit
......@@ -120,23 +52,13 @@ namespace xmlsearch {
class QueryHitData
{
public:
QueryHitData( double penalty,const OUString& document, OUString* terms )
: penalty_( penalty ),
document_( document ),
QueryHitData( const OUString& document, OUString* terms )
: document_( document ),
terms_( terms ) { }
~QueryHitData() { delete[] terms_; }
OUString getDocument() const { return document_; }
double getPenalty() const { return penalty_; }
private:
double penalty_;
const OUString document_;
OUString* terms_;
......@@ -147,7 +69,6 @@ namespace xmlsearch {
class PrefixTranslator
{
public:
static PrefixTranslator* makePrefixTranslator( const OUString*,sal_Int32 )
{
return 0;
......
......@@ -128,10 +128,6 @@ namespace chelp
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
getPropertyValues( const ::com::sun::star::uno::Sequence<
::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 {
OUString get_title() const { return m_aTitle; }
OUString get_id() const { return m_aStartId; }
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; }
}; // end class StaticModuleInformation
......
......@@ -119,14 +119,11 @@ namespace chelp {
bool isPicture() const { return m_aModule == "picture"; }
bool isActive() const { return !m_aActive.isEmpty() && m_aActive == "true"; }
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 isModule() const { return m_aId.isEmpty() && !m_aModule.isEmpty(); }
bool isRoot() const { return m_aModule.isEmpty(); }
bool isErrorDocument();
OUString get_url() const { return m_aURL; }
OUString get_id();
OUString get_tag();
......@@ -157,8 +154,6 @@ namespace chelp {
OUString get_language();
OUString get_device() const { return m_aDevice; }
OUString get_program();
OUString get_query() const { return m_aQuery; }
......
......@@ -29,8 +29,7 @@ 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