loplugin:expandablemethods in drawinglayer..editeng

Change-Id: Ic7fe13651e18b4eec90ef3fd8d7aab81197e0f39
Reviewed-on: https://gerrit.libreoffice.org/30707
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2016-11-09 10:26:36 +02:00
parent 0e0e3ea312
commit 30e39e4793
20 changed files with 25 additions and 118 deletions

View File

@ -211,11 +211,6 @@ namespace drawinglayer
return mpSdrFillGraphicAttribute->getTiling(); return mpSdrFillGraphicAttribute->getTiling();
} }
bool SdrFillGraphicAttribute::getStretch() const
{
return mpSdrFillGraphicAttribute->getStretch();
}
FillGraphicAttribute SdrFillGraphicAttribute::createFillGraphicAttribute(const basegfx::B2DRange& rRange) const FillGraphicAttribute SdrFillGraphicAttribute::createFillGraphicAttribute(const basegfx::B2DRange& rRange) const
{ {
// get logical size of bitmap (before possibly expanding it) // get logical size of bitmap (before possibly expanding it)
@ -226,7 +221,7 @@ namespace drawinglayer
basegfx::B2DVector aBitmapTopLeft(0.0, 0.0); basegfx::B2DVector aBitmapTopLeft(0.0, 0.0);
//UUUU are changes needed? When stretched we are already done, all other values will have no influence //UUUU are changes needed? When stretched we are already done, all other values will have no influence
if(getTiling() || !getStretch()) if(getTiling() || !mpSdrFillGraphicAttribute->getStretch())
{ {
// init values with range sizes // init values with range sizes
const double fRangeWidth(0.0 != rRange.getWidth() ? rRange.getWidth() : 1.0); const double fRangeWidth(0.0 != rRange.getWidth() ? rRange.getWidth() : 1.0);

View File

@ -240,7 +240,7 @@ primitive2d::Primitive2DReference makeSolidLinePrimitive(
const basegfx::B2DPoint aTmpEnd(getEnd() + (fExt * aVector)); const basegfx::B2DPoint aTmpEnd(getEnd() + (fExt * aVector));
// Get which is the line to show // Get which is the line to show
bool bIsSolidline = isSolidLine(); bool bIsSolidline = mnStyle == css::table::BorderLineStyle::SOLID;
double nWidth = getLeftWidth(); double nWidth = getLeftWidth();
basegfx::BColor aColor = getRGBColorLeft(); basegfx::BColor aColor = getRGBColorLeft();
if ( basegfx::fTools::equal( 0.0, mfLeftWidth ) ) if ( basegfx::fTools::equal( 0.0, mfLeftWidth ) )

View File

@ -43,7 +43,7 @@ namespace drawinglayer
if(getBuffered2DDecomposition().empty()) if(getBuffered2DDecomposition().empty())
{ {
// remember new valid DiscreteUnit // remember new valid DiscreteUnit
const_cast< DiscreteMetricDependentPrimitive2D* >(this)->updateDiscreteUnit(fDiscreteUnit); const_cast< DiscreteMetricDependentPrimitive2D* >(this)->mfDiscreteUnit = fDiscreteUnit;
} }
// call base implementation // call base implementation

View File

@ -346,16 +346,6 @@ namespace drawinglayer
{ {
} }
bool TextDecoratedPortionPrimitive2D::decoratedIsNeeded() const
{
return (TEXT_LINE_NONE != getFontOverline()
|| TEXT_LINE_NONE != getFontUnderline()
|| TEXT_STRIKEOUT_NONE != getTextStrikeout()
|| TEXT_FONT_EMPHASIS_MARK_NONE != getTextEmphasisMark()
|| TEXT_RELIEF_NONE != getTextRelief()
|| getShadow());
}
bool TextDecoratedPortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const bool TextDecoratedPortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{ {
if(TextSimplePortionPrimitive2D::operator==(rPrimitive)) if(TextSimplePortionPrimitive2D::operator==(rPrimitive))
@ -384,7 +374,14 @@ namespace drawinglayer
// inking area, so add them if needed // inking area, so add them if needed
basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{ {
if(decoratedIsNeeded()) // check if this needs to be a TextDecoratedPortionPrimitive2D or
// if a TextSimplePortionPrimitive2D would be suficcient
if (TEXT_LINE_NONE != getFontOverline()
|| TEXT_LINE_NONE != getFontUnderline()
|| TEXT_STRIKEOUT_NONE != getTextStrikeout()
|| TEXT_FONT_EMPHASIS_MARK_NONE != getTextEmphasisMark()
|| TEXT_RELIEF_NONE != getTextRelief()
|| getShadow())
{ {
// decoration is used, fallback to BufferedDecompositionPrimitive2D::getB2DRange which uses // decoration is used, fallback to BufferedDecompositionPrimitive2D::getB2DRange which uses
// the own local decomposition for computation and thus creates all necessary // the own local decomposition for computation and thus creates all necessary

View File

@ -585,16 +585,6 @@ namespace accessibility
aEvent ); aEvent );
} }
void AccessibleEditableTextPara::GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 nEventId ) const
{
FireEvent( nEventId, rNewValue );
}
void AccessibleEditableTextPara::LostPropertyEvent( const uno::Any& rOldValue, const sal_Int16 nEventId ) const
{
FireEvent( nEventId, uno::Any(), rOldValue );
}
void AccessibleEditableTextPara::SetState( const sal_Int16 nStateId ) void AccessibleEditableTextPara::SetState( const sal_Int16 nStateId )
{ {
::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get()); ::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
@ -602,7 +592,7 @@ namespace accessibility
!pStateSet->contains(nStateId) ) !pStateSet->contains(nStateId) )
{ {
pStateSet->AddState( nStateId ); pStateSet->AddState( nStateId );
GotPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED ); FireEvent( AccessibleEventId::STATE_CHANGED, uno::makeAny( nStateId ) );
} }
} }
@ -613,7 +603,7 @@ namespace accessibility
pStateSet->contains(nStateId) ) pStateSet->contains(nStateId) )
{ {
pStateSet->RemoveState( nStateId ); pStateSet->RemoveState( nStateId );
LostPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED ); FireEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), uno::makeAny( nStateId ) );
} }
} }
@ -2798,17 +2788,8 @@ namespace accessibility
uno::Sequence< OUString> SAL_CALL AccessibleEditableTextPara::getSupportedServiceNames() throw (uno::RuntimeException, std::exception) uno::Sequence< OUString> SAL_CALL AccessibleEditableTextPara::getSupportedServiceNames() throw (uno::RuntimeException, std::exception)
{ {
const OUString sServiceName( getServiceName() );
return uno::Sequence< OUString > (&sServiceName, 1);
}
// XServiceName
OUString SAL_CALL AccessibleEditableTextPara::getServiceName() throw (uno::RuntimeException)
{
// #105185# Using correct service now // #105185# Using correct service now
return OUString("com.sun.star.text.AccessibleParagraphView"); return { OUString("com.sun.star.text.AccessibleParagraphView") };
} }
} // end of namespace accessibility } // end of namespace accessibility

View File

@ -438,18 +438,6 @@ namespace accessibility
aEvent ); aEvent );
} }
void AccessibleImageBullet::GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 nEventId ) const
{
FireEvent( nEventId, rNewValue );
}
void AccessibleImageBullet::LostPropertyEvent( const uno::Any& rOldValue, const sal_Int16 nEventId ) const
{
FireEvent( nEventId, uno::Any(), rOldValue );
}
void AccessibleImageBullet::SetState( const sal_Int16 nStateId ) void AccessibleImageBullet::SetState( const sal_Int16 nStateId )
{ {
@ -458,7 +446,7 @@ namespace accessibility
!pStateSet->contains(nStateId) ) !pStateSet->contains(nStateId) )
{ {
pStateSet->AddState( nStateId ); pStateSet->AddState( nStateId );
GotPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED ); FireEvent( AccessibleEventId::STATE_CHANGED, uno::makeAny( nStateId ) );
} }
} }
@ -470,7 +458,7 @@ namespace accessibility
pStateSet->contains(nStateId) ) pStateSet->contains(nStateId) )
{ {
pStateSet->RemoveState( nStateId ); pStateSet->RemoveState( nStateId );
LostPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED ); FireEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), uno::makeAny( nStateId ) );
} }
} }

View File

@ -193,7 +193,7 @@ void EditView::InvalidateOtherViewWindows( const Rectangle& rInvRect )
{ {
if (comphelper::LibreOfficeKit::isActive()) if (comphelper::LibreOfficeKit::isActive())
{ {
for (auto& pWin: GetOtherViewWindows()) for (auto& pWin : pImpEditView->aOutWindowSet)
{ {
if (pWin) if (pWin)
pWin->Invalidate( rInvRect ); pWin->Invalidate( rInvRect );
@ -313,11 +313,6 @@ vcl::Window* EditView::GetWindow() const
return pImpEditView->pOutWin; return pImpEditView->pOutWin;
} }
EditView::OutWindowSet& EditView::GetOtherViewWindows()
{
return pImpEditView->aOutWindowSet;
}
bool EditView::HasOtherViewWindow( vcl::Window* pWin ) bool EditView::HasOtherViewWindow( vcl::Window* pWin )
{ {
OutWindowSet& rOutWindowSet = pImpEditView->aOutWindowSet; OutWindowSet& rOutWindowSet = pImpEditView->aOutWindowSet;

View File

@ -35,10 +35,10 @@ class EditHTMLParser : public HTMLParser
{ {
using HTMLParser::CallParser; using HTMLParser::CallParser;
private: private:
OUStringBuffer maStyleSource; OUStringBuffer maStyleSource;
EditSelection aCurSel; EditSelection aCurSel;
OUString aBaseURL; OUString aBaseURL;
EditEngine* mpEditEngine; EditEngine* mpEditEngine;
AnchorInfo* pCurAnchor; AnchorInfo* pCurAnchor;
bool bInPara:1; bool bInPara:1;
@ -46,9 +46,9 @@ private:
bool bFieldsInserted:1; bool bFieldsInserted:1;
bool bInTitle:1; bool bInTitle:1;
sal_uInt8 nInTable; sal_uInt8 nInTable;
sal_uInt8 nInCell; sal_uInt8 nInCell;
sal_uInt8 nDefListLevel; sal_uInt8 nDefListLevel;
void StartPara( bool bReal ); void StartPara( bool bReal );
void EndPara( bool bReal ); void EndPara( bool bReal );

View File

@ -551,11 +551,6 @@ EEHorizontalTextDirection Outliner::GetDefaultHorizontalTextDirection() const
return pEditEngine->GetDefaultHorizontalTextDirection(); return pEditEngine->GetDefaultHorizontalTextDirection();
} }
SvtScriptType Outliner::GetScriptType( const ESelection& rSelection ) const
{
return pEditEngine->GetScriptType( rSelection );
}
LanguageType Outliner::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const LanguageType Outliner::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const
{ {
return pEditEngine->GetLanguage( nPara, nPos ); return pEditEngine->GetLanguage( nPara, nPos );

View File

@ -168,7 +168,7 @@ void Outliner::ParagraphDeleted( sal_Int32 nPara )
if( !pEditEngine->IsInUndo() ) if( !pEditEngine->IsInUndo() )
{ {
ParagraphRemovingHdl(pPara); aParaRemovingHdl.Call( { this, pPara } );
} }
pParaList->Remove( nPara ); pParaList->Remove( nPara );
@ -820,7 +820,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
if ( !pEditEngine->IsFlatMode() ) if ( !pEditEngine->IsFlatMode() )
{ {
ESelection aSel( nPara, 0, nPara, 0 ); ESelection aSel( nPara, 0, nPara, 0 );
aStdFont = EditEngine::CreateFontFromItemSet( pEditEngine->GetAttribs( aSel ), GetScriptType( aSel ) ); aStdFont = EditEngine::CreateFontFromItemSet( pEditEngine->GetAttribs( aSel ), pEditEngine->GetScriptType( aSel ) );
} }
else else
{ {
@ -1344,13 +1344,6 @@ void Outliner::ParagraphInsertedHdl(Paragraph* pPara)
} }
void Outliner::ParagraphRemovingHdl(Paragraph* pPara)
{
if( !IsInUndo() )
aParaRemovingHdl.Call( { this, pPara } );
}
void Outliner::DepthChangedHdl(Paragraph* pPara, ParaFlag nPrevFlags) void Outliner::DepthChangedHdl(Paragraph* pPara, ParaFlag nPrevFlags)
{ {
if( !IsInUndo() ) if( !IsInUndo() )

View File

@ -1749,15 +1749,11 @@ namespace
} }
}; };
} }
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getStaticTypes() throw()
{
return theSvxUnoTextBaseTypes::get();
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getTypes() uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getTypes()
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
return getStaticTypes(); return theSvxUnoTextBaseTypes::get();
} }
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextBase::getImplementationId() uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextBase::getImplementationId()

View File

@ -83,7 +83,6 @@ namespace drawinglayer
const basegfx::B2DVector& getOffsetPosition() const; const basegfx::B2DVector& getOffsetPosition() const;
const basegfx::B2DVector& getRectPoint() const; const basegfx::B2DVector& getRectPoint() const;
bool getTiling() const; bool getTiling() const;
bool getStretch() const;
// FillGraphicAttribute generator // FillGraphicAttribute generator
FillGraphicAttribute createFillGraphicAttribute(const basegfx::B2DRange& rRange) const; FillGraphicAttribute createFillGraphicAttribute(const basegfx::B2DRange& rRange) const;

View File

@ -74,11 +74,6 @@ namespace drawinglayer
double getWidth( double getWidth(
const geometry::ViewInformation2D& rViewInformation) const; const geometry::ViewInformation2D& rViewInformation) const;
bool isSolidLine() const
{
return mnStyle == css::table::BorderLineStyle::SOLID;
}
bool isInsideUsed() const bool isInsideUsed() const
{ {
return !basegfx::fTools::equalZero(mfLeftWidth); return !basegfx::fTools::equalZero(mfLeftWidth);

View File

@ -46,13 +46,6 @@ namespace drawinglayer
*/ */
double mfDiscreteUnit; double mfDiscreteUnit;
protected:
/// helper to update discrete unit
void updateDiscreteUnit(double fNew)
{
mfDiscreteUnit = fNew;
}
public: public:
/// constructor /// constructor
DiscreteMetricDependentPrimitive2D() DiscreteMetricDependentPrimitive2D()

View File

@ -118,10 +118,6 @@ namespace drawinglayer
bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; } bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; }
bool getShadow() const { return mbShadow; } bool getShadow() const { return mbShadow; }
/// check if this needs to be a TextDecoratedPortionPrimitive2D or
/// if a TextSimplePortionPrimitive2D would be suficcient
bool decoratedIsNeeded() const;
/// compare operator /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;

View File

@ -166,9 +166,6 @@ namespace accessibility
virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) throw (css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) throw (css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override;
// XServiceName
static OUString SAL_CALL getServiceName() throw (css::uno::RuntimeException);
/** Set the current index in the accessibility parent /** Set the current index in the accessibility parent
@attention This method does not lock the SolarMutex, @attention This method does not lock the SolarMutex,
@ -304,10 +301,6 @@ namespace accessibility
*/ */
bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nIndex ); bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nIndex );
// syntactic sugar for FireEvent
void GotPropertyEvent( const css::uno::Any& rNewValue, const sal_Int16 nEventId ) const;
void LostPropertyEvent( const css::uno::Any& rOldValue, const sal_Int16 nEventId ) const;
int getNotifierClientId() const { return mnNotifierClientId; } int getNotifierClientId() const { return mnNotifierClientId; }
/// Do we have children? This is the case for image bullets /// Do we have children? This is the case for image bullets

View File

@ -148,10 +148,6 @@ namespace accessibility
AccessibleImageBullet( const AccessibleImageBullet& ) = delete; AccessibleImageBullet( const AccessibleImageBullet& ) = delete;
AccessibleImageBullet& operator= ( const AccessibleImageBullet& ) = delete; AccessibleImageBullet& operator= ( const AccessibleImageBullet& ) = delete;
// syntactic sugar for FireEvent
void GotPropertyEvent( const css::uno::Any& rNewValue, const sal_Int16 nEventId ) const;
void LostPropertyEvent( const css::uno::Any& rOldValue, const sal_Int16 nEventId ) const;
// maintain state set and send STATE_CHANGE events // maintain state set and send STATE_CHANGE events
void SetState( const sal_Int16 nStateId ); void SetState( const sal_Int16 nStateId );
void UnSetState( const sal_Int16 nStateId ); void UnSetState( const sal_Int16 nStateId );

View File

@ -109,7 +109,6 @@ public:
void SetWindow( vcl::Window* pWin ); void SetWindow( vcl::Window* pWin );
vcl::Window* GetWindow() const; vcl::Window* GetWindow() const;
OutWindowSet& GetOtherViewWindows();
bool HasOtherViewWindow( vcl::Window* pWin ); bool HasOtherViewWindow( vcl::Window* pWin );
bool AddOtherViewWindow( vcl::Window* pWin ); bool AddOtherViewWindow( vcl::Window* pWin );
bool RemoveOtherViewWindow( vcl::Window* pWin ); bool RemoveOtherViewWindow( vcl::Window* pWin );

View File

@ -694,7 +694,6 @@ public:
void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ); void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const; EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
SvtScriptType GetScriptType( const ESelection& rSelection ) const;
LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const; LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const;
void SetAsianCompressionMode( sal_uInt16 nCompressionMode ); void SetAsianCompressionMode( sal_uInt16 nCompressionMode );
@ -763,7 +762,6 @@ public:
void SetParaInsertedHdl(const Link<ParagraphHdlParam,void>& rLink){aParaInsertedHdl=rLink;} void SetParaInsertedHdl(const Link<ParagraphHdlParam,void>& rLink){aParaInsertedHdl=rLink;}
const Link<ParagraphHdlParam,void>& GetParaInsertedHdl() const { return aParaInsertedHdl; } const Link<ParagraphHdlParam,void>& GetParaInsertedHdl() const { return aParaInsertedHdl; }
void ParagraphRemovingHdl(Paragraph*);
void SetParaRemovingHdl(const Link<ParagraphHdlParam,void>& rLink){aParaRemovingHdl=rLink;} void SetParaRemovingHdl(const Link<ParagraphHdlParam,void>& rLink){aParaRemovingHdl=rLink;}
const Link<ParagraphHdlParam,void>& GetParaRemovingHdl() const { return aParaRemovingHdl; } const Link<ParagraphHdlParam,void>& GetParaRemovingHdl() const { return aParaRemovingHdl; }

View File

@ -400,8 +400,6 @@ protected:
public: public:
UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase ) UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
static css::uno::Sequence< css::uno::Type > SAL_CALL getStaticTypes() throw();
css::uno::Reference< css::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel ); css::uno::Reference< css::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
// css::uno::XInterface // css::uno::XInterface