[Libreoffice-commits] core.git: 3 commits - basic/source compilerplugins/clang include/svtools include/svx include/tools include/vcl sc/source svtools/source svx/source tools/source vcl/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Apr 23 06:17:59 UTC 2018


 basic/source/comp/token.cxx                   |    4 --
 basic/source/inc/token.hxx                    |    1 
 compilerplugins/clang/singlevalfields.cxx     |    4 +-
 compilerplugins/clang/singlevalfields.results |   38 ++++++++++++++++++--
 include/svtools/HtmlWriter.hxx                |    1 
 include/svx/galmisc.hxx                       |    1 
 include/svx/svdviter.hxx                      |    2 -
 include/tools/config.hxx                      |    1 
 include/vcl/menubtn.hxx                       |    3 +
 include/vcl/morebtn.hxx                       |    3 +
 sc/source/filter/excel/fontbuff.cxx           |    3 -
 sc/source/filter/inc/lotfntbf.hxx             |    6 ---
 svtools/source/svhtml/HtmlWriter.cxx          |    7 +--
 svx/source/gallery2/galmisc.cxx               |    8 ----
 svx/source/svdraw/svdviter.cxx                |    4 --
 tools/source/generic/config.cxx               |   49 +++-----------------------
 vcl/source/control/menubtn.cxx                |    4 +-
 vcl/source/control/morebtn.cxx                |   22 +----------
 18 files changed, 55 insertions(+), 106 deletions(-)

New commits:
commit d254f8a926d7d3ec4565d01f7a41ad3d9d7c9e87
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Sat Apr 21 19:13:06 2018 +0200

    loplugin:singlevalfields improve unaryoperator
    
    when we see a unaryoperator, unless it's one of a small set, we can
    know (mostly) that the field will not be written.
    there is still a small risk of false+ with code taking references
    via conditional expressions.
    
    Change-Id: I96fa808067576a50e5eaf425338e225b4e0bdd4e
    Reviewed-on: https://gerrit.libreoffice.org/53263
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 60d10ab6a11b..4cb564d0b62e 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -212,7 +212,6 @@ SbiTokenizer::SbiTokenizer( const OUString& rSrc, StarBASIC* pb )
     , nPCol2(0)
     , bEof(false)
     , bEos(true)
-    , bKeywords(true)
     , bAs(false)
     , bErrorIsSymbol(true)
 {
@@ -362,8 +361,7 @@ SbiToken SbiTokenizer::Next()
     }
     else
     {
-        if( eScanType != SbxVARIANT
-         || ( !bKeywords && bSymbol ) )
+        if( eScanType != SbxVARIANT )
             return eCurTok = SYMBOL;
         // valid token?
         short lb = 0;
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index 3f265cefb83e..598d20c15e42 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -107,7 +107,6 @@ protected:
     sal_uInt16  nPLine, nPCol1, nPCol2; // pushback location
     bool bEof;
     bool bEos;
-    bool bKeywords;                 // true, if keywords are parsed
     bool bAs;                       // last keyword was AS
     bool bErrorIsSymbol;            // Handle Error token as Symbol, not keyword
 public:
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx
index eb510449b9ac..e24781e3a099 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -307,8 +307,8 @@ bool SingleValFields::VisitMemberExpr( const MemberExpr* memberExpr )
                 bPotentiallyAssignedTo = true;
                 break;
             }
-            child = parent;
-            parent = getParentStmt(parent);
+            // cannot be assigned to anymore
+            break;
         }
         else if (isa<CallExpr>(parent))
         {
diff --git a/compilerplugins/clang/singlevalfields.results b/compilerplugins/clang/singlevalfields.results
index 74a90ed39e47..01cb5880d1b8 100644
--- a/compilerplugins/clang/singlevalfields.results
+++ b/compilerplugins/clang/singlevalfields.results
@@ -1,9 +1,15 @@
+basic/source/inc/token.hxx:110
+    SbiTokenizer bKeywords
+    1
 chart2/source/model/main/DataPoint.hxx:107
     chart::DataPoint m_bNoParentPropAllowed
     0
 chart2/source/view/inc/GL3DRenderer.hxx:161
     chart::opengl3D::TextInfoBatch batchNum
     512
+connectivity/source/inc/dbase/DIndexIter.hxx:37
+    connectivity::dbase::OIndexIterator m_pOperand
+    0
 include/basic/sbxvar.hxx:70
     SbxValues::(anonymous) pData
     0
@@ -19,18 +25,30 @@ include/filter/msfilter/dffpropset.hxx:35
 include/o3tl/vector_pool.hxx:93
     o3tl::detail::struct_from_value::type nextFree
     -1
-include/sfx2/charwin.hxx:105
-    SvxCharViewControl maHasInsert
+include/oox/dump/dumperbase.hxx:1661
+    oox::dump::RecordObjectBase mbBinaryOnly
+    0
+include/oox/ole/axcontrol.hxx:427
+    oox::ole::ComCtlModelBase mbCommonPart
     1
+include/oox/ole/axcontrol.hxx:428
+    oox::ole::ComCtlModelBase mbComplexPart
+    1
+include/svtools/HtmlWriter.hxx:29
+    HtmlWriter mbContentWritten
+    0
 include/svtools/svparser.hxx:74
     SvParser::TokenStackType nTokenValue
     0
 include/svtools/svparser.hxx:75
     SvParser::TokenStackType bTokenHasValue
     0
-include/svx/svdograf.hxx:107
-    SdrGrafObj mbIsPreview
+include/svx/svdviter.hxx:73
+    SdrViewIter mbNoMasterPage
     0
+include/tools/config.hxx:36
+    Config mnLockCount
+    1
 include/vcl/filter/pdfdocument.hxx:174
     vcl::filter::PDFNameElement m_nLength
     0
@@ -136,6 +154,15 @@ sw/source/filter/ww8/ww8par.hxx:655
 sw/source/filter/ww8/ww8par.hxx:664
     WW8FormulaControl mhpsCheckBox
     20
+sw/source/uibase/inc/envlop.hxx:66
+    SwEnvDlg pAddresseeSet
+    0
+sw/source/uibase/inc/envlop.hxx:67
+    SwEnvDlg pSenderSet
+    0
+unotools/source/config/saveopt.cxx:77
+    SvtSaveOptions_Impl bROUserAutoSave
+    0
 vcl/inc/salprn.hxx:41
     SalPrinterQueueInfo mnStatus
     0
@@ -157,6 +184,9 @@ vcl/inc/svdata.hxx:285
 vcl/inc/svdata.hxx:287
     ImplSVNWFData mbProgressNeedsErase
     0
+vcl/source/control/morebtn.cxx:26
+    ImplMoreButtonData mpItemList
+    0
 vcl/source/filter/jpeg/transupp.h:128
     (anonymous) perfect
     0
diff --git a/include/svtools/HtmlWriter.hxx b/include/svtools/HtmlWriter.hxx
index 25030f6dffe8..49f2aa6c02f2 100644
--- a/include/svtools/HtmlWriter.hxx
+++ b/include/svtools/HtmlWriter.hxx
@@ -26,7 +26,6 @@ private:
     SvStream& mrStream;
 
     bool mbElementOpen;
-    bool mbContentWritten;
     bool mbCharactersWritten;
     bool mbPrettyPrint;
     /// XML namespace, in case of XHTML.
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index 0bdcbffa86d3..fbc3a4bc9a98 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -144,7 +144,6 @@ using TransferableHelper::CopyToClipboard;
     sal_uInt32                      mnObjectPos;
     tools::SvRef<SotStorageStream>             mxModelStream;
     GraphicObject*                  mpGraphicObject;
-    ImageMap*                       mpImageMap;
     INetURLObject*                  mpURL;
 
                                     GalleryTransferable( GalleryTheme* pTheme, sal_uInt32 nObjectPos, bool bLazy );
diff --git a/include/svx/svdviter.hxx b/include/svx/svdviter.hxx
index 090001fe60f0..125a4c5e6180 100644
--- a/include/svx/svdviter.hxx
+++ b/include/svx/svdviter.hxx
@@ -70,8 +70,6 @@ class SVX_DLLPUBLIC SdrViewIter
 
     size_t                                              mnListenerNum;
 
-    bool                                                mbNoMasterPage : 1;
-
 private:
     SVX_DLLPRIVATE void          ImpInitVars();
     SVX_DLLPRIVATE SdrView*      ImpFindView();
diff --git a/include/tools/config.hxx b/include/tools/config.hxx
index 8d1e853d1f07..d6a00aa61d64 100644
--- a/include/tools/config.hxx
+++ b/include/tools/config.hxx
@@ -33,7 +33,6 @@ private:
     ImplConfigData*     mpData;
     ImplGroupData*      mpActGroup;
     sal_uInt32          mnDataUpdateId;
-    sal_uInt16          mnLockCount;
 
     TOOLS_DLLPRIVATE bool           ImplUpdateConfig() const;
     TOOLS_DLLPRIVATE ImplGroupData* ImplGetGroup() const;
diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx
index 52461ffde7f6..05416a6b8a3a 100644
--- a/sc/source/filter/excel/fontbuff.cxx
+++ b/sc/source/filter/excel/fontbuff.cxx
@@ -50,9 +50,6 @@ void LotusFontBuffer::Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet )
     if( pCurrent->pHeight )
         rItemSet.Put( *pCurrent->pHeight );
 
-    if( pCurrent->pColor )
-        rItemSet.Put( *pCurrent->pColor );
-
     if( nIndex & 0x08 )
     {
         SvxWeightItem aWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT );
diff --git a/sc/source/filter/inc/lotfntbf.hxx b/sc/source/filter/inc/lotfntbf.hxx
index 158612e9385f..cb42d5ed7e65 100644
--- a/sc/source/filter/inc/lotfntbf.hxx
+++ b/sc/source/filter/inc/lotfntbf.hxx
@@ -35,14 +35,12 @@ private:
         OUString*           pTmpName;
         SvxFontItem*        pFont;
         SvxFontHeightItem*  pHeight;
-        SvxColorItem*       pColor;
-        sal_Int32               nType;      // < 0 -> undefiniert
+        sal_Int32           nType;      // < 0 -> undefined
         ENTRY()
                             {
                                 pTmpName = nullptr;
                                 pFont = nullptr;
                                 pHeight = nullptr;
-                                pColor = nullptr;
                                 nType = -1;
                             }
         ~ENTRY()
@@ -53,8 +51,6 @@ private:
                                     delete pFont;
                                 if( pHeight )
                                     delete pHeight;
-                                if( pColor )
-                                    delete pColor;
                             }
         void         TmpName( const OUString &rNew )
                             {
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
index 631a56e3e1f1..7414b40b15b5 100644
--- a/svtools/source/svhtml/HtmlWriter.cxx
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -14,7 +14,6 @@
 HtmlWriter::HtmlWriter(SvStream& rStream, const OString& rNamespace) :
     mrStream(rStream),
     mbElementOpen(false),
-    mbContentWritten(false),
     mbCharactersWritten(false),
     mbPrettyPrint(true)
 {
@@ -38,9 +37,8 @@ void HtmlWriter::start(const OString& aElement)
     if (mbElementOpen)
     {
         mrStream.WriteChar('>');
-        if (!mbContentWritten && mbPrettyPrint)
+        if (mbPrettyPrint)
             mrStream.WriteChar('\n');
-        mbContentWritten = false;
     }
     maElementStack.push_back(aElement);
 
@@ -92,7 +90,7 @@ void HtmlWriter::end()
     }
     else
     {
-        if (!mbContentWritten && mbPrettyPrint)
+        if (mbPrettyPrint)
         {
             for(size_t i = 0; i < maElementStack.size() - 1; i++)
             {
@@ -107,7 +105,6 @@ void HtmlWriter::end()
     }
     maElementStack.pop_back();
     mbElementOpen = false;
-    mbContentWritten = false;
     mbCharactersWritten = false;
 }
 
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 6469a4a5bea9..5cc0006b9c7e 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -380,7 +380,6 @@ GalleryTransferable::GalleryTransferable( GalleryTheme* pTheme, sal_uInt32 nObje
     meObjectKind( mpTheme->GetObjectKind( nObjectPos ) ),
     mnObjectPos( nObjectPos ),
     mpGraphicObject( nullptr ),
-    mpImageMap( nullptr ),
     mpURL( nullptr )
 {
 
@@ -496,11 +495,6 @@ bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, cons
     {
         bRet = ( mxModelStream.is() && SetObject( mxModelStream.get(), 0, rFlavor ) );
     }
-    else if( ( SotClipboardFormatId::SVIM == nFormat ) && mpImageMap )
-    {
-        // TODO/MBA: do we need a BaseURL here?!
-        bRet = SetImageMap( *mpImageMap );
-    }
     else if( ( SotClipboardFormatId::SIMPLE_FILE == nFormat ) && mpURL )
     {
         bRet = SetString( mpURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ), rFlavor );
@@ -552,8 +546,6 @@ void GalleryTransferable::ObjectReleased()
     mxModelStream.clear();
     delete mpGraphicObject;
     mpGraphicObject = nullptr;
-    delete mpImageMap;
-    mpImageMap = nullptr;
     delete mpURL;
     mpURL = nullptr;
 }
diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx
index 044526e6e638..d77f7a3780fc 100644
--- a/svx/source/svdraw/svdviter.cxx
+++ b/svx/source/svdraw/svdviter.cxx
@@ -40,7 +40,6 @@ SdrViewIter::SdrViewIter(const SdrPage* pPage)
     mpPage = pPage;
     mpModel = pPage ? &pPage->getSdrModelFromSdrPage() : nullptr;
     mpObject = nullptr;
-    mbNoMasterPage = false;
     ImpInitVars();
 }
 
@@ -50,7 +49,6 @@ SdrViewIter::SdrViewIter(const SdrObject* pObject)
     mpObject = pObject;
     mpModel = pObject ? &pObject->getSdrModelFromSdrObject() : nullptr;
     mpPage = pObject ? pObject->GetPage() : nullptr;
-    mbNoMasterPage = false;
 
     if(!mpModel || !mpPage)
     {
@@ -86,7 +84,7 @@ bool SdrViewIter::ImpCheckPageView(SdrPageView const * pPV) const
             return true;
         }
     }
-    else if(!mbNoMasterPage && bMaster && (!mpObject || !mpObject->IsNotVisibleAsMaster()))
+    else if(bMaster && (!mpObject || !mpObject->IsNotVisibleAsMaster()))
     {
         if(pPg->TRG_HasMasterPage())
         {
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index b5f392de5556..55ce2bdc03b8 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -658,7 +658,6 @@ Config::Config( const OUString& rFileName )
     mpData          = ImplGetConfigData( maFileName );
     mpActGroup      = nullptr;
     mnDataUpdateId  = 0;
-    mnLockCount     = 1;
 
     SAL_INFO("tools.generic", "Config::Config( " << maFileName << " )");
 }
@@ -684,7 +683,7 @@ void Config::SetGroup(const OString& rGroup)
 void Config::DeleteGroup(const OString& rGroup)
 {
     // Update config data if necessary
-    if ( !mnLockCount || !mpData->mbRead )
+    if ( !mpData->mbRead )
     {
         ImplUpdateConfig();
         mpData->mbRead = true;
@@ -721,12 +720,7 @@ void Config::DeleteGroup(const OString& rGroup)
         delete pGroup;
 
         // Rewrite config data
-        if ( !mnLockCount )
-            ImplWriteConfig( mpData );
-        else
-        {
-            mpData->mbModified = true;
-        }
+        mpData->mbModified = true;
 
         mnDataUpdateId = mpData->mnDataUpdateId;
         mpData->mnDataUpdateId++;
@@ -735,10 +729,6 @@ void Config::DeleteGroup(const OString& rGroup)
 
 OString Config::GetGroupName(sal_uInt16 nGroup) const
 {
-    // Update config data if necessary
-    if ( !mnLockCount )
-        ImplUpdateConfig();
-
     ImplGroupData*  pGroup = mpData->mpFirstGroup;
     sal_uInt16          nGroupCount = 0;
     OString aGroupName;
@@ -759,10 +749,6 @@ OString Config::GetGroupName(sal_uInt16 nGroup) const
 
 sal_uInt16 Config::GetGroupCount() const
 {
-    // Update config data if necessary
-    if ( !mnLockCount )
-        ImplUpdateConfig();
-
     ImplGroupData*  pGroup = mpData->mpFirstGroup;
     sal_uInt16          nGroupCount = 0;
     while ( pGroup )
@@ -776,10 +762,6 @@ sal_uInt16 Config::GetGroupCount() const
 
 bool Config::HasGroup(const OString& rGroup) const
 {
-    // Update config data if necessary
-    if ( !mnLockCount )
-        ImplUpdateConfig();
-
     ImplGroupData*  pGroup = mpData->mpFirstGroup;
     bool            bRet = false;
 
@@ -807,10 +789,6 @@ OString Config::ReadKey(const OString& rKey, const OString& rDefault) const
     SAL_INFO("tools.generic", "Config::ReadKey( " << rKey << " ) from " << GetGroup()
                       << " in " << maFileName);
 
-    // Update config data if necessary
-    if ( !mnLockCount )
-        ImplUpdateConfig();
-
     // Search key, return value if found
     ImplGroupData* pGroup = ImplGetGroup();
     if ( pGroup )
@@ -834,7 +812,7 @@ void Config::WriteKey(const OString& rKey, const OString& rStr)
                        << GetGroup() << " in " << maFileName);
 
     // Update config data if necessary
-    if ( !mnLockCount || !mpData->mbRead )
+    if ( !mpData->mbRead )
     {
         ImplUpdateConfig();
         mpData->mbRead = true;
@@ -875,12 +853,7 @@ void Config::WriteKey(const OString& rKey, const OString& rStr)
         {
             pKey->maValue = rStr;
 
-            if ( !mnLockCount )
-                ImplWriteConfig( mpData );
-            else
-            {
-                mpData->mbModified = true;
-            }
+            mpData->mbModified = true;
         }
     }
 }
@@ -888,7 +861,7 @@ void Config::WriteKey(const OString& rKey, const OString& rStr)
 void Config::DeleteKey(const OString& rKey)
 {
     // Update config data if necessary
-    if ( !mnLockCount || !mpData->mbRead )
+    if ( !mpData->mbRead )
     {
         ImplUpdateConfig();
         mpData->mbRead = true;
@@ -918,13 +891,7 @@ void Config::DeleteKey(const OString& rKey)
                 pGroup->mpFirstKey = pKey->mpNext;
             delete pKey;
 
-            // Rewrite config file
-            if ( !mnLockCount )
-                ImplWriteConfig( mpData );
-            else
-            {
-                mpData->mbModified = true;
-            }
+            mpData->mbModified = true;
         }
     }
 }
@@ -933,10 +900,6 @@ sal_uInt16 Config::GetKeyCount() const
 {
     SAL_INFO("tools.generic", "Config::GetKeyCount() from " << GetGroup() << " in " << maFileName);
 
-    // Update config data if necessary
-    if ( !mnLockCount )
-        ImplUpdateConfig();
-
     // Search key and update value
     sal_uInt16 nCount = 0;
     ImplGroupData* pGroup = ImplGetGroup();
commit 7c08c1af7116346f2dc0b669e231d82f4230a8c7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Apr 20 17:10:00 2018 +0200

    loplugin:useuniqueptr in MenuButton
    
    Change-Id: I4e7a2ca5f8bb645e99414b1c99dc6261310c89bb
    Reviewed-on: https://gerrit.libreoffice.org/53237
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index dfbb39962139..99ddf2bdb1e2 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -22,6 +22,7 @@
 
 #include <vcl/button.hxx>
 #include <vcl/dllapi.h>
+#include <memory>
 
 class FloatingWindow;
 class Timer;
@@ -34,7 +35,7 @@ class VCL_DLLPUBLIC MenuButton : public PushButton
 private:
     friend class VclBuilder;
 
-    Timer*          mpMenuTimer;
+    std::unique_ptr<Timer> mpMenuTimer;
     VclPtr<PopupMenu> mpMenu;
     VclPtr<Window>  mpFloatingWindow;
     sal_uInt16      mnCurItemId;
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 5771f24ab289..0b47bf8dfac8 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -96,7 +96,7 @@ MenuButton::~MenuButton()
 
 void MenuButton::dispose()
 {
-    delete mpMenuTimer;
+    mpMenuTimer.reset();
     mpFloatingWindow.clear();
     mpMenu.clear();
     PushButton::dispose();
@@ -124,7 +124,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
         {
             if ( !mpMenuTimer )
             {
-                mpMenuTimer = new Timer("MenuTimer");
+                mpMenuTimer.reset(new Timer("MenuTimer"));
                 mpMenuTimer->SetInvokeHandler( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
             }
 
commit e098e2d5bf0f0f9452774c133cca23ba7fbd16df
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Apr 20 17:08:47 2018 +0200

    loplugin:useuniqueptr in MoreButton
    
    and remove unused mpItemList field in ImplMoreButtonData
    
    Change-Id: I1eee6958d0f064cec22028399de5fb28e8647617
    Reviewed-on: https://gerrit.libreoffice.org/53236
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/morebtn.hxx b/include/vcl/morebtn.hxx
index 1ee17a348380..4243a1438045 100644
--- a/include/vcl/morebtn.hxx
+++ b/include/vcl/morebtn.hxx
@@ -24,13 +24,14 @@
 #include <vcl/dllapi.h>
 #include <vcl/mapmod.hxx>
 #include <vcl/button.hxx>
+#include <memory>
 
 struct ImplMoreButtonData;
 
 
 class VCL_DLLPUBLIC MoreButton : public PushButton
 {
-    ImplMoreButtonData* mpMBData;
+    std::unique_ptr<ImplMoreButtonData> mpMBData;
     bool                mbState;
 
                         MoreButton( const MoreButton & ) = delete;
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 1bcbee39d9db..6756853fe5ec 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -23,18 +23,15 @@
 
 struct ImplMoreButtonData
 {
-    std::vector< VclPtr<vcl::Window> >*  mpItemList;
     OUString                             maMoreText;
     OUString                             maLessText;
 };
 
 void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
 {
-    mpMBData     = new ImplMoreButtonData;
+    mpMBData.reset(new ImplMoreButtonData);
     mbState      = false;
 
-    mpMBData->mpItemList = nullptr;
-
     PushButton::ImplInit( pParent, nStyle );
 
     mpMBData->maMoreText = Button::GetStandardText( StandardButtonType::More );
@@ -80,8 +77,7 @@ MoreButton::~MoreButton()
 
 void MoreButton::dispose()
 {
-    delete mpMBData->mpItemList;
-    delete mpMBData;
+    mpMBData.reset();
     PushButton::dispose();
 }
 
@@ -98,13 +94,6 @@ void MoreButton::Click()
     // Update the windows according to the status
     if ( mbState )
     {
-        // Show window
-        if ( mpMBData->mpItemList ) {
-            for (VclPtr<Window> & i : *mpMBData->mpItemList) {
-                i->Show();
-            }
-        }
-
         // Adapt dialogbox
         Point aPos( pParent->GetPosPixel() );
         tools::Rectangle aDeskRect( pParent->ImplGetFrameWindow()->GetDesktopRectPixel() );
@@ -127,13 +116,6 @@ void MoreButton::Click()
         // Adapt Dialogbox
         aSize.AdjustHeight( -nDeltaPixel );
         pParent->SetSizePixel( aSize );
-
-        // Hide window(s) again
-        if ( mpMBData->mpItemList ) {
-            for (VclPtr<Window> & i : *mpMBData->mpItemList) {
-                i->Hide();
-            }
-        }
     }
     // Call Click handler here, so that we can initialize the Controls
     PushButton::Click();


More information about the Libreoffice-commits mailing list