summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-10 12:18:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-10 16:57:12 +0200
commit3b21fed4b153e3bbf1d47c3073f31a3735538596 (patch)
treedc9fb83579f454713d8cd44df3d8627bc826e564 /cui
parentfont lists come presorted (diff)
downloadcore-3b21fed4b153e3bbf1d47c3073f31a3735538596.tar.gz
core-3b21fed4b153e3bbf1d47c3073f31a3735538596.zip
optimize adding a block of entries at one time
Change-Id: I9a59154fa445cf3c44ede3ceb1d09f408d906530 Reviewed-on: https://gerrit.libreoffice.org/61618 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx4
-rw-r--r--cui/source/dialogs/cuicharmap.cxx15
-rw-r--r--cui/source/options/optjava.cxx2
-rw-r--r--cui/source/tabpages/chardlg.cxx7
4 files changed, 14 insertions, 14 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index af8fea0455f7..3d48ae269a56 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1971,7 +1971,7 @@ IMPL_LINK_NOARG(SvxMainMenuOrganizerDialog, ModifyHdl, weld::Entry&, void)
const int nNewMenuPos = m_xMenuListBox->find_id(m_sNewMenuEntryId);
const int nOldSelection = m_xMenuListBox->get_selected_index();
m_xMenuListBox->remove(nNewMenuPos);
- m_xMenuListBox->insert(nNewMenuPos, m_sNewMenuEntryId, pNewEntryData->GetName(), nullptr, nullptr);
+ m_xMenuListBox->insert(nNewMenuPos, pNewEntryData->GetName(), &m_sNewMenuEntryId, nullptr, nullptr);
m_xMenuListBox->select(nOldSelection);
}
@@ -2009,7 +2009,7 @@ IMPL_LINK( SvxMainMenuOrganizerDialog, MoveHdl, weld::Button&, rButton, void )
OUString sId = m_xMenuListBox->get_id(nSourceEntry);
OUString sEntry = m_xMenuListBox->get_text(nSourceEntry);
m_xMenuListBox->remove(nSourceEntry);
- m_xMenuListBox->insert(nTargetEntry, sId, sEntry, nullptr, nullptr);
+ m_xMenuListBox->insert(nTargetEntry, sEntry, &sId, nullptr, nullptr);
m_xMenuListBox->select(nTargetEntry);
UpdateButtonStates();
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index c0de50c1e564..4ffc213003ca 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -422,17 +422,18 @@ void SvxCharacterMap::init()
OUString aDefStr( aFont.GetFamilyName() );
OUString aLastName;
int nCount = m_xVirDev->GetDevFontCount();
- m_xFontLB->freeze();
+ std::vector<weld::ComboBoxEntry> aEntries;
+ aEntries.reserve(nCount);
for (int i = 0; i < nCount; ++i)
{
OUString aFontName( m_xVirDev->GetDevFont( i ).GetFamilyName() );
if (aFontName != aLastName)
{
aLastName = aFontName;
- m_xFontLB->append(OUString::number(i), aFontName);
+ aEntries.emplace_back(aFontName, OUString::number(i));
}
}
- m_xFontLB->thaw();
+ m_xFontLB->insert_vector(aEntries, true);
// the font may not be in the list =>
// try to find a font name token in list and select found font,
// else select topmost entry
@@ -596,14 +597,12 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont )
void SvxCharacterMap::fillAllSubsets(weld::ComboBox& rListBox)
{
SubsetMap aAll(nullptr);
- rListBox.clear();
- rListBox.freeze();
+ std::vector<weld::ComboBoxEntry> aEntries;
for (auto & subset : aAll.GetSubsetMap())
- rListBox.append_text(subset.GetName());
- rListBox.thaw();
+ aEntries.emplace_back(subset.GetName());
+ rListBox.insert_vector(aEntries, true);
}
-
void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph)
{
if(sGlyph.isEmpty())
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index f115faedc701..9b3660d35592 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -804,7 +804,7 @@ void SvxJavaParameterDlg::EditParameter()
if ( !editedClassPath.isEmpty() && editableClassPath != editedClassPath )
{
m_xAssignedList->remove(nPos);
- m_xAssignedList->insert_text(editedClassPath, nPos);
+ m_xAssignedList->insert_text(nPos, editedClassPath);
m_xAssignedList->select(nPos);
}
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index c4b7432e1bdc..eb80b4187fdf 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -604,14 +604,15 @@ namespace
void FillFontNames(weld::ComboBox& rBox, const FontList& rList)
{
// insert fonts
- rBox.freeze();
sal_uInt16 nFontCount = rList.GetFontNameCount();
+ std::vector<weld::ComboBoxEntry> aVector;
+ aVector.reserve(nFontCount);
for (sal_uInt16 i = 0; i < nFontCount; ++i)
{
const FontMetric& rFontMetric = rList.GetFontName(i);
- rBox.append_text(rFontMetric.GetFamilyName());
+ aVector.emplace_back(rFontMetric.GetFamilyName());
}
- rBox.thaw();
+ rBox.insert_vector(aVector, false);
}
}