[Libreoffice-commits] core.git: include/vcl sw/source

melikeyurtoglu aysemelikeyurtoglu at gmail.com
Wed Nov 2 09:23:53 UTC 2016


 include/vcl/builderfactory.hxx           |   10 ++++++++++
 sw/source/ui/config/optload.cxx          |    9 +--------
 sw/source/ui/dbui/mmaddressblockpage.cxx |    9 +--------
 3 files changed, 12 insertions(+), 16 deletions(-)

New commits:
commit 9937b8daa7c6b8012d9ce4f936e239d87f34a0d1
Author: melikeyurtoglu <aysemelikeyurtoglu at gmail.com>
Date:   Sun Oct 16 15:26:43 2016 +0300

    tdf#91222 VclBuilder constructor cleanup
    
    Change-Id: I9a82ebc57c7e246841fda0262763fa9a7fbd5970
    Signed-off-by: melikeyurtoglu <aysemelikeyurtoglu at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/29919
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
index f2d0c4cf..4231522 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 aba9941..4953740 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 105fab5..07526e0 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)
 {


More information about the Libreoffice-commits mailing list