office-gobmx/linguistic/source/lngopt.hxx
Stephan Bergmann e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00

216 lines
10 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_LINGUISTIC_SOURCE_LNGOPT_HXX
#define INCLUDED_LINGUISTIC_SOURCE_LNGOPT_HXX
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/linguistic2/XLinguProperties.hpp>
#include <unotools/lingucfg.hxx>
#include <svl/itemprop.hxx>
#include <unotools/configitem.hxx>
#include <unotools/linguprops.hxx>
#include <com/sun/star/uno/Any.h>
#include "linguistic/misc.hxx"
#include "defs.hxx"
namespace com { namespace sun { namespace star {
namespace beans {
struct PropertyChangeEvent;
}
}}}
// LinguOptions
// This class represents all Linguistik relevant options.
class LinguOptions
{
static SvtLinguOptions *pData;
static oslInterlockedCount nRefCount; // number of objects of this class
public:
LinguOptions();
LinguOptions(const LinguOptions &rOpt);
~LinguOptions();
static OUString GetName( sal_Int32 nWID );
const css::uno::Sequence< OUString >&
GetActiveDics() const { return pData->aActiveDics; }
};
typedef cppu::OMultiTypeInterfaceContainerHelperVar<sal_Int32>
OPropertyListenerContainerHelper;
class LinguProps :
public cppu::WeakImplHelper
<
css::linguistic2::XLinguProperties,
css::beans::XFastPropertySet,
css::beans::XPropertyAccess,
css::lang::XComponent,
css::lang::XServiceInfo
>
{
::comphelper::OInterfaceContainerHelper2 aEvtListeners;
OPropertyListenerContainerHelper aPropListeners;
SfxItemPropertyMap aPropertyMap;
SvtLinguConfig aConfig;
bool bDisposing;
LinguProps(const LinguProps &) = delete;
LinguProps & operator = (const LinguProps &) = delete;
void launchEvent( const css::beans::PropertyChangeEvent &rEvt ) const;
/// @throws css::uno::RuntimeException
bool getPropertyBool(const OUString& aPropertyName);
/// @throws css::uno::RuntimeException
sal_Int16 getPropertyInt16(const OUString& aPropertyName);
/// @throws css::uno::RuntimeException
css::lang::Locale getPropertyLocale(const OUString& aPropertyName);
/// @throws css::uno::RuntimeException
void setProperty(const OUString& aPropertyName, bool p1)
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
/// @throws css::uno::RuntimeException
void setProperty(const OUString& aPropertyName, sal_Int16 p1)
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
/// @throws css::uno::RuntimeException
void setProperty(const OUString& aPropertyName, css::lang::Locale p1)
{ setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
public:
LinguProps();
virtual sal_Bool SAL_CALL getIsUseDictionaryList() override
{ return getPropertyBool(UPN_IS_USE_DICTIONARY_LIST); }
virtual void SAL_CALL setIsUseDictionaryList(sal_Bool p1) override
{ setProperty(UPN_IS_USE_DICTIONARY_LIST, (bool) p1); }
virtual sal_Bool SAL_CALL getIsIgnoreControlCharacters() override
{ return getPropertyBool(UPN_IS_IGNORE_CONTROL_CHARACTERS); }
virtual void SAL_CALL setIsIgnoreControlCharacters(sal_Bool p1) override
{ setProperty(UPN_IS_IGNORE_CONTROL_CHARACTERS, (bool) p1); }
virtual sal_Bool SAL_CALL getIsSpellUpperCase() override
{ return getPropertyBool(UPN_IS_SPELL_UPPER_CASE); }
virtual void SAL_CALL setIsSpellUpperCase(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_UPPER_CASE, (bool) p1); }
virtual sal_Bool SAL_CALL getIsSpellWithDigits() override
{ return getPropertyBool(UPN_IS_SPELL_WITH_DIGITS); }
virtual void SAL_CALL setIsSpellWithDigits(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, (bool) p1); }
virtual sal_Bool SAL_CALL getIsSpellCapitalization() override
{ return getPropertyBool(UPN_IS_SPELL_CAPITALIZATION); }
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, (bool) p1); }
virtual sal_Int16 SAL_CALL getHyphMinLeading() override
{ return getPropertyInt16(UPN_HYPH_MIN_LEADING); }
virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) override
{ setProperty(UPN_HYPH_MIN_LEADING, p1); }
virtual sal_Int16 SAL_CALL getHyphMinTrailing() override
{ return getPropertyInt16(UPN_HYPH_MIN_TRAILING); }
virtual void SAL_CALL setHyphMinTrailing(sal_Int16 p1) override
{ setProperty(UPN_HYPH_MIN_TRAILING, p1); }
virtual sal_Int16 SAL_CALL getHyphMinWordLength() override
{ return getPropertyInt16(UPN_HYPH_MIN_WORD_LENGTH); }
virtual void SAL_CALL setHyphMinWordLength(sal_Int16 p1) override
{ setProperty(UPN_HYPH_MIN_WORD_LENGTH, p1); }
virtual css::lang::Locale SAL_CALL getDefaultLocale() override
{ return getPropertyLocale(UPN_DEFAULT_LOCALE); }
virtual void SAL_CALL setDefaultLocale(const css::lang::Locale& p1) override
{ setProperty(UPN_DEFAULT_LOCALE, p1); }
virtual sal_Bool SAL_CALL getIsHyphAuto() override
{ return getPropertyBool(UPN_IS_HYPH_AUTO); }
virtual void SAL_CALL setIsHyphAuto(sal_Bool p1) override
{ setProperty(UPN_IS_HYPH_AUTO, (bool) p1); }
virtual sal_Bool SAL_CALL getIsHyphSpecial() override
{ return getPropertyBool(UPN_IS_HYPH_SPECIAL); }
virtual void SAL_CALL setIsHyphSpecial(sal_Bool p1) override
{ setProperty(UPN_IS_HYPH_SPECIAL, (bool) p1); }
virtual sal_Bool SAL_CALL getIsSpellAuto() override
{ return getPropertyBool(UPN_IS_SPELL_AUTO); }
virtual void SAL_CALL setIsSpellAuto(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_AUTO, (bool) p1); }
virtual sal_Bool SAL_CALL getIsSpellSpecial() override
{ return getPropertyBool(UPN_IS_SPELL_SPECIAL); }
virtual void SAL_CALL setIsSpellSpecial(sal_Bool p1) override
{ setProperty(UPN_IS_SPELL_SPECIAL, (bool) p1); }
virtual sal_Bool SAL_CALL getIsWrapReverse() override
{ return getPropertyBool(UPN_IS_WRAP_REVERSE); }
virtual void SAL_CALL setIsWrapReverse(sal_Bool p1) override
{ setProperty(UPN_IS_WRAP_REVERSE, (bool) p1); }
virtual css::lang::Locale SAL_CALL getDefaultLocale_CJK() override
{ return getPropertyLocale(UPN_DEFAULT_LOCALE_CJK); }
virtual void SAL_CALL setDefaultLocale_CJK(const css::lang::Locale& p1) override
{ setProperty(UPN_DEFAULT_LOCALE_CJK, p1); }
virtual css::lang::Locale SAL_CALL getDefaultLocale_CTL() override
{ return getPropertyLocale(UPN_DEFAULT_LOCALE_CTL); }
virtual void SAL_CALL setDefaultLocale_CTL(const css::lang::Locale& p1) override
{ setProperty(UPN_DEFAULT_LOCALE_CTL, p1); }
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rxListener ) override;
virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rxListener ) override;
virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rxListener ) override;
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rxListener ) override;
// XFastPropertySet
virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& aValue ) override;
virtual css::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) override;
// XPropertyAccess
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override;
virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< css::beans::PropertyValue >& aProps ) override;
// XComponent
virtual void SAL_CALL dispose() override;
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& rxListener ) override;
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& rxListener ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
static inline OUString getImplementationName_Static() throw();
static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
};
inline OUString LinguProps::getImplementationName_Static() throw()
{
return OUString( "com.sun.star.lingu2.LinguProps" );
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */