From 7c92afd5fccde1f00fea247ef236e866758baf5d Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 18 Oct 2010 23:21:24 +0200 Subject: [PATCH] Changed: #1135 Some crashes under Linux --- code/ryzom/client/src/client_chat_manager.cpp | 14 +++++++++----- code/ryzom/client/src/interface_v3/chat_window.cpp | 3 ++- code/ryzom/client/src/interface_v3/people_list.cpp | 6 ++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index 97814abe1..0d23e5cd4 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -959,7 +959,7 @@ void CClientChatManager::buildTellSentence(const ucstring &sender, const ucstrin bool bWoman = entity && entity->getGender() == GSGENDER::female; name = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(sender), bWoman); - } + } else { // Does the char have a CSR title? @@ -967,7 +967,8 @@ void CClientChatManager::buildTellSentence(const ucstring &sender, const ucstrin } ucstring cur_time; - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); } @@ -1008,7 +1009,8 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde ucstring cur_time; if (cat.toString() != "&bbl&") { - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); } @@ -1183,11 +1185,13 @@ class CHandlerTell : public IActionHandler ucstring finalMsg; CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false); ucstring cur_time; - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); } - ucstring csr = CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : ""; + ucstring csr; + if (CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw())) csr += ucstring("(CSR) "); finalMsg += cur_time + csr + CI18N::get("youTell") + ": "; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true); diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index e247c3d53..e8378ea10 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -473,7 +473,8 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," "); encodeColorTag(prop.getRGBA(), finalMsg, false); ucstring cur_time; - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); } diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 83642687f..8ffa051a7 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -465,7 +465,8 @@ void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint num } ucstring cur_time; - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); } @@ -936,7 +937,8 @@ class CHandlerContactEntry : public IActionHandler ucstring final; CChatWindow::encodeColorTag(prop.getRGBA(), final, false); ucstring cur_time; - if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false)->getValueBool()) + CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false); + if (pNL && pNL->getValueBool()) { cur_time = CInterfaceManager::getTimestampHuman(); }