diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-14 13:19:22 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-06-14 21:57:20 +0200 |
commit | c37077578deffb79405330967191185967e90b98 (patch) | |
tree | 9cd983a39a251e22ba63b789c95b07801ceb0238 /sw | |
parent | 509c706aa07440a573f0e0c44499b82cde068ad2 (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 'sw')
-rw-r--r-- | sw/inc/ndgrf.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/misc/outline.cxx | 188 | ||||
-rw-r--r-- | sw/source/uibase/inc/numprevw.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/inc/prcntfld.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/prcntfld.cxx | 3 |
7 files changed, 1 insertions, 207 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index a2d3ce5b4c08..e44c72e69309 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -42,7 +42,6 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode Size nGrfSize; bool bInSwapIn :1; - bool bGraphicArrived :1; bool bChgTwipSize :1; bool bFrameInPaint :1; ///< To avoid Start-/EndActions in Paint via SwapIn. bool bScaleImageMap :1; ///< Scale image map in SetTwipSize. @@ -104,8 +103,6 @@ public: bChgTwipSize = b; } - void SetGraphicArrived( bool b ) { bGraphicArrived = b; } - bool IsFrameInPaint() const { return bFrameInPaint; } void SetFrameInPaint( bool b ) { bFrameInPaint = b; } diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index e06eaf120a81..1c5af6aabbe1 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -139,8 +139,6 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) bFrameInPaint = pSwGrfNode->IsFrameInPaint(); - pSwGrfNode->SetGraphicArrived(true); - Graphic aGrf; if( sfx2::LinkManager::GetGraphicFromAny( rMimeType, rValue, aGrf ) && diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 635e0f8d80cd..00e63f64a918 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -76,7 +76,6 @@ SwGrfNode::SwGrfNode( bInSwapIn = bChgTwipSize = bFrameInPaint = bScaleImageMap = false; - bGraphicArrived = true; ReRead(rGrfName, rFltName, pGraphic, false); } @@ -93,7 +92,6 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, { bInSwapIn = bChgTwipSize = bFrameInPaint = bScaleImageMap = false; - bGraphicArrived = true; } /** Create new SW/G reader. @@ -119,7 +117,6 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, bInSwapIn = bChgTwipSize = bFrameInPaint = bScaleImageMap = false; - bGraphicArrived = false; InsertLink( rGrfName, rFltName ); if( IsLinkedFile() ) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index bd66fa969d03..f5ea3b36cee0 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -867,194 +867,6 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor()); pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize)); - if (pActNum) - { - long nWidthRelation = 30; // chapter dialog - if(nPageWidth) - { - nWidthRelation = nPageWidth / aSize.Width(); - if(bPosition) - nWidthRelation = nWidthRelation * 2 / 3; - else - nWidthRelation = nWidthRelation / 4; - } - - // height per level - const long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1)); - const long nYStep = (aSize.Height() - 6)/ MAXLEVEL; - long nYStart = 4; - aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(), - GetDefaultFontFlags::OnlyOne, &rRenderContext); - // #101524# OJ - aStdFont.SetColor(SwViewOption::GetFontColor()); - - const long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10; - aStdFont.SetFontSize(Size( 0, nFontHeight )); - - long nPreNum = pActNum->Get(0).GetStart(); - - if (bPosition) - { - const long nLineHeight = nFontHeight * 8 / 7; - sal_uInt8 nStart = 0; - while (!(nActLevel & (1 << nStart))) - { - nStart++; - } - if(nStart) // so that possible predecessors and successors are showed - nStart--; - - SwNumberTree::tNumberVector aNumVector; - sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL); - for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel) - { - const SwNumFormat &rFormat = pActNum->Get(nLevel); - aNumVector.push_back(rFormat.GetStart()); - - long nXStart( 0 ); - long nTextOffset( 0 ); - long nNumberXPos( 0 ); - if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nXStart = rFormat.GetAbsLSpace() / nWidthRelation; - nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation; - nNumberXPos = nXStart; - const long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation; - - if(nFirstLineOffset <= nNumberXPos) - nNumberXPos -= nFirstLineOffset; - else - nNumberXPos = 0; - } - else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) - { - const long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation); - nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos; - } - - long nBulletWidth = 0; - if (SVX_NUM_BITMAP == rFormat.GetNumberingType()) - { - nBulletWidth = lcl_DrawGraphic(pVDev.get(), rFormat, nNumberXPos, - nYStart, nWidthRelation); - } - else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType()) - { - nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos, - nYStart, aStdFont.GetFontSize()); - } - else - { - pVDev->SetFont(aStdFont); - if(pActNum->IsContinusNum()) - aNumVector[nLevel] = nPreNum; - OUString aText(pActNum->MakeNumString( aNumVector )); - pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); - nBulletWidth = pVDev->GetTextWidth(aText); - nPreNum++; - } - if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT && - rFormat.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) - { - pVDev->SetFont(aStdFont); - OUString aText(' '); - pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); - nBulletWidth += pVDev->GetTextWidth(aText); - } - - long nTextXPos(0); - if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nTextXPos = nXStart; - if (nTextOffset < 0) - nTextXPos = nTextXPos + nTextOffset; - if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos) - nTextXPos = nNumberXPos + nBulletWidth + nTextOffset; - } - else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) - { - switch (rFormat.GetLabelFollowedBy()) - { - case SvxNumberFormat::LISTTAB: - { - nTextXPos = rFormat.GetListtabPos() / nWidthRelation; - if (nTextXPos < nNumberXPos + nBulletWidth) - { - nTextXPos = nNumberXPos + nBulletWidth; - } - } - break; - case SvxNumberFormat::SPACE: - case SvxNumberFormat::NOTHING: - case SvxNumberFormat::NEWLINE: - { - nTextXPos = nNumberXPos + nBulletWidth; - } - break; - } - - nXStart = rFormat.GetIndentAt() / nWidthRelation; - } - - tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2)); - pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK ); - pVDev->DrawRect(aRect1); - - tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2)); - pVDev->DrawRect(aRect2); - nYStart += 2 * nLineHeight; - } - } - else - { - SwNumberTree::tNumberVector aNumVector; - const long nLineHeight = nFontHeight * 3 / 2; - for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep) - { - const SwNumFormat &rFormat = pActNum->Get(nLevel); - aNumVector.push_back(rFormat.GetStart()); - long nXStart(0); - if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) - { - nXStart = rFormat.GetAbsLSpace() / nWidthRelation; - } - else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) - { - const long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation); - nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart; - } - nXStart /= 2; - nXStart += 2; - long nTextOffset; - if (SVX_NUM_BITMAP == rFormat.GetNumberingType()) - { - lcl_DrawGraphic(pVDev.get(), rFormat, nXStart, nYStart, nWidthRelation); - nTextOffset = nLineHeight + nXStep; - } - else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType()) - { - nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize()); - nTextOffset += nXStep; - } - else - { - pVDev->SetFont(aStdFont); - if (pActNum->IsContinusNum()) - aNumVector[nLevel] = nPreNum; - OUString aText(pActNum->MakeNumString( aNumVector )); - pVDev->DrawText( Point(nXStart, nYStart), aText ); - nTextOffset = pVDev->GetTextWidth(aText) + nXStep; - nPreNum++; - } - pVDev->SetFont(aStdFont); - pVDev->DrawText( - Point(nXStart + nTextOffset, nYStart), - (pOutlineNames == nullptr - ? utl::ConfigManager::getProductName() - : pOutlineNames[nLevel])); - } - } - } rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev); } diff --git a/sw/source/uibase/inc/numprevw.hxx b/sw/source/uibase/inc/numprevw.hxx index ca18922226d9..8b28e2646d9e 100644 --- a/sw/source/uibase/inc/numprevw.hxx +++ b/sw/source/uibase/inc/numprevw.hxx @@ -28,12 +28,7 @@ namespace rtl { class OUString; } class NumberingPreview : public vcl::Window { - const SwNumRule* pActNum; vcl::Font aStdFont; - long nPageWidth; - const OUString* pOutlineNames; - bool bPosition; - sal_uInt16 nActLevel; protected: virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& rRect ) override; @@ -41,8 +36,6 @@ class NumberingPreview : public vcl::Window public: NumberingPreview(vcl::Window* pParent) : Window(pParent) - , pActNum(nullptr),nPageWidth(0), pOutlineNames(nullptr), - bPosition(false), nActLevel(USHRT_MAX) { } diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx index 3a90c7567cdd..5ee2a6f2d088 100644 --- a/sw/source/uibase/inc/prcntfld.hxx +++ b/sw/source/uibase/inc/prcntfld.hxx @@ -104,8 +104,6 @@ class SW_DLLPUBLIC SwPercentField int nLastValue; sal_uInt16 nOldDigits; FieldUnit eOldUnit; - bool bLockAutoCalculation; //prevent recalculation of percent values when the - //reference value is changed SAL_DLLPRIVATE static int ImpPower10(sal_uInt16 n); diff --git a/sw/source/uibase/utlui/prcntfld.cxx b/sw/source/uibase/utlui/prcntfld.cxx index 5ded25dcd4d2..76715f8c0d28 100644 --- a/sw/source/uibase/utlui/prcntfld.cxx +++ b/sw/source/uibase/utlui/prcntfld.cxx @@ -287,7 +287,6 @@ SwPercentField::SwPercentField(weld::MetricSpinButton* pControl) , nLastValue(-1) , nOldDigits(m_pField->get_digits()) , eOldUnit(FUNIT_NONE) - , bLockAutoCalculation(false) { int nMin, nMax; m_pField->get_range(nMin, nMax, FUNIT_TWIP); @@ -301,7 +300,7 @@ void SwPercentField::SetRefValue(int nValue) nRefValue = nValue; - if (!bLockAutoCalculation && (m_pField->get_unit() == FUNIT_PERCENT)) + if (m_pField->get_unit() == FUNIT_PERCENT) SetPrcntValue(nRealValue, eOldUnit); } |