Kaydet (Commit) 3833b8e8 authored tarafından Caolán McNamara's avatar Caolán McNamara

drop now unused SvxFontListBox

Change-Id: I1ad6c5b98d7bd75c42e14177c417af6ad4ebbeda
Reviewed-on: https://gerrit.libreoffice.org/61016
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3c11aa74
......@@ -51,44 +51,6 @@ public:
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
};
/** A list box supporting formatted string entries. */
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontListBox : public SvTabListBox
{
private:
// The following members are used to store additional parameters for InitEntry().
vcl::Font maEntryFont; /// Current entry font used in InitEntry().
const Color* mpEntryColor; /// Current entry color used in InitEntry().
bool mbUseFont; /// true = Use maEntryFont/mpEntryColor in InitEntry().
public:
SvxFontListBox(vcl::Window* pParent, WinBits nStyle);
/** Inserts a list entry and sets the font used for this entry.
@param pColor The font color. NULL = use default listbox text color. */
void InsertFontEntry(
const OUString& rString, const vcl::Font& rFont, const Color* pColor = nullptr );
/** Selects an entry specified by its position in the list box. */
void SelectEntryPos( sal_uLong nPos );
/** Removes a selection. */
void SetNoSelection();
/** Returns the position of the entry currently selected or TREELIST_APPEND.
*/
sal_uLong GetSelectedEntryPos() const;
protected:
/** Initializes a new SvLBoxFontString entry.
@descr Uses current value of maEntryFont to set the entry font (if mbUseFont is true). */
virtual void InitEntry(
SvTreeListEntry* pEntry,
const OUString& rEntryText,
const Image& rCollImg,
const Image& rExpImg,
SvLBoxButtonKind eButtonKind) override;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -76,66 +76,4 @@ void SvLBoxFontString::InitViewData( SvTreeListBox* pView, SvTreeListEntry* pEnt
pView->Control::SetFont( aOldFont );
}
SvxFontListBox::SvxFontListBox(vcl::Window* pParent, WinBits nStyle)
: SvTabListBox(pParent, nStyle)
, mpEntryColor(nullptr)
, mbUseFont(false)
{
vcl::Font aStdFont(GetFont()); // Used for entries without specific font.
aStdFont.SetTransparent(true);
maEntryFont = aStdFont;
}
void SvxFontListBox::InsertFontEntry( const OUString& rString, const vcl::Font& rFont, const Color* pColor )
{
mbUseFont = true; // InitEntry() will use maEntryFont
maEntryFont = rFont; // font to use in InitEntry() over InsertEntry()
mpEntryColor = pColor; // color to use in InitEntry() over InsertEntry()
InsertEntry( rString );
mbUseFont = false;
}
void SvxFontListBox::SelectEntryPos( sal_uLong nPos )
{
SvTreeListEntry* pEntry = GetEntry( nPos );
if( pEntry )
{
Select( pEntry );
ShowEntry( pEntry );
}
}
void SvxFontListBox::SetNoSelection()
{
SelectAll( false );
}
sal_uLong SvxFontListBox::GetSelectedEntryPos() const
{
SvTreeListEntry* pSvLBoxEntry = FirstSelected();
return pSvLBoxEntry ? GetModel()->GetAbsPos( pSvLBoxEntry ) : TREELIST_ENTRY_NOTFOUND;
}
void SvxFontListBox::InitEntry(
SvTreeListEntry* pEntry, const OUString& rEntryText,
const Image& rCollImg, const Image& rExpImg,
SvLBoxButtonKind eButtonKind)
{
if( mbUseFont )
{
if( nTreeFlags & SvTreeFlags::CHKBTN )
pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(
eButtonKind, pCheckButtonData));
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(
rCollImg, rExpImg, true));
pEntry->AddItem(o3tl::make_unique<SvLBoxFontString>(
rEntryText, maEntryFont, mpEntryColor));
}
else
SvTreeListBox::InitEntry( pEntry, rEntryText, rCollImg, rExpImg,
eButtonKind );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment