20#include <com/sun/star/awt/FontUnderline.hpp>
21#include <ooo/vba/excel/XlColorIndex.hpp>
22#include <ooo/vba/excel/XlUnderlineStyle.hpp>
35 const uno::Reference< XHelperInterface >& xParent,
36 const uno::Reference< uno::XComponentContext >& xContext,
38 const uno::Reference< beans::XPropertySet >& xPropertySet,
41 mpRangeObj( pRangeObj )
61 return ScVbaFont_BASE::getSize();
75 if ( !
nIndex || (
nIndex == excel::XlColorIndex::xlColorIndexAutomatic ) )
81 ScVbaFont_BASE::setColorIndex( _colorindex );
92 return ScVbaFont_BASE::getColorIndex();
100 throw uno::RuntimeException(
101 "setStandardFontSize not supported" );
108 throw uno::RuntimeException(
"getStandardFontSize not supported" );
116 throw uno::RuntimeException(
"setStandardFont not supported" );
123 throw uno::RuntimeException(
"getStandardFont not supported");
131 bool bItalic =
false;
136 for (sal_Int32 nIdx{ 0 }; nIdx>=0; )
138 const std::u16string_view aToken{
o3tl::getToken(aStyles, 0,
' ', nIdx ) };
160 OUStringBuffer aStyles;
164 aStyles.append(
"Bold");
169 if( !aStyles.isEmpty() )
171 aStyles.append(
"Italic");
173 return uno::Any( aStyles.makeStringAndClear() );
182 return ScVbaFont_BASE::getBold();
192 sal_Int32
nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
203 case excel::XlUnderlineStyle::xlUnderlineStyleNone:
206 case excel::XlUnderlineStyle::xlUnderlineStyleSingle:
207 case excel::XlUnderlineStyle::xlUnderlineStyleSingleAccounting:
208 nValue = awt::FontUnderline::SINGLE;
210 case excel::XlUnderlineStyle::xlUnderlineStyleDouble:
211 case excel::XlUnderlineStyle::xlUnderlineStyleDoubleAccounting:
212 nValue = awt::FontUnderline::DOUBLE;
215 throw uno::RuntimeException(
"Unknown value for Underline" );
237 case awt::FontUnderline::DOUBLE:
238 nValue = excel::XlUnderlineStyle::xlUnderlineStyleDouble;
240 case awt::FontUnderline::SINGLE:
241 nValue = excel::XlUnderlineStyle::xlUnderlineStyleSingle;
244 nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
247 throw uno::RuntimeException(
"Unknown value retrieved for Underline" );
259 return ScVbaFont_BASE::getStrikethrough();
268 return ScVbaFont_BASE::getShadow();
278 return ScVbaFont_BASE::getItalic();
287 return ScVbaFont_BASE::getName();
301 mxFont->setPropertyValue(
"CharContoured", aValue );
310 return mbFormControl ?
uno::Any(
false ) :
mxFont->getPropertyValue(
"CharContoured");
319uno::Sequence< OUString >
virtual css::uno::Any SAL_CALL getColorIndex() override
virtual void SAL_CALL setUnderline(const css::uno::Any &_underline) override
virtual css::uno::Any SAL_CALL getStrikethrough() override
virtual css::uno::Any SAL_CALL getFontStyle() override
virtual css::uno::Any SAL_CALL getShadow() override
virtual OUString getServiceImplName() override
SfxItemSet * GetDataSet()
virtual css::uno::Any SAL_CALL getStandardFont() override
virtual css::uno::Any SAL_CALL getUnderline() override
virtual css::uno::Any SAL_CALL getOutlineFont() override
virtual css::uno::Any SAL_CALL getColor() override
virtual css::uno::Any SAL_CALL getStandardFontSize() override
virtual void SAL_CALL setStandardFontSize(const css::uno::Any &_standardfontsize) override
virtual void SAL_CALL setFontStyle(const css::uno::Any &_fontstyle) override
virtual ~ScVbaFont() override
virtual void SAL_CALL setColorIndex(const css::uno::Any &_colorindex) override
ScCellRangeObj * mpRangeObj
virtual css::uno::Any SAL_CALL getBold() override
virtual css::uno::Any SAL_CALL getItalic() override
virtual css::uno::Any SAL_CALL getSize() override
virtual void SAL_CALL setOutlineFont(const css::uno::Any &_outlinefont) override
virtual css::uno::Any SAL_CALL getName() override
ScVbaFont(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const ScVbaPalette &dPalette, const css::uno::Reference< css::beans::XPropertySet > &xPropertySet, ScCellRangeObj *pRangeObj=nullptr, bool bFormControl=false)
virtual void SAL_CALL setStandardFont(const css::uno::Any &_standardfont) override
virtual css::uno::Sequence< OUString > getServiceNames() override
Sequence< OUString > aServiceNames
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
sal_Int32 OORGBToXLRGB(sal_Int32 nCol)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
uno::Reference< rendering::XCanvasFont > mxFont
::std::pair< MetaAction *, int > Component
cppu::ImplInheritanceHelper< VbaFontBase, ov::excel::XFont > ScVbaFont_BASE