# HG changeset patch
# User Michael Stahl <mst@openoffice.org>
# Date 1304616200 0
# Node ID f28c2d46848b0b96a44e2fd12123800ad42291b1
# Parent  35e511774a9e026505a14253cf7db7e62f5f7c69
rtftok01: debugservices: adapt to rtftok interface changes

diff --git a/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx b/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx
--- a/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx
+++ b/writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx
@@ -90,27 +90,32 @@
 	uno::Reference<com::sun::star::ucb::XSimpleFileAccess> xFileAccess;
 	uno::Reference<embed::XStorage> xStorage;
 
-	void dest(char* token, char* /*value*/)
-	{
-		destMap.insert(rtl::OString(token));
+    virtual void unknown(char const*const /*token*/, char const*const /*value*/,
+                         bool const /*bStar*/)
+    {
+    }
+
+    virtual void dest(Token_t const token, char const*const /*value*/)
+    {
+        destMap.insert(rtl::OString(TokenToId(token)));
 //		printf("{\\*\\%s%s ", token, value);
-		if (strcmp(token, "objdata")==0)
+        if (RTF_objdata == token)
 		{
 			binBuffer.clear();
 			objDataLevel=1;
 			numOfOLEChars=0;
 		}
 	}
-	void ctrl(char*token, char* /*value*/)
-	{
-		ctrlMap.insert(rtl::OString(token));
+    virtual void ctrl(Token_t const token, char const*const /*value*/)
+    {
+        ctrlMap.insert(rtl::OString(TokenToId(token)));
 //		printf("\\%s%s ", token, value);
 	}
-	void lbrace(void)
+    virtual void lbrace()
 	{
 //		printf("{");
 	}
-	void rbrace(void)
+    virtual void rbrace()
 	{
 #ifndef LINUX
         unsigned char * binBufferStr = ((unsigned char*)&(*binBuffer.begin()));
@@ -223,17 +228,17 @@
 #endif
 //		printf("}");
 	}
-	void addSpaces(int /*count*/)
+    virtual void addSpaces(unsigned int const /*count*/)
 	{
 //		for(int i=0;i<count;i++)
 //			printf(" ");
 
 	}
-	void addBinData(unsigned char /*data*/)
+    virtual void addBinData(unsigned char const /*data*/)
 	{
 //		printf("%02Xh", data);
 	}
-	void addChar(char ch)
+    virtual void addChar(char const ch)
 	{
 //		printf("%c", ch);
 		if (objDataLevel)
@@ -256,11 +261,11 @@
 			numOfOLEChars++;
 		}
 	}
-	void addCharU(sal_Unicode /*ch*/)
+    virtual void addCharU(sal_Unicode const /*ch*/)
 	{
 //		printf("\\u%i ", ch);
 	}
-	void addHexChar(char* /*hexch*/)
+    virtual void addHexChar(char const /*hexch*/[2])
 	{
 //		printf("\'%s ", hexch);
 	}
@@ -317,7 +322,7 @@
 
     virtual ~RtfInputSourceImpl() {}
 
-	int read(void *buf, int maxlen)
+    virtual size_t read(void *const buf, size_t const maxlen)
 	{
 		uno::Sequence< sal_Int8 > buffer;
 		int len=xInputStream->readSomeBytes(buffer,maxlen);
diff --git a/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx b/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
--- a/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
+++ b/writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx
@@ -119,52 +119,58 @@
         ucharBuffer = "";
     }
 
-	void dest(char* token, char* value)
+    virtual void unknown(char const*const /*token*/, char const*const /*value*/,
+                         bool const /*bStar*/)
+    {
+    }
+
+    virtual void dest(Token_t const token, char const*const value)
 	{
         clearBuffers();
-        cout << "<dest name=\"" << token << "\" value=\""<< value << "\">" << endl;
+        cout << "<dest name=\"" << TokenToId(token) << "\" value=\""<< value
+             << "\">" << endl;
         vCloseTags.push_back("</dest>");
 	}
-	void ctrl(char*token, char* value)
+    virtual void ctrl(Token_t const token, char const*const value)
 	{
         clearBuffers();
-        cout << "<" << token << ">" << value << "</" << token << ">"
-             << endl;
+        cout << "<" << TokenToId(token) << ">" << value
+             << "</" << TokenToId(token) << ">" << endl;
 	}
-	void lbrace(void)
+    virtual void lbrace()
 	{
         clearBuffers();
         cout << "<brace>" << endl;
         vCloseTags.push_back("</brace>");
 	}
-	void rbrace(void)
+    virtual void rbrace()
 	{
         clearBuffers();
         cout << vCloseTags.back() << endl;
         vCloseTags.pop_back();
 	}
-	void addSpaces(int count)
+    virtual void addSpaces(unsigned int const count)
 	{
         clearBuffers();
         cout << "<spaces count=\"" << count << "\"/>" << endl;
 	}
-	void addBinData(unsigned char /*data*/)
+    virtual void addBinData(unsigned char const /*data*/)
 	{
         clearBuffers();
         cout << "<bindata/>" << endl;
 	}
-	void addChar(char ch)
+    virtual void addChar(char const ch)
 	{
         charBuffer += ch;
 	}
-	void addCharU(sal_Unicode ch)
+    virtual void addCharU(sal_Unicode const ch)
 	{
         ucharBuffer += sal_Char(ch < 128 ? ch : '.');
 	}
-	void addHexChar(char* hexch)
-	{
+    virtual void addHexChar(char const hexch[2])
+    {
         clearBuffers();
-        cout << "<hexchar value=\"" << hexch << "\"/>" << endl;
+        cout << "<hexchar value=\"" << hexch[0] << hexch[1] << "\"/>" << endl;
 	}
 
 public:
@@ -207,7 +213,7 @@
 
     virtual ~RtfInputSourceImpl() {}
 
-	int read(void *buf, int maxlen)
+    virtual size_t read(void *const buf, size_t const maxlen)
 	{
 		uno::Sequence< sal_Int8 > buffer;
 		int len=xInputStream->readSomeBytes(buffer,maxlen);
