29#include <com/sun/star/awt/FontSlant.hpp>
30#include <com/sun/star/lang/IllegalArgumentException.hpp>
31#include <inspectorvalues.hrc>
41 if (pParent ==
nullptr)
42 throw lang::IllegalArgumentException(
"no parent Window given to InspectorTextPanel::Create",
44 return std::make_unique<InspectorTextPanel>(pParent);
48 :
PanelLayout(pParent,
"InspectorTextPanel",
"svx/ui/inspectortextpanel.ui")
49 , mpListBoxStyles(m_xBuilder->weld_tree_view(
"listbox_fonts"))
53 std::vector<int> aWidths{ o3tl::narrowing<int>(fWidth * 29) };
61 if (
bool bValue; rAny >>= bValue)
63 rString =
SvxResId(bValue ? RID_TRUE : RID_FALSE);
65 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
69 else if (awt::FontSlant eValue; rAny >>= eValue)
71 rString =
SvxResId(eValue == awt::FontSlant_ITALIC ? RID_ITALIC : RID_NORMAL);
73 else if (
tools::Long nValueLong; rAny >>= nValueLong)
75 if (rPropName.find(
u"Color") != std::u16string_view::npos)
76 rString =
"0x" + OUString::number(nValueLong, 16);
78 rString = OUString::number(nValueLong);
80 else if (
double fValue; rAny >>= fValue)
82 if (rPropName.find(
u"Weight") != std::u16string_view::npos)
83 rString =
SvxResId(fValue > 100 ? RID_BOLD : RID_NORMAL);
85 rString = OUString::number((
round(fValue * 100)) / 100.00);
87 else if (
short nValueShort; rAny >>= nValueShort)
89 rString = OUString::number(nValueShort);
100 std::unique_ptr<weld::TreeIter> pResult = rListBoxStyles.
make_iterator();
101 const OUString& rName = rCurrent.
sNodeName;
108 rListBoxStyles.
insert(pParent, -1, &rName,
nullptr,
nullptr,
nullptr,
false, pResult.get());
114 rListBoxStyles.
set_text(*pResult, sPairValue, 1);
121 rListBoxStyles.
set_text(*pResult,
"", 1);
125 FillBox_Impl(rListBoxStyles, rChildNode, pResult.get());
132 for (
const TreeNode& rChildNode : rStore)
147 std::unique_ptr<weld::TreeIter> pEntry =
mpListBoxStyles->make_iterator();
151 for (sal_Int32
i = 0;
i < nParIdx; ++
i)
const int MinimumPanelWidth
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const=0
virtual void expand_row(const TreeIter &rIter)=0
virtual void set_text(int row, const OUString &rText, int col=-1)=0
virtual void set_text_emphasis(int row, bool bOn, int col)=0
virtual void insert(const TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, TreeIter *pRet)=0
virtual void all_foreach(const std::function< bool(TreeIter &)> &func)=0
virtual void set_sensitive(int row, bool bSensitive, int col=-1)=0
OUString SvxResId(TranslateId aId)