Commits

Michael Stahl  committed f28c2d4

rtftok01: debugservices: adapt to rtftok interface changes

  • Participants
  • Parent commits 35e5117

Comments (0)

Files changed (2)

File writerfilter/unocomponent/debugservices/rtftok/ScannerTestService.cxx

 	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()));
 #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)
 			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);
 	}
 
     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);

File writerfilter/unocomponent/debugservices/rtftok/XMLScanner.cxx

         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:
 
     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);