summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-17 19:24:55 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-17 19:24:55 +0300
commita8df6762ff88458916397b9707f6954b2714e14d (patch)
treeacb84bdc0f30426c4c7dd6eef95a8d6b6a4a6d19
parentb0b155efefe224bd645a28efc24eb8b0b3e5580b (diff)
SL-13065 Fixed missing error and infinite cycle caused by too much logging
-rw-r--r--indra/newview/llfloatermodelpreview.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 5895ebe7d7..d1056662ca 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -349,7 +349,6 @@ BOOL LLFloaterModelPreview::postBuild()
childSetVisible("warning_title", false);
childSetVisible("warning_message", false);
- childSetVisible("status", false);
initDecompControls();
@@ -1579,23 +1578,41 @@ void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash
return;
}
- LLPanel* panel = mTabContainer->getPanelByName("logs_panel");
-
// Make sure we have space for new string
S32 editor_text_len = mUploadLogText->getLength();
+ if (editor_max_len < (editor_text_len + add_text_len)
+ && mUploadLogText->getLineCount() <= 0)
+ {
+ mUploadLogText->getTextBoundingRect();// forces a reflow() to fix line count
+ }
while (editor_max_len < (editor_text_len + add_text_len))
{
- editor_text_len -= mUploadLogText->removeFirstLine();
+ S32 shift = mUploadLogText->removeFirstLine();
+ if (shift > 0)
+ {
+ // removed a line
+ editor_text_len -= shift;
+ }
+ else
+ {
+ //nothing to remove?
+ LL_WARNS() << "Failed to clear log lines" << LL_ENDL;
+ break;
+ }
}
mUploadLogText->appendText(str, true);
- if (flash && mTabContainer->getCurrentPanel() != panel)
+ if (flash)
{
- // This will makes colors pale due to "glow_type = LLRender::BT_ALPHA"
- // So instead of using "MenuItemFlashBgColor" added stronger color
- static LLUIColor sFlashBgColor(LLColor4U(255, 99, 0));
- mTabContainer->setTabPanelFlashing(panel, true, sFlashBgColor);
+ LLPanel* panel = mTabContainer->getPanelByName("logs_panel");
+ if (mTabContainer->getCurrentPanel() != panel)
+ {
+ // This will makes colors pale due to "glow_type = LLRender::BT_ALPHA"
+ // So instead of using "MenuItemFlashBgColor" added stronger color
+ static LLUIColor sFlashBgColor(LLColor4U(255, 99, 0));
+ mTabContainer->setTabPanelFlashing(panel, true, sFlashBgColor);
+ }
}
}