21#include <com/sun/star/text/AutoTextContainer.hpp>
24#include <rtl/character.hxx>
25#include <osl/file.hxx>
33 OUStringBuffer sRet(aGroupName.size());
35 for(
size_t i = 0;
i < aGroupName.size();
i++ )
38 if (rtl::isAsciiAlphanumeric(cChar) ||
39 cChar ==
'_' || cChar == 0x20)
45 return sRet.makeStringAndClear();
48SwVbaTemplate::SwVbaTemplate(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext, OUString aFullUrl )
64 ::osl::File::getSystemPathFromFileURL(
aURL.GetLastName(),
sName );
77 sURL = sURL.copy( 0, sURL.getLength() -
aURL.GetLastName().getLength() - 1 );
78 ::osl::File::getSystemPathFromFileURL( sURL, sPath );
87 uno::Reference< text::XAutoTextContainer2 > xAutoTextContainer = text::AutoTextContainer::create( xContext );
90 OUString sGroup(
"Normal");
95 sGroup =
sName.copy( 0,
sName.lastIndexOf(
'.' ) );
99 uno::Reference< container::XIndexAccess > xGroup;
100 if( !xAutoTextContainer->hasByName( sNewGroup ) )
102 throw uno::RuntimeException(
"Auto Text Entry doesn't exist" );
105 xGroup.set( xAutoTextContainer->getByName( sNewGroup ), uno::UNO_QUERY_THROW );
108 if(
index.hasValue() )
116 return "SwVbaTemplate";
119uno::Sequence< OUString >
124 "ooo.vba.word.Template"
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual ~SwVbaTemplate() override
virtual OUString getServiceImplName() override
virtual OUString SAL_CALL getPath() override
virtual OUString SAL_CALL getName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual css::uno::Any SAL_CALL AutoTextEntries(const css::uno::Any &index) override
SwVbaTemplate(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString)
Sequence< OUString > aServiceNames
Reference< XComponentContext > getProcessComponentContext()
static OUString lcl_CheckGroupName(std::u16string_view aGroupName)