summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-11 14:02:42 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-05-12 09:40:38 +0100
commit936a49646738452f7331ed9a47ac015db9ee7295 (patch)
tree7dff1a6db99e3e28b8bc2226d07b29d5f2b5cd0b /svx
parentab81e3bff2a1844be67209bc8947d539edbaf8e6 (diff)
Switch VclBuilder constructors to use VclPtr.
Change-Id: Id35a86eb52bbde6ca09a5e61a0b1a79b23be8faf
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/checklbx.cxx2
-rw-r--r--svx/source/dialog/connctrl.cxx2
-rw-r--r--svx/source/dialog/dlgctrl.cxx24
-rw-r--r--svx/source/dialog/fntctrl.cxx3
-rw-r--r--svx/source/dialog/fontlb.cxx2
-rw-r--r--svx/source/dialog/frmdirlbox.cxx4
-rw-r--r--svx/source/dialog/frmsel.cxx2
-rw-r--r--svx/source/dialog/graphctl.cxx2
-rw-r--r--svx/source/dialog/langbox.cxx8
-rw-r--r--svx/source/dialog/measctrl.cxx2
-rw-r--r--svx/source/dialog/relfld.cxx15
-rw-r--r--svx/source/dialog/txencbox.cxx9
-rw-r--r--svx/source/gallery2/galctrl.cxx2
-rw-r--r--svx/source/tbxctrls/SvxColorValueSet.cxx2
14 files changed, 35 insertions, 44 deletions
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 66527a7132fb..9d131ea7d812 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -37,7 +37,7 @@ VCL_BUILDER_DECL_FACTORY(SvxCheckListBox)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- return new SvxCheckListBox(pParent, nWinStyle);
+ rRet = VclPtr<SvxCheckListBox>::Create(pParent, nWinStyle);
}
void SvxCheckListBox::SetNormalStaticImage(const Image& rNormalStaticImage)
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index a130f9f858fa..7830c5ff786e 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -52,7 +52,7 @@ VCL_BUILDER_DECL_FACTORY(SvxXConnectionPreview)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- return new SvxXConnectionPreview(pParent, nWinStyle);
+ rRet = VclPtr<SvxXConnectionPreview>::Create(pParent, nWinStyle);
}
SvxXConnectionPreview::~SvxXConnectionPreview()
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index ad7c410a690d..3b47422c2ac3 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1141,9 +1141,9 @@ VCL_BUILDER_DECL_FACTORY(ColorLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- ColorLB *pListBox = new ColorLB(pParent, nWinBits);
+ VclPtrInstance<ColorLB> pListBox(pParent, nWinBits);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
// Fills the Listbox with color and strings
@@ -1193,9 +1193,9 @@ VCL_BUILDER_DECL_FACTORY(HatchingLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- HatchingLB *pListBox = new HatchingLB(pParent, nWinStyle);
+ VclPtrInstance<HatchingLB> pListBox(pParent, nWinStyle);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
void HatchingLB::Fill( const XHatchListRef &pList )
@@ -1286,9 +1286,9 @@ VCL_BUILDER_DECL_FACTORY(GradientLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- GradientLB *pListBox = new GradientLB(pParent, nWinStyle);
+ VclPtrInstance<GradientLB> pListBox(pParent, nWinStyle);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
void GradientLB::Fill( const XGradientListRef &pList )
@@ -1402,9 +1402,9 @@ VCL_BUILDER_DECL_FACTORY(BitmapLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- BitmapLB *pListBox = new BitmapLB(pParent, nWinStyle);
+ VclPtrInstance<BitmapLB> pListBox(pParent, nWinStyle);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
namespace
@@ -1575,9 +1575,9 @@ VCL_BUILDER_DECL_FACTORY(LineLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- LineLB *pListBox = new LineLB(pParent, nWinBits);
+ VclPtrInstance<LineLB> pListBox(pParent, nWinBits);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
void LineLB::setAddStandardFields(bool bNew)
@@ -1673,9 +1673,9 @@ VCL_BUILDER_DECL_FACTORY(LineEndLB)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- LineEndLB *pListBox = new LineEndLB(pParent, nWinBits);
+ VclPtrInstance<LineEndLB> pListBox(pParent, nWinBits);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
void LineEndLB::Fill( const XLineEndListRef &pList, bool bStart )
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index a1bb1d4c8289..91c8354ec5f1 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -496,8 +496,7 @@ VCL_BUILDER_DECL_FACTORY(SvxFontPrevWindow)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- SvxFontPrevWindow *pWindow = new SvxFontPrevWindow(pParent, nWinStyle);
- return pWindow;
+ rRet = VclPtr<SvxFontPrevWindow>::Create(pParent, nWinStyle);
}
SvxFontPrevWindow::~SvxFontPrevWindow()
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index 625bbd37f7ac..22720acb7680 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -95,7 +95,7 @@ VCL_BUILDER_DECL_FACTORY(SvxFontListBox)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- return new SvxFontListBox(pParent, nWinStyle);
+ rRet = VclPtr<SvxFontListBox>::Create(pParent, nWinStyle);
}
void SvxFontListBox::InsertFontEntry( const OUString& rString, const vcl::Font& rFont, const Color* pColor )
diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx
index ef87c9f98c10..3614cff40362 100644
--- a/svx/source/dialog/frmdirlbox.cxx
+++ b/svx/source/dialog/frmdirlbox.cxx
@@ -45,9 +45,9 @@ FrameDirectionListBox::FrameDirectionListBox( vcl::Window* pParent, WinBits nBit
VCL_BUILDER_DECL_FACTORY(FrameDirectionListBox)
{
(void)rMap;
- FrameDirectionListBox* pListBox = new FrameDirectionListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
+ VclPtrInstance<FrameDirectionListBox> pListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
pListBox->EnableAutoSize(true);
- return pListBox;
+ rRet = pListBox;
}
void FrameDirectionListBox::InsertEntryValue( const OUString& rString, SvxFrameDirection eDirection, sal_Int32 nPos )
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 567bc36b9e13..2ea626589ffc 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -799,7 +799,7 @@ FrameSelector::~FrameSelector()
VCL_BUILDER_DECL_FACTORY(SvxFrameSelector)
{
(void)rMap;
- return new FrameSelector(pParent);
+ rRet = VclPtr<FrameSelector>::Create(pParent);
}
void FrameSelector::Initialize( FrameSelFlags nFlags )
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index f1b3a9e51717..1587a70f5914 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -80,7 +80,7 @@ VCL_BUILDER_DECL_FACTORY(GraphCtrl)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- return new GraphCtrl(pParent, nWinStyle);
+ rRet = VclPtr<GraphCtrl>::Create(pParent, nWinStyle);
}
GraphCtrl::~GraphCtrl()
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 9311c53b9207..4a4dc6b82604 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -111,9 +111,9 @@ VCL_BUILDER_DECL_FACTORY(SvxLanguageBox)
nBits |= WB_DROPDOWN;
else
nBits |= WB_BORDER;
- SvxLanguageBox *pLanguageBox = new SvxLanguageBox(pParent, nBits);
+ VclPtrInstance<SvxLanguageBox> pLanguageBox(pParent, nBits);
pLanguageBox->EnableAutoSize(true);
- return pLanguageBox;
+ rRet = pLanguageBox;
}
VCL_BUILDER_DECL_FACTORY(SvxLanguageComboBox)
@@ -124,9 +124,9 @@ VCL_BUILDER_DECL_FACTORY(SvxLanguageComboBox)
nBits |= WB_DROPDOWN;
else
nBits |= WB_BORDER;
- SvxLanguageComboBox *pLanguageBox = new SvxLanguageComboBox(pParent, nBits);
+ VclPtrInstance<SvxLanguageComboBox> pLanguageBox(pParent, nBits);
pLanguageBox->EnableAutoSize(true);
- return pLanguageBox;
+ rRet = pLanguageBox;
}
SvxLanguageBoxBase::SvxLanguageBoxBase( bool bCheck )
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index a9c3a9e3f70c..e272f4e53f7e 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -68,7 +68,7 @@ VCL_BUILDER_DECL_FACTORY(SvxXMeasurePreview)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- return new SvxXMeasurePreview(pParent, nWinStyle);
+ rRet = VclPtr<SvxXMeasurePreview>::Create(pParent, nWinStyle);
}
Size SvxXMeasurePreview::GetOptimalSize() const
diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx
index 6e177aa02cb2..96267d955761 100644
--- a/svx/source/dialog/relfld.cxx
+++ b/svx/source/dialog/relfld.cxx
@@ -18,9 +18,7 @@
*/
#include "svx/relfld.hxx"
-#include "vcl/builder.hxx"
-
-
+#include "vcl/builderfactory.hxx"
SvxRelativeField::SvxRelativeField(
vcl::Window *const pParent, WinBits const nBits, FieldUnit const eUnit)
@@ -39,17 +37,16 @@ SvxRelativeField::SvxRelativeField(
SetMax( 9999 );
}
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL
-makeSvxRelativeField(vcl::Window *const pParent, VclBuilder::stringmap & rMap)
+VCL_BUILDER_DECL_FACTORY(SvxRelativeField)
{
OString const custom(VclBuilder::extractCustomProperty(rMap));
FieldUnit const eUnit(VclBuilder::detectUnit(custom));
- SvxRelativeField *const pRet = new SvxRelativeField(pParent,
- WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP, eUnit);
- return pRet;
+ rRet = VclPtr<SvxRelativeField>::Create(pParent,
+ WB_BORDER | WB_SPIN | WB_REPEAT |
+ WB_LEFT | WB_GROUP,
+ eUnit);
}
-
void SvxRelativeField::Modify()
{
MetricField::Modify();
diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index c038a5d365d2..6d6ff38f9dca 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -48,15 +48,12 @@ VCL_BUILDER_DECL_FACTORY(SvxTextEncodingBox)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- SvxTextEncodingBox *pListBox = new SvxTextEncodingBox(pParent, nWinBits);
+ VclPtrInstance<SvxTextEncodingBox> pListBox(pParent, nWinBits);
if (bDropdown)
pListBox->EnableAutoSize(true);
-
- return pListBox;
+ rRet = pListBox;
}
-
-
SvxTextEncodingBox::~SvxTextEncodingBox()
{
disposeOnce();
@@ -68,8 +65,6 @@ void SvxTextEncodingBox::dispose()
ListBox::dispose();
}
-
-
sal_Int32 SvxTextEncodingBox::EncodingToPos_Impl( rtl_TextEncoding nEnc ) const
{
sal_Int32 nCount = GetEntryCount();
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index ba1d4b9a899a..1302046f743d 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -54,7 +54,7 @@ VCL_BUILDER_DECL_FACTORY(GalleryPreview)
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- return new GalleryPreview(pParent, nWinBits);
+ rRet = VclPtr<GalleryPreview>::Create(pParent, nWinBits);
}
Size GalleryPreview::GetOptimalSize() const
diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx
index ef448a40720a..6d9c108745bd 100644
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -37,7 +37,7 @@ VCL_BUILDER_DECL_FACTORY(SvxColorValueSet)
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
- return new SvxColorValueSet(pParent, nWinBits);
+ rRet = VclPtr<SvxColorValueSet>::Create(pParent, nWinBits);
}
sal_uInt32 SvxColorValueSet::getMaxRowCount()