diff options
author | Andreas Bille <abi@openoffice.org> | 2001-07-16 14:20:25 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2001-07-16 14:20:25 +0000 |
commit | 065784bbcc60d0cfedbf1145dc920f2a0ffbc098 (patch) | |
tree | d74eddbbfc32788db01a9b128e5e229b0ae1365f /xmlhelp | |
parent | 911c3b718468ff801e94ed9bc3859e82872ef702 (diff) |
#89660#
Multiple entries are now avoided.
There is no way to reevaluate the ranking after the search engine
has produced the result.
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 1c9d1d6739b7..08ba4766fd1c 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -2,9 +2,9 @@ * * $RCSfile: resultsetforquery.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: abi $ $Date: 2001-06-19 13:41:05 $ + * last change: $Author: abi $ $Date: 2001-07-16 15:20:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,10 @@ #ifndef _XMLSEARCH_QE_QUERYPROCESSOR_HXX_ #include <qe/QueryProcessor.hxx> #endif +#ifndef INCLUDED_STL_SET +#include <set> +#define INCLUDED_STL_SET +#endif using namespace chelp; using namespace xmlsearch::excep; @@ -149,11 +153,17 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< lang::XMultiServiceF if( queryResults ) it = queryResults->makeQueryHitIterator(); + rtl::OUString aStr; + std::set< rtl::OUString > aSet; + while( it && it->next() ) { QueryHitData* qhd = it->getHit( 0 ); - if( qhd ) - m_aPath.push_back( replWith + ( qhd->getDocument()).copy( replIdx ) ); + if( qhd && + aSet.insert(qhd->getDocument()).second ) + { + m_aPath.push_back( replWith + (qhd->getDocument()).copy( replIdx ) ); + } } delete it; // deletes also queryResults |