summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc
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 /sw/source/ui/misc
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 'sw/source/ui/misc')
-rw-r--r--sw/source/ui/misc/outline.cxx188
1 files changed, 0 insertions, 188 deletions
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);
}