From 118d03d815a7615b9c53363218a7ac45b3f4c514 Mon Sep 17 00:00:00 2001 From: groucho Date: Wed, 07 May 2003 09:01:39 +0000 Subject: Incorporated TimWs current source tree and make it compile --- (limited to 'noncore/apps/opie-reader/CFilter.cpp') diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index d5e3116..73a0872 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp @@ -682,3 +682,61 @@ void repalm::getch(tchar& ch, CStyle& sty) } } #endif + +//static tchar nextpart[] = { 'C','l','i','c','k',' ','h','e','r','e',' ','f','o','r',' ','t','h','e',' ','n','e','x','t',' ','p','a','r','t',0 }; +//static tchar prevpart[] = { 'C','l','i','c','k',' ','h','e','r','e',' ','f','o','r',' ','t','h','e',' ','p','r','e','v','i','o','u','s',' ','p','a','r','t',0 }; + +void DePluck::getch(tchar& ch, CStyle& sty) +{ + if (m_buffed > 0) + { + sty = m_laststyle; + ch = nextpart[m_current++]; + if (m_current == m_buffed) + { + m_current = m_buffed = 0; + } + } + else + { + if (m_buffer != 0) + { + ch = m_buffer; + m_buffer = 0; + return; + } + unsigned long lnk; + do + { + if (nextpart[m_buffed] == 0) break; + parent->getch(ch, sty); + m_laststyle = sty; + if (sty.getLink()) lnk = sty.getData(); + } while (ch == nextpart[m_buffed] && sty.getLink() && ++m_buffed); + m_current = 0; + if (nextpart[m_buffed] == 0) + { + m_buffed = 0; + QString dmy; + parent->hyperlink(lnk, dmy); + do + { + parent->getch(ch, sty); + } + while (ch != 10); + parent->getch(ch, sty); + } + else if (m_buffed > 0) + { + m_buffer = ch; + ch = nextpart[0]; + if (m_buffed == 1) + { + m_buffed = 0; + } + else m_current = 1; + } + } + + return; +} -- cgit v0.9.0.2