[Libreoffice-commits] core.git: include/svx svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 07:59:30 UTC 2018


 include/svx/paraprev.hxx       |   25 -----------
 svx/source/dialog/paraprev.cxx |   91 -----------------------------------------
 2 files changed, 116 deletions(-)

New commits:
commit f00312e7fa960b64accd25c3a55533f61893daae
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 19 16:54:28 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 20 09:59:01 2018 +0200

    drop unused SvxParaPrevWindow
    
    Change-Id: Ie217864bc9a5d8dd08d75a651b0826a07b9f1ed9
    Reviewed-on: https://gerrit.libreoffice.org/60776
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/paraprev.hxx b/include/svx/paraprev.hxx
index 6cfb7f824d0e..62b8eda4ab80 100644
--- a/include/svx/paraprev.hxx
+++ b/include/svx/paraprev.hxx
@@ -35,31 +35,6 @@ enum class SvxPrevLineSpace
     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
 {
     Size                aSize;
diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx
index 081a362e0149..0ac65ad075a9 100644
--- a/svx/source/dialog/paraprev.cxx
+++ b/svx/source/dialog/paraprev.cxx
@@ -22,97 +22,6 @@
 #include <vcl/builderfactory.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() :
     nLeftMargin     ( 0 ),
     nRightMargin    ( 0 ),


More information about the Libreoffice-commits mailing list