Kaydet (Commit) 1a743fd8 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:expandablemethods in hwpfilter..linguistic

Change-Id: I62ae20ab4a47b3b7e2b0d503cedcad3319cc9c85
Reviewed-on: https://gerrit.libreoffice.org/30683Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst bc57a3e3
......@@ -138,15 +138,10 @@ int HWPFile::SetState(int errcode)
return error_code;
}
bool HWPFile::Read1b(unsigned char &out)
{
return hiodev && hiodev->read1b(out);
}
bool HWPFile::Read1b(char &out)
{
unsigned char tmp8;
if (!Read1b(tmp8))
if (!hiodev || !hiodev->read1b(tmp8))
return false;
out = tmp8;
return true;
......
......@@ -125,7 +125,6 @@ class DLLEXPORT HWPFile
* Reads one byte from HIODev
*/
bool Read1b(char &out);
bool Read1b(unsigned char &out);
/**
* Reads two byte from HIODev
*/
......
......@@ -39,7 +39,6 @@ class DefaultNumberingProvider : public cppu::WeakImplHelper
css::lang::XServiceInfo
>
{
void impl_loadTranslit();
public:
DefaultNumberingProvider(
const css::uno::Reference < css::uno::XComponentContext >& rxContext );
......
......@@ -271,12 +271,6 @@ DefaultNumberingProvider::~DefaultNumberingProvider()
delete translit;
}
void DefaultNumberingProvider::impl_loadTranslit()
{
if ( !translit )
translit = new TransliterationImpl(m_xContext);
}
Sequence< Reference<container::XIndexAccess> >
DefaultNumberingProvider::getDefaultOutlineNumberings(const Locale& rLocale ) throw(RuntimeException, std::exception)
{
......@@ -647,7 +641,8 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
const OUString &tmp = OUString::number( number );
OUString transliteration;
getPropertyByName(aProperties, "Transliteration", true) >>= transliteration;
impl_loadTranslit();
if ( !translit )
translit = new TransliterationImpl(m_xContext);
translit->loadModuleByImplName(transliteration, aLocale);
result += translit->transliterateString2String(tmp, 0, tmp.getLength());
} catch (Exception& ) {
......
......@@ -88,9 +88,6 @@ public:
}
public:
SvMetaObject * MakeClone() const;
SvMetaSlot *Clone() const { return static_cast<SvMetaSlot *>(MakeClone()); }
SvMetaSlot();
SvMetaSlot( SvMetaType * pType );
......
......@@ -27,11 +27,6 @@
#include <database.hxx>
SvMetaObject *SvMetaSlot::MakeClone() const
{
return new SvMetaSlot( *this );
}
SvMetaSlot::SvMetaSlot()
: aRecordPerSet( true )
, aRecordAbsolute( false )
......@@ -480,7 +475,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
if (aSId.equals(pAttr->GetSlotId().getString()))
{
SvMetaSlot& rSlot = dynamic_cast<SvMetaSlot&>(*pAttr);
xEnumSlot = rSlot.Clone();
xEnumSlot = new SvMetaSlot( rSlot );
break;
}
}
......@@ -488,7 +483,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
if ( m == rBase.GetSlotList().size() )
{
OSL_FAIL("Invalid EnumSlot!");
xEnumSlot = Clone();
xEnumSlot = new SvMetaSlot( *this );
sal_uLong nValue;
if ( rBase.FindId(aSId , &nValue) )
{
......
......@@ -42,8 +42,6 @@ public:
bool isConstructor() const { return m_pReturnType == nullptr; }
void setExceptions(DeclList const * pExceptions);
sal_uInt16 nExceptions()
{ return (sal_uInt16)(m_exceptions.size()); }
bool dumpBlob(typereg::Writer & rBlob, sal_uInt16 index);
......
......@@ -41,7 +41,7 @@ bool AstOperation::isVariadic() const {
bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index)
{
sal_uInt16 nParam = getNodeCount(NT_parameter);
sal_uInt16 nExcep = nExceptions();
sal_uInt16 nExcep = (sal_uInt16)m_exceptions.size();
RTMethodMode methodMode = RTMethodMode::TWOWAY;
OUString returnTypeName;
......
......@@ -162,8 +162,6 @@ private:
static void CutComment( OString &rText );
void WriteUTF8ByteOrderMarkToOutput() { *aOutput.mSimple << '\xEF' << '\xBB' << '\xBF'; }
public:
Export( const OString &rOutput );
Export(const OString &rMergeSource, const OString &rOutput, bool bUTF8BOM);
......
......@@ -236,7 +236,8 @@ Export::Export(
std::exit(EXIT_FAILURE);
}
if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput();
if ( bUTF8BOM )
*aOutput.mSimple << '\xEF' << '\xBB' << '\xBF';
}
void Export::Init()
......
......@@ -644,7 +644,7 @@ void SAL_CALL ConvDic::removeFlushListener(
OUString SAL_CALL ConvDic::getImplementationName( )
throw (RuntimeException, std::exception)
{
return getImplementationName_Static();
return OUString( "com.sun.star.lingu2.ConvDic" );
}
sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName )
......@@ -656,15 +656,7 @@ sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName )
uno::Sequence< OUString > SAL_CALL ConvDic::getSupportedServiceNames( )
throw (RuntimeException, std::exception)
{
return getSupportedServiceNames_Static();
}
uno::Sequence< OUString > ConvDic::getSupportedServiceNames_Static()
throw()
{
uno::Sequence<OUString> aSNS { SN_CONV_DICTIONARY };
return aSNS;
return { SN_CONV_DICTIONARY };
}
......
......@@ -122,23 +122,11 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException, std::exception) override;
static inline OUString
getImplementationName_Static() throw();
static css::uno::Sequence< OUString >
getSupportedServiceNames_Static() throw();
bool HasEntry( const OUString &rLeftText, const OUString &rRightText );
void AddEntry( const OUString &rLeftText, const OUString &rRightText );
void RemoveEntry( const OUString &rLeftText, const OUString &rRightText );
};
inline OUString ConvDic::getImplementationName_Static() throw()
{
return OUString( "com.sun.star.lingu2.ConvDic" );
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -110,7 +110,7 @@ void SAL_CALL HHConvDic::addEntry(
OUString SAL_CALL HHConvDic::getImplementationName( )
throw (RuntimeException, std::exception)
{
return getImplementationName_Static();
return OUString( "com.sun.star.lingu2.HHConvDic" );
}
......@@ -124,17 +124,7 @@ sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName )
uno::Sequence< OUString > SAL_CALL HHConvDic::getSupportedServiceNames( )
throw (RuntimeException, std::exception)
{
return getSupportedServiceNames_Static();
}
uno::Sequence< OUString > HHConvDic::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< OUString > aSNS( 2 );
aSNS.getArray()[0] = SN_CONV_DICTIONARY;
aSNS.getArray()[1] = SN_HH_CONV_DICTIONARY;
return aSNS;
return { SN_CONV_DICTIONARY, SN_HH_CONV_DICTIONARY };
}
......
......@@ -47,19 +47,8 @@ public:
virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException, std::exception) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException, std::exception) override;
static inline OUString
getImplementationName_Static() throw();
static css::uno::Sequence< OUString >
getSupportedServiceNames_Static() throw();
};
inline OUString HHConvDic::getImplementationName_Static() throw()
{
return OUString( "com.sun.star.lingu2.HHConvDic" );
}
#endif
......
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