Kaydet (Commit) cb555163 authored tarafından Christian Lippka's avatar Christian Lippka

#85721# added support for forbidden characters

üst c98e47b2
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoForbiddenCharsTable.hxx,v $ * $RCSfile: UnoForbiddenCharsTable.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: cl $ $Date: 2001-04-04 15:51:51 $ * last change: $Author: cl $ $Date: 2001-04-05 16:46:44 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -65,16 +65,21 @@ ...@@ -65,16 +65,21 @@
#ifndef _COM_SUN_STAR_I18N_XFORBIDDENCHARACTERS_HPP_ #ifndef _COM_SUN_STAR_I18N_XFORBIDDENCHARACTERS_HPP_
#include <com/sun/star/i18n/XForbiddenCharacters.hpp> #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_LINGUISTIC2_XSUPPORTEDLOCALES_HPP_
#include <com/sun/star/linguistic2/XSupportedLocales.hpp>
#endif
#ifndef _VOS_REF_HXX_ #ifndef _VOS_REF_HXX_
#include <vos/ref.hxx> #include <vos/ref.hxx>
#endif #endif
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx>
class SvxForbiddenCharactersTable; class SvxForbiddenCharactersTable;
class SvxUnoForbiddenCharsTable : public cppu::WeakImplHelper1<com::sun::star::i18n::XForbiddenCharacters> class SvxUnoForbiddenCharsTable : public cppu::WeakImplHelper2<
com::sun::star::i18n::XForbiddenCharacters,
com::sun::star::linguistic2::XSupportedLocales>
{ {
protected: protected:
/** this virtual function is called if the forbidden characters are changed */ /** this virtual function is called if the forbidden characters are changed */
...@@ -86,10 +91,15 @@ public: ...@@ -86,10 +91,15 @@ public:
SvxUnoForbiddenCharsTable(vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars); SvxUnoForbiddenCharsTable(vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars);
~SvxUnoForbiddenCharsTable(); ~SvxUnoForbiddenCharsTable();
// XForbiddenCharacters
virtual com::sun::star::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::container::NoSuchElementException, com::sun::star::uno::RuntimeException); virtual com::sun::star::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::container::NoSuchElementException, com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL hasForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setForbiddenCharacters( const com::sun::star::lang::Locale& rLocale, const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters ) throw(com::sun::star::uno::RuntimeException); virtual void SAL_CALL setForbiddenCharacters( const com::sun::star::lang::Locale& rLocale, const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters ) throw(com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
// XSupportedLocales
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const ::com::sun::star::lang::Locale& aLocale ) throw (::com::sun::star::uno::RuntimeException);
}; };
#endif // _SVX_UNOFORBIDDENCHARSTABLE_HXX_ #endif // _SVX_UNOFORBIDDENCHARSTABLE_HXX_
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoForbiddenCharsTable.cxx,v $ * $RCSfile: UnoForbiddenCharsTable.cxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: cl $ $Date: 2001-04-04 15:53:10 $ * last change: $Author: cl $ $Date: 2001-04-05 16:46:12 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -142,3 +142,30 @@ void SvxUnoForbiddenCharsTable::removeForbiddenCharacters( const Locale& rLocale ...@@ -142,3 +142,30 @@ void SvxUnoForbiddenCharsTable::removeForbiddenCharacters( const Locale& rLocale
onChange(); onChange();
} }
// XSupportedLocales
Sequence< Locale > SAL_CALL SvxUnoForbiddenCharsTable::getLocales()
throw(RuntimeException)
{
const sal_Int32 nCount = mxForbiddenChars.isValid() ? mxForbiddenChars->Count() : 0;
Sequence< Locale > aLocales( nCount );
if( nCount )
{
Locale* pLocales = aLocales.getArray();
for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
{
const ULONG nLanguage = mxForbiddenChars->GetObjectKey( nIndex );
SvxLanguageToLocale ( *pLocales++, static_cast < LanguageType > (nLanguage) );
}
}
return aLocales;
}
sal_Bool SAL_CALL SvxUnoForbiddenCharsTable::hasLocale( const Locale& aLocale )
throw(RuntimeException)
{
return hasForbiddenCharacters( aLocale );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment