[Libreoffice-commits] core.git: hwpfilter/source i18npool/inc i18npool/source idlc/inc idlc/source idl/inc idl/source l10ntools/inc l10ntools/source linguistic/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Nov 8 08:42:09 UTC 2016


 hwpfilter/source/hwpfile.cxx                                          |    7 -----
 hwpfilter/source/hwpfile.h                                            |    1 
 i18npool/inc/defaultnumberingprovider.hxx                             |    1 
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |    9 +-----
 idl/inc/slot.hxx                                                      |    3 --
 idl/source/objects/slot.cxx                                           |    9 +-----
 idlc/inc/astoperation.hxx                                             |    2 -
 idlc/source/astoperation.cxx                                          |    2 -
 l10ntools/inc/export.hxx                                              |    2 -
 l10ntools/source/export.cxx                                           |    3 +-
 linguistic/source/convdic.cxx                                         |   12 +-------
 linguistic/source/convdic.hxx                                         |   12 --------
 linguistic/source/hhconvdic.cxx                                       |   14 +---------
 linguistic/source/hhconvdic.hxx                                       |   11 -------
 14 files changed, 12 insertions(+), 76 deletions(-)

New commits:
commit 1a743fd8a27d063525e3567619a2971770c61574
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Nov 8 09:51:17 2016 +0200

    loplugin:expandablemethods in hwpfilter..linguistic
    
    Change-Id: I62ae20ab4a47b3b7e2b0d503cedcad3319cc9c85
    Reviewed-on: https://gerrit.libreoffice.org/30683
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 0c8a88c..3abfcac 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -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;
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index 36e332d..793354e4 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -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
  */
diff --git a/i18npool/inc/defaultnumberingprovider.hxx b/i18npool/inc/defaultnumberingprovider.hxx
index d65ef5e..5140a55 100644
--- a/i18npool/inc/defaultnumberingprovider.hxx
+++ b/i18npool/inc/defaultnumberingprovider.hxx
@@ -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 );
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index fe5bf48..a8ec5b2 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -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& ) {
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index 87118d6..5513009c 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -88,9 +88,6 @@ public:
             }
 
 public:
-            SvMetaObject *  MakeClone() const;
-            SvMetaSlot *Clone() const { return static_cast<SvMetaSlot *>(MakeClone()); }
-
             SvMetaSlot();
             SvMetaSlot( SvMetaType * pType );
 
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index eee05ad..9ae31d4 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -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) )
                 {
diff --git a/idlc/inc/astoperation.hxx b/idlc/inc/astoperation.hxx
index 85b12c8..a4837cb 100644
--- a/idlc/inc/astoperation.hxx
+++ b/idlc/inc/astoperation.hxx
@@ -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);
 
diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx
index cd6076b..e88656f 100644
--- a/idlc/source/astoperation.cxx
+++ b/idlc/source/astoperation.cxx
@@ -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;
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 3c59d46..8e8f5743 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -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);
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index bb1aeab..5a29d8d 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -236,7 +236,8 @@ Export::Export(
         std::exit(EXIT_FAILURE);
     }
 
-    if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput();
+    if ( bUTF8BOM )
+        *aOutput.mSimple << '\xEF' << '\xBB' << '\xBF';
 }
 
 void Export::Init()
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index d955c4c..7395355 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -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 };
 }
 
 
diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx
index 4481551..e5d28b2 100644
--- a/linguistic/source/convdic.hxx
+++ b/linguistic/source/convdic.hxx
@@ -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: */
diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx
index 66f9375..fcb4a32 100644
--- a/linguistic/source/hhconvdic.cxx
+++ b/linguistic/source/hhconvdic.cxx
@@ -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 };
 }
 
 
diff --git a/linguistic/source/hhconvdic.hxx b/linguistic/source/hhconvdic.hxx
index ed7c449..e925c17 100644
--- a/linguistic/source/hhconvdic.hxx
+++ b/linguistic/source/hhconvdic.hxx
@@ -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
 


More information about the Libreoffice-commits mailing list