diff options
author | melikeyurtoglu <aysemelikeyurtoglu@gmail.com> | 2016-10-16 15:26:43 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-02 09:23:27 +0000 |
commit | 9937b8daa7c6b8012d9ce4f936e239d87f34a0d1 (patch) | |
tree | e06be5d0009110a8cb7813bc8b76027d598761a4 | |
parent | 8e904d334cbf3c10202d486e0b6e2e58edec3f9c (diff) |
tdf#91222 VclBuilder constructor cleanup
Change-Id: I9a82ebc57c7e246841fda0262763fa9a7fbd5970
Signed-off-by: melikeyurtoglu <aysemelikeyurtoglu@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/29919
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/vcl/builderfactory.hxx | 10 | ||||
-rw-r--r-- | sw/source/ui/config/optload.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.cxx | 9 |
3 files changed, 12 insertions, 16 deletions
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx index f2d0c4cf96ff..423152221d8e 100644 --- a/include/vcl/builderfactory.hxx +++ b/include/vcl/builderfactory.hxx @@ -31,6 +31,16 @@ rRet = VclPtr<typeName>::Create(pParent,arg1); \ } +#define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName,arg2) \ + VCL_BUILDER_DECL_FACTORY(typeName) \ + { \ + OString sBorder = VclBuilder::extractCustomProperty(rMap); \ + WinBits wb = arg2; \ + if (!sBorder.isEmpty()) \ + wb |= WB_BORDER; \ + rRet = VclPtr<typeName>::Create(pParent,wb); \ + } + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index aba994138a24..49537401187f 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -389,14 +389,7 @@ SwCaptionPreview::SwCaptionPreview(vcl::Window* pParent, WinBits nStyle) maDrawPos = Point(4, 6); } -VCL_BUILDER_DECL_FACTORY(SwCaptionPreview) -{ - WinBits nBits = 0; - OString sBorder = VclBuilder::extractCustomProperty(rMap); - if (!sBorder.isEmpty()) - nBits |= WB_BORDER; - rRet = VclPtr<SwCaptionPreview>::Create(pParent, nBits); -} +VCL_BUILDER_FACTORY_CONSTRUCTOR(SwCaptionPreview, 0) void SwCaptionPreview::ApplySettings(vcl::RenderContext& rRenderContext) { diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 105fab557a0c..07526e03c151 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1268,14 +1268,7 @@ void DDListBox::dispose() SvTreeListBox::dispose(); } -VCL_BUILDER_DECL_FACTORY(DDListBox) -{ - WinBits nWinStyle = WB_TABSTOP; - OString sBorder = VclBuilder::extractCustomProperty(rMap); - if (!sBorder.isEmpty()) - nWinStyle |= WB_BORDER; - rRet = VclPtr<DDListBox>::Create(pParent, nWinStyle); -} +VCL_BUILDER_FACTORY_CONSTRUCTOR(DDListBox, WB_TABSTOP) void DDListBox::SetAddressDialog(SwCustomizeAddressBlockDialog *pParent) { |