loplugin:expandablemethods in stoc..svl

Change-Id: I7dd701ef07a14f70589b87154bfeeda7530b628f
Reviewed-on: https://gerrit.libreoffice.org/30316
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-10-27 10:34:56 +02:00
parent e641c1740f
commit c19d2b276b
11 changed files with 22 additions and 71 deletions

View File

@@ -167,7 +167,6 @@ public:
SvStream & Load(SvStream &); SvStream & Load(SvStream &);
virtual SvStream & Store(SvStream &) const; virtual SvStream & Store(SvStream &) const;
bool HasPersistentRefCounts() const;
void LoadCompleted(); void LoadCompleted();
sal_uInt16 GetFirstWhich() const; sal_uInt16 GetFirstWhich() const;

View File

@@ -44,7 +44,6 @@ class SVL_DLLPUBLIC ShareControlFile : public LockFileCommon
std::vector< LockFileEntry > m_aUsersData; std::vector< LockFileEntry > m_aUsersData;
void OpenStream();
void Close(); void Close();
bool IsValid() bool IsValid()
{ {

View File

@@ -63,8 +63,6 @@ public:
virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
OUString GetValueTextByVal(bool bTheValue) const;
bool GetValue() const { return m_nValue.bVisible; } bool GetValue() const { return m_nValue.bVisible; }
}; };

View File

@@ -849,11 +849,6 @@ private:
// Create builtin formats for language/country if necessary, return CLOffset // Create builtin formats for language/country if necessary, return CLOffset
SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge ); 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> // Create theCurrencyTable with all <type>NfCurrencyEntry</type>
SVL_DLLPRIVATE static void ImpInitCurrencyTable(); SVL_DLLPRIVATE static void ImpInitCurrencyTable();

View File

@@ -701,7 +701,6 @@ class ImplIntrospectionAccess : public IntrospectionAccessHelper
Reference<XIndexAccess> getXIndexAccess(); Reference<XIndexAccess> getXIndexAccess();
Reference<XEnumerationAccess> getXEnumerationAccess(); Reference<XEnumerationAccess> getXEnumerationAccess();
Reference<XIdlArray> getXIdlArray(); Reference<XIdlArray> getXIdlArray();
Reference<XUnoTunnel> getXUnoTunnel();
void cacheXNameContainer(); void cacheXNameContainer();
void cacheXIndexContainer(); void cacheXIndexContainer();
@@ -1019,11 +1018,6 @@ Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray()
return mxObjIdlArray; return mxObjIdlArray;
} }
Reference<XUnoTunnel> ImplIntrospectionAccess::getXUnoTunnel()
{
return Reference<XUnoTunnel>::query( mxIface );
}
// Methods from XInterface // Methods from XInterface
Any SAL_CALL ImplIntrospectionAccess::queryInterface( const Type& rType ) Any SAL_CALL ImplIntrospectionAccess::queryInterface( const Type& rType )
throw( RuntimeException, std::exception ) 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 ) sal_Int64 ImplIntrospectionAccess::getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
return getXUnoTunnel()->getSomething( aIdentifier ); return Reference<XUnoTunnel>::query( mxIface )->getSomething( aIdentifier );
} }

View File

@@ -351,7 +351,6 @@ namespace svgio
/// StrokeDashOffset content /// StrokeDashOffset content
SvgNumber getStrokeDashOffset() const; SvgNumber getStrokeDashOffset() const;
void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset) { maStrokeDashOffset = rStrokeDashOffset; }
/// StrokeLinecap content /// StrokeLinecap content
StrokeLinecap getStrokeLinecap() const; StrokeLinecap getStrokeLinecap() const;
@@ -363,7 +362,6 @@ namespace svgio
/// StrokeMiterLimit content /// StrokeMiterLimit content
SvgNumber getStrokeMiterLimit() const; SvgNumber getStrokeMiterLimit() const;
void setStrokeMiterLimit(const SvgNumber& rStrokeMiterLimit) { maStrokeMiterLimit = rStrokeMiterLimit; }
/// StrokeOpacity content /// StrokeOpacity content
SvgNumber getStrokeOpacity() const; SvgNumber getStrokeOpacity() const;
@@ -446,7 +444,6 @@ namespace svgio
// BaselineShift // BaselineShift
void setBaselineShift(const BaselineShift aBaselineShift) { maBaselineShift = aBaselineShift; } void setBaselineShift(const BaselineShift aBaselineShift) { maBaselineShift = aBaselineShift; }
BaselineShift getBaselineShift() const { return maBaselineShift; } BaselineShift getBaselineShift() const { return maBaselineShift; }
void setBaselineShiftNumber(const SvgNumber& rBaselineShift) { maBaselineShiftNumber = rBaselineShift; }
SvgNumber getBaselineShiftNumber() const; SvgNumber getBaselineShiftNumber() const;
}; };
} // end of namespace svgreader } // end of namespace svgreader

View File

@@ -1397,7 +1397,7 @@ namespace svgio
{ {
if(aNum.isPositive()) if(aNum.isPositive())
{ {
setStrokeDashOffset(aNum); maStrokeDashOffset = aNum;
} }
} }
break; break;
@@ -1448,7 +1448,7 @@ namespace svgio
{ {
if(basegfx::fTools::moreOrEqual(aNum.getNumber(), 1.0)) if(basegfx::fTools::moreOrEqual(aNum.getNumber(), 1.0))
{ //readSingleNumber sets Unit_px as default, if unit is missing. Correct it here. { //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; break;
@@ -1937,7 +1937,7 @@ namespace svgio
} }
else if(readSingleNumber(aContent, aNum)) else if(readSingleNumber(aContent, aNum))
{ {
setBaselineShiftNumber(aNum); maBaselineShiftNumber = aNum;
if(Unit_percent == aNum.getUnit()) if(Unit_percent == aNum.getUnit())
{ {

View File

@@ -323,11 +323,6 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
return rStream; return rStream;
} }
bool SfxItemPool::HasPersistentRefCounts() const
{
return pImpl->mbPersistentRefCounts;
}
/** /**
* If the SfxItemPool was loaded with 'bRefCounts' == sal_False, we need * 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. * 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 ); return &pTarget->Put( *pItem );
// References have NOT been loaded together with the pool? // References have NOT been loaded together with the pool?
if ( !pTarget->HasPersistentRefCounts() ) if ( !pTarget->pImpl->mbPersistentRefCounts )
AddRef( *pItem ); AddRef( *pItem );
else else
return pItem; return pItem;

View File

@@ -45,7 +45,7 @@ bool SfxVisibilityItem::GetPresentation(SfxItemPresentation,
OUString & rText, OUString & rText,
const IntlWrapper *) const const IntlWrapper *) const
{ {
rText = GetValueTextByVal(m_nValue.bVisible); rText = m_nValue.bVisible ? OUString("TRUE") : OUString("FALSE");
return true; return true;
} }
@@ -86,10 +86,4 @@ SfxPoolItem * SfxVisibilityItem::Clone(SfxItemPool *) const
return new SfxVisibilityItem(*this); return new SfxVisibilityItem(*this);
} }
// virtual
OUString SfxVisibilityItem::GetValueTextByVal(bool bTheValue) const
{
return bTheValue ? OUString("TRUE") : OUString("FALSE");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -54,28 +54,6 @@ namespace svt {
ShareControlFile::ShareControlFile( const OUString& aOrigURL ) ShareControlFile::ShareControlFile( const OUString& aOrigURL )
: LockFileCommon( aOrigURL, OUString( ".~sharing." ) ) : 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() ) if ( !m_xStream.is() && !m_aURL.isEmpty() )
{ {
uno::Reference< ucb::XCommandEnvironment > xDummyEnv; uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
@@ -125,8 +103,20 @@ void ShareControlFile::OpenStream()
m_xTruncate.set( m_xOutputStream, uno::UNO_QUERY_THROW ); m_xTruncate.set( m_xOutputStream, uno::UNO_QUERY_THROW );
m_xStream = xStream; m_xStream = xStream;
} }
if ( !IsValid() )
throw io::NotConnectedException();
} }
ShareControlFile::~ShareControlFile()
{
try
{
Close();
}
catch( uno::Exception& )
{}
}
void ShareControlFile::Close() void ShareControlFile::Close()
{ {

View File

@@ -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 SvNumberFormatter::ImpPosToken ( const OUStringBuffer & sFormat, sal_Unicode token, sal_Int32 nStartPos /* = 0*/ )
{ {
sal_Int32 nLength = sFormat.getLength(); sal_Int32 nLength = sFormat.getLength();
@@ -2911,8 +2899,10 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex,
{ // "automatic" old style { // "automatic" old style
OUString aSymbol, aAbbrev; OUString aSymbol, aAbbrev;
GetCompatibilityCurrency( aSymbol, aAbbrev ); GetCompatibilityCurrency( aSymbol, aAbbrev );
ImpGetPosCurrFormat( sString, aSymbol ); NfCurrencyEntry::CompletePositiveFormatString( sString,
ImpGetNegCurrFormat( sNegStr, aSymbol ); aSymbol, xLocaleData->getCurrPositiveFormat() );
NfCurrencyEntry::CompleteNegativeFormatString( sNegStr,
aSymbol, xLocaleData->getCurrNegativeFormat() );
} }
if (IsRed) if (IsRed)
{ {