[Libreoffice-commits] core.git: include/svl stoc/source svgio/inc svgio/source svl/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 27 10:16:31 UTC 2016


 include/svl/itempool.hxx                      |    1 
 include/svl/sharecontrolfile.hxx              |    1 
 include/svl/visitem.hxx                       |    2 -
 include/svl/zforlist.hxx                      |    5 ---
 stoc/source/inspect/introspection.cxx         |    8 ------
 svgio/inc/svgstyleattributes.hxx              |    3 --
 svgio/source/svgreader/svgstyleattributes.cxx |    6 ++--
 svl/source/items/poolio.cxx                   |    7 -----
 svl/source/items/visitem.cxx                  |    8 ------
 svl/source/misc/sharecontrolfile.cxx          |   34 +++++++++-----------------
 svl/source/numbers/zforlist.cxx               |   18 +++----------
 11 files changed, 22 insertions(+), 71 deletions(-)

New commits:
commit c19d2b276b7a28c07315cf60cb0965098a935e5f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Oct 27 10:34:56 2016 +0200

    loplugin:expandablemethods in stoc..svl
    
    Change-Id: I7dd701ef07a14f70589b87154bfeeda7530b628f
    Reviewed-on: https://gerrit.libreoffice.org/30316
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 6c9327f..5121177 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -167,7 +167,6 @@ public:
 
     SvStream &                      Load(SvStream &);
     virtual SvStream &              Store(SvStream &) const;
-    bool                            HasPersistentRefCounts() const;
     void                            LoadCompleted();
 
     sal_uInt16                      GetFirstWhich() const;
diff --git a/include/svl/sharecontrolfile.hxx b/include/svl/sharecontrolfile.hxx
index d622d0e..ad899ac 100644
--- a/include/svl/sharecontrolfile.hxx
+++ b/include/svl/sharecontrolfile.hxx
@@ -44,7 +44,6 @@ class SVL_DLLPUBLIC ShareControlFile : public LockFileCommon
 
     std::vector< LockFileEntry >                  m_aUsersData;
 
-    void OpenStream();
     void Close();
     bool IsValid()
     {
diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx
index 0efc712..b661c37 100644
--- a/include/svl/visitem.hxx
+++ b/include/svl/visitem.hxx
@@ -63,8 +63,6 @@ public:
 
     virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
 
-    OUString GetValueTextByVal(bool bTheValue) const;
-
     bool GetValue() const { return m_nValue.bVisible; }
 };
 
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 9611eb6..ab7dd90 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -849,11 +849,6 @@ private:
     // Create builtin formats for language/country if necessary, return CLOffset
     SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge );
 
-    // Build negative currency format, old compatibility style
-    SVL_DLLPRIVATE void ImpGetNegCurrFormat(OUStringBuffer& sNegStr, const OUString& rCurrSymbol);
-    // Build positive currency format, old compatibility style
-    SVL_DLLPRIVATE void ImpGetPosCurrFormat(OUStringBuffer& sPosStr, const OUString& rCurrSymbol);
-
     // Create theCurrencyTable with all <type>NfCurrencyEntry</type>
     SVL_DLLPRIVATE static void ImpInitCurrencyTable();
 
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 081983f..a755443 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -701,7 +701,6 @@ class ImplIntrospectionAccess : public IntrospectionAccessHelper
     Reference<XIndexAccess>         getXIndexAccess();
     Reference<XEnumerationAccess>   getXEnumerationAccess();
     Reference<XIdlArray>            getXIdlArray();
-    Reference<XUnoTunnel>           getXUnoTunnel();
 
     void cacheXNameContainer();
     void cacheXIndexContainer();
@@ -1019,11 +1018,6 @@ Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray()
     return mxObjIdlArray;
 }
 
-Reference<XUnoTunnel> ImplIntrospectionAccess::getXUnoTunnel()
-{
-    return Reference<XUnoTunnel>::query( mxIface );
-}
-
 // Methods from XInterface
 Any SAL_CALL ImplIntrospectionAccess::queryInterface( const Type& rType )
     throw( RuntimeException, std::exception )
@@ -1282,7 +1276,7 @@ void ImplIntrospectionAccess::set(Any& array, sal_Int32 index, const Any& value)
 sal_Int64 ImplIntrospectionAccess::getSomething( const Sequence< sal_Int8 >& aIdentifier )
         throw (RuntimeException, std::exception)
 {
-    return getXUnoTunnel()->getSomething( aIdentifier );
+    return Reference<XUnoTunnel>::query( mxIface )->getSomething( aIdentifier );
 }
 
 
diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx
index 360335a..2021204 100644
--- a/svgio/inc/svgstyleattributes.hxx
+++ b/svgio/inc/svgstyleattributes.hxx
@@ -351,7 +351,6 @@ namespace svgio
 
             /// StrokeDashOffset content
             SvgNumber getStrokeDashOffset() const;
-            void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset) { maStrokeDashOffset = rStrokeDashOffset; }
 
             /// StrokeLinecap content
             StrokeLinecap getStrokeLinecap() const;
@@ -363,7 +362,6 @@ namespace svgio
 
             /// StrokeMiterLimit content
             SvgNumber getStrokeMiterLimit() const;
-            void setStrokeMiterLimit(const SvgNumber& rStrokeMiterLimit) { maStrokeMiterLimit = rStrokeMiterLimit; }
 
             /// StrokeOpacity content
             SvgNumber getStrokeOpacity() const;
@@ -446,7 +444,6 @@ namespace svgio
             // BaselineShift
             void setBaselineShift(const BaselineShift aBaselineShift) { maBaselineShift = aBaselineShift; }
             BaselineShift getBaselineShift() const { return maBaselineShift; }
-            void setBaselineShiftNumber(const SvgNumber& rBaselineShift) { maBaselineShiftNumber = rBaselineShift; }
             SvgNumber getBaselineShiftNumber() const;
         };
     } // end of namespace svgreader
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 6a92c42e7..948f361 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1397,7 +1397,7 @@ namespace svgio
                     {
                         if(aNum.isPositive())
                         {
-                            setStrokeDashOffset(aNum);
+                            maStrokeDashOffset = aNum;
                         }
                     }
                     break;
@@ -1448,7 +1448,7 @@ namespace svgio
                     {
                         if(basegfx::fTools::moreOrEqual(aNum.getNumber(), 1.0))
                         { //readSingleNumber sets Unit_px as default, if unit is missing. Correct it here.
-                            setStrokeMiterLimit(SvgNumber(aNum.getNumber(), Unit_none));
+                            maStrokeMiterLimit = SvgNumber(aNum.getNumber(), Unit_none);
                         }
                     }
                     break;
@@ -1937,7 +1937,7 @@ namespace svgio
                         }
                         else if(readSingleNumber(aContent, aNum))
                         {
-                            setBaselineShiftNumber(aNum);
+                            maBaselineShiftNumber = aNum;
 
                             if(Unit_percent == aNum.getUnit())
                             {
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 7e023fa..c695bb9 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -323,11 +323,6 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
     return rStream;
 }
 
-bool SfxItemPool::HasPersistentRefCounts() const
-{
-    return pImpl->mbPersistentRefCounts;
-}
-
 /**
  * If the SfxItemPool was loaded with 'bRefCounts' == sal_False, we need
  * to finish the loading of the document contents with a call of this method.
@@ -868,7 +863,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
                     return &pTarget->Put( *pItem );
 
                 // References have NOT been loaded together with the pool?
-                if ( !pTarget->HasPersistentRefCounts() )
+                if ( !pTarget->pImpl->mbPersistentRefCounts )
                     AddRef( *pItem );
                 else
                     return pItem;
diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx
index da59348..32d7568 100644
--- a/svl/source/items/visitem.cxx
+++ b/svl/source/items/visitem.cxx
@@ -45,7 +45,7 @@ bool SfxVisibilityItem::GetPresentation(SfxItemPresentation,
                                         OUString & rText,
                                         const IntlWrapper *) const
 {
-    rText = GetValueTextByVal(m_nValue.bVisible);
+    rText = m_nValue.bVisible ? OUString("TRUE") : OUString("FALSE");
     return true;
 }
 
@@ -86,10 +86,4 @@ SfxPoolItem * SfxVisibilityItem::Clone(SfxItemPool *) const
     return new SfxVisibilityItem(*this);
 }
 
-// virtual
-OUString SfxVisibilityItem::GetValueTextByVal(bool bTheValue) const
-{
-    return bTheValue ? OUString("TRUE") : OUString("FALSE");
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx
index ca95115..205c4e2 100644
--- a/svl/source/misc/sharecontrolfile.cxx
+++ b/svl/source/misc/sharecontrolfile.cxx
@@ -54,28 +54,6 @@ namespace svt {
 ShareControlFile::ShareControlFile( const OUString& aOrigURL )
 : LockFileCommon( aOrigURL, OUString( ".~sharing."  ) )
 {
-    OpenStream();
-
-    if ( !IsValid() )
-        throw io::NotConnectedException();
-}
-
-
-ShareControlFile::~ShareControlFile()
-{
-    try
-    {
-        Close();
-    }
-    catch( uno::Exception& )
-    {}
-}
-
-
-void ShareControlFile::OpenStream()
-{
-    // if it is called outside of constructor the mutex must be locked already
-
     if ( !m_xStream.is() && !m_aURL.isEmpty() )
     {
         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
@@ -125,8 +103,20 @@ void ShareControlFile::OpenStream()
         m_xTruncate.set( m_xOutputStream, uno::UNO_QUERY_THROW );
         m_xStream = xStream;
     }
+
+    if ( !IsValid() )
+        throw io::NotConnectedException();
 }
 
+ShareControlFile::~ShareControlFile()
+{
+    try
+    {
+        Close();
+    }
+    catch( uno::Exception& )
+    {}
+}
 
 void ShareControlFile::Close()
 {
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 9044d88..c2617a5 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2744,18 +2744,6 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
 }
 
 
-void SvNumberFormatter::ImpGetPosCurrFormat(OUStringBuffer& sPosStr, const OUString& rCurrSymbol)
-{
-    NfCurrencyEntry::CompletePositiveFormatString( sPosStr,
-        rCurrSymbol, xLocaleData->getCurrPositiveFormat() );
-}
-
-void SvNumberFormatter::ImpGetNegCurrFormat(OUStringBuffer& sNegStr, const OUString& rCurrSymbol)
-{
-    NfCurrencyEntry::CompleteNegativeFormatString( sNegStr,
-        rCurrSymbol, xLocaleData->getCurrNegativeFormat() );
-}
-
 sal_Int32 SvNumberFormatter::ImpPosToken ( const OUStringBuffer & sFormat, sal_Unicode token, sal_Int32 nStartPos /* = 0*/ )
 {
     sal_Int32 nLength = sFormat.getLength();
@@ -2911,8 +2899,10 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex,
         {   // "automatic" old style
             OUString aSymbol, aAbbrev;
             GetCompatibilityCurrency( aSymbol, aAbbrev );
-            ImpGetPosCurrFormat( sString, aSymbol );
-            ImpGetNegCurrFormat( sNegStr, aSymbol );
+            NfCurrencyEntry::CompletePositiveFormatString( sString,
+                                aSymbol, xLocaleData->getCurrPositiveFormat() );
+            NfCurrencyEntry::CompleteNegativeFormatString( sNegStr,
+                                aSymbol, xLocaleData->getCurrNegativeFormat() );
         }
         if (IsRed)
         {


More information about the Libreoffice-commits mailing list