summaryrefslogtreecommitdiff
path: root/xmlhelp/source
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-05-10 14:25:10 +0000
committerAndreas Bille <abi@openoffice.org>2001-05-10 14:25:10 +0000
commitf796ed6d917eb9aecaf2d832df8ea459bcd41de9 (patch)
tree7f6f951b5d8128de02f9313a7452c2c6510be5cf /xmlhelp/source
parent11f9aa4fcb2ad0a5fada8561c7041e7f25a059fc (diff)
*** empty log message ***
Diffstat (limited to 'xmlhelp/source')
-rw-r--r--xmlhelp/source/cxxhelp/db/Block.cxx8
-rw-r--r--xmlhelp/source/cxxhelp/db/BtreeDict.cxx93
-rw-r--r--xmlhelp/source/cxxhelp/db/makefile.mk13
3 files changed, 42 insertions, 72 deletions
diff --git a/xmlhelp/source/cxxhelp/db/Block.cxx b/xmlhelp/source/cxxhelp/db/Block.cxx
index 3f91ec9b2679..a9282a3edc44 100644
--- a/xmlhelp/source/cxxhelp/db/Block.cxx
+++ b/xmlhelp/source/cxxhelp/db/Block.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Block.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
+ * last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,6 +85,7 @@ Block::Block( const DBEnv* dbenv )
isLeaf_( true ),
free_( 0 ),
num_( 0 ),
+ dataL_( dbenv->getDataLen() ),
data_( new sal_Int8[ dbenv->getDataLen() ] )
{
}
@@ -138,7 +139,8 @@ sal_Int32 Block::getInteger( sal_Int32 i ) const throw( excep::IllegalIndexExcep
throw excep::IllegalIndexException(
rtl::OUString::createFromAscii( "Block::setInteger -> index out of range" ) );
- return ::getInteger_( &data_[i] );
+ sal_Int32 ret = ::getInteger_( &data_[i] );
+ return ret;
}
diff --git a/xmlhelp/source/cxxhelp/db/BtreeDict.cxx b/xmlhelp/source/cxxhelp/db/BtreeDict.cxx
index 8ce5e7447469..af6c6127b91d 100644
--- a/xmlhelp/source/cxxhelp/db/BtreeDict.cxx
+++ b/xmlhelp/source/cxxhelp/db/BtreeDict.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BtreeDict.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
+ * last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -262,11 +262,11 @@ namespace xmlsearch {
}
- void setBlockNumbers( sal_Int32* blocks )
- {
- for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
- blocks[ entryID(e) ] = getNum();
- }
+ void setBlockNumbers( sal_Int32* blocks );
+// {
+// for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
+// blocks[ entryID(e) ] = getNum();
+// }
#ifdef ABIDEBUG
@@ -328,6 +328,12 @@ namespace xmlsearch {
+ void DictBlock::setBlockNumbers( sal_Int32* blocks )
+ {
+ for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
+ blocks[ entryID(e) ] = getNum();
+ }
+
@@ -344,34 +350,36 @@ using namespace xmlsearch::util;
class BlockProcessorImpl
- : public BlockProcessor
+ : public BlockProcessor
{
public:
- BlockProcessorImpl( BtreeDict* bla )
- : bla_( bla )
- {
- }
-
+ BlockProcessorImpl( BtreeDict* bla )
+ : bla_( bla )
+ {
+ }
- ~BlockProcessorImpl()
- {
- }
+ ~BlockProcessorImpl()
+ {
+ }
- void process( Block* block ) const
- {
- dynamic_cast<DictBlock*>(block)->setBlockNumbers( bla_->get_blocks() );
- }
+ void process( Block* block ) const;
private:
- BtreeDict* bla_;
+ BtreeDict* bla_;
};
+void BlockProcessorImpl::process( Block* block ) const
+{
+ DictBlock* bla = dynamic_cast<DictBlock*>( block );
+ bla->setBlockNumbers( bla_->get_blocks() );
+}
+
BtreeDict::BtreeDict( DBEnv* dbenv )
@@ -393,7 +401,8 @@ BtreeDict::~BtreeDict()
const DictBlock* BtreeDict::accessBlock( sal_Int32 id ) const
{
- return dynamic_cast< const DictBlock* >( blockManager_.accessBlock( id ) );
+ const Block* bl = blockManager_.accessBlock( id );
+ return dynamic_cast< const DictBlock* >( bl );
}
@@ -609,43 +618,3 @@ void DBEnvImpl::write( sal_Int32 blNum,xmlsearch::db::Block* block )
-
-void bla()
-{
- BtreeDict source( new DBEnvImpl() );
-
- std::vector< sal_Int32 > bla = source.withPrefix( rtl::OUString::createFromAscii( "text" ) );
- for( sal_uInt32 i = 0; i < bla.size(); ++i )
- ; // cout << bla[i] << endl;
-
- // source.test();
-}
-
-
-
-
-#ifdef ABIDEBUG
-
-#include <qe/QueryProcessor.hxx>
-
-
-void blu()
-{
- rtl::OUString indexDir = rtl::OUString::createFromAscii( "//./home/ab106281/work/index" );
- qe::QueryProcessor proc( indexDir );
-
- vector< rtl::OUString > bla(1);
-
- bla[ 0 ] = rtl::OUString::createFromAscii( "text" );
- rtl::OUString scope = rtl::OUString::createFromAscii( "headingheading" );
- sal_Int32 nHits = 100;
-
- qe::QueryStatement statement( nHits,
- bla,
- scope );
-
- proc.processQuery( statement );
-}
-
-
-#endif
diff --git a/xmlhelp/source/cxxhelp/db/makefile.mk b/xmlhelp/source/cxxhelp/db/makefile.mk
index 6fb299cd7c4c..7e1afad662c8 100644
--- a/xmlhelp/source/cxxhelp/db/makefile.mk
+++ b/xmlhelp/source/cxxhelp/db/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
+# last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -70,20 +70,19 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : svpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sv.mk
-# --- Files --------------------------------------------------------
+.IF "$(GUI)"=="WNT"
+CFLAGS+=/GR
+.ENDIF
-.IF "$(header)" == ""
+# --- Files --------------------------------------------------------
SLOFILES=\
$(SLO)$/Block.obj \
$(SLO)$/BlockManager.obj \
$(SLO)$/BtreeDict.obj \
$(SLO)$/Schema.obj
-.ENDIF
# --- Targets ------------------------------------------------------