20 #include <com/sun/star/awt/FontUnderline.hpp>
21 #include <ooo/vba/excel/XlColorIndex.hpp>
22 #include <ooo/vba/excel/XlUnderlineStyle.hpp>
34 const uno::Reference< XHelperInterface >& xParent,
35 const uno::Reference< uno::XComponentContext >& xContext,
37 const uno::Reference< beans::XPropertySet >& xPropertySet,
39 ScVbaFont_BASE( xParent, xContext, dPalette.getPalette(), xPropertySet, bFormControl ),
40 mpRangeObj( pRangeObj )
60 return ScVbaFont_BASE::getSize();
70 _colorindex >>= nIndex;
74 if ( !nIndex || ( nIndex == excel::XlColorIndex::xlColorIndexAutomatic ) )
77 ScVbaFont_BASE::setColorIndex( uno::makeAny( nIndex ) );
80 ScVbaFont_BASE::setColorIndex( _colorindex );
91 return ScVbaFont_BASE::getColorIndex();
99 throw uno::RuntimeException(
100 "setStandardFontSize not supported" );
107 throw uno::RuntimeException(
"getStandardFontSize not supported" );
115 throw uno::RuntimeException(
"setStandardFont not supported" );
122 throw uno::RuntimeException(
"getStandardFont not supported");
130 bool bItalic =
false;
135 for (sal_Int32 nIdx{ 0 }; nIdx>=0; )
137 const OUString aToken{ aStyles.getToken( 0,
' ', nIdx ) };
138 if (aToken.equalsIgnoreAsciiCase(
"Bold"))
144 else if (aToken.equalsIgnoreAsciiCase(
"Italic"))
152 setBold( uno::makeAny( bBold ) );
153 setItalic( uno::makeAny( bItalic ) );
159 OUStringBuffer aStyles;
163 aStyles.append(
"Bold");
168 if( !aStyles.isEmpty() )
170 aStyles.append(
"Italic");
172 return uno::makeAny( aStyles.makeStringAndClear() );
181 return ScVbaFont_BASE::getBold();
191 sal_Int32
nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
202 case excel::XlUnderlineStyle::xlUnderlineStyleNone:
205 case excel::XlUnderlineStyle::xlUnderlineStyleSingle:
206 case excel::XlUnderlineStyle::xlUnderlineStyleSingleAccounting:
207 nValue = awt::FontUnderline::SINGLE;
209 case excel::XlUnderlineStyle::xlUnderlineStyleDouble:
210 case excel::XlUnderlineStyle::xlUnderlineStyleDoubleAccounting:
211 nValue = awt::FontUnderline::DOUBLE;
214 throw uno::RuntimeException(
"Unknown value for Underline" );
231 return uno::makeAny( nValue );
233 mxFont->getPropertyValue(
"CharUnderline") >>= nValue;
236 case awt::FontUnderline::DOUBLE:
237 nValue = excel::XlUnderlineStyle::xlUnderlineStyleDouble;
239 case awt::FontUnderline::SINGLE:
240 nValue = excel::XlUnderlineStyle::xlUnderlineStyleSingle;
243 nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
246 throw uno::RuntimeException(
"Unknown value retrieved for Underline" );
249 return uno::makeAny( nValue );
258 return ScVbaFont_BASE::getStrikethrough();
267 return ScVbaFont_BASE::getShadow();
277 return ScVbaFont_BASE::getItalic();
286 return ScVbaFont_BASE::getName();
300 mxFont->setPropertyValue(
"CharContoured", aValue );
309 return mbFormControl ?
uno::Any(
false ) :
mxFont->getPropertyValue(
"CharContoured");
318 uno::Sequence< OUString >
virtual void SAL_CALL setOutlineFont(const css::uno::Any &_outlinefont) override
ScCellRangeObj * mpRangeObj
virtual css::uno::Any SAL_CALL getOutlineFont() override
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
uno::Reference< rendering::XCanvasFont > mxFont
Sequence< OUString > aServiceNames
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
cppu::ImplInheritanceHelper< VbaFontBase, ov::excel::XFont > ScVbaFont_BASE
virtual css::uno::Any SAL_CALL getStandardFont() 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 setUnderline(const css::uno::Any &_underline) override
virtual void SAL_CALL setColorIndex(const css::uno::Any &_colorindex) override
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
virtual css::uno::Any SAL_CALL getFontStyle() override
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
virtual css::uno::Any SAL_CALL getStrikethrough() override
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
virtual css::uno::Any SAL_CALL getColorIndex() override
virtual css::uno::Any SAL_CALL getName() override
sal_Int32 OORGBToXLRGB(sal_Int32 nCol)
virtual OUString getServiceImplName() override
virtual css::uno::Any SAL_CALL getShadow() override
virtual css::uno::Any SAL_CALL getSize() override
virtual void SAL_CALL setFontStyle(const css::uno::Any &_fontstyle) override
virtual css::uno::Any SAL_CALL getItalic() override
virtual ~ScVbaFont() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual css::uno::Any SAL_CALL getBold() override
virtual css::uno::Any SAL_CALL getUnderline() override
virtual void SAL_CALL setStandardFontSize(const css::uno::Any &_standardfontsize) override
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
virtual css::uno::Any SAL_CALL getStandardFontSize() override
virtual css::uno::Any SAL_CALL getColor() override
SfxItemSet * GetDataSet()
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
virtual void SAL_CALL setStandardFont(const css::uno::Any &_standardfont) override
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)