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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 06:23:49 UTC 2018


 include/svx/dlgctrl.hxx         |    8 ------
 include/svx/itemwin.hxx         |    4 ++-
 svx/source/dialog/dlgctrl.cxx   |   43 ------------------------------------
 svx/source/tbxctrls/itemwin.cxx |   47 +++++++++++++++++++++++++++++++++++-----
 4 files changed, 45 insertions(+), 57 deletions(-)

New commits:
commit efa4c68c35a0074657b016e0132446e72385c725
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 12 14:52:04 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Dec 13 07:23:24 2018 +0100

    loplugin:mergeclasses merge LineLB into SvxLineBox
    
    Change-Id: I76bab66b09ae809c069f586ccb1c4ce13fa30234
    Reviewed-on: https://gerrit.libreoffice.org/65025
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 64205752626e..fd51e5264dd3 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -227,14 +227,6 @@ public:
 
 /************************************************************************/
 
-class SAL_WARN_UNUSED SVX_DLLPUBLIC LineLB : public ListBox
-{
-public:
-    LineLB(vcl::Window* pParent);
-
-    void Fill(const XDashListRef &pList);
-};
-
 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxLineLB
 {
 private:
diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx
index a50126eb6440..ac910a8f6fc5 100644
--- a/include/svx/itemwin.hxx
+++ b/include/svx/itemwin.hxx
@@ -28,7 +28,7 @@ class XLineColorItem;
 class XLineWidthItem;
 class SfxObjectShell;
 
-class SvxLineBox : public LineLB
+class SvxLineBox : public ListBox
 {
     sal_uInt16      nCurPos;
     Timer           aDelayTimer;
@@ -47,6 +47,8 @@ public:
 
     void FillControl();
 
+    void Fill(const XDashListRef &pList);
+
 protected:
     virtual void    Select() override;
     virtual bool    PreNotify( NotifyEvent& rNEvt ) override;
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 9b3d6f8eb135..225f044613ea 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -922,49 +922,6 @@ void FillTypeLB::Fill()
     SetUpdateMode( true );
 }
 
-LineLB::LineLB(vcl::Window* pParent)
-:   ListBox(pParent, WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL)
-{
-    // No EdgeBlending for LineStyle/Dash SetEdgeBlending(true);
-}
-
-// Fills the listbox (provisional) with strings
-
-void LineLB::Fill( const XDashListRef &pList )
-{
-    Clear();
-
-    if( !pList.is() )
-        return;
-
-    // entry for 'none'
-    InsertEntry(pList->GetStringForUiNoLine());
-
-    // entry for solid line
-    InsertEntry(pList->GetStringForUiSolidLine(),
-            Image(pList->GetBitmapForUISolidLine()));
-
-    // entries for dashed lines
-
-    long nCount = pList->Count();
-    SetUpdateMode( false );
-
-    for( long i = 0; i < nCount; i++ )
-    {
-        const XDashEntry* pEntry = pList->GetDash(i);
-        const BitmapEx aBitmap = pList->GetUiBitmap( i );
-        if( !aBitmap.IsEmpty() )
-        {
-            InsertEntry(pEntry->GetName(), Image(aBitmap));
-        }
-        else
-            InsertEntry( pEntry->GetName() );
-    }
-
-    AdaptDropDownLineCountToMaximum();
-    SetUpdateMode( true );
-}
-
 SvxLineLB::SvxLineLB(std::unique_ptr<weld::ComboBox> pControl)
     : m_xControl(std::move(pControl))
     , mbAddStandardFields(true)
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 03725e3868f4..1b523ef49afd 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -51,7 +51,7 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::beans;
 
 SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame ) :
-    LineLB( pParent ),
+    ListBox(pParent, WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL),
     nCurPos     ( 0 ),
     aLogicalSize(40,140),
     bRelease    ( true ),
@@ -67,6 +67,43 @@ SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame
 }
 
 
+// Fills the listbox (provisional) with strings
+
+void SvxLineBox::Fill( const XDashListRef &pList )
+{
+    Clear();
+
+    if( !pList.is() )
+        return;
+
+    // entry for 'none'
+    InsertEntry(pList->GetStringForUiNoLine());
+
+    // entry for solid line
+    InsertEntry(pList->GetStringForUiSolidLine(),
+            Image(pList->GetBitmapForUISolidLine()));
+
+    // entries for dashed lines
+
+    long nCount = pList->Count();
+    SetUpdateMode( false );
+
+    for( long i = 0; i < nCount; i++ )
+    {
+        const XDashEntry* pEntry = pList->GetDash(i);
+        const BitmapEx aBitmap = pList->GetUiBitmap( i );
+        if( !aBitmap.IsEmpty() )
+        {
+            InsertEntry(pEntry->GetName(), Image(aBitmap));
+        }
+        else
+            InsertEntry( pEntry->GetName() );
+    }
+
+    AdaptDropDownLineCountToMaximum();
+    SetUpdateMode( true );
+}
+
 IMPL_LINK_NOARG(SvxLineBox, DelayHdl_Impl, Timer *, void)
 {
     if ( GetEntryCount() == 0 )
@@ -80,7 +117,7 @@ IMPL_LINK_NOARG(SvxLineBox, DelayHdl_Impl, Timer *, void)
 void SvxLineBox::Select()
 {
     // Call the parent's Select() member to trigger accessibility events.
-    LineLB::Select();
+    ListBox::Select();
 
     if ( IsTravelSelect() )
         return;
@@ -166,13 +203,13 @@ bool SvxLineBox::PreNotify( NotifyEvent& rNEvt )
         default:
         break;
     }
-    return LineLB::PreNotify( rNEvt );
+    return ListBox::PreNotify( rNEvt );
 }
 
 
 bool SvxLineBox::EventNotify( NotifyEvent& rNEvt )
 {
-    bool bHandled = LineLB::EventNotify( rNEvt );
+    bool bHandled = ListBox::EventNotify( rNEvt );
 
     if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
     {
@@ -221,7 +258,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt )
         SetSizePixel(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont)));
     }
 
-    LineLB::DataChanged( rDCEvt );
+    ListBox::DataChanged( rDCEvt );
 }
 
 void SvxLineBox::FillControl()


More information about the Libreoffice-commits mailing list