Resolves: tdf#141441 get and set selected entry when "unfrozen"
Change-Id: I4229460fb27ae3dc133c0f6a53c7792a87bf4db3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133389 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -844,9 +844,10 @@ FontStyleBox::FontStyleBox(std::unique_ptr<weld::ComboBox> p)
|
|||||||
|
|
||||||
void FontStyleBox::Fill( std::u16string_view rName, const FontList* pList )
|
void FontStyleBox::Fill( std::u16string_view rName, const FontList* pList )
|
||||||
{
|
{
|
||||||
m_xComboBox->freeze();
|
|
||||||
OUString aOldText = m_xComboBox->get_active_text();
|
OUString aOldText = m_xComboBox->get_active_text();
|
||||||
int nPos = m_xComboBox->get_active();
|
int nPos = m_xComboBox->get_active();
|
||||||
|
|
||||||
|
m_xComboBox->freeze();
|
||||||
m_xComboBox->clear();
|
m_xComboBox->clear();
|
||||||
|
|
||||||
// does a font with this name already exist?
|
// does a font with this name already exist?
|
||||||
@@ -949,6 +950,18 @@ void FontStyleBox::Fill( std::u16string_view rName, const FontList* pList )
|
|||||||
if ( bNormal || bItalic || bBold )
|
if ( bNormal || bItalic || bBold )
|
||||||
m_xComboBox->append_text(pList->GetBoldItalicStr());
|
m_xComboBox->append_text(pList->GetBoldItalicStr());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// insert standard styles if no font
|
||||||
|
m_xComboBox->append_text(pList->GetNormalStr());
|
||||||
|
m_xComboBox->append_text(pList->GetItalicStr());
|
||||||
|
m_xComboBox->append_text(pList->GetBoldStr());
|
||||||
|
m_xComboBox->append_text(pList->GetBoldItalicStr());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_xComboBox->thaw();
|
||||||
|
|
||||||
if (!aOldText.isEmpty())
|
if (!aOldText.isEmpty())
|
||||||
{
|
{
|
||||||
int nFound = m_xComboBox->find_text(aOldText);
|
int nFound = m_xComboBox->find_text(aOldText);
|
||||||
@@ -963,23 +976,6 @@ void FontStyleBox::Fill( std::u16string_view rName, const FontList* pList )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// insert standard styles if no font
|
|
||||||
m_xComboBox->append_text(pList->GetNormalStr());
|
|
||||||
m_xComboBox->append_text(pList->GetItalicStr());
|
|
||||||
m_xComboBox->append_text(pList->GetBoldStr());
|
|
||||||
m_xComboBox->append_text(pList->GetBoldItalicStr());
|
|
||||||
if (!aOldText.isEmpty())
|
|
||||||
{
|
|
||||||
if (nPos >= m_xComboBox->get_count())
|
|
||||||
m_xComboBox->set_active(0);
|
|
||||||
else
|
|
||||||
m_xComboBox->set_active(nPos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_xComboBox->thaw();
|
|
||||||
}
|
|
||||||
|
|
||||||
FontSizeBox::FontSizeBox(std::unique_ptr<weld::ComboBox> p)
|
FontSizeBox::FontSizeBox(std::unique_ptr<weld::ComboBox> p)
|
||||||
: pFontList(nullptr)
|
: pFontList(nullptr)
|
||||||
|
Reference in New Issue
Block a user