summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-14 13:19:22 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-06-14 21:57:20 +0200
commitc37077578deffb79405330967191185967e90b98 (patch)
tree9cd983a39a251e22ba63b789c95b07801ceb0238 /svx
parent509c706aa07440a573f0e0c44499b82cde068ad2 (diff)
loplugin:unusedfields
Change-Id: I7d9966d11f8272034523d9804ecf76e119552780 Reviewed-on: https://gerrit.libreoffice.org/55796 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/dialcontrol.cxx17
-rw-r--r--svx/source/dialog/orienthelper.cxx4
-rw-r--r--svx/source/dialog/paraprev.cxx51
-rw-r--r--svx/source/dialog/swframeexample.cxx22
-rw-r--r--svx/source/svdraw/svdopath.cxx6
-rw-r--r--svx/source/svdraw/svdpdf.cxx3
-rw-r--r--svx/source/svdraw/svdpdf.hxx3
7 files changed, 13 insertions, 93 deletions
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index ce55a72d73a0..7270710e048a 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -626,11 +626,6 @@ sal_Int32 SvxDialControl::GetRotation() const
return mpImpl->mnAngle;
}
-void SvxDialControl::SetRotation( sal_Int32 nAngle )
-{
- SetRotation( nAngle, false );
-}
-
void SvxDialControl::SetLinkedField(weld::SpinButton* pField, sal_Int32 nDecimalPlaces)
{
mpImpl->mnLinkedFieldValueMultiplyer = 100 / std::pow(10.0, double(nDecimalPlaces));
@@ -659,7 +654,7 @@ IMPL_LINK_NOARG(SvxDialControl, LinkedFieldModifyHdl, weld::SpinButton&, void)
void SvxDialControl::LinkedFieldModifyHdl()
{
if( mpImpl->mpLinkField )
- SetRotation(mpImpl->mpLinkField->get_value() * mpImpl->mnLinkedFieldValueMultiplyer, false);
+ SetRotation(mpImpl->mpLinkField->get_value() * mpImpl->mnLinkedFieldValueMultiplyer);
}
@@ -696,11 +691,11 @@ void SvxDialControl::InvalidateControl()
{
mpImpl->mxBmpBuffered->CopyBackground( IsEnabled() ? *mpImpl->mxBmpEnabled : *mpImpl->mxBmpDisabled );
if( !mpImpl->mbNoRot )
- mpImpl->mxBmpBuffered->DrawElements( GetText(), mpImpl->mnAngle );
+ mpImpl->mxBmpBuffered->DrawElements( OUString(), mpImpl->mnAngle );
Invalidate();
}
-void SvxDialControl::SetRotation( sal_Int32 nAngle, bool bBroadcast )
+void SvxDialControl::SetRotation( sal_Int32 nAngle )
{
bool bOldSel = mpImpl->mbNoRot;
mpImpl->mbNoRot = false;
@@ -714,8 +709,6 @@ void SvxDialControl::SetRotation( sal_Int32 nAngle, bool bBroadcast )
InvalidateControl();
if( mpImpl->mpLinkField )
mpImpl->mpLinkField->set_value(GetRotation() / mpImpl->mnLinkedFieldValueMultiplyer);
- if( bBroadcast )
- mpImpl->maModifyHdl.Call( this );
}
}
@@ -734,7 +727,7 @@ void SvxDialControl::HandleMouseEvent( const Point& rPos, bool bInitial )
nAngle = ((nAngle + 750) / 1500) * 1500;
// Round up to 1 degree
nAngle = (((nAngle + 50) / 100) * 100) % 36000;
- SetRotation( nAngle, true );
+ SetRotation( nAngle );
}
}
@@ -743,7 +736,7 @@ void SvxDialControl::HandleEscapeEvent()
if( IsMouseCaptured() )
{
ReleaseMouse();
- SetRotation( mpImpl->mnOldAngle, true );
+ SetRotation( mpImpl->mnOldAngle );
if( mpImpl->mpLinkField )
mpImpl->mpLinkField->grab_focus();
}
diff --git a/svx/source/dialog/orienthelper.cxx b/svx/source/dialog/orienthelper.cxx
index b08d121706e7..f69831c1d9e5 100644
--- a/svx/source/dialog/orienthelper.cxx
+++ b/svx/source/dialog/orienthelper.cxx
@@ -33,7 +33,6 @@ struct OrientationHelper_Impl
typedef std::pair< VclPtr<vcl::Window>, TriState > WindowPair;
typedef std::vector< WindowPair > WindowVec;
- DialControl& mrCtrlDial;
CheckBox& mrCbStacked;
WindowVec maWinVec;
bool mbEnabled;
@@ -53,12 +52,11 @@ struct OrientationHelper_Impl
OrientationHelper_Impl::OrientationHelper_Impl( DialControl& rCtrlDial, CheckBox& rCbStacked ) :
- mrCtrlDial( rCtrlDial ),
mrCbStacked( rCbStacked ),
mbEnabled( rCtrlDial.IsEnabled() ),
mbVisible( rCtrlDial.IsVisible() )
{
- maWinVec.emplace_back( &mrCtrlDial, TRISTATE_TRUE );
+ maWinVec.emplace_back( &rCtrlDial, TRISTATE_TRUE );
maWinVec.emplace_back( &mrCbStacked, TRISTATE_INDET );
mrCbStacked.SetClickHdl( LINK( this, OrientationHelper_Impl, ClickHdl ) );
}
diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx
index 3a4d2bd14651..d10b11b28688 100644
--- a/svx/source/dialog/paraprev.cxx
+++ b/svx/source/dialog/paraprev.cxx
@@ -214,12 +214,8 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
ParaPrevWindow::ParaPrevWindow() :
nLeftMargin ( 0 ),
nRightMargin ( 0 ),
- nFirstLineOfst ( 0 ),
- nUpper ( 0 ),
- nLower ( 0 ),
eAdjust ( SvxAdjust::Left ),
- eLastLine ( SvxAdjust::Left ),
- eLine ( SvxPrevLineSpace::N1 )
+ eLastLine ( SvxAdjust::Left )
{
aSize = Size(11905, 16837);
}
@@ -272,8 +268,6 @@ void ParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
if (i == 3)
{
rRenderContext.SetFillColor(COL_GRAY);
- auto nTop = nUpper * aLineSiz.Height() / aSize.Height();
- aPnt.AdjustY(nTop * 2 );
}
if (i == 6 )
@@ -282,45 +276,12 @@ void ParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
if (3 <= i && 6 > i)
{
long nLeft = nLeftMargin * aLineSiz.Width() / aSize.Width();
- long nFirst = nFirstLineOfst * aLineSiz.Width() / aSize.Width();
- long nTmp = nLeft + nFirst;
-
- if (i == 3)
- {
- aPnt.AdjustX(nTmp );
- aSiz.AdjustWidth( -nTmp );
- }
- else
- {
- aPnt.AdjustX(nLeft );
- aSiz.AdjustWidth( -nLeft );
- }
+ aPnt.AdjustX(nLeft );
+ aSiz.AdjustWidth( -nLeft );
long nRight = nRightMargin * aLineSiz.Width() / aSize.Width();
aSiz.AdjustWidth( -nRight );
}
- if (4 == i || 5 == i || 6 == i)
- {
- switch (eLine)
- {
- case SvxPrevLineSpace::N1:
- break;
- case SvxPrevLineSpace::N115:
- aPnt.AdjustY(nH / 6.67 ); // 1/.15 = 6.(6)
- break;
- case SvxPrevLineSpace::N15:
- aPnt.AdjustY(nH / 2 );
- break;
- case SvxPrevLineSpace::N2:
- aPnt.AdjustY(nH );
- break;
- case SvxPrevLineSpace::Prop:
- case SvxPrevLineSpace::Min:
- case SvxPrevLineSpace::Leading:
- break;
- }
- }
-
aPnt.AdjustY(nH );
if (3 <= i && 5 >= i)
@@ -385,12 +346,6 @@ void ParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
rRenderContext.DrawRect( aRect );
Lines[i] = aRect;
- if (5 == i)
- {
- auto nBottom = nLower * aLineSiz.Height() / aSize.Height();
- aPnt.AdjustY(nBottom * 2 );
- }
-
aPnt.AdjustY(nH );
// Reset, recalculate for each line
aPnt.setX( DEF_MARGIN / 2 );
diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx
index 21bf84dc61c0..da8fd7d40a83 100644
--- a/svx/source/dialog/swframeexample.cxx
+++ b/svx/source/dialog/swframeexample.cxx
@@ -721,9 +721,7 @@ SwFrameExample::SwFrameExample()
, nHRel(RelOrientation::FRAME)
, nVAlign(VertOrientation::TOP)
, nVRel(RelOrientation::PRINT_AREA)
- , nWrap(WrapTextMode_NONE)
, nAnchor(RndStdIds::FLY_AT_PAGE)
- , bTrans(false)
, aRelPos(Point(0,0))
{
InitColors_Impl();
@@ -1312,22 +1310,8 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
if (aTxt.IsOver(aFrmRect) && nAnchor != RndStdIds::FLY_AS_CHAR && !bIgnoreWrap)
{
- switch(nWrap)
- {
- case WrapTextMode_NONE:
- aTxt.SetTop( aFrmRect.Bottom() + nTxtLineHeight );
- aTxt.SetBottom( aTxt.Top() + nTxtLineHeight - 1 );
- break;
-
- case WrapTextMode_LEFT:
- aTxt.SetRight( aFrmRect.Left() );
- break;
-
- case WrapTextMode_RIGHT:
- aTxt.SetLeft( aFrmRect.Right() );
- break;
- default: break;
- }
+ aTxt.SetTop( aFrmRect.Bottom() + nTxtLineHeight );
+ aTxt.SetBottom( aTxt.Top() + nTxtLineHeight - 1 );
}
if (pOuterFrame->IsInside(aTxt))
DrawRect_Impl(rRenderContext, aTxt, m_aTxtCol, m_aTransColor );
@@ -1363,7 +1347,7 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
DrawRect_Impl(rRenderContext, aRect, m_aTransColor, m_aAlignColor);
// Frame View
- bool bDontFill = (nAnchor == RndStdIds::FLY_AT_CHAR && aFrmRect.IsOver(aAutoCharFrame)) || bTrans;
+ bool bDontFill = (nAnchor == RndStdIds::FLY_AT_CHAR && aFrmRect.IsOver(aAutoCharFrame));
DrawRect_Impl(rRenderContext, aFrmRect, bDontFill? m_aTransColor : m_aBgCol, m_aFrameColor);
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index b61e88ae1a43..631c35a41407 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -90,7 +90,6 @@ struct ImpSdrPathDragData : public SdrDragStatUserData
sal_uInt16 nPrevPrevPnt; // index of point before previous point
sal_uInt16 nNextNextPnt; // index of point after next point
bool bControl; // point is a control point
- bool bIsPrevControl; // point is a control point before a support point
bool bIsNextControl; // point is a control point after a support point
bool bPrevIsControl; // if nPnt is a support point: a control point comes before
bool bNextIsControl; // if nPnt is a support point: a control point comes after
@@ -128,7 +127,6 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
, nPrevPrevPnt(0)
, nNextNextPnt(0)
, bControl(false)
- , bIsPrevControl(false)
, bIsNextControl(false)
, bPrevIsControl(false)
, bNextIsControl(false)
@@ -190,13 +188,11 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
if (!bPrevIsBegPnt) nPrevPrevPnt=GetPrevPnt(nPrevPnt,nPntMax,bClosed);
if (!bNextIsEndPnt) nNextNextPnt=GetNextPnt(nNextPnt,nPntMax,bClosed);
bControl=rHdl.IsPlusHdl(); // point is a control point
- bIsPrevControl=false; // point is a control point before a support point
bIsNextControl=false; // point is a control point after a support point
bPrevIsControl=false; // if nPnt is a support point: a control point comes before
bNextIsControl=false; // if nPnt is a support point: a control point comes after
if (bControl) {
- bIsPrevControl=aTmpXP.IsControl(nPrevPnt);
- bIsNextControl=!bIsPrevControl;
+ bIsNextControl=!aTmpXP.IsControl(nPrevPnt);
} else {
bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==PolyFlags::Control;
bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==PolyFlags::Control;
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 800095294a4b..81909736199a 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -141,7 +141,6 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
, mbLastObjWasPolyWithoutLine(false)
, mbNoLine(false)
, mbNoFill(false)
- , mbLastObjWasLine(false)
, maClip()
, mpPdfDocument(nullptr)
, mnPageCount(0)
@@ -696,12 +695,10 @@ void ImpSdrPdfImport::InsertObj(SdrObject* pObj, bool bScale)
const bool bClosed(pObj->IsClosedObj());
mbLastObjWasPolyWithoutLine = mbNoLine && bClosed;
- mbLastObjWasLine = !bClosed;
}
else
{
mbLastObjWasPolyWithoutLine = false;
- mbLastObjWasLine = false;
}
}
}
diff --git a/svx/source/svdraw/svdpdf.hxx b/svx/source/svdraw/svdpdf.hxx
index 9b9e81e69dad..48e46be11178 100644
--- a/svx/source/svdraw/svdpdf.hxx
+++ b/svx/source/svdraw/svdpdf.hxx
@@ -184,9 +184,6 @@ class ImpSdrPdfImport final
bool mbNoLine;
bool mbNoFill;
- // to optimize multiple lines into a Polyline
- bool mbLastObjWasLine;
-
// clipregion
basegfx::B2DPolyPolygon maClip;