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

Caolán McNamara caolanm at redhat.com
Mon Jul 18 08:00:30 UTC 2016


 cui/source/dialogs/iconcdlg.cxx   |   12 +++++++++++-
 cui/source/inc/cuitabarea.hxx     |    1 +
 cui/source/tabpages/tppattern.cxx |   33 ++++++++++++++++++++++++++++++---
 include/svx/dlgctrl.hxx           |   23 -----------------------
 svx/source/dialog/dlgctrl.cxx     |   21 ---------------------
 5 files changed, 42 insertions(+), 48 deletions(-)

New commits:
commit 25ab24b4c4fe748a05a59fb4eba0b2f96e71da38
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 18 08:58:50 2016 +0100

    Resolves: tdf#100896 crash in hyperlink dialog
    
    regression from...
    
    commit 98747742b20c82382ed16b193e7bec175e905978
    Author: Noel Grandin <noel at peralex.com>
    Date:   Fri Jun 24 13:12:25 2016 +0200
    
        loplugin:singlevalfields in cui
    
    which cut too deep
    
    Change-Id: I0e42eed48196c9e037ba343eea93c2c854c0991c

diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 1a89730..fbaaf47 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -412,7 +412,17 @@ void IconChoiceDialog::ActivatePageImpl ()
     {
         if ( !pData->pPage )
         {
-            pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *CreateInputItemSet( mnCurrentPageId ) );
+            const SfxItemSet* pTmpSet = nullptr;
+
+            if ( pSet )
+            {
+                pTmpSet = pSet;
+            }
+
+            if ( pTmpSet )
+                pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *pTmpSet );
+            else
+                pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *CreateInputItemSet( mnCurrentPageId ) );
 
             pData->pPage->Reset( *pSet );
 
commit 1bc9a5a909be343520ce31b7c9a79998fabf65a2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jul 17 21:12:14 2016 +0100

    odd SvxBitmapCtl is used in only one place
    
    Change-Id: I82a4c8f2e36153b0bc59571ce39956637e278fcb

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index aa82276..5d6083d 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -34,6 +34,7 @@
 
 class SdrModel;
 class SdrView;
+class SvxBitmapCtl;
 
 /************************************************************************/
 
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 7cc8aab..b967c75 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -49,6 +49,36 @@
 
 using namespace com::sun::star;
 
+/*************************************************************************
+|* Preview control for the display of bitmaps
+\************************************************************************/
+
+class SvxBitmapCtl
+{
+private:
+    Color           aPixelColor, aBackgroundColor;
+    const sal_uInt16*   pBmpArray;
+
+public:
+    // Constructor: BitmapCtl for SvxPixelCtl
+    SvxBitmapCtl()
+        : pBmpArray(nullptr)
+    {
+    }
+
+    // BitmapCtl: Returns the Bitmap
+    BitmapEx GetBitmapEx()
+    {
+        const Bitmap aRetval(createHistorical8x8FromArray(pBmpArray, aPixelColor, aBackgroundColor));
+
+        return BitmapEx(aRetval);
+    }
+
+    void SetBmpArray( const sal_uInt16* pPixel ) { pBmpArray = pPixel; }
+    void SetPixelColor( Color aColor ) { aPixelColor = aColor; }
+    void SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; }
+};
+
 SvxPatternTabPage::SvxPatternTabPage(  vcl::Window* pParent, const SfxItemSet& rInAttrs) :
 
     SvxTabPage          ( pParent,
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index b9e75e7..92b656c 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -142,27 +142,6 @@ public:
 };
 
 /*************************************************************************
-|* Preview control for the display of bitmaps
-\************************************************************************/
-
-class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBitmapCtl final
-{
-private:
-    Color           aPixelColor, aBackgroundColor;
-    const sal_uInt16*   pBmpArray;
-
-public:
-    SvxBitmapCtl();
-    ~SvxBitmapCtl();
-
-    BitmapEx GetBitmapEx();
-
-    void    SetBmpArray( const sal_uInt16* pPixel ) { pBmpArray = pPixel; }
-    void    SetPixelColor( Color aColor ) { aPixelColor = aColor; }
-    void    SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; }
-};
-
-/*************************************************************************
 |* Control for editing bitmaps
 \************************************************************************/
 
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index e525f5a..cefcb4c 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1103,26 +1103,6 @@ void SvxPixelCtl::Reset()
     Invalidate();
 }
 
-// Constructor: BitmapCtl for SvxPixelCtl
-
-SvxBitmapCtl::SvxBitmapCtl()
-    : pBmpArray(nullptr)
-{
-}
-
-SvxBitmapCtl::~SvxBitmapCtl()
-{
-}
-
-// BitmapCtl: Returns the Bitmap
-
-BitmapEx SvxBitmapCtl::GetBitmapEx()
-{
-    const Bitmap aRetval(createHistorical8x8FromArray(pBmpArray, aPixelColor, aBackgroundColor));
-
-    return BitmapEx(aRetval);
-}
-
 VCL_BUILDER_DECL_FACTORY(ColorLB)
 {
     bool bDropdown = VclBuilder::extractDropdown(rMap);
commit c3addf79d4c67d4f8f3bb2cdba0ecb6b10062636
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jul 17 21:06:32 2016 +0100

    nothing inherits from SvxBitmapCtl
    
    Change-Id: Ie1796caf1a53d0beef3ff456f2c4b32213b8977e

diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 3906e62..b9e75e7 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -145,15 +145,15 @@ public:
 |* Preview control for the display of bitmaps
 \************************************************************************/
 
-class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBitmapCtl
+class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBitmapCtl final
 {
-protected:
+private:
     Color           aPixelColor, aBackgroundColor;
     const sal_uInt16*   pBmpArray;
 
 public:
-            SvxBitmapCtl();
-            ~SvxBitmapCtl();
+    SvxBitmapCtl();
+    ~SvxBitmapCtl();
 
     BitmapEx GetBitmapEx();
 
commit 76258ecb71494ced74c1c4c3e54715976471218e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jul 17 21:04:59 2016 +0100

    SvxBitmapCtl::nLines is never read
    
    Change-Id: Ib03eb766b1f45247204e64543dbf80c24f8608c7

diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 47dad34..7cc8aab 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -263,9 +263,6 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs )
 
 void SvxPatternTabPage::Reset( const SfxItemSet*  )
 {
-    // aLbBitmaps.SelectEntryPos( 0 );
-
-    m_pBitmapCtl->SetLines( m_pCtlPixel->GetLineCount() );
     m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() );
     m_pBitmapCtl->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() );
     m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() );
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 73d05b1..3906e62 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -148,7 +148,6 @@ public:
 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBitmapCtl
 {
 protected:
-    sal_uInt16      nLines;
     Color           aPixelColor, aBackgroundColor;
     const sal_uInt16*   pBmpArray;
 
@@ -159,7 +158,6 @@ public:
     BitmapEx GetBitmapEx();
 
     void    SetBmpArray( const sal_uInt16* pPixel ) { pBmpArray = pPixel; }
-    void    SetLines( sal_uInt16 nLns ) { nLines = nLns; }
     void    SetPixelColor( Color aColor ) { aPixelColor = aColor; }
     void    SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; }
 };
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index fc8cf66..e525f5a 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1106,8 +1106,7 @@ void SvxPixelCtl::Reset()
 // Constructor: BitmapCtl for SvxPixelCtl
 
 SvxBitmapCtl::SvxBitmapCtl()
-    : nLines(0)
-    , pBmpArray(nullptr)
+    : pBmpArray(nullptr)
 {
 }
 


More information about the Libreoffice-commits mailing list