Kaydet (Commit) f00312e7 authored tarafından Caolán McNamara's avatar Caolán McNamara

drop unused SvxParaPrevWindow

Change-Id: Ie217864bc9a5d8dd08d75a651b0826a07b9f1ed9
Reviewed-on: https://gerrit.libreoffice.org/60776Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 71caf233
...@@ -35,31 +35,6 @@ enum class SvxPrevLineSpace ...@@ -35,31 +35,6 @@ enum class SvxPrevLineSpace
Leading Leading
}; };
class SVX_DLLPUBLIC SvxParaPrevWindow final : public vcl::Window
{
OUString aText;
tools::Rectangle Lines[9];
using Window::Draw;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
virtual Size GetOptimalSize() const override;
void DrawParagraph(vcl::RenderContext& rRenderContext);
public:
SvxParaPrevWindow( vcl::Window* pParent, WinBits nBits);
void SetText( const OUString& rStr ) override
{
aText = rStr;
}
OUString GetText() const override
{
return aText;
}
};
class SVX_DLLPUBLIC ParaPrevWindow final : public weld::CustomWidgetController class SVX_DLLPUBLIC ParaPrevWindow final : public weld::CustomWidgetController
{ {
Size aSize; Size aSize;
......
...@@ -22,97 +22,6 @@ ...@@ -22,97 +22,6 @@
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
SvxParaPrevWindow::SvxParaPrevWindow( vcl::Window* pParent, WinBits nBits) :
Window( pParent, nBits)
{
// Count in Twips by default
SetMapMode(MapMode(MapUnit::MapTwip));
SetBorderStyle(WindowBorderStyle::MONO);
}
VCL_BUILDER_FACTORY_ARGS(SvxParaPrevWindow, WB_BORDER)
Size SvxParaPrevWindow::GetOptimalSize() const
{
return getParagraphPreviewOptimalSize(*this);
}
void SvxParaPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
DrawParagraph(rRenderContext);
}
#define DEF_MARGIN 120
void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
{
Size aWinSize(GetOutputSizePixel());
aWinSize = rRenderContext.PixelToLogic(aWinSize);
Size aTmp(1, 1);
aTmp = PixelToLogic(aTmp);
aWinSize.AdjustWidth( -(aTmp.Width() /2) );
aWinSize.AdjustHeight( -(aTmp.Height() /2) );
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
const Color& rWinColor = rStyleSettings.GetWindowColor();
Color aGrayColor(COL_LIGHTGRAY);
rRenderContext.SetFillColor(rWinColor);
rRenderContext.DrawRect(tools::Rectangle(Point(), aWinSize));
rRenderContext.SetLineColor();
long nH = aWinSize.Height() / 19;
Size aLineSiz(aWinSize.Width() - DEF_MARGIN, nH);
Size aSiz = aLineSiz;
Point aPnt;
aPnt.setX( DEF_MARGIN / 2 );
rRenderContext.SetFillColor(aGrayColor);
for (sal_uInt16 i = 0; i < 9; ++i)
{
if (i == 3)
rRenderContext.SetFillColor(COL_GRAY);
else if (i == 6 )
rRenderContext.SetFillColor(aGrayColor);
aPnt.AdjustY(nH );
if (3 <= i && 5 >= i)
{
long nLW = long();
switch (i)
{
case 3:
nLW = aLineSiz.Width() * 8 / 10;
break;
case 4:
nLW = aLineSiz.Width() * 9 / 10;
break;
case 5:
nLW = aLineSiz.Width() / 2;
break;
}
if (nLW > aSiz.Width())
nLW = aSiz.Width();
aSiz.setWidth( nLW );
}
tools::Rectangle aRect(aPnt, aSiz);
rRenderContext.DrawRect( aRect );
Lines[i] = aRect;
aPnt.AdjustY(nH );
// Reset, recalculate for each line
aPnt.setX( DEF_MARGIN / 2 );
aSiz = aLineSiz;
}
}
ParaPrevWindow::ParaPrevWindow() : ParaPrevWindow::ParaPrevWindow() :
nLeftMargin ( 0 ), nLeftMargin ( 0 ),
nRightMargin ( 0 ), nRightMargin ( 0 ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment