21 #include <ooo/vba/word/WdStyleType.hpp>
22 #include <com/sun/star/lang/Locale.hpp>
23 #include <com/sun/star/text/XTextDocument.hpp>
33 SwVbaStyle::SwVbaStyle(
const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext > & xContext,
const uno::Reference< frame::XModel>& xModel,
const uno::Reference< beans::XPropertySet >& _xPropertySet ) :
SwVbaStyle_BASE( xParent, xContext ) ,
mxModel( xModel ), mxStyleProps( _xPropertySet )
35 mxStyle.set( _xPropertySet, uno::UNO_QUERY_THROW );
53 xTCProps->getPropertyValue(
"CharLocale") >>= aLocale;
60 xTCProps->setPropertyValue(
"CharLocale",
uno::Any( aLocale ) ) ;
75 sal_Int32
nType = word::WdStyleType::wdStyleTypeParagraph;
76 uno::Reference< lang::XServiceInfo > xServiceInfo(
mxStyle, uno::UNO_QUERY_THROW );
77 if( xServiceInfo->supportsService(
"com.sun.star.style.ParagraphStyle") )
78 nType = word::WdStyleType::wdStyleTypeParagraph;
79 else if( xServiceInfo->supportsService(
"com.sun.star.style.CharacterStyle") )
80 nType = word::WdStyleType::wdStyleTypeCharacter;
82 nType = word::WdStyleType::wdStyleTypeList;
86 uno::Reference< word::XFont > SAL_CALL
96 uno::Reference< word::XStyle > xStyle;
97 if( rStyle >>= xStyle )
99 sStyle = xStyle->getName();
106 if( !sStyle.isEmpty() )
108 xParaProps->setPropertyValue(
"ParaStyleName",
uno::Any( sStyle ) );
112 throw uno::RuntimeException();
118 mxStyleProps->getPropertyValue(
"DisplayName") >>= sNameLocal;
129 if( word::WdStyleType::wdStyleTypeParagraph !=
getType() )
131 throw uno::RuntimeException();
134 uno::Reference< text::XTextDocument > xTextDocument(
mxModel, uno::UNO_QUERY_THROW );
140 bool isAutoUpdate =
false;
141 mxStyleProps->getPropertyValue(
"IsAutoUpdate") >>= isAutoUpdate;
154 mxStyleProps->getPropertyValue(
"ParentStyle") >>= sBaseStyle;
155 if( sBaseStyle.isEmpty() )
157 throw uno::RuntimeException();
166 uno::Reference< word::XStyle > xStyle;
167 _basestyle >>= xStyle;
170 throw uno::RuntimeException();
173 OUString sBaseStyle = xStyle->getName();
180 OUString sFollowStyle;
181 mxStyleProps->getPropertyValue(
"FollowStyle") >>= sFollowStyle;
182 if( sFollowStyle.isEmpty() )
184 throw uno::RuntimeException();
193 uno::Reference< word::XStyle > xStyle;
194 _nextparagraphstyle >>= xStyle;
197 throw uno::RuntimeException();
200 OUString sFollowStyle = xStyle->getName();
206 sal_Int16 nNumberingLevel = 0;
207 mxStyleProps->getPropertyValue(
"NumberingLevel") >>= nNumberingLevel;
208 return nNumberingLevel;
217 uno::Sequence< OUString >
222 "ooo.vba.word.XStyle"
virtual css::uno::Any SAL_CALL getBaseStyle() override
virtual sal_Bool SAL_CALL getAutomaticallyUpdate() override
SwVbaStyle(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::beans::XPropertySet > &_xPropertySet)
virtual ::sal_Int32 SAL_CALL getType() override
virtual css::uno::Reference< ::ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
virtual OUString getServiceImplName() override
css::uno::Reference< css::frame::XModel2 > mxModel
Sequence< OUString > aServiceNames
virtual void SAL_CALL setNameLocal(const OUString &_namelocal) override
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
virtual void SAL_CALL setBaseStyle(const css::uno::Any &_basestyle) override
virtual void SAL_CALL setNextParagraphStyle(const css::uno::Any &_nextparagraphstyle) override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual ::sal_Int32 SAL_CALL getListLevelNumber() override
virtual ::sal_Int32 SAL_CALL getLanguageID() override
virtual void SAL_CALL setAutomaticallyUpdate(sal_Bool _automaticallyupdate) override
const css::uno::Reference< css::container::XIndexAccess > & getPalette() const
css::uno::Reference< css::style::XStyle > mxStyle
virtual css::uno::Any SAL_CALL getNextParagraphStyle() override
css::uno::WeakReference< ov::XHelperInterface > mxParent
static void setStyle(const css::uno::Reference< css::beans::XPropertySet > &xParaProps, const css::uno::Any &xStyle)
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override
css::uno::Reference< css::beans::XPropertySet > mxStyleProps
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual void SAL_CALL setName(const OUString &Name) override
static void setLanguageID(const css::uno::Reference< css::beans::XPropertySet > &xTCProps, LanguageType _languageid)
css::uno::Reference< css::frame::XModel > mxModel
virtual OUString SAL_CALL getNameLocal() override
virtual OUString SAL_CALL getName() override