summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-20 17:33:40 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-20 22:43:27 +0200
commit1fc105cec523a081f18ca78fff43e58e3a881232 (patch)
tree6e6030e44e51668f55c6977131733c25129601a0 /cui
parent63de1888f67dc43c30d5a102651b7c2738243efb (diff)
svtools: change these SvTreeListEntry functions to unique_ptr
... parameters to make it clear that they take ownership. Change-Id: I572c5fa6268438a86d0a4fa1d2aef15382cb5607
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx10
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/customize/macropg.cxx10
-rw-r--r--cui/source/dialogs/thesdlg.cxx9
-rw-r--r--cui/source/options/fontsubs.cxx23
-rw-r--r--cui/source/options/optHeaderTabListbox.cxx5
-rw-r--r--cui/source/options/optaboutconfig.cxx52
-rw-r--r--cui/source/options/optfltr.cxx19
-rw-r--r--cui/source/options/optlingu.cxx20
-rw-r--r--cui/source/tabpages/autocdlg.cxx27
-rw-r--r--cui/source/tabpages/macroass.cxx5
11 files changed, 108 insertions, 74 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 6db36dc1bb29..aed91331eee1 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -911,11 +911,13 @@ void SfxAcceleratorConfigPage::CreateCustomItems(SvTreeListEntry* pEntry,
const OUString& sCol1 ,
const OUString& sCol2)
{
- SfxAccCfgLBoxString_Impl* pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1);
- pEntry->ReplaceItem(pStringItem, 1);
+ std::unique_ptr<SfxAccCfgLBoxString_Impl> pStringItem1(
+ new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1));
+ pEntry->ReplaceItem(std::move(pStringItem1), 1);
- pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol2);
- pEntry->ReplaceItem(pStringItem, 2);
+ std::unique_ptr<SfxAccCfgLBoxString_Impl> pStringItem2(
+ new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol2));
+ pEntry->ReplaceItem(std::move(pStringItem2), 2);
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 8e9f09476684..6ad019326631 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2105,7 +2105,7 @@ SvTreeListEntry* SvxConfigPage::InsertEntryIntoUI(
{
// add new popup painter, it gets destructed by the entry
pNewEntry->ReplaceItem(
- new PopupPainter( pNewEntry, aName ),
+ std::unique_ptr<PopupPainter>(new PopupPainter(pNewEntry, aName)),
pNewEntry->ItemCount() - 1 );
}
}
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 0e14b0fc2397..812f5fd97cad 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -554,8 +554,9 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
OUString* pEventName = new OUString( sEventName );
_pE->SetUserData( static_cast<void*>(pEventName) );
OUString sNew( eventURL );
- _pE->ReplaceItem( new IconLBoxString( _pE, 0, sNew,
- &mpImpl->aMacroImg, &mpImpl->aComponentImg ), LB_MACROS_ITEMPOS );
+ _pE->ReplaceItem(std::unique_ptr<IconLBoxString>(new IconLBoxString(
+ _pE, 0, sNew, &mpImpl->aMacroImg, &mpImpl->aComponentImg)),
+ LB_MACROS_ITEMPOS );
rListBox.GetModel()->InvalidateEntry( _pE );
rListBox.Select( _pE );
rListBox.MakeVisible( _pE );
@@ -701,8 +702,9 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
// update the listbox entry
pImpl->pEventLB->SetUpdateMode( false );
- pE->ReplaceItem( new IconLBoxString( pE, 0, sEventURL,
- &pImpl->aMacroImg, &pImpl->aComponentImg ), LB_MACROS_ITEMPOS );
+ pE->ReplaceItem(std::unique_ptr<IconLBoxString>(new IconLBoxString(
+ pE, 0, sEventURL, &pImpl->aMacroImg, &pImpl->aComponentImg)),
+ LB_MACROS_ITEMPOS );
rListBox.GetModel()->InvalidateEntry( pE );
rListBox.Select( pE );
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index c346935c2c79..21c9323c4e27 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -230,10 +230,13 @@ SvTreeListEntry * ThesaurusAlternativesCtrl::AddEntry( sal_Int32 nVal, const OUS
{
aText = OUString::number( nVal ) + ". ";
}
- pEntry->AddItem( new SvLBoxString( pEntry, 0, OUString() ) ); // add empty column
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString(pEntry, 0, OUString()))); // add empty column
aText += rText;
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false ) ); // otherwise crash
- pEntry->AddItem( new AlternativesString( *this, pEntry, 0, aText ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false))); // otherwise crash
+ pEntry->AddItem(std::unique_ptr<AlternativesString>(
+ new AlternativesString( *this, pEntry, 0, aText)));
SetExtraData( pEntry, AlternativesExtraData( rText, bIsHeader ) );
GetModel()->Insert( pEntry );
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index f3888b6474bb..7874a065a23e 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -121,17 +121,18 @@ SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(OUString& rFont1, OUString& rF
if( !pCheckButtonData )
pCheckButtonData = new SvLBoxButtonData( m_pCheckLB );
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false)); // Sonst Puff!
-
- pEntry->AddItem( new SvLBoxButton( pEntry,
- SvLBoxButtonKind_enabledCheckbox, 0,
- pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxButton( pEntry,
- SvLBoxButtonKind_enabledCheckbox, 0,
- pCheckButtonData ) );
-
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont1 ) );
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont2 ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp(
+ pEntry, 0, Image(), Image(), false))); // otherwise boom!
+
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry,
+ SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry,
+ SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
+
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(
+ pEntry, 0, rFont1)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(
+ pEntry, 0, rFont2)));
return pEntry;
}
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 09c8e7e17c16..11eacd707df1 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -71,8 +71,9 @@ void OptHeaderTabListBox::InitEntry( SvTreeListEntry* pEntry, const OUString& rT
{
// initialize all columns with own class (column 0 == Bitmap)
SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nCol ));
- OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, rCol.GetText() );
- pEntry->ReplaceItem( pStr, nCol );
+ std::unique_ptr<OptLBoxString_Impl> pStr(
+ new OptLBoxString_Impl(pEntry, 0, rCol.GetText()));
+ pEntry->ReplaceItem(std::move(pStr), nCol);
}
}
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 2d74ce25c4d2..a87d8098509a 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -202,11 +202,12 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const OUS
bool bInsertToPrefBox)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false)); //It is needed, otherwise causes crash
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rProp));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rStatus));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rType));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rValue));
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false))); //It is needed, otherwise causes crash
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, rProp)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, rStatus)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, rType)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, rValue)));
pEntry->SetUserData( new UserData(rPropertyPath) );
if(bInsertToPrefBox)
@@ -284,13 +285,18 @@ void CuiAboutConfigTabPage::FillItems(const Reference< XNameAccess >& xNameAcces
{
// not leaf node
SvTreeListEntry* pEntry = new SvTreeListEntry;
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, SvTreeListBox::GetDefaultExpandedNodeImage(),
- SvTreeListBox::GetDefaultCollapsedNodeImage(), false));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, seqItems[i]));
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp(pEntry, 0, SvTreeListBox::GetDefaultExpandedNodeImage(),
+ SvTreeListBox::GetDefaultCollapsedNodeImage(), false)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( pEntry, 0, seqItems[i])));
//It is needed, without this the selection line will be truncated.
- pEntry->AddItem( new SvLBoxString( pEntry, 0, ""));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, ""));
- pEntry->AddItem( new SvLBoxString( pEntry, 0, ""));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( pEntry, 0, "")));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( pEntry, 0, "")));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( pEntry, 0, "")));
pEntry->SetUserData( new UserData(xNextNameAccess, lineage + 1) );
pEntry->EnableChildrenOnDemand();
@@ -774,7 +780,8 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
);
if (it != m_prefBoxEntries.end())
{
- it->ReplaceItem( new SvLBoxString( &(*it), 0, sDialogValue ), 4 );
+ it->ReplaceItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( &(*it), 0, sDialogValue)), 4);
SvTreeListEntries::iterator modifiedIt = std::find_if(
m_modifiedPrefBoxEntries.begin(), m_modifiedPrefBoxEntries.end(),
@@ -786,7 +793,9 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
);
if( modifiedIt != m_modifiedPrefBoxEntries.end())
- modifiedIt->ReplaceItem( new SvLBoxString( &(*modifiedIt), 0, sDialogValue ), 4 );
+ modifiedIt->ReplaceItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString(&(*modifiedIt), 0, sDialogValue)),
+ 4);
else
{
SvTreeListEntry *pCloneEntry = new SvTreeListEntry;
@@ -883,13 +892,18 @@ void CuiAboutConfigTabPage::InsertEntry( SvTreeListEntry *pEntry)
if(!hasEntry)
{
pParentEntry = new SvTreeListEntry;
- pParentEntry->AddItem( new SvLBoxContextBmp( pParentEntry, 0, SvTreeListBox::GetDefaultExpandedNodeImage(),
- SvTreeListBox::GetDefaultCollapsedNodeImage(), false));
- pParentEntry->AddItem( new SvLBoxString( pParentEntry, 0, sParentName));
+ pParentEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp(pParentEntry, 0, SvTreeListBox::GetDefaultExpandedNodeImage(),
+ SvTreeListBox::GetDefaultCollapsedNodeImage(), false)));
+ pParentEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString(pParentEntry, 0, sParentName)));
//It is needed, without this the selection line will be truncated.
- pParentEntry->AddItem( new SvLBoxString( pParentEntry, 0, ""));
- pParentEntry->AddItem( new SvLBoxString( pParentEntry, 0, ""));
- pParentEntry->AddItem( new SvLBoxString( pParentEntry, 0, ""));
+ pParentEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString(pParentEntry, 0, "")));
+ pParentEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString(pParentEntry, 0, "")));
+ pParentEntry->AddItem(std::unique_ptr<SvLBoxString>(
+ new SvLBoxString( pParentEntry, 0, "")));
pParentEntry->EnableChildrenOnDemand(false);
m_pPrefBox->Insert( pParentEntry, pGrandParentEntry );
}
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 6ee34bf30f4b..5ede579184e7 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -339,14 +339,17 @@ void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType,
if( !pCheckButtonData )
pCheckButtonData = new SvLBoxButtonData( m_pCheckLB );
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false));
- pEntry->AddItem( new SvLBoxButton( pEntry, loadEnabled? SvLBoxButtonKind_enabledCheckbox :
- SvLBoxButtonKind_disabledCheckbox,
- 0, pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxButton( pEntry, saveEnabled? SvLBoxButtonKind_enabledCheckbox :
- SvLBoxButtonKind_disabledCheckbox,
- 0, pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxString( pEntry, 0, _rTxt ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(
+ new SvLBoxButton(pEntry, loadEnabled ? SvLBoxButtonKind_enabledCheckbox
+ : SvLBoxButtonKind_disabledCheckbox,
+ 0, pCheckButtonData)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(
+ new SvLBoxButton(pEntry, saveEnabled ? SvLBoxButtonKind_enabledCheckbox
+ : SvLBoxButtonKind_disabledCheckbox,
+ 0, pCheckButtonData)));
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, _rTxt)));
pEntry->SetUserData( reinterpret_cast<void*>(_nType) );
m_pCheckLB->Insert( pEntry );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index ab5bea68f699..1de1d71b2efc 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1813,11 +1813,15 @@ SvTreeListEntry* SvxLinguTabPage::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
OUString sEmpty;
if (CBCOL_FIRST == nCol)
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(
+ pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
if (CBCOL_SECOND == nCol)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // empty column
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false));
- pEntry->AddItem( new BrwString_Impl( pEntry, 0, rTxt ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(
+ pEntry, 0, sEmpty))); // empty column
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp(
+ pEntry, 0, Image(), Image(), false)));
+ pEntry->AddItem(std::unique_ptr<BrwString_Impl>(new BrwString_Impl(
+ pEntry, 0, rTxt)));
return pEntry;
}
@@ -1944,11 +1948,11 @@ SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol
OUString sEmpty;
if (CBCOL_FIRST == nCol)
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
if (CBCOL_SECOND == nCol)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // empty column
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false));
- pEntry->AddItem( new BrwStringDic_Impl( pEntry, 0, rTxt ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, sEmpty))); // empty column
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false)));
+ pEntry->AddItem(std::unique_ptr<BrwStringDic_Impl>(new BrwStringDic_Impl(pEntry, 0, rTxt)));
return pEntry;
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index ca6f66834a74..600f5a481758 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -474,19 +474,20 @@ SvTreeListEntry* OfaSwAutoFmtOptionsPage::CreateEntry(OUString& rTxt, sal_uInt16
m_pCheckLB->SetCheckButtonData( pCheckButtonData );
}
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false));
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp(
+ pEntry, 0, Image(), Image(), false)));
OUString sEmpty;
if (nCol == CBCOL_SECOND)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, sEmpty)));
else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
if (nCol == CBCOL_FIRST)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, sEmpty)));
else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
- pEntry->AddItem( new OfaImpBrwString( pEntry, 0, rTxt ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
+ pEntry->AddItem(std::unique_ptr<OfaImpBrwString>(new OfaImpBrwString( pEntry, 0, rTxt)));
return pEntry;
}
@@ -1781,20 +1782,22 @@ SvTreeListEntry* OfaQuoteTabPage::CreateEntry(OUString& rTxt, sal_uInt16 nCol)
m_pSwCheckLB->SetCheckButtonData(pCheckButtonData);
}
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), false));
+ pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(
+ new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false)));
OUString sEmpty;
if (nCol == CBCOL_SECOND)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, sEmpty)));
else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
if (nCol == CBCOL_FIRST)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pEntry, 0, sEmpty)));
else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
+ pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton(
+ pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData)));
- pEntry->AddItem( new OfaImpBrwString( pEntry, 0, rTxt ) );
+ pEntry->AddItem(std::unique_ptr<OfaImpBrwString>(new OfaImpBrwString(pEntry, 0, rTxt)));
return pEntry;
}
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 5bc3697056f6..3d56dbd72d72 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -333,7 +333,7 @@ IMPL_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
}
mpImpl->pEventLB->SetUpdateMode( false );
- pE->ReplaceItem( new SvLBoxString( pE, 0, sScriptURI ), LB_MACROS_ITEMPOS );
+ pE->ReplaceItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(pE, 0, sScriptURI)), LB_MACROS_ITEMPOS);
rListBox.GetModel()->InvalidateEntry( pE );
rListBox.Select( pE );
rListBox.MakeVisible( pE );
@@ -426,7 +426,8 @@ void _SfxMacroTabPage::FillEvents()
if( sOld != sNew )
{
- pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
+ pE->ReplaceItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(
+ pE, 0, sNew)), LB_MACROS_ITEMPOS);
rListBox.GetModel()->InvalidateEntry( pE );
}
}