Merge remote branch 'upstream/master'
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 12 Jan 2011 23:44:03 +0000 (00:44 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 12 Jan 2011 23:44:03 +0000 (00:44 +0100)
xbmc/Application.cpp
xbmc/Application.h
xbmc/KeyboardStat.cpp
xbmc/KeyboardStat.h
xbmc/PowerManager.cpp
xbmc/WinEventsWin32.cpp
xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleTagSami.cpp

index e89340f..4ee93e2 100644 (file)
@@ -379,13 +379,6 @@ bool CApplication::OnEvent(XBMC_Event& newEvent)
       if (!g_application.m_bStop)
         g_application.getApplicationMessenger().Quit();
       break;
-//    case XBMC_KEYDOWN:
-//    case XBMC_KEYUP:
-//      g_Keyboard.HandleEvent(newEvent);
-//      g_application.ProcessKeyboard();
-//      break;
-// New key handling code added in preparation for the major overhaul
-// of the keyboard handling
     case XBMC_KEYDOWN:
       g_application.OnKey(g_Keyboard.ProcessKeyDown(newEvent.key.keysym));
       break;
@@ -3104,22 +3097,6 @@ bool CApplication::ProcessJoystickEvent(const std::string& joystickName, int wKe
    return false;
 }
 
-bool CApplication::ProcessKeyboard()
-{
-  MEASURE_FUNCTION;
-
-  // Get the keypress from the keyboard
-  const CKey key(g_Keyboard.GetKey());
-
-  // If we have a valid keypress pass it to OnKey
-  if (key.GetVKey() || key.GetUnicode())
-  {
-    g_Keyboard.Reset();
-    return OnKey(key);
-  }
-  return false;
-}
-
 bool CApplication::Cleanup()
 {
   try
index b470422..966fcda 100644 (file)
@@ -363,7 +363,6 @@ protected:
   bool PlayStack(const CFileItem& item, bool bRestart);
   bool SwitchToFullScreen();
   bool ProcessMouse();
-  bool ProcessKeyboard();
   bool ProcessRemote(float frameTime);
   bool ProcessGamepad(float frameTime);
   bool ProcessEventServer(float frameTime);
index d6f751f..9d581d5 100644 (file)
 
 CKeyboardStat g_Keyboard;
 
-#define XBMC_NLK_CAPS 0x01
-#define XBMC_NLK_NUM  0x02
-
-/* Global keystate information */
-static uint8_t  XBMC_KeyState[XBMCK_LAST];
-static XBMCMod XBMC_ModState;
-
-static uint8_t XBMC_NoLockKeys;
-
-struct _XBMC_KeyRepeat {
-  int firsttime;    /* if we check against the delay or repeat value */
-  int delay;        /* the delay before we start repeating */
-  int interval;     /* the delay between key repeat events */
-  uint32_t timestamp; /* the time the first keydown event occurred */
-
-  XBMC_Event evt;    /* the event we are supposed to repeat */
-} XBMC_KeyRepeat;
-
-int XBMC_EnableKeyRepeat(int delay, int interval)
-{
-  if ( (delay < 0) || (interval < 0) ) {
-    return(-1);
-  }
-  XBMC_KeyRepeat.firsttime = 0;
-  XBMC_KeyRepeat.delay = delay;
-  XBMC_KeyRepeat.interval = interval;
-  XBMC_KeyRepeat.timestamp = 0;
-  return(0);
-}
-
 struct XBMC_KeyMapping
 {
   int   source;
@@ -533,18 +503,11 @@ static bool LookupKeyMapping(BYTE* VKey, char* Ascii, WCHAR* Unicode, int source
 
 CKeyboardStat::CKeyboardStat()
 {
-  /* Initialize the tables */
-  XBMC_ModState = XBMCKMOD_NONE;
-  memset(XBMC_KeyState, 0, sizeof(XBMC_KeyState));
-
-  XBMC_EnableKeyRepeat(0, 0);
-
-  XBMC_NoLockKeys = 0;
-
-  Reset();
-  m_lastKey = XBMCK_UNKNOWN;
+  memset(&m_lastKeysym, 0, sizeof(m_lastKeysym));
   m_lastKeyTime = 0;
-  m_keyHoldTime = 0;
+
+  // In Linux the codes (numbers) for multimedia keys differ depending on
+  // what driver is used and the evdev bool switches between the two.
   m_bEvdev = true;
 }
 
@@ -589,326 +552,6 @@ void CKeyboardStat::Initialize()
 #endif
 }
 
-void CKeyboardStat::Reset()
-{
-  m_VKey      = 0;
-  m_wUnicode  = '\0';
-  m_cAscii    = '\0';
-  m_Modifiers = 0;
-
-  ZeroMemory(&XBMC_KeyState, sizeof(XBMC_KeyState));
-}
-
-void CKeyboardStat::ResetState()
-{
-  Reset();
-  XBMC_ModState = XBMCKMOD_NONE;
-}
-
-int CKeyboardStat::HandleEvent(XBMC_Event& newEvent)
-{
-  int repeatable;
-  uint16_t modstate;
-
-  /* Set up the keysym */
-  XBMC_keysym *keysym = &newEvent.key.keysym;
-  modstate = (uint16_t)XBMC_ModState;
-
-  repeatable = 0;
-
-  int state;
-  if(newEvent.type == XBMC_KEYDOWN)
-    state = XBMC_PRESSED;
-  else if(newEvent.type == XBMC_KEYUP)
-    state = XBMC_RELEASED;
-  else
-    return 0;
-
-  if ( state == XBMC_PRESSED )
-  {
-    keysym->mod = (XBMCMod)modstate;
-    switch (keysym->sym)
-    {
-      case XBMCK_UNKNOWN:
-        break;
-      case XBMCK_NUMLOCK:
-        modstate ^= XBMCKMOD_NUM;
-        if ( XBMC_NoLockKeys & XBMC_NLK_NUM )
-          break;
-        if ( ! (modstate&XBMCKMOD_NUM) )
-          state = XBMC_RELEASED;
-        keysym->mod = (XBMCMod)modstate;
-        break;
-      case XBMCK_CAPSLOCK:
-        modstate ^= XBMCKMOD_CAPS;
-        if ( XBMC_NoLockKeys & XBMC_NLK_CAPS )
-          break;
-        if ( ! (modstate&XBMCKMOD_CAPS) )
-          state = XBMC_RELEASED;
-        keysym->mod = (XBMCMod)modstate;
-        break;
-      case XBMCK_LCTRL:
-        modstate |= XBMCKMOD_LCTRL;
-        break;
-      case XBMCK_RCTRL:
-        modstate |= XBMCKMOD_RCTRL;
-        break;
-      case XBMCK_LSHIFT:
-        modstate |= XBMCKMOD_LSHIFT;
-        break;
-      case XBMCK_RSHIFT:
-        modstate |= XBMCKMOD_RSHIFT;
-        break;
-      case XBMCK_LALT:
-        modstate |= XBMCKMOD_LALT;
-        break;
-      case XBMCK_RALT:
-        modstate |= XBMCKMOD_RALT;
-        break;
-      case XBMCK_LMETA:
-        modstate |= XBMCKMOD_LMETA;
-        break;
-      case XBMCK_RMETA:
-        modstate |= XBMCKMOD_RMETA;
-        break;
-      case XBMCK_LSUPER:
-        modstate |= XBMCKMOD_LSUPER;
-        break;
-      case XBMCK_RSUPER:
-        modstate |= XBMCKMOD_RSUPER;
-        break;
-      case XBMCK_MODE:
-        modstate |= XBMCKMOD_MODE;
-        break;
-      default:
-        repeatable = 1;
-        break;
-    }
-  }
-  else
-  {
-    switch (keysym->sym)
-    {
-      case XBMCK_UNKNOWN:
-        break;
-      case XBMCK_NUMLOCK:
-        if ( XBMC_NoLockKeys & XBMC_NLK_NUM )
-          break;
-        /* Only send keydown events */
-        return(0);
-      case XBMCK_CAPSLOCK:
-        if ( XBMC_NoLockKeys & XBMC_NLK_CAPS )
-          break;
-        /* Only send keydown events */
-        return(0);
-      case XBMCK_LCTRL:
-        modstate &= ~XBMCKMOD_LCTRL;
-        break;
-      case XBMCK_RCTRL:
-        modstate &= ~XBMCKMOD_RCTRL;
-        break;
-      case XBMCK_LSHIFT:
-        modstate &= ~XBMCKMOD_LSHIFT;
-        break;
-      case XBMCK_RSHIFT:
-        modstate &= ~XBMCKMOD_RSHIFT;
-        break;
-      case XBMCK_LALT:
-        modstate &= ~XBMCKMOD_LALT;
-        break;
-      case XBMCK_RALT:
-        modstate &= ~XBMCKMOD_RALT;
-        break;
-      case XBMCK_LMETA:
-        modstate &= ~XBMCKMOD_LMETA;
-        break;
-      case XBMCK_RMETA:
-        modstate &= ~XBMCKMOD_RMETA;
-        break;
-      case XBMCK_LSUPER:
-        modstate &= ~XBMCKMOD_LSUPER;
-        break;
-      case XBMCK_RSUPER:
-        modstate &= ~XBMCKMOD_RSUPER;
-        break;
-      case XBMCK_MODE:
-        modstate &= ~XBMCKMOD_MODE;
-        break;
-      default:
-        break;
-    }
-    keysym->mod = (XBMCMod)modstate;
-  }
-
-  if(state == XBMC_RELEASED)
-    if ( XBMC_KeyRepeat.timestamp &&
-      XBMC_KeyRepeat.evt.key.keysym.sym == keysym->sym )
-    {
-      XBMC_KeyRepeat.timestamp = 0;
-    }
-
-  if ( keysym->sym != XBMCK_UNKNOWN )
-  {
-    /* Update internal keyboard state */
-    XBMC_ModState = (XBMCMod)modstate;
-    XBMC_KeyState[keysym->sym] = state;
-  }
-
-  newEvent.key.state = state;
-  Update(newEvent);
-
-  return 0;
-}
-
-void CKeyboardStat::Update(XBMC_Event& event)
-{
-  if (event.type == XBMC_KEYDOWN)
-  {
-    unsigned int now = CTimeUtils::GetFrameTime();
-    if (m_lastKey == event.key.keysym.sym)
-      m_keyHoldTime += now - m_lastKeyTime;
-    else
-      m_keyHoldTime = 0;
-    m_lastKey = event.key.keysym.sym;
-    m_lastKeyTime = now;
-
-    m_cAscii = 0;
-    m_VKey = 0;
-
-    m_wUnicode = event.key.keysym.unicode;
-
-    m_Modifiers = 0;
-    if (event.key.keysym.mod & XBMCKMOD_CTRL)
-      m_Modifiers |= CKey::MODIFIER_CTRL;
-    if (event.key.keysym.mod & XBMCKMOD_SHIFT)
-      m_Modifiers |= CKey::MODIFIER_SHIFT;
-    if (event.key.keysym.mod & XBMCKMOD_ALT)
-      m_Modifiers |= CKey::MODIFIER_ALT;
-    if (event.key.keysym.mod & XBMCKMOD_RALT)
-      m_Modifiers |= CKey::MODIFIER_RALT;
-    if (event.key.keysym.mod & XBMCKMOD_SUPER)
-      m_Modifiers |= CKey::MODIFIER_SUPER;
-
-    CLog::Log(LOGDEBUG, "SDLKeyboard: scancode: %d, sym: %d, unicode: %d, modifier: %x", event.key.keysym.scancode, event.key.keysym.sym, event.key.keysym.unicode, event.key.keysym.mod);
-
-    if ((event.key.keysym.unicode >= 'A' && event.key.keysym.unicode <= 'Z') ||
-      (event.key.keysym.unicode >= 'a' && event.key.keysym.unicode <= 'z'))
-    {
-      m_cAscii = (char)event.key.keysym.unicode;
-      m_VKey = toupper(m_cAscii);
-    }
-    else if (event.key.keysym.unicode >= '0' && event.key.keysym.unicode <= '9')
-    {
-      m_cAscii = (char)event.key.keysym.unicode;
-      m_VKey = 0x60 + m_cAscii - '0'; // xbox keyboard routine appears to return 0x60->69 (unverified). Ideally this "fixing"
-      // should be done in xbox routine, not in the sdl/directinput routines.
-      // we should just be using the unicode/ascii value in all routines (perhaps with some
-      // headroom for modifier keys?)
-    }
-    else
-    {
-      // see comment above about the weird use of m_VKey here...
-      if (event.key.keysym.unicode == ')') { m_VKey = 0x60; m_cAscii = ')'; }
-      else if (event.key.keysym.unicode == '!') { m_VKey = 0x61; m_cAscii = '!'; }
-      else if (event.key.keysym.unicode == '@') { m_VKey = 0x62; m_cAscii = '@'; }
-      else if (event.key.keysym.unicode == '#') { m_VKey = 0x63; m_cAscii = '#'; }
-      else if (event.key.keysym.unicode == '$') { m_VKey = 0x64; m_cAscii = '$'; }
-      else if (event.key.keysym.unicode == '%') { m_VKey = 0x65; m_cAscii = '%'; }
-      else if (event.key.keysym.unicode == '^') { m_VKey = 0x66; m_cAscii = '^'; }
-      else if (event.key.keysym.unicode == '&') { m_VKey = 0x67; m_cAscii = '&'; }
-      else if (event.key.keysym.unicode == '*') { m_VKey = 0x68; m_cAscii = '*'; }
-      else if (event.key.keysym.unicode == '(') { m_VKey = 0x69; m_cAscii = '('; }
-      else if (event.key.keysym.unicode == ':') { m_VKey = 0xba; m_cAscii = ':'; }
-      else if (event.key.keysym.unicode == ';') { m_VKey = 0xba; m_cAscii = ';'; }
-      else if (event.key.keysym.unicode == '=') { m_VKey = 0xbb; m_cAscii = '='; }
-      else if (event.key.keysym.unicode == '+') { m_VKey = 0xbb; m_cAscii = '+'; }
-      else if (event.key.keysym.unicode == '<') { m_VKey = 0xbc; m_cAscii = '<'; }
-      else if (event.key.keysym.unicode == ',') { m_VKey = 0xbc; m_cAscii = ','; }
-      else if (event.key.keysym.unicode == '-') { m_VKey = 0xbd; m_cAscii = '-'; }
-      else if (event.key.keysym.unicode == '_') { m_VKey = 0xbd; m_cAscii = '_'; }
-      else if (event.key.keysym.unicode == '>') { m_VKey = 0xbe; m_cAscii = '>'; }
-      else if (event.key.keysym.unicode == '.') { m_VKey = 0xbe; m_cAscii = '.'; }
-      else if (event.key.keysym.unicode == '?') { m_VKey = 0xbf; m_cAscii = '?'; } // 0xbf is OEM 2 Why is it assigned here?
-      else if (event.key.keysym.unicode == '/') { m_VKey = 0xbf; m_cAscii = '/'; }
-      else if (event.key.keysym.unicode == '~') { m_VKey = 0xc0; m_cAscii = '~'; }
-      else if (event.key.keysym.unicode == '`') { m_VKey = 0xc0; m_cAscii = '`'; }
-      else if (event.key.keysym.unicode == '{') { m_VKey = 0xeb; m_cAscii = '{'; }
-      else if (event.key.keysym.unicode == '[') { m_VKey = 0xeb; m_cAscii = '['; } // 0xeb is not defined by MS. Why is it assigned here?
-      else if (event.key.keysym.unicode == '|') { m_VKey = 0xec; m_cAscii = '|'; }
-      else if (event.key.keysym.unicode == '\\') { m_VKey = 0xec; m_cAscii = '\\'; }
-      else if (event.key.keysym.unicode == '}') { m_VKey = 0xed; m_cAscii = '}'; }
-      else if (event.key.keysym.unicode == ']') { m_VKey = 0xed; m_cAscii = ']'; } // 0xed is not defined by MS. Why is it assigned here?
-      else if (event.key.keysym.unicode == '"') { m_VKey = 0xee; m_cAscii = '"'; }
-      else if (event.key.keysym.unicode == '\'') { m_VKey = 0xee; m_cAscii = '\''; }
-
-      // For control key combinations, e.g. ctrl-P, the UNICODE gets set
-      // to 1 for ctrl-A, 2 for ctrl-B etc. This mapping sets the UNICODE
-      // back to 'a', 'b', etc.
-      // It isn't clear to me if this applies to Linux and Mac as well as
-      // Windows.
-      if (m_Modifiers & CKey::MODIFIER_CTRL)
-      {
-        if (!m_VKey && !m_cAscii)
-          LookupKeyMapping(&m_VKey, NULL, &m_wUnicode
-                         , event.key.keysym.sym
-                         , g_mapping_ctrlkeys
-                         , sizeof(g_mapping_ctrlkeys)/sizeof(g_mapping_ctrlkeys[0]));
-      }
-
-      /* Check for standard non printable keys */
-      if (!m_VKey && !m_cAscii)
-        LookupKeyMapping(&m_VKey, NULL, &m_wUnicode
-                       , event.key.keysym.sym
-                       , g_mapping_npc
-                       , sizeof(g_mapping_npc)/sizeof(g_mapping_npc[0]));
-
-
-      if (!m_VKey && !m_cAscii)
-      {
-        /* Check for linux defined non printable keys */
-        if(m_bEvdev)
-          LookupKeyMapping(&m_VKey, NULL, NULL
-                         , event.key.keysym.scancode
-                         , g_mapping_evdev
-                         , sizeof(g_mapping_evdev)/sizeof(g_mapping_evdev[0]));
-        else
-          LookupKeyMapping(&m_VKey, NULL, NULL
-                         , event.key.keysym.scancode
-                         , g_mapping_ubuntu
-                         , sizeof(g_mapping_ubuntu)/sizeof(g_mapping_ubuntu[0]));
-      }
-
-      if (!m_VKey && !m_cAscii)
-      {
-        if (event.key.keysym.mod & XBMCKMOD_LSHIFT) m_VKey = 0xa0;
-        else if (event.key.keysym.mod & XBMCKMOD_RSHIFT) m_VKey = 0xa1;
-        else if (event.key.keysym.mod & XBMCKMOD_LALT) m_VKey = 0xa4;
-        else if (event.key.keysym.mod & XBMCKMOD_RALT) m_VKey = 0xa5;
-        else if (event.key.keysym.mod & XBMCKMOD_LCTRL) m_VKey = 0xa2;
-        else if (event.key.keysym.mod & XBMCKMOD_RCTRL) m_VKey = 0xa3;
-        else if (event.key.keysym.unicode > 32 && event.key.keysym.unicode < 128)
-          // only TRUE ASCII! (Otherwise XBMC crashes! No unicode not even latin 1!)
-          m_cAscii = (char)(event.key.keysym.unicode & 0xff);
-      }
-    }
-  }
-  else
-  { // key up event
-    Reset();
-    m_lastKey = XBMCK_UNKNOWN;
-    m_keyHoldTime = 0;
-  }
-}
-
-// Set the supplied CKey from the current keyboard state.
-
-const CKey CKeyboardStat::GetKey()
-{
-  return CKey(m_VKey, m_wUnicode, m_cAscii, m_Modifiers, m_keyHoldTime);
-}
-
-// New key handling code added in preparation for the major overhaul
-// of the keyboard handling
 const CKey CKeyboardStat::ProcessKeyDown(XBMC_keysym& keysym)
 { uint8_t vkey;
   wchar_t unicode;
index ec328a0..6097c6d 100644 (file)
@@ -49,34 +49,19 @@ public:
   ~CKeyboardStat();
 
   void Initialize();
-  void Reset();
-  void ResetState();
-  int  HandleEvent(XBMC_Event& newEvent);
-  void Update(XBMC_Event& event);
 
-  const CKey GetKey();
-
-  CStdString GetKeyName(int KeyID);
-
-// New key handling code added in preparation for the major overhaul
-// of the keyboard handling
   const CKey ProcessKeyDown(XBMC_keysym& keysym);
   void       ProcessKeyUp(void);
 
-private:
-  uint8_t  m_VKey;
-  wchar_t  m_wUnicode;
-  char     m_cAscii;
-  uint32_t m_Modifiers;
+  CStdString GetKeyName(int KeyID);
 
-  XBMCKey m_lastKey;
+private:
+  XBMC_keysym m_lastKeysym;
   unsigned int m_lastKeyTime;
-  unsigned int m_keyHoldTime;
-  bool m_bEvdev;
 
-// New key handling code added in preparation for the major overhaul
-// of the keyboard handling
-  XBMC_keysym m_lastKeysym;
+  // In Linux the codes (numbers) for multimedia keys differ depending on
+  // what driver is used and the evdev bool switches between the two.
+  bool m_bEvdev;
 };
 
 extern CKeyboardStat g_Keyboard;
index 31ece5c..f7c13c7 100644 (file)
@@ -215,8 +215,6 @@ void CPowerManager::OnSleep()
   CBuiltins::Execute("LIRC.Stop");
 #endif
 
-  g_Keyboard.ResetState();
-
   g_application.StopPlaying();
   g_application.StopShutdownTimer();
 }
index 4d04e30..b73ff5b 100644 (file)
@@ -382,8 +382,6 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
     case WM_KILLFOCUS:
       g_application.m_AppFocused = uMsg == WM_SETFOCUS;
       CLog::Log(LOGDEBUG, __FUNCTION__"Window %s focus", g_application.m_AppFocused ? "gained" : "lost");
-      if (!g_application.m_AppFocused)
-        g_Keyboard.ResetState();//lost focus, unstick any keys
       g_Windowing.NotifyAppFocusChange(g_application.m_AppFocused);
       break;
     case WM_SYSKEYDOWN:
index 2235b76..a6dcbc6 100644 (file)
@@ -33,7 +33,7 @@ CDVDSubtitleTagSami::~CDVDSubtitleTagSami()
 bool CDVDSubtitleTagSami::Init()
 {
   m_tags = new CRegExp(true);
-  if (!m_tags->RegComp("(<[^>]*>)"))
+  if (!m_tags->RegComp("(<[^>]*>|\\{[^\\}]*\\})"))
     return false;
 
   m_tagOptions = new CRegExp(true);
@@ -57,36 +57,52 @@ void CDVDSubtitleTagSami::ConvertLine(CDVDOverlayText* pOverlay, const char* lin
     CStdString fullTag = m_tags->GetMatch(0);
     fullTag.ToLower();
     strUTF8.erase(pos, fullTag.length());
-    if (fullTag == "<b>")
+    if (fullTag == "<b>" || fullTag == "{\\b1}")
     {
       m_flag[FLAG_BOLD] = true;
       strUTF8.insert(pos, "[B]");
       pos += 3;
     }
-    else if (fullTag == "</b>" && m_flag[FLAG_BOLD])
+    else if ((fullTag == "</b>" || fullTag == "{\\b0}") && m_flag[FLAG_BOLD])
     {
       m_flag[FLAG_BOLD] = false;
       strUTF8.insert(pos, "[/B]");
       pos += 4;
     }
-    else if (fullTag == "<i>")
+    else if (fullTag == "<i>" || fullTag == "{\\i1}")
     {
       m_flag[FLAG_ITALIC] = true;
       strUTF8.insert(pos, "[I]");
       pos += 3;
     }
-    else if (fullTag == "</i>" && m_flag[FLAG_ITALIC])
+    else if ((fullTag == "</i>" || fullTag == "{\\i0}") && m_flag[FLAG_ITALIC])
     {
       m_flag[FLAG_ITALIC] = false;
       strUTF8.insert(pos, "[/I]");
       pos += 4;
     }
-    else if (fullTag == "</font>" && m_flag[FLAG_COLOR])
+    else if ((fullTag == "</font>" || fullTag == "{\\c}") && m_flag[FLAG_COLOR])
     {
       m_flag[FLAG_COLOR] = false;
       strUTF8.insert(pos, "[/COLOR]");
       pos += 8;
     }
+    else if (fullTag.Left(5) == "{\\c&h" || fullTag.Left(6) == "{\\1c&h")
+    {
+      m_flag[FLAG_COLOR] = true;
+         CStdString tempColorTag = "[COLOR FF";
+         CStdString tagOptionValue;
+         if (fullTag.Left(5) == "{\\c&h")
+            tagOptionValue = fullTag.substr(5,6);
+         else
+            tagOptionValue = fullTag.substr(6,6);
+         tempColorTag += tagOptionValue.substr(4,2);
+         tempColorTag += tagOptionValue.substr(2,2);
+         tempColorTag += tagOptionValue.substr(0,2);
+      tempColorTag += "]";
+      strUTF8.insert(pos, tempColorTag);
+      pos += tempColorTag.length();
+       }
     else if (fullTag.Left(5) == "<font")
     {
       int pos2 = 5;