summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llaccordionctrl.cpp10
-rwxr-xr-xindra/llui/llbadge.cpp8
-rwxr-xr-xindra/llui/llbutton.cpp8
-rwxr-xr-xindra/llui/llcheckboxctrl.cpp2
-rwxr-xr-xindra/llui/llcombobox.cpp5
-rwxr-xr-xindra/llui/llcombobox.h6
-rwxr-xr-xindra/llui/llconsole.cpp1
-rwxr-xr-xindra/llui/lldraghandle.cpp1
-rwxr-xr-xindra/llui/llfloater.cpp30
-rwxr-xr-xindra/llui/llfocusmgr.h2
-rwxr-xr-xindra/llui/llfolderview.cpp29
-rwxr-xr-xindra/llui/llfolderview.h8
-rw-r--r--indra/llui/llfolderviewitem.cpp16
-rwxr-xr-x[-rw-r--r--]indra/llui/llfolderviewitem.h7
-rwxr-xr-xindra/llui/lllayoutstack.cpp22
-rwxr-xr-xindra/llui/lllineeditor.cpp24
-rwxr-xr-xindra/llui/lllineeditor.h3
-rwxr-xr-xindra/llui/llmenugl.cpp15
-rwxr-xr-xindra/llui/llmodaldialog.cpp2
-rwxr-xr-xindra/llui/llnotifications.cpp32
-rwxr-xr-xindra/llui/llnotifications.h4
-rwxr-xr-xindra/llui/llnotificationtemplate.h1
-rwxr-xr-xindra/llui/llprogressbar.cpp2
-rwxr-xr-xindra/llui/llrngwriter.cpp9
-rwxr-xr-xindra/llui/llscrollcontainer.cpp3
-rwxr-xr-xindra/llui/llscrolllistctrl.cpp8
-rwxr-xr-xindra/llui/llsliderctrl.cpp2
-rwxr-xr-xindra/llui/llspellcheck.cpp19
-rwxr-xr-xindra/llui/llspinctrl.cpp2
-rwxr-xr-xindra/llui/llstatbar.cpp2
-rwxr-xr-xindra/llui/llstatbar.h1
-rwxr-xr-xindra/llui/llstatgraph.cpp2
-rwxr-xr-xindra/llui/lltabcontainer.cpp5
-rwxr-xr-xindra/llui/lltabcontainer.h5
-rwxr-xr-xindra/llui/lltextbase.cpp50
-rwxr-xr-xindra/llui/lltexteditor.cpp28
-rwxr-xr-xindra/llui/lltextvalidate.cpp2
-rwxr-xr-xindra/llui/lltimectrl.cpp7
-rwxr-xr-xindra/llui/llui.cpp16
-rwxr-xr-xindra/llui/lluictrlfactory.h8
-rwxr-xr-xindra/llui/llurlentry.cpp252
-rwxr-xr-xindra/llui/llurlentry.h55
-rwxr-xr-xindra/llui/llurlmatch.cpp5
-rwxr-xr-xindra/llui/llurlmatch.h8
-rwxr-xr-xindra/llui/llurlregistry.cpp27
-rwxr-xr-xindra/llui/llurlregistry.h2
-rwxr-xr-xindra/llui/llview.cpp4
-rw-r--r--indra/llui/llviewereventrecorder.cpp2
-rwxr-xr-xindra/llui/llxuiparser.cpp2
-rwxr-xr-xindra/llui/tests/llurlentry_test.cpp14
-rwxr-xr-xindra/llui/tests/llurlmatch_test.cpp30
51 files changed, 620 insertions, 188 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index b787794b95..623f570cef 100755
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -36,25 +36,17 @@
#include "boost/bind.hpp"
-static const S32 DRAGGER_BAR_MARGIN = 4;
-static const S32 DRAGGER_BAR_HEIGHT = 5;
static const S32 BORDER_MARGIN = 2;
static const S32 PARENT_BORDER_MARGIN = 5;
-
-static const S32 panel_delta = DRAGGER_BAR_MARGIN; // Distanse between two panels
-
-static const S32 HORIZONTAL_MULTIPLE = 8;
static const S32 VERTICAL_MULTIPLE = 16;
static const F32 MIN_AUTO_SCROLL_RATE = 120.f;
static const F32 MAX_AUTO_SCROLL_RATE = 500.f;
static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
-
// LLAccordionCtrl =================================================================|
static LLDefaultChildRegistry::Register<LLAccordionCtrl> t2("accordion");
-
LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
, mFitParent(params.fit_parent)
, mAutoScrolling( false )
@@ -613,7 +605,7 @@ BOOL LLAccordionCtrl::autoScroll (S32 x, S32 y)
// autoscroll region should take up no more than one third of visible scroller area
S32 auto_scroll_region_height = llmin(rect_local.getHeight() / 3, 10);
- S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+ S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
LLRect bottom_scroll_rect = screen_local_extents;
bottom_scroll_rect.mTop = rect_local.mBottom + auto_scroll_region_height;
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index 30cb18812b..42726de0ad 100755
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -196,10 +196,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons
F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f;
F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f;
- LLRectf screen_rect(llround(x),
- llround(y),
- llround(x) + width,
- llround(y) + height);
+ LLRectf screen_rect(ll_round(x),
+ ll_round(y),
+ ll_round(x) + width,
+ ll_round(y) + height);
LLVector3 vertices[4];
vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f);
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index ce8383857c..8c7df45884 100755
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -606,8 +606,8 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
overlay_height = mImageOverlay->getHeight();
F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f);
- overlay_width = llround((F32)overlay_width * scale_factor);
- overlay_height = llround((F32)overlay_height * scale_factor);
+ overlay_width = ll_round((F32)overlay_width * scale_factor);
+ overlay_height = ll_round((F32)overlay_height * scale_factor);
}
@@ -776,7 +776,7 @@ void LLButton::draw()
if (hasFocus())
{
F32 lerp_amt = gFocusMgr.getFocusFlashAmt();
- drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llround(lerp(1.f, 3.f, lerp_amt)));
+ drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, ll_round(lerp(1.f, 3.f, lerp_amt)));
}
if (use_glow_effect)
@@ -1067,7 +1067,7 @@ void LLButton::resize(LLUIString label)
{
S32 overlay_width = mImageOverlay->getWidth();
F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
- overlay_width = llround((F32)overlay_width * scale_factor);
+ overlay_width = ll_round((F32)overlay_width * scale_factor);
switch(mImageOverlayAlignment)
{
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index 5525520d78..eee6339caf 100755
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -41,8 +41,6 @@
#include "lltextbox.h"
#include "llkeyboard.h"
-const U32 MAX_STRING_LENGTH = 10;
-
static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box");
// Compiler optimization, generate extern template
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 56be52f69a..b32aea5ffa 100755
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -788,6 +788,11 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
// since the dropdown button eats the key
if (key == KEY_RETURN)
{
+ if (mask == MASK_NONE)
+ {
+ mOnReturnSignal(this, getValue());
+ }
+
// don't show list and don't eat key input when committing
// free-form text entry with RETURN since user already knows
// what they are trying to select
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 67393504e7..c9b1212b70 100755
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -199,6 +199,11 @@ public:
void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; }
void setTextChangedCallback( commit_callback_t cb ) { mTextChangedCallback = cb; }
+ /**
+ * Connects callback to signal called when Return key is pressed.
+ */
+ boost::signals2::connection setReturnCallback( const commit_signal_t::slot_type& cb ) { return mOnReturnSignal.connect(cb); }
+
void setButtonVisible(BOOL visible);
void onButtonMouseDown();
@@ -231,6 +236,7 @@ private:
commit_callback_t mTextChangedCallback;
commit_callback_t mSelectionCallback;
boost::signals2::connection mTopLostSignalConnection;
+ commit_signal_t mOnReturnSignal;
S32 mLastSelectedIndex;
};
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fdfaf284de..26ae31cac6 100755
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -52,7 +52,6 @@ extern void AddNewDebugConsoleToLCD(const LLWString &newLine);
LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow.
const F32 FADE_DURATION = 2.f;
-const S32 MIN_CONSOLE_WIDTH = 200;
static LLDefaultChildRegistry::Register<LLConsole> r("console");
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 7c6559eddb..48bf5bb80f 100755
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -46,7 +46,6 @@ const S32 LEADING_PAD = 5;
const S32 TITLE_HPAD = 8;
const S32 BORDER_PAD = 1;
const S32 LEFT_PAD = BORDER_PAD + TITLE_HPAD + LEADING_PAD;
-const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize btn
S32 LLDragHandle::sSnapMargin = 5;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3dbc9a5902..14f75a2352 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1954,7 +1954,7 @@ void LLFloater::drawShadow(LLPanel* panel)
}
gl_drop_shadow(left, top, right, bottom,
shadow_color % getCurrentTransparency(),
- llround(shadow_offset));
+ ll_round(shadow_offset));
}
void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
@@ -2082,16 +2082,16 @@ void LLFloater::updateTitleButtons()
btn_rect.setLeftTopAndSize(
LLPANEL_BORDER_WIDTH,
getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * button_count,
- llround((F32)floater_close_box_size * mButtonScale),
- llround((F32)floater_close_box_size * mButtonScale));
+ ll_round((F32)floater_close_box_size * mButtonScale),
+ ll_round((F32)floater_close_box_size * mButtonScale));
}
else
{
btn_rect.setLeftTopAndSize(
getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * button_count,
getRect().getHeight() - close_box_from_top,
- llround((F32)floater_close_box_size * mButtonScale),
- llround((F32)floater_close_box_size * mButtonScale));
+ ll_round((F32)floater_close_box_size * mButtonScale),
+ ll_round((F32)floater_close_box_size * mButtonScale));
}
// first time here, init 'buttons_rect'
@@ -2142,16 +2142,16 @@ void LLFloater::buildButtons(const Params& floater_params)
btn_rect.setLeftTopAndSize(
LLPANEL_BORDER_WIDTH,
getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * (i + 1),
- llround(floater_close_box_size * mButtonScale),
- llround(floater_close_box_size * mButtonScale));
+ ll_round(floater_close_box_size * mButtonScale),
+ ll_round(floater_close_box_size * mButtonScale));
}
else
{
btn_rect.setLeftTopAndSize(
getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * (i + 1),
getRect().getHeight() - close_box_from_top,
- llround(floater_close_box_size * mButtonScale),
- llround(floater_close_box_size * mButtonScale));
+ ll_round(floater_close_box_size * mButtonScale),
+ ll_round(floater_close_box_size * mButtonScale));
}
LLButton::Params p;
@@ -3466,28 +3466,28 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
LLCoordCommon out;
if (self.mX < -0.5f)
{
- out.mX = llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
+ out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
}
else if (self.mX > 0.5f)
{
- out.mX = llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
+ out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
}
else
{
- out.mX = llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
+ out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
}
if (self.mY < -0.5f)
{
- out.mY = llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
+ out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
}
else if (self.mY > 0.5f)
{
- out.mY = llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
+ out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
}
else
{
- out.mY = llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
+ out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
}
// return center point instead of lower left
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 1c7326260c..afd2a8ce06 100755
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -92,7 +92,7 @@ public:
void setKeystrokesOnly(BOOL keystrokes_only) { mKeystrokesOnly = keystrokes_only; }
F32 getFocusFlashAmt() const;
- S32 getFocusFlashWidth() const { return llround(lerp(1.f, 3.f, getFocusFlashAmt())); }
+ S32 getFocusFlashWidth() const { return ll_round(lerp(1.f, 3.f, getFocusFlashAmt())); }
LLColor4 getFocusColor() const;
void triggerFocusFlash();
BOOL getAppHasFocus() const { return mAppHasFocus; }
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 474b545f00..4c05d001a0 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -53,7 +53,6 @@
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-const S32 RENAME_WIDTH_PAD = 4;
const S32 RENAME_HEIGHT_PAD = 1;
const S32 AUTO_OPEN_STACK_DEPTH = 16;
@@ -171,7 +170,8 @@ LLFolderView::LLFolderView(const Params& p)
mDraggingOverItem(NULL),
mStatusTextBox(NULL),
mShowItemLinkOverlays(p.show_item_link_overlays),
- mViewModel(p.view_model)
+ mViewModel(p.view_model),
+ mGroupedItemModel(p.grouped_item_model)
{
claimMem(mViewModel);
LLPanel* panel = p.parent_panel;
@@ -307,18 +307,18 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height )
LLFolderViewFolder::arrange(&mMinWidth, &target_height);
LLRect scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
- reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) );
+ reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
LLRect new_scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
if (new_scroll_rect.getWidth() != scroll_rect.getWidth())
{
- reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) );
+ reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
}
// move item renamer text field to item's new position
updateRenamerPosition();
- return llround(mTargetHeight);
+ return ll_round(mTargetHeight);
}
static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
@@ -341,7 +341,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
scroll_rect = mScrollContainer->getContentWindowRect();
}
width = llmax(mMinWidth, scroll_rect.getWidth());
- height = llmax(llround(mCurHeight), scroll_rect.getHeight());
+ height = llmax(ll_round(mCurHeight), scroll_rect.getHeight());
// Restrict width within scroll container's width
if (mUseEllipses && mScrollContainer)
@@ -1611,7 +1611,7 @@ void LLFolderView::update()
LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter();
- if (filter_object.isModified() && filter_object.isNotDefault())
+ if (filter_object.isModified() && filter_object.isNotDefault() && mParentPanel.get()->getVisible())
{
mNeedsAutoSelect = TRUE;
}
@@ -1653,8 +1653,10 @@ void LLFolderView::update()
scrollToShowSelection();
}
- BOOL filter_finished = getViewModelItem()->passedFilter()
- && mViewModel->contentsReady();
+ BOOL filter_finished = mViewModel->contentsReady()
+ && (getViewModelItem()->passedFilter()
+ || ( getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration()
+ && !filter_object.isModified()));
if (filter_finished
|| gFocusMgr.childHasKeyboardFocus(mParentPanel.get())
|| gFocusMgr.childHasMouseCapture(mParentPanel.get()))
@@ -1809,7 +1811,6 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
}
// Successively filter out invalid options
-
U32 multi_select_flag = (mSelectedItems.size() > 1 ? ITEM_IN_MULTI_SELECTION : 0x0);
U32 flags = multi_select_flag | FIRST_SELECTED_ITEM;
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
@@ -1821,6 +1822,14 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
flags = multi_select_flag;
}
+ // This adds a check for restrictions based on the entire
+ // selection set - for example, any one wearable may not push you
+ // over the limit, but all wearables together still might.
+ if (getFolderViewGroupedItemModel())
+ {
+ getFolderViewGroupedItemModel()->groupFilterContextMenu(mSelectedItems,*menu);
+ }
+
addNoOptions(menu);
}
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 08e0a6220a..114dd7bd2f 100755
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -45,6 +45,7 @@
#include "llscrollcontainer.h"
class LLFolderViewModelInterface;
+class LLFolderViewGroupedItemModel;
class LLFolderViewFolder;
class LLFolderViewItem;
class LLFolderViewFilter;
@@ -93,6 +94,7 @@ public:
use_ellipses,
show_item_link_overlays;
Mandatory<LLFolderViewModelInterface*> view_model;
+ Optional<LLFolderViewGroupedItemModel*> grouped_item_model;
Mandatory<std::string> options_menu;
@@ -100,7 +102,7 @@ public:
};
friend class LLFolderViewScrollContainer;
- typedef std::deque<LLFolderViewItem*> selected_items_t;
+ typedef folder_view_item_deque selected_items_t;
LLFolderView(const Params&);
virtual ~LLFolderView( void );
@@ -113,6 +115,9 @@ public:
LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; }
const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; }
+ LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() { return mGroupedItemModel; }
+ const LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() const { return mGroupedItemModel; }
+
typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t;
void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); }
void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); }
@@ -300,6 +305,7 @@ protected:
LLHandle<LLPanel> mParentPanel;
LLFolderViewModelInterface* mViewModel;
+ LLFolderViewGroupedItemModel* mGroupedItemModel;
/**
* Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll.
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 6dd6f94d02..747b472ac2 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -861,7 +861,7 @@ void LLFolderViewItem::draw()
if (filter_string_length > 0)
{
- S32 left = llround(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
+ S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2;
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
S32 top = getRect().getHeight() - TOP_PAD;
@@ -1045,7 +1045,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
{
S32 child_width = *width;
S32 child_height = 0;
- S32 child_top = parent_item_height - llround(running_height);
+ S32 child_top = parent_item_height - ll_round(running_height);
target_height += folderp->arrange( &child_width, &child_height );
@@ -1064,7 +1064,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
{
S32 child_width = *width;
S32 child_height = 0;
- S32 child_top = parent_item_height - llround(running_height);
+ S32 child_top = parent_item_height - ll_round(running_height);
target_height += itemp->arrange( &child_width, &child_height );
// don't change width, as this item is as wide as its parent folder by construction
@@ -1101,7 +1101,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
folders_t::iterator fit = iter++;
// number of pixels that bottom of folder label is from top of parent folder
if (getRect().getHeight() - (*fit)->getRect().mTop + (*fit)->getItemHeight()
- > llround(mCurHeight) + mMaxFolderItemOverlap)
+ > ll_round(mCurHeight) + mMaxFolderItemOverlap)
{
// hide if beyond current folder height
(*fit)->setVisible(FALSE);
@@ -1114,7 +1114,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
items_t::iterator iit = iter++;
// number of pixels that bottom of item label is from top of parent folder
if (getRect().getHeight() - (*iit)->getRect().mBottom
- > llround(mCurHeight) + mMaxFolderItemOverlap)
+ > ll_round(mCurHeight) + mMaxFolderItemOverlap)
{
(*iit)->setVisible(FALSE);
}
@@ -1126,12 +1126,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
}
// don't change width as this item is already as wide as its parent folder
- reshape(getRect().getWidth(),llround(mCurHeight));
+ reshape(getRect().getWidth(),ll_round(mCurHeight));
// pass current height value back to parent
- *height = llround(mCurHeight);
+ *height = ll_round(mCurHeight);
- return llround(mTargetHeight);
+ return ll_round(mTargetHeight);
}
BOOL LLFolderViewFolder::needsArrange()
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 0cd20a0f2d..5ad5731cad 100644..100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -454,5 +454,12 @@ public:
template<typename SORT_FUNC> void sortItems(const SORT_FUNC& func) { mItems.sort(func); }
};
+typedef std::deque<LLFolderViewItem*> folder_view_item_deque;
+
+class LLFolderViewGroupedItemModel: public LLRefCount
+{
+public:
+ virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) = 0;
+};
#endif // LLFOLDERVIEWITEM_H
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index c59286fc60..69246a2f57 100755
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -103,7 +103,7 @@ F32 LLLayoutPanel::getVisibleAmount() const
S32 LLLayoutPanel::getLayoutDim() const
{
- return llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+ return ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
}
@@ -130,7 +130,7 @@ void LLLayoutPanel::setTargetDim(S32 value)
S32 LLLayoutPanel::getVisibleDim() const
{
F32 min_dim = getRelevantMinDim();
- return llround(mVisibleAmt
+ return ll_round(mVisibleAmt
* (min_dim
+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
}
@@ -138,7 +138,7 @@ S32 LLLayoutPanel::getVisibleDim() const
void LLLayoutPanel::setOrientation( LLView::EOrientation orientation )
{
mOrientation = orientation;
- S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+ S32 layout_dim = ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
@@ -381,14 +381,14 @@ void LLLayoutStack::updateLayout()
{
panelp->mTargetDim = panelp->getRelevantMinDim();
}
- space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
+ space_to_distribute -= panelp->getVisibleDim() + ll_round((F32)mPanelSpacing * panelp->getVisibleAmount());
total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
}
llassert(total_visible_fraction < 1.05f);
// don't need spacing after last panel
- space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+ space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
S32 remaining_space = space_to_distribute;
F32 fraction_distributed = 0.f;
@@ -399,7 +399,7 @@ void LLLayoutStack::updateLayout()
if (panelp->mAutoResize)
{
F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
- S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
+ S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute);
fraction_distributed += fraction_to_distribute;
panelp->mTargetDim += delta;
remaining_space -= delta;
@@ -431,23 +431,23 @@ void LLLayoutStack::updateLayout()
LLRect panel_rect;
if (mOrientation == HORIZONTAL)
{
- panel_rect.setLeftTopAndSize(llround(cur_pos),
+ panel_rect.setLeftTopAndSize(ll_round(cur_pos),
getRect().getHeight(),
- llround(panel_dim),
+ ll_round(panel_dim),
getRect().getHeight());
}
else
{
panel_rect.setLeftTopAndSize(0,
- llround(cur_pos),
+ ll_round(cur_pos),
getRect().getWidth(),
- llround(panel_dim));
+ ll_round(panel_dim));
}
LLRect resize_bar_rect(panel_rect);
F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
F32 panel_visible_dim = panelp->getVisibleDim();
- S32 panel_spacing_round = (S32)(llround(panel_spacing));
+ S32 panel_spacing_round = (S32)(ll_round(panel_spacing));
if (mOrientation == HORIZONTAL)
{
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 45f4272aa7..a08cf91a69 100755
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -88,6 +88,7 @@ LLLineEditor::Params::Params()
background_image("background_image"),
background_image_disabled("background_image_disabled"),
background_image_focused("background_image_focused"),
+ bg_image_always_focused("bg_image_always_focused", false),
select_on_focus("select_on_focus", false),
revert_on_esc("revert_on_esc", true),
spellcheck("spellcheck", false),
@@ -147,6 +148,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mBgImage( p.background_image ),
mBgImageDisabled( p.background_image_disabled ),
mBgImageFocused( p.background_image_focused ),
+ mShowImageFocused( p.bg_image_always_focused ),
mHaveHistory(FALSE),
mReplaceNewlinesWithSpaces( TRUE ),
mLabel(p.label),
@@ -829,7 +831,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
// Scroll if mouse cursor outside of bounds
if (mScrollTimer.hasExpired())
{
- S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
+ S32 increment = ll_round(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
mScrollTimer.reset();
mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME);
if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) )
@@ -1675,7 +1677,7 @@ void LLLineEditor::drawBackground()
{
image = mBgImageDisabled;
}
- else if ( has_focus )
+ else if ( has_focus || mShowImageFocused)
{
image = mBgImageFocused;
}
@@ -1833,7 +1835,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
select_left - mScrollHPos,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
@@ -1843,8 +1845,8 @@ void LLLineEditor::draw()
color.setAlpha(alpha);
// selected middle
S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text);
- width = llmin(width, mTextRightEdge - llround(rendered_pixels_right));
- gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color);
+ width = llmin(width, mTextRightEdge - ll_round(rendered_pixels_right));
+ gl_rect_2d(ll_round(rendered_pixels_right), cursor_top, ll_round(rendered_pixels_right)+width, cursor_bottom, color);
LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha );
rendered_text += mGLFont->render(
@@ -1855,7 +1857,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
select_right - mScrollHPos - rendered_text,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
@@ -1870,7 +1872,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
}
@@ -1884,7 +1886,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
#if 1 // for when we're ready for image art.
@@ -2044,7 +2046,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right, FALSE);
}
@@ -2069,7 +2071,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right, FALSE);
}
// Draw children (border)
@@ -2573,7 +2575,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length)
S32 LLLineEditor::getPreeditFontSize() const
{
- return llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+ return ll_round(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
}
void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace)
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 40f931ecc1..c6d472f59b 100755
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -90,6 +90,7 @@ public:
spellcheck,
commit_on_focus_lost,
ignore_tab,
+ bg_image_always_focused,
is_password;
// colors
@@ -375,6 +376,8 @@ protected:
BOOL mReadOnly;
+ BOOL mShowImageFocused;
+
LLWString mPreeditWString;
LLWString mPreeditOverwrittenWString;
std::vector<S32> mPreeditPositions;
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 31df853ab4..7cdbcb0621 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -101,17 +101,10 @@ const std::string LLMenuGL::ARROW_DOWN("vvvvvvv");
const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f;
-const S32 PIE_GESTURE_ACTIVATE_DISTANCE = 10;
-
BOOL LLMenuGL::sKeyboardMode = FALSE;
LLHandle<LLView> LLMenuHolderGL::sItemLastSelectedHandle;
LLFrameTimer LLMenuHolderGL::sItemActivationTimer;
-//LLColor4 LLMenuGL::sBackgroundColor( 0.8f, 0.8f, 0.0f, 1.0f );
-
-const S32 PIE_CENTER_SIZE = 20; // pixels, radius of center hole
-const F32 PIE_SCALE_FACTOR = 1.7f; // scale factor for pie menu when mouse is initially down
-const F32 PIE_SHRINK_TIME = 0.2f; // time of transition between unbounded and bounded display of pie menu
const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f;
@@ -1589,7 +1582,7 @@ void LLMenuItemBranchDownGL::draw( void )
std::string::size_type offset = upper_case_label.find(getJumpKey());
if (offset != std::string::npos)
{
- S32 x_offset = llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
+ S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset);
S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1);
gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS);
@@ -3026,8 +3019,8 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask )
LLVector2 mouse_avg_dir((F32)mMouseVelX, (F32)mMouseVelY);
mouse_avg_dir.normVec();
F32 interp = 0.5f * (llclamp(mouse_dir * mouse_avg_dir, 0.f, 1.f));
- mMouseVelX = llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
- mMouseVelY = llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
+ mMouseVelX = ll_round(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
+ mMouseVelY = ll_round(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
mLastMouseX = x;
mLastMouseY = y;
@@ -3696,7 +3689,7 @@ BOOL LLMenuHolderGL::handleKey(KEY key, MASK mask, BOOL called_from_parent)
{
handled = pMenu->handleKey(key, mask, TRUE);
}
- else
+ else if (mask == MASK_NONE || (key >= KEY_LEFT && key <= KEY_DOWN))
{
//highlight first enabled one
if(pMenu->highlightNextItem(NULL))
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 33e66add18..8cf88ad5eb 100755
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -287,7 +287,7 @@ void LLModalDialog::draw()
void LLModalDialog::centerOnScreen()
{
LLVector2 window_size = LLUI::getWindowSize();
- centerWithin(LLRect(0, 0, llround(window_size.mV[VX]), llround(window_size.mV[VY])));
+ centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
}
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index de14391d1f..7e235997d8 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -678,7 +678,7 @@ void LLNotification::respond(const LLSD& response)
// and then call it
functor(asLLSD(), response);
}
- else
+ else if (mCombinedNotifications.empty())
{
// no registered responder
return;
@@ -700,6 +700,14 @@ void LLNotification::respond(const LLSD& response)
}
}
+ for (std::vector<LLNotificationPtr>::const_iterator it = mCombinedNotifications.begin(); it != mCombinedNotifications.end(); ++it)
+ {
+ if ((*it))
+ {
+ (*it)->respond(response);
+ }
+ }
+
update();
}
@@ -1322,6 +1330,28 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload)
}
}
break;
+ case LLNotification::COMBINE_WITH_NEW:
+ // Add to the existing unique notification with the data from this particular instance...
+ // This guarantees that duplicate notifications will be collapsed to the one
+ // most recently triggered
+ for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
+ existing_it != mUniqueNotifications.end();
+ ++existing_it)
+ {
+ LLNotificationPtr existing_notification = existing_it->second;
+ if (pNotif != existing_notification
+ && pNotif->isEquivalentTo(existing_notification))
+ {
+ // copy the notifications from the newest instance into the oldest
+ existing_notification->mCombinedNotifications.push_back(pNotif);
+ existing_notification->mCombinedNotifications.insert(existing_notification->mCombinedNotifications.end(),
+ pNotif->mCombinedNotifications.begin(), pNotif->mCombinedNotifications.end());
+
+ // pop up again
+ existing_notification->update();
+ }
+ }
+ break;
case LLNotification::KEEP_OLD:
break;
case LLNotification::CANCEL_OLD:
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 3cf432f330..0d673d178b 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -414,6 +414,9 @@ private:
using the same mechanism.
*/
bool mTemporaryResponder;
+
+ // keep track of other notifications combined with COMBINE_WITH_NEW
+ std::vector<LLNotificationPtr> mCombinedNotifications;
void init(const std::string& template_name, const LLSD& form_elements);
@@ -560,6 +563,7 @@ public:
typedef enum e_combine_behavior
{
REPLACE_WITH_NEW,
+ COMBINE_WITH_NEW,
KEEP_OLD,
CANCEL_OLD
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index 0315ddbea8..c23fc53763 100755
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -43,6 +43,7 @@ struct LLNotificationTemplate
static void declareValues()
{
declare("replace_with_new", LLNotification::REPLACE_WITH_NEW);
+ declare("combine_with_new", LLNotification::COMBINE_WITH_NEW);
declare("keep_old", LLNotification::KEEP_OLD);
declare("cancel_old", LLNotification::CANCEL_OLD);
}
diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp
index 84a890edfa..209796565c 100755
--- a/indra/llui/llprogressbar.cpp
+++ b/indra/llui/llprogressbar.cpp
@@ -77,7 +77,7 @@ void LLProgressBar::draw()
LLColor4 bar_color = mColorBar.get();
bar_color.mV[VALPHA] *= alpha; // modulate alpha
LLRect progress_rect = getLocalRect();
- progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f));
+ progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f));
mImageFill->draw(progress_rect, bar_color);
}
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index cd9fe3610e..e4a31d6a79 100755
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -28,7 +28,16 @@
#include "llrngwriter.h"
#include "lluicolor.h"
+
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdelete-incomplete"
+#include "lluictrlfactory.h"
+#pragma clang diagnostic pop
+#else
#include "lluictrlfactory.h"
+#endif
+
#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 8c506d76bb..f70eebc594 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -48,7 +48,6 @@
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-static const S32 HORIZONTAL_MULTIPLE = 8;
static const S32 VERTICAL_MULTIPLE = 16;
static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
@@ -315,7 +314,7 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
// clip rect against root view
inner_rect_local.intersectWith(screen_local_extents);
- S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+ S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
// autoscroll region should take up no more than one third of visible scroller area
S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10);
S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10);
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 5f72ee3ac6..db8fdc46b7 100755
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -648,7 +648,7 @@ bool LLScrollListCtrl::updateColumnWidths()
S32 new_width = 0;
if (column->mRelWidth >= 0)
{
- new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth());
+ new_width = (S32)ll_round(column->mRelWidth*mItemListRect.getWidth());
}
else if (column->mDynamicWidth)
{
@@ -1825,6 +1825,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
return TRUE;
}
}
+ return LLUICtrl::handleRightMouseDown(x, y, mask);
}
return FALSE;
}
@@ -2095,9 +2096,6 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask )
// not called from parent means we have keyboard focus or a child does
if (mCanSelect)
{
- // Ignore capslock
- mask = mask;
-
if (mask == MASK_NONE)
{
switch(key)
@@ -2682,7 +2680,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params
}
if (new_column->mRelWidth >= 0)
{
- new_column->setWidth((S32)llround(new_column->mRelWidth*mItemListRect.getWidth()));
+ new_column->setWidth((S32)ll_round(new_column->mRelWidth*mItemListRect.getWidth()));
}
else if(new_column->mDynamicWidth)
{
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 2da39fa54b..0056cb6dc4 100755
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -43,8 +43,6 @@
#include "llresmgr.h"
#include "lluictrlfactory.h"
-const U32 MAX_STRING_LENGTH = 10;
-
static LLDefaultChildRegistry::Register<LLSliderCtrl> r("slider");
LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp
index 250372da5b..0db4281059 100755
--- a/indra/llui/llspellcheck.cpp
+++ b/indra/llui/llspellcheck.cpp
@@ -144,12 +144,14 @@ void LLSpellChecker::refreshDictionaryMap()
const std::string user_path = getDictionaryUserPath();
// Load dictionary information (file name, friendly name, ...)
- llifstream user_file(user_path + DICT_FILE_MAIN, std::ios::binary);
+ std::string user_filename(user_path + DICT_FILE_MAIN);
+ llifstream user_file(user_filename.c_str(), std::ios::binary);
if ( (!user_file.is_open())
|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file))
|| (0 == sDictMap.size()) )
{
- llifstream app_file(app_path + DICT_FILE_MAIN, std::ios::binary);
+ std::string app_filename(app_path + DICT_FILE_MAIN);
+ llifstream app_file(app_filename.c_str(), std::ios::binary);
if ( (!app_file.is_open())
|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file))
|| (0 == sDictMap.size()) )
@@ -159,7 +161,7 @@ void LLSpellChecker::refreshDictionaryMap()
}
// Load user installed dictionary information
- llifstream custom_file(user_path + DICT_FILE_USER, std::ios::binary);
+ llifstream custom_file(user_filename.c_str(), std::ios::binary);
if (custom_file.is_open())
{
LLSD custom_dict_map;
@@ -215,7 +217,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
if (gDirUtilp->fileExists(dict_path))
{
- llifstream file_in(dict_path, std::ios::in);
+ llifstream file_in(dict_path.c_str(), std::ios::in);
if (file_in.is_open())
{
std::string word; int line_num = 0;
@@ -238,7 +240,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
word_list.push_back(word);
- llofstream file_out(dict_path, std::ios::out | std::ios::trunc);
+ llofstream file_out(dict_path.c_str(), std::ios::out | std::ios::trunc);
if (file_out.is_open())
{
file_out << word_list.size() << std::endl;
@@ -352,7 +354,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language)
if (gDirUtilp->fileExists(user_path + DICT_FILE_IGNORE))
{
- llifstream file_in(user_path + DICT_FILE_IGNORE, std::ios::in);
+ llifstream file_in((user_path + DICT_FILE_IGNORE).c_str(), std::ios::in);
if (file_in.is_open())
{
std::string word; int idxLine = 0;
@@ -463,7 +465,8 @@ void LLSpellChecker::removeDictionary(const std::string& dict_language)
LLSD LLSpellChecker::loadUserDictionaryMap()
{
LLSD dict_map;
- llifstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::binary);
+ std::string dict_filename(getDictionaryUserPath() + DICT_FILE_USER);
+ llifstream dict_file(dict_filename.c_str(), std::ios::binary);
if (dict_file.is_open())
{
LLSDSerialize::fromXMLDocument(dict_map, dict_file);
@@ -475,7 +478,7 @@ LLSD LLSpellChecker::loadUserDictionaryMap()
// static
void LLSpellChecker::saveUserDictionaryMap(const LLSD& dict_map)
{
- llofstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::trunc);
+ llofstream dict_file((getDictionaryUserPath() + DICT_FILE_USER).c_str(), std::ios::trunc);
if (dict_file.is_open())
{
LLSDSerialize::toPrettyXML(dict_map, dict_file);
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index ebdbdf59c0..8b1ba406c8 100755
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -153,7 +153,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision)
for (S32 i = 0; i < decimal_precision; i++)
clamped_value *= 10.0;
- clamped_value = llround((F32)clamped_value);
+ clamped_value = ll_round((F32)clamped_value);
for (S32 i = 0; i < decimal_precision; i++)
clamped_value /= 10.0;
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 303417c337..35f5330a3f 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -711,7 +711,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
if (tick_begin > last_label + MIN_LABEL_SPACING)
{
gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f));
- S32 label_pos = tick_begin - llround((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth()));
+ S32 label_pos = tick_begin - ll_round((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth()));
LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH,
LLColor4(1.f, 1.f, 1.f, 0.5f),
LLFontGL::LEFT, LLFontGL::TOP);
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 89d7ff24ed..1ff4c67fc5 100755
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -80,7 +80,6 @@ private:
mFloatingTargetMaxBar,
mCurMaxBar,
mCurMinBar,
- mLabelSpacing,
mTickSpacing;
S32 mDecimalDigits,
mNumHistoryFrames,
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index 98962aff9a..3fe314e77a 100755
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -111,7 +111,7 @@ void LLStatGraph::draw()
color = it->mColor;
gGL.color4fv(color.mV);
- gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
+ gl_rect_2d(1, ll_round(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
}
void LLStatGraph::setMin(const F32 min)
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 6f858cdeb3..4b08798892 100755
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -2094,3 +2094,8 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y)
}
}
}
+
+S32 LLTabContainer::getTotalTabWidth() const
+{
+ return mTotalTabWidth;
+}
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 57862fc626..057809dc42 100755
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -182,7 +182,8 @@ public:
LLPanel* getPanelByIndex(S32 index);
S32 getIndexForPanel(LLPanel* panel);
S32 getPanelIndexByTitle(const std::string& title);
- LLPanel* getPanelByName(const std::string& name);
+ LLPanel* getPanelByName(const std::string& name);
+ S32 getTotalTabWidth() const;
void setCurrentTabName(const std::string& name);
void selectFirstTab();
@@ -287,7 +288,7 @@ private:
S32 mMaxTabWidth;
S32 mTotalTabWidth;
- S32 mTabHeight;
+ S32 mTabHeight;
// Padding under the text labels of tab buttons
S32 mLabelPadBottom;
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index a3b7595e09..20ec243ec5 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -38,7 +38,6 @@
#include "lltextutil.h"
#include "lltooltip.h"
#include "lluictrl.h"
-#include "lluriparser.h"
#include "llurlaction.h"
#include "llurlregistry.h"
#include "llview.h"
@@ -1558,7 +1557,7 @@ void LLTextBase::reflow()
line_count));
line_start_index = segment->getStart() + seg_offset;
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
remaining_pixels = text_available_width;
line_height = 0;
}
@@ -1570,7 +1569,7 @@ void LLTextBase::reflow()
last_segment_char_on_line,
line_rect,
line_count));
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
break;
}
// ...or finished a segment and there are segments remaining on this line
@@ -1585,7 +1584,7 @@ void LLTextBase::reflow()
line_rect,
line_count));
line_start_index = segment->getStart() + seg_offset;
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
line_height = 0;
remaining_pixels = text_available_width;
}
@@ -2064,8 +2063,16 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted());
// output the styled Url
- //appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly());
+
+ // show query part of url with gray color only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries
+ std::string label = match.getQuery();
+ if (label.size())
+ {
+ link_params.color = LLColor4::grey;
+ link_params.readonly_color = LLColor4::grey;
+ appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
+ }
// set the tooltip for the Url label
if (! match.getTooltip().empty())
@@ -2856,13 +2863,44 @@ void LLTextBase::updateRects()
needsReflow();
}
+ // update mTextBoundingRect after mVisibleTextRect took scrolls into account
+ if (!mLineInfoList.empty() && mScroller)
+ {
+ S32 delta_pos = 0;
+
+ switch(mVAlign)
+ {
+ case LLFontGL::TOP:
+ delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
+ break;
+ case LLFontGL::VCENTER:
+ delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
+ break;
+ case LLFontGL::BOTTOM:
+ delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
+ break;
+ case LLFontGL::BASELINE:
+ // do nothing
+ break;
+ }
+ // move line segments to fit new visible rect
+ if (delta_pos != 0)
+ {
+ for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it)
+ {
+ it->mRect.translate(0, delta_pos);
+ }
+ mTextBoundingRect.translate(0, delta_pos);
+ }
+ }
+
// update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed)
doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom);
doc_rect.mLeft = 0;
doc_rect.mRight = mScroller
? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
: mVisibleTextRect.getWidth();
- doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
+ doc_rect.mTop = llmax(mVisibleTextRect.getHeight(), mTextBoundingRect.getHeight()) + doc_rect.mBottom;
if (!mScroller)
{
// push doc rect to top of text widget
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 227b1f91a9..d170d17f94 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -814,7 +814,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL handled = FALSE;
// if I'm not currently selecting text
- if (!(hasSelection() && hasMouseCapture()))
+ if (!(mIsSelecting && hasMouseCapture()))
{
// let text segments handle mouse event
handled = LLTextBase::handleMouseUp(x, y, mask);
@@ -2456,12 +2456,30 @@ void LLTextEditor::updateLinkSegments()
LLTextSegment *segment = *it;
if (segment && segment->getStyle() && segment->getStyle()->isLink())
{
- // if the link's label (what the user can edit) is a valid Url,
- // then update the link's HREF to be the same as the label text.
- // This lets users edit Urls in-place.
LLStyleConstSP style = segment->getStyle();
LLStyleSP new_style(new LLStyle(*style));
LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart());
+
+ segment_set_t::const_iterator next_it = mSegments.upper_bound(segment);
+ LLTextSegment *next_segment = *next_it;
+ if (next_segment)
+ {
+ LLWString next_url_label = wtext.substr(next_segment->getStart(), next_segment->getEnd()-next_segment->getStart());
+ std::string link_check = wstring_to_utf8str(url_label) + wstring_to_utf8str(next_url_label);
+ LLUrlMatch match;
+
+ if ( LLUrlRegistry::instance().findUrl(link_check, match))
+ {
+ if(match.getQuery() == wstring_to_utf8str(next_url_label))
+ {
+ continue;
+ }
+ }
+ }
+
+ // if the link's label (what the user can edit) is a valid Url,
+ // then update the link's HREF to be the same as the label text.
+ // This lets users edit Urls in-place.
if (LLUrlRegistry::instance().hasUrl(url_label))
{
std::string new_url = wstring_to_utf8str(url_label);
@@ -2848,7 +2866,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
S32 LLTextEditor::getPreeditFontSize() const
{
- return llround((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+ return ll_round((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
}
BOOL LLTextEditor::isDirty() const
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp
index 234e600ccd..324ceb7fba 100755
--- a/indra/llui/lltextvalidate.cpp
+++ b/indra/llui/lltextvalidate.cpp
@@ -336,7 +336,7 @@ namespace LLTextValidate
S32 len = str.length();
while(len--)
{
- if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f)
+ if ((str[len] < 0x20 && str[len] != 0xA) || str[len] > 0x7f)
{
rv = FALSE;
break;
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index 9ea1e8815e..516057f8fd 100755
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -153,7 +153,7 @@ U32 LLTimeCtrl::getMinutes() const
void LLTimeCtrl::setTime24(F32 time)
{
time = llclamp(time, 0.0f, 23.99f); // fix out of range values
- mTime = llround(time * MINUTES_PER_HOUR); // fixes values like 4.99999
+ mTime = ll_round(time * MINUTES_PER_HOUR); // fixes values like 4.99999
updateText();
}
@@ -381,7 +381,7 @@ bool LLTimeCtrl::isHoursStringValid(const std::string& str)
bool LLTimeCtrl::isMinutesStringValid(const std::string& str)
{
U32 minutes;
- if (!LLStringUtil::convertToU32(str, minutes) || (minutes <= MINUTES_MAX) && str.length() < 3)
+ if (!LLStringUtil::convertToU32(str, minutes) || ((minutes <= MINUTES_MAX) && str.length() < 3))
return true;
return false;
@@ -415,7 +415,8 @@ U32 LLTimeCtrl::parseHours(const std::string& str)
U32 LLTimeCtrl::parseMinutes(const std::string& str)
{
U32 minutes;
- if (LLStringUtil::convertToU32(str, minutes) && (minutes >= MINUTES_MIN) && (minutes <= MINUTES_MAX))
+ // not sure of this fix - clang doesnt like compare minutes U32 to >= MINUTES_MIN (0) but MINUTES_MIN can change
+ if (LLStringUtil::convertToU32(str, minutes) && ((S32)minutes >= MINUTES_MIN) && ((S32)minutes <= MINUTES_MAX))
{
return minutes;
}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 1f570edd88..aabc7ed2e4 100755
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -236,8 +236,8 @@ void LLUI::dirtyRect(LLRect rect)
void LLUI::setMousePositionScreen(S32 x, S32 y)
{
S32 screen_x, screen_y;
- screen_x = llround((F32)x * getScaleFactor().mV[VX]);
- screen_y = llround((F32)y * getScaleFactor().mV[VY]);
+ screen_x = ll_round((F32)x * getScaleFactor().mV[VX]);
+ screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
}
@@ -248,8 +248,8 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
LLCoordWindow cursor_pos_window;
getWindow()->getCursorPosition(&cursor_pos_window);
LLCoordGL cursor_pos_gl(cursor_pos_window.convert());
- *x = llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
- *y = llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
+ *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
+ *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
}
//static
@@ -369,15 +369,15 @@ LLVector2 LLUI::getWindowSize()
//static
void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y)
{
- *gl_x = llround((F32)screen_x * getScaleFactor().mV[VX]);
- *gl_y = llround((F32)screen_y * getScaleFactor().mV[VY]);
+ *gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]);
+ *gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]);
}
//static
void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y)
{
- *screen_x = llround((F32)gl_x / getScaleFactor().mV[VX]);
- *screen_y = llround((F32)gl_y / getScaleFactor().mV[VY]);
+ *screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]);
+ *screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]);
}
//static
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index a5796c8af2..3ce39c947f 100755
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -183,7 +183,15 @@ public:
if (!widget)
{
LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL;
+
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdelete-incomplete"
+ delete view;
+#pragma clang diagnostic pop
+#else
delete view;
+#endif
view = NULL;
}
}
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index c06d6144b9..6db0d88998 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -38,8 +38,7 @@
#include "lltrans.h"
#include "lluicolortable.h"
#include "message.h"
-
-#include "uriparser/Uri.h"
+#include "llexperiencecache.h"
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
@@ -48,7 +47,8 @@ std::string localize_slapp_label(const std::string& url, const std::string& full
LLUrlEntryBase::LLUrlEntryBase()
-{}
+{
+}
LLUrlEntryBase::~LLUrlEntryBase()
{
@@ -187,6 +187,30 @@ bool LLUrlEntryBase::isWikiLinkCorrect(std::string url)
return (LLUrlRegistry::instance().hasUrl(label)) ? false : true;
}
+std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
+{
+ LLUriParser up(unescapeUrl(url));
+ up.normalize();
+
+ std::string label;
+ up.extractParts();
+ up.glueFirst(label);
+
+ return label;
+}
+
+std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
+{
+ LLUriParser up(unescapeUrl(url));
+
+ std::string query;
+ up.extractParts();
+ up.glueSecond(query);
+
+ return query;
+}
+
+
static std::string getStringAfterToken(const std::string str, const std::string token)
{
size_t pos = str.find(token);
@@ -203,6 +227,7 @@ static std::string getStringAfterToken(const std::string str, const std::string
// LLUrlEntryHTTP Describes generic http: and https: Urls
//
LLUrlEntryHTTP::LLUrlEntryHTTP()
+ : LLUrlEntryBase()
{
mPattern = boost::regex("https?://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*",
boost::regex::perl|boost::regex::icase);
@@ -212,6 +237,25 @@ LLUrlEntryHTTP::LLUrlEntryHTTP()
std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
+ return urlToLabelWithGreyQuery(url);
+}
+
+std::string LLUrlEntryHTTP::getQuery(const std::string &url) const
+{
+ return urlToGreyQuery(url);
+}
+
+std::string LLUrlEntryHTTP::getUrl(const std::string &string) const
+{
+ if (string.find("://") == std::string::npos)
+ {
+ return "http://" + escapeUrl(string);
+ }
+ return escapeUrl(string);
+}
+
+std::string LLUrlEntryHTTP::getTooltip(const std::string &url) const
+{
return unescapeUrl(url);
}
@@ -247,6 +291,7 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const
// LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com
//
LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
+ : LLUrlEntryBase()
{
mPattern = boost::regex("("
"\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR
@@ -260,7 +305,12 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
std::string LLUrlEntryHTTPNoProtocol::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
- return unescapeUrl(url);
+ return urlToLabelWithGreyQuery(url);
+}
+
+std::string LLUrlEntryHTTPNoProtocol::getQuery(const std::string &url) const
+{
+ return urlToGreyQuery(url);
}
std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
@@ -272,6 +322,95 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
return escapeUrl(string);
}
+std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const
+{
+ return unescapeUrl(url);
+}
+
+LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL()
+ : LLUrlEntryBase()
+{
+ mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
+ boost::regex::perl|boost::regex::icase);
+ mMenuName = "menu_url_http.xml";
+ mTooltip = LLTrans::getString("TooltipHttpUrl");
+}
+
+std::string LLUrlEntryInvalidSLURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
+{
+
+ return escapeUrl(url);
+}
+
+std::string LLUrlEntryInvalidSLURL::getUrl(const std::string &string) const
+{
+ return escapeUrl(string);
+}
+
+std::string LLUrlEntryInvalidSLURL::getTooltip(const std::string &url) const
+{
+ return unescapeUrl(url);
+}
+
+bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const
+{
+ S32 actual_parts;
+
+ if(url.find(".com/secondlife/") != std::string::npos)
+ {
+ actual_parts = 5;
+ }
+ else if(url.find("/app/") != std::string::npos)
+ {
+ actual_parts = 6;
+ }
+ else
+ {
+ actual_parts = 3;
+ }
+
+ LLURI uri(url);
+ LLSD path_array = uri.pathArray();
+ S32 path_parts = path_array.size();
+ S32 x,y,z;
+
+ if (path_parts == actual_parts)
+ {
+ // handle slurl with (X,Y,Z) coordinates
+ LLStringUtil::convertToS32(path_array[path_parts-3],x);
+ LLStringUtil::convertToS32(path_array[path_parts-2],y);
+ LLStringUtil::convertToS32(path_array[path_parts-1],z);
+
+ if((x>= 0 && x<= 256) && (y>= 0 && y<= 256) && (z>= 0))
+ {
+ return TRUE;
+ }
+ }
+ else if (path_parts == (actual_parts-1))
+ {
+ // handle slurl with (X,Y) coordinates
+
+ LLStringUtil::convertToS32(path_array[path_parts-2],x);
+ LLStringUtil::convertToS32(path_array[path_parts-1],y);
+ ;
+ if((x>= 0 && x<= 256) && (y>= 0 && y<= 256))
+ {
+ return TRUE;
+ }
+ }
+ else if (path_parts == (actual_parts-2))
+ {
+ // handle slurl with (X) coordinate
+ LLStringUtil::convertToS32(path_array[path_parts-1],x);
+ if(x>= 0 && x<= 256)
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
//
// LLUrlEntrySLURL Describes generic http: and https: Urls
//
@@ -293,6 +432,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa
// - http://slurl.com/secondlife/Place/X
// - http://slurl.com/secondlife/Place
//
+
LLURI uri(url);
LLSD path_array = uri.pathArray();
S32 path_parts = path_array.size();
@@ -345,30 +485,56 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
}
//
-// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
+// LLUrlEntrySeconlifeURL Describes *secondlife.com/ and *lindenlab.com/ urls to substitute icon 'hand.png' before link
//
-LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL()
-{
- mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?(/\\S*)?\\b",
+LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
+{
+ mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
mMenuName = "menu_url_http.xml";
+ mTooltip = LLTrans::getString("TooltipHttpUrl");
}
-std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
+/// Return the url from a string that matched the regex
+std::string LLUrlEntrySecondlifeURL::getUrl(const std::string &string) const
{
- LLUriParser up(url);
- up.extractParts();
- return up.host();
+ if (string.find("://") == std::string::npos)
+ {
+ return "https://" + escapeUrl(string);
+ }
+ return escapeUrl(string);
}
-std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const
+std::string LLUrlEntrySecondlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
+{
+ return urlToLabelWithGreyQuery(url);
+}
+
+std::string LLUrlEntrySecondlifeURL::getQuery(const std::string &url) const
+{
+ return urlToGreyQuery(url);
+}
+
+std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const
{
return url;
}
//
+// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
+//
+LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
+ {
+ mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(?!\\S)",
+ boost::regex::perl|boost::regex::icase);
+
+ mIcon = "Hand";
+ mMenuName = "menu_url_http.xml";
+}
+
+//
// LLUrlEntryAgent Describes a Second Life agent Url, e.g.,
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
@@ -868,9 +1034,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
// If parcel name is empty use Sim_name (x, y, z) for parcel label.
else if (!parcel_data.sim_name.empty())
{
- S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
- S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
- S32 region_z = llround(parcel_data.global_z);
+ S32 region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
+ S32 region_z = ll_round(parcel_data.global_z);
label = llformat("%s (%d, %d, %d)",
parcel_data.sim_name.c_str(), region_x, region_y, region_z);
@@ -1234,3 +1400,57 @@ std::string LLUrlEntryIcon::getIcon(const std::string &url)
LLStringUtil::trim(mIcon);
return mIcon;
}
+
+LLUrlEntryExperienceProfile::LLUrlEntryExperienceProfile()
+{
+ mPattern = boost::regex(APP_HEADER_REGEX "/experience/[\\da-f-]+/\\w+\\S*",
+ boost::regex::perl|boost::regex::icase);
+ mIcon = "Generic_Experience";
+ mMenuName = "menu_url_experience.xml";
+}
+
+std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const LLUrlLabelCallback &cb )
+{
+ if (!gCacheName)
+ {
+ // probably at the login screen, use short string for layout
+ return LLTrans::getString("LoadingData");
+ }
+
+ std::string experience_id_string = getIDStringFromUrl(url);
+ if (experience_id_string.empty())
+ {
+ // something went wrong, just give raw url
+ return unescapeUrl(url);
+ }
+
+ LLUUID experience_id(experience_id_string);
+ if (experience_id.isNull())
+ {
+ return LLTrans::getString("ExperienceNameNull");
+ }
+
+ const LLSD& experience_details = LLExperienceCache::get(experience_id);
+ if(!experience_details.isUndefined())
+ {
+ std::string experience_name_string = experience_details[LLExperienceCache::NAME].asString();
+ return experience_name_string.empty() ? LLTrans::getString("ExperienceNameUntitled") : experience_name_string;
+ }
+
+ addObserver(experience_id_string, url, cb);
+ LLExperienceCache::get(experience_id, boost::bind(&LLUrlEntryExperienceProfile::onExperienceDetails, this, _1));
+ return LLTrans::getString("LoadingData");
+
+}
+
+void LLUrlEntryExperienceProfile::onExperienceDetails( const LLSD& experience_details )
+{
+ std::string name = experience_details[LLExperienceCache::NAME].asString();
+ if(name.empty())
+ {
+ name = LLTrans::getString("ExperienceNameUntitled");
+ }
+ callObservers(experience_details[LLExperienceCache::EXPERIENCE_ID].asString(), name, LLStringUtil::null);
+}
+
+
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 1cb11cdb1c..dd1f257a3d 100755
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -78,6 +78,9 @@ public:
/// Given a matched Url, return a label for the Url
virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; }
+ /// Return port, query and fragment parts for the Url
+ virtual std::string getQuery(const std::string &url) const { return ""; }
+
/// Return an icon that can be displayed next to Urls of this type
virtual std::string getIcon(const std::string &url);
@@ -104,6 +107,8 @@ public:
bool isWikiLinkCorrect(std::string url);
+ virtual bool isSLURLvalid(const std::string &url) const { return TRUE; };
+
protected:
std::string getIDStringFromUrl(const std::string &url) const;
std::string escapeUrl(const std::string &url) const;
@@ -111,6 +116,8 @@ protected:
std::string getLabelFromWikiLink(const std::string &url) const;
std::string getUrlFromWikiLink(const std::string &string) const;
void addObserver(const std::string &id, const std::string &url, const LLUrlLabelCallback &cb);
+ std::string urlToLabelWithGreyQuery(const std::string &url) const;
+ std::string urlToGreyQuery(const std::string &url) const;
virtual void callObservers(const std::string &id, const std::string &label, const std::string& icon);
typedef struct {
@@ -133,6 +140,9 @@ class LLUrlEntryHTTP : public LLUrlEntryBase
public:
LLUrlEntryHTTP();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
+ /*virtual*/ std::string getQuery(const std::string &url) const;
+ /*virtual*/ std::string getUrl(const std::string &string) const;
+ /*virtual*/ std::string getTooltip(const std::string &url) const;
};
///
@@ -155,7 +165,20 @@ class LLUrlEntryHTTPNoProtocol : public LLUrlEntryBase
public:
LLUrlEntryHTTPNoProtocol();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
+ /*virtual*/ std::string getQuery(const std::string &url) const;
+ /*virtual*/ std::string getUrl(const std::string &string) const;
+ /*virtual*/ std::string getTooltip(const std::string &url) const;
+};
+
+class LLUrlEntryInvalidSLURL : public LLUrlEntryBase
+{
+public:
+ LLUrlEntryInvalidSLURL();
+ /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getUrl(const std::string &string) const;
+ /*virtual*/ std::string getTooltip(const std::string &url) const;
+
+ bool isSLURLvalid(const std::string &url) const;
};
///
@@ -172,16 +195,24 @@ public:
///
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
///
-class LLUrlEntrySeconlifeURL : public LLUrlEntryBase
+class LLUrlEntrySecondlifeURL : public LLUrlEntryBase
{
public:
- LLUrlEntrySeconlifeURL();
- bool isTrusted() const { return true; }
+ LLUrlEntrySecondlifeURL();
+ /*virtual*/ bool isTrusted() const { return true; }
+ /*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
+ /*virtual*/ std::string getQuery(const std::string &url) const;
/*virtual*/ std::string getTooltip(const std::string &url) const;
+};
-private:
- std::string mLabel;
+///
+/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
+///
+class LLUrlEntrySimpleSecondlifeURL : public LLUrlEntrySecondlifeURL
+{
+public:
+ LLUrlEntrySimpleSecondlifeURL();
};
///
@@ -278,6 +309,20 @@ private:
};
///
+/// LLUrlEntryExperienceProfile Describes a Second Life experience profile Url, e.g.,
+/// secondlife:///app/experience/0e346d8b-4433-4d66-a6b0-fd37083abc4c/profile
+/// that displays the experience name
+class LLUrlEntryExperienceProfile : public LLUrlEntryBase
+{
+public:
+ LLUrlEntryExperienceProfile();
+ /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
+private:
+ void onExperienceDetails(const LLSD& experience_details);
+};
+
+
+///
/// LLUrlEntryGroup Describes a Second Life group Url, e.g.,
/// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about
///
diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp
index 016d1ca92d..2f2ac969e1 100755
--- a/indra/llui/llurlmatch.cpp
+++ b/indra/llui/llurlmatch.cpp
@@ -42,8 +42,8 @@ LLUrlMatch::LLUrlMatch() :
{
}
-void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
- const std::string &label, const std::string &tooltip,
+void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label,
+ const std::string& query, const std::string &tooltip,
const std::string &icon, const LLStyle::Params& style,
const std::string &menu, const std::string &location,
const LLUUID& id, bool underline_on_hover_only, bool trusted)
@@ -52,6 +52,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
mEnd = end;
mUrl = url;
mLabel = label;
+ mQuery = query;
mTooltip = tooltip;
mIcon = icon;
mStyle = style;
diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h
index 9f8960b32f..ff699902ca 100755
--- a/indra/llui/llurlmatch.h
+++ b/indra/llui/llurlmatch.h
@@ -62,6 +62,9 @@ public:
/// return a label that can be used for the display of this Url
std::string getLabel() const { return mLabel; }
+ /// return a right part of url which should be drawn in grey
+ std::string getQuery() const { return mQuery; }
+
/// return a message that could be displayed in a tooltip or status bar
std::string getTooltip() const { return mTooltip; }
@@ -85,10 +88,10 @@ public:
/// Change the contents of this match object (used by LLUrlRegistry)
void setValues(U32 start, U32 end, const std::string &url, const std::string &label,
- const std::string &tooltip, const std::string &icon,
+ const std::string& query, const std::string &tooltip, const std::string &icon,
const LLStyle::Params& style, const std::string &menu,
const std::string &location, const LLUUID& id,
- bool underline_on_hover_only = false, bool trusted = false );
+ bool underline_on_hover_only = false, bool trusted = false);
const LLUUID& getID() const { return mID; }
private:
@@ -96,6 +99,7 @@ private:
U32 mEnd;
std::string mUrl;
std::string mLabel;
+ std::string mQuery;
std::string mTooltip;
std::string mIcon;
std::string mMenuName;
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 9e8d8d01f1..2085505947 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -44,10 +44,13 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryNoLink());
mUrlEntryIcon = new LLUrlEntryIcon();
registerUrl(mUrlEntryIcon);
+ mLLUrlEntryInvalidSLURL = new LLUrlEntryInvalidSLURL();
+ registerUrl(mLLUrlEntryInvalidSLURL);
registerUrl(new LLUrlEntrySLURL());
// decorated links for host names like: secondlife.com and lindenlab.com
- registerUrl(new LLUrlEntrySeconlifeURL());
+ registerUrl(new LLUrlEntrySecondlifeURL());
+ registerUrl(new LLUrlEntrySimpleSecondlifeURL());
registerUrl(new LLUrlEntryHTTP());
mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel();
@@ -67,6 +70,7 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryPlace());
registerUrl(new LLUrlEntryInventory());
registerUrl(new LLUrlEntryObjectIM());
+ registerUrl(new LLUrlEntryExperienceProfile());
//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,
//so it should be registered in the end of list
registerUrl(new LLUrlEntrySL());
@@ -188,6 +192,14 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
if (start < match_start || match_entry == NULL)
{
+ if (mLLUrlEntryInvalidSLURL == *it)
+ {
+ if(url_entry && url_entry->isSLURLvalid(text.substr(start, end - start + 1)))
+ {
+ continue;
+ }
+ }
+
if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it))
{
if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1)))
@@ -209,13 +221,17 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// fill in the LLUrlMatch object and return it
std::string url = text.substr(match_start, match_end - match_start + 1);
- LLUriParser up(url);
- up.normalize();
- url = up.normalizedUri();
+ if (match_entry == mUrlEntryTrusted)
+ {
+ LLUriParser up(url);
+ up.normalize();
+ url = up.normalizedUri();
+ }
match.setValues(match_start, match_end,
match_entry->getUrl(url),
match_entry->getLabel(url, cb),
+ match_entry->getQuery(url),
match_entry->getTooltip(url),
match_entry->getIcon(url),
match_entry->getStyle(),
@@ -243,7 +259,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
// character encoding, so we need to update the start
// and end values to be correct for the wide string.
LLWString wurl = utf8str_to_wstring(match.getUrl());
- S32 start = text.find(wurl);
+ size_t start = text.find(wurl);
if (start == std::string::npos)
{
return false;
@@ -252,6 +268,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
match.setValues(start, end, match.getUrl(),
match.getLabel(),
+ match.getQuery(),
match.getTooltip(),
match.getIcon(),
match.getStyle(),
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 1cb403dfc9..5ce4048d5d 100755
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -93,7 +93,9 @@ private:
friend class LLSingleton<LLUrlRegistry>;
std::vector<LLUrlEntryBase *> mUrlEntry;
+ LLUrlEntryBase* mUrlEntryTrusted;
LLUrlEntryBase* mUrlEntryIcon;
+ LLUrlEntryBase* mLLUrlEntryInvalidSLURL;
LLUrlEntryBase* mUrlEntryHTTPLabel;
LLUrlEntryBase* mUrlEntrySLLabel;
};
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 9e6bebc93b..a8beb9cfc9 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2164,10 +2164,6 @@ LLControlVariable *LLView::findControl(const std::string& name)
return control_group.getControl(name);
}
-const S32 FLOATER_H_MARGIN = 15;
-const S32 MIN_WIDGET_HEIGHT = 10;
-const S32 VPAD = 4;
-
void LLView::initFromParams(const LLView::Params& params)
{
LLRect required_rect = getRequiredRect();
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index c5a4354f32..9fe6a542b4 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -50,7 +50,7 @@ bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() {
void LLViewerEventRecorder::setEventLoggingOn() {
if (! mLog.is_open()) {
- mLog.open(mLogFilename, llofstream::out);
+ mLog.open(mLogFilename.c_str(), std::ios_base::out);
}
logEvents=true;
LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL;
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 37d88cb9f9..99a0869ce3 100755
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -58,7 +58,9 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs;
const char* NO_VALUE_MARKER = "no_value";
+#ifdef LL_WINDOWS
const S32 LINE_NUMBER_HERE = 0;
+#endif
struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues>
{
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index c3f0e92cb0..15f2354552 100755
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -32,9 +32,23 @@
#include "lltut.h"
#include "../lluicolortable.h"
#include "../llrender/lluiimage.h"
+#include "../llmessage/llexperiencecache.h"
#include <boost/regex.hpp>
+
+namespace LLExperienceCache
+{
+ const LLSD& get( const LLUUID& key)
+ {
+ static LLSD boo;
+ return boo;
+ }
+
+ void get( const LLUUID& key, callback_slot_t slot ){}
+
+}
+
typedef std::map<std::string, LLControlGroup*> settings_map_t;
settings_map_t LLUI::sSettingGroups;
diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp
index 55c1efefef..843886eb69 100755
--- a/indra/llui/tests/llurlmatch_test.cpp
+++ b/indra/llui/tests/llurlmatch_test.cpp
@@ -151,7 +151,7 @@ namespace tut
LLUrlMatch match;
ensure("empty()", match.empty());
- match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(0, 1, "http://secondlife.com", "", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("! empty()", ! match.empty());
}
@@ -164,7 +164,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getStart() == 0", match.getStart(), 0);
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getStart() == 10", match.getStart(), 10);
}
@@ -177,7 +177,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getEnd() == 0", match.getEnd(), 0);
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getEnd() == 20", match.getEnd(), 20);
}
@@ -190,10 +190,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getUrl() == ''", match.getUrl(), "");
- match.setValues(10, 20, "http://slurl.com/", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "http://slurl.com/", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getUrl() == '' (2)", match.getUrl(), "");
}
@@ -206,10 +206,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getLabel() == ''", match.getLabel(), "");
- match.setValues(10, 20, "", "Label", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "Label", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getLabel() == '' (2)", match.getLabel(), "");
}
@@ -222,10 +222,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getTooltip() == ''", match.getTooltip(), "");
- match.setValues(10, 20, "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getTooltip() == '' (2)", match.getTooltip(), "");
}
@@ -238,10 +238,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getIcon() == ''", match.getIcon(), "");
- match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getIcon() == '' (2)", match.getIcon(), "");
}
@@ -254,10 +254,10 @@ namespace tut
LLUrlMatch match;
ensure("getMenuName() empty", match.getMenuName().empty());
- match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null);
ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("getMenuName() empty (2)", match.getMenuName().empty());
}
@@ -270,10 +270,10 @@ namespace tut
LLUrlMatch match;
ensure("getLocation() empty", match.getLocation().empty());
- match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null);
ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris");
- match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
+ match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("getLocation() empty (2)", match.getLocation().empty());
}
}