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

Michael Meeks michael.meeks at collabora.com
Sat May 9 12:31:16 PDT 2015


 chart2/source/controller/dialogs/TextDirectionListBox.cxx    |    7 --
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx |    6 -
 chart2/source/controller/dialogs/tp_DataSourceControls.cxx   |    3 
 cui/source/customize/acccfg.cxx                              |    3 
 cui/source/customize/cfgutil.cxx                             |    6 -
 cui/source/customize/macropg.cxx                             |    3 
 cui/source/customize/selector.cxx                            |    5 -
 cui/source/dialogs/SpellDialog.cxx                           |    5 -
 cui/source/dialogs/colorpicker.cxx                           |   12 +--
 cui/source/dialogs/cuicharmap.cxx                            |    6 -
 cui/source/dialogs/cuigrfflt.cxx                             |   11 ---
 cui/source/dialogs/hangulhanjadlg.cxx                        |   17 +----
 cui/source/dialogs/hlmarkwn.cxx                              |    3 
 cui/source/dialogs/hltpbase.cxx                              |    6 -
 cui/source/dialogs/hyphen.cxx                                |    6 -
 cui/source/dialogs/iconcdlg.cxx                              |   11 +--
 cui/source/dialogs/scriptdlg.cxx                             |    6 -
 cui/source/dialogs/thesdlg.cxx                               |   17 +----
 cui/source/options/connpooloptions.cxx                       |    7 --
 cui/source/options/optaboutconfig.cxx                        |    7 --
 cui/source/options/optcolor.cxx                              |    4 -
 cui/source/options/optdict.cxx                               |    9 --
 cui/source/options/optinet2.cxx                              |    8 --
 cui/source/tabpages/autocdlg.cxx                             |   10 ---
 cui/source/tabpages/backgrnd.cxx                             |    5 -
 cui/source/tabpages/grfpage.cxx                              |    4 -
 cui/source/tabpages/numfmt.cxx                               |    6 -
 cui/source/tabpages/numpages.cxx                             |    8 --
 cui/source/tabpages/tabstpge.cxx                             |    7 --
 include/vcl/builderfactory.hxx                               |   35 +++++++++++
 30 files changed, 112 insertions(+), 131 deletions(-)

New commits:
commit cf6bfd666843c1cfc75e453e6e7f0405173a1831
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat May 9 16:46:56 2015 +0100

    tdf#91052 - use macros to standardize 'make' constructors for VclBuilder.
    
    When complete - should ease the switch to VclPtr<>::Create.
    
    Change-Id: Idf876e2eeb830b36dd86e84317277cc88e1dc013

diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
index c3f5e30..a2fd923 100644
--- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx
+++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
@@ -22,7 +22,7 @@
 #include "Strings.hrc"
 #include <svl/languageoptions.hxx>
 #include <vcl/window.hxx>
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 
 namespace chart
 {
@@ -42,10 +42,7 @@ TextDirectionListBox::TextDirectionListBox( vcl::Window* pParent, vcl::Window* p
     }
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTextDirectionListBox(vcl::Window *pParent, VclBuilder::stringmap &)
-     {
-         return new TextDirectionListBox(pParent);
-     }
+VCL_BUILDER_FACTORY(TextDirectionListBox)
 
 } //namespace chart
 
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 6f3805f..a8de059 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -29,6 +29,7 @@
 #include <vcl/msgbox.hxx>
 #include <svx/svx3ditems.hxx>
 #include <svx/svddef.hxx>
+#include <vcl/builderfactory.hxx>
 
 namespace chart
 {
@@ -43,10 +44,7 @@ LightButton::LightButton( vcl::Window* pParent)
     SetModeImage( Image( SVX_RES(RID_SVXIMAGE_LIGHT_OFF)   ) );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLightButton(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new LightButton(pParent);
-}
+VCL_BUILDER_FACTORY(LightButton)
 
 void LightButton::switchLightOn(bool bOn)
 {
diff --git a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx
index 54ecfe6..55eb084 100644
--- a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <vcl/layout.hxx>
+#include <vcl/builderfactory.hxx>
 #include "tp_DataSourceControls.hxx"
 
 using namespace ::com::sun::star;
@@ -35,7 +36,7 @@ SeriesListBox::SeriesListBox(vcl::Window* pParent, WinBits nStyle)
     : SvTreeListBox(pParent, nStyle)
 {}
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSeriesListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SeriesListBox)
 {
     WinBits nWinStyle = 0;
     OString sBorder = VclBuilder::extractCustomProperty(rMap);
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index d929cf0..e4d803d 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -33,6 +33,7 @@
 #include "svtools/treelistentry.hxx"
 
 #include <sal/macros.h>
+#include <vcl/builderfactory.hxx>
 
 #include "cuires.hrc"
 #include "acccfg.hrc"
@@ -652,7 +653,7 @@ void SfxAccCfgLBoxString_Impl::Paint(
 
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxAccCfgTabListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SfxAccCfgTabListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 0d990ca..c74e0e7 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -59,7 +59,7 @@
 #include <unotools/configmgr.hxx>
 #include "dialmgr.hxx"
 #include <svl/stritem.hxx>
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -258,7 +258,7 @@ SfxConfigFunctionListBox::SfxConfigFunctionListBox(vcl::Window* pParent, WinBits
     GetModel()->SetSortMode( SortAscending );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigFunctionListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SfxConfigFunctionListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
@@ -400,7 +400,7 @@ SfxConfigGroupListBox::SfxConfigGroupListBox(vcl::Window* pParent, WinBits nStyl
     SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigGroupListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SfxConfigGroupListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index cd7e84d..ae4daa6 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -39,6 +39,7 @@
 #include "headertablistbox.hxx"
 #include "macropg_impl.hxx"
 #include <svx/dialogs.hrc>
+#include <vcl/builderfactory.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 
 #include <algorithm>
@@ -151,7 +152,7 @@ void MacroEventListBox::dispose()
     Control::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeMacroEventListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(MacroEventListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index a3d6acf..ce1cbca 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -21,6 +21,7 @@
 #include <vcl/msgbox.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/vclmedit.hxx>
+#include <vcl/builderfactory.hxx>
 #include "selector.hxx"
 #include <dialmgr.hxx>
 #include <svx/fmresids.hrc>
@@ -86,7 +87,7 @@ SvxConfigFunctionListBox::SvxConfigFunctionListBox(vcl::Window* pParent, WinBits
         LINK( this, SvxConfigFunctionListBox, TimerHdl ) );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigFunctionListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SvxConfigFunctionListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
@@ -219,7 +220,7 @@ SvxConfigGroupListBox::SvxConfigGroupListBox(vcl::Window* pParent, WinBits nStyl
     );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigGroupListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SvxConfigGroupListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 10bc499..c571832 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -44,6 +44,7 @@
 #include <sfx2/app.hxx>
 #include <vcl/help.hxx>
 #include <vcl/graph.hxx>
+#include <vcl/builderfactory.hxx>
 #include <osl/file.hxx>
 #include <cuires.hrc>
 #include <editeng/optitems.hxx>
@@ -1218,9 +1219,9 @@ SentenceEditWindow_Impl::SentenceEditWindow_Impl(vcl::Window * pParent, WinBits
     DisableSelectionOnFocus();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSentenceEditWindow(vcl::Window *pParent,
-    VclBuilder::stringmap &)
+VCL_BUILDER_DECL_FACTORY(SentenceEditWindow)
 {
+    (void)rMap;
     return new SentenceEditWindow_Impl(pParent, WB_BORDER|WB_VSCROLL|WB_IGNORETAB);
 }
 
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 96bfff0..ee90eb7 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -36,6 +36,7 @@
 #include <vcl/bmpacc.hxx>
 #include <vcl/decoview.hxx>
 #include <vcl/svapp.hxx>
+#include <vcl/builderfactory.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
@@ -151,10 +152,7 @@ HexColorControl::HexColorControl( vcl::Window* pParent, const WinBits& nStyle )
     SetMaxTextLen( 6 );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeHexColorControl(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new HexColorControl(pParent, WB_BORDER);
-}
+VCL_BUILDER_FACTORY_ARGS(HexColorControl, WB_BORDER)
 
 void HexColorControl::SetColor( sal_Int32 nColor )
 {
@@ -274,7 +272,7 @@ ColorPreviewControl::ColorPreviewControl( vcl::Window* pParent, const WinBits& n
     SetLineColor( maColor );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorPreviewControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(ColorPreviewControl)
 {
     WinBits nBits = 0;
 
@@ -370,7 +368,7 @@ void ColorFieldControl::dispose()
     Control::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorFieldControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(ColorFieldControl)
 {
     WinBits nBits = 0;
 
@@ -763,7 +761,7 @@ void ColorSliderControl::dispose()
     Control::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorSliderControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(ColorSliderControl)
 {
     WinBits nBits = 0;
 
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 85d2057..feadbe0 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -30,6 +30,7 @@
 #include <sfx2/objsh.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 #include <svl/stritem.hxx>
 
 #include <cuires.hrc>
@@ -179,10 +180,7 @@ SvxShowText::SvxShowText(vcl::Window* pParent, bool bCenter)
     , mbCenter(bCenter)
 {}
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxShowText(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvxShowText(pParent);
-}
+VCL_BUILDER_FACTORY(SvxShowText)
 
 void SvxShowText::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&)
 {
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index ea1d83c..2edac2d 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 #include <vcl/msgbox.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/viewsh.hxx>
@@ -37,7 +37,7 @@ GraphicPreviewWindow::GraphicPreviewWindow(vcl::Window* pParent,
 {
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeGraphicPreviewWindow(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(GraphicPreviewWindow)
 {
     WinBits nWinBits = WB_TABSTOP;
 
@@ -504,12 +504,7 @@ Size EmbossControl::GetOptimalSize() const
     return LogicToPixel(Size(77, 60), MAP_APPFONT);
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeEmbossControl(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new EmbossControl(pParent);
-}
-
-
+VCL_BUILDER_FACTORY(EmbossControl)
 
 GraphicFilterEmboss::GraphicFilterEmboss(vcl::Window* pParent,
     const Graphic& rGraphic, RECT_POINT eLightSource)
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 69632fa..0ded6c5 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -26,6 +26,7 @@
 #include <algorithm>
 #include <vcl/controllayout.hxx>
 #include <vcl/msgbox.hxx>
+#include <vcl/builderfactory.hxx>
 #include <unotools/lingucfg.hxx>
 #include <unotools/linguprops.hxx>
 #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
@@ -322,11 +323,7 @@ namespace svx
         return minimumSize;
     }
 
-    extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRubyRadioButton( vcl::Window *pParent, VclBuilder::stringmap & )
-    {
-        return new RubyRadioButton( pParent, WB_LEFT|WB_VCENTER );
-    }
-
+    VCL_BUILDER_FACTORY_ARGS(RubyRadioButton, WB_LEFT|WB_VCENTER)
 
     //= SuggestionSet
 
@@ -547,10 +544,7 @@ namespace svx
         m_aListBox->SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
     }
 
-    extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSuggestionDisplay( vcl::Window *pParent, VclBuilder::stringmap & )
-    {
-        return new SuggestionDisplay( pParent, WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
-    }
+    VCL_BUILDER_FACTORY_ARGS( SuggestionDisplay, WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
 
 
     //= HangulHanjaConversionDialog
@@ -1504,10 +1498,7 @@ namespace svx
         m_pNext = pNext;
     }
 
-    extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSuggestionEdit( vcl::Window *pParent, VclBuilder::stringmap & )
-    {
-        return new SuggestionEdit( pParent, WB_LEFT|WB_VCENTER|WB_BORDER );
-    }
+    VCL_BUILDER_FACTORY_ARGS(SuggestionEdit, WB_LEFT|WB_VCENTER|WB_BORDER)
 
     namespace
     {
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index 5af8082..b65bf8c 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -23,6 +23,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/wrkwin.hxx>
+#include <vcl/builderfactory.hxx>
 
 // UNO-Stuff
 #include <comphelper/processfactory.hxx>
@@ -83,7 +84,7 @@ void SvxHlmarkTreeLBox::dispose()
     SvTreeListBox::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHlmarkTreeLBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SvxHlmarkTreeLBox)
 {
     WinBits nWinStyle = WB_TABSTOP;
     OString sBorder = VclBuilder::extractCustomProperty(rMap);
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 9260c68..3be79e6 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -29,6 +29,7 @@
 #include "macroass.hxx"
 #include <svx/svxdlg.hxx>
 #include <cuires.hrc>
+#include <vcl/builderfactory.hxx>
 #include <boost/scoped_ptr.hpp>
 
 using namespace ::ucbhelper;
@@ -41,10 +42,7 @@ SvxHyperURLBox::SvxHyperURLBox( vcl::Window* pParent, INetProtocol eSmart )
 {
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHyperURLBox(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvxHyperURLBox(pParent, INetProtocol::Http);
-}
+VCL_BUILDER_FACTORY_ARGS(SvxHyperURLBox, INetProtocol::Http)
 
 sal_Int8 SvxHyperURLBox::AcceptDrop( const AcceptDropEvent& /* rEvt */ )
 {
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index e124a43..c24e4eb 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -28,6 +28,7 @@
 #include <svx/dialmgr.hxx>
 #include <svx/dlgutil.hxx>
 #include <vcl/msgbox.hxx>
+#include <vcl/builderfactory.hxx>
 
 #define HYPH_POS_CHAR       '='
 #define CONTINUE_HYPH       USHRT_MAX
@@ -41,10 +42,7 @@ HyphenEdit::HyphenEdit(vcl::Window* pParent)
 {
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeHyphenEdit(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new HyphenEdit(pParent);
-}
+VCL_BUILDER_FACTORY(HyphenEdit)
 
 void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
 {
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 6174603..0b77226 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -31,6 +31,7 @@
 #include <vcl/mnemonic.hxx>
 #include <vcl/i18nhelp.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 
 using ::std::vector;
 
@@ -153,12 +154,10 @@ void IconChoicePage::DataChanged( const DataChangedEvent& rDCEvt )
 |
 \**********************************************************************/
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvtIconChoiceCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvtIconChoiceCtrl(pParent, WB_3DLOOK | WB_ICON | WB_BORDER |
-                                 WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
-                                 WB_NODRAGSELECTION | WB_TABSTOP);
-}
+VCL_BUILDER_FACTORY_ARGS(SvtIconChoiceCtrl,
+                         WB_3DLOOK | WB_ICON | WB_BORDER |
+                         WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
+                         WB_NODRAGSELECTION | WB_TABSTOP);
 
 IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
                                      const OUString& rUIXMLDescription,
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 215278a..2a5e29e 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -23,6 +23,7 @@
 #include <sfx2/objsh.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/layout.hxx>
+#include <vcl/builderfactory.hxx>
 #include <osl/mutex.hxx>
 
 #include <cuires.hrc>
@@ -94,10 +95,7 @@ SFTreeListBox::SFTreeListBox(vcl::Window* pParent)
     nMode = 0xFF;    // everything
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSFTreeListBox(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SFTreeListBox(pParent);
-}
+VCL_BUILDER_FACTORY(SFTreeListBox)
 
 SFTreeListBox::~SFTreeListBox()
 {
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 26808a1..aa58d71 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -31,6 +31,7 @@
 #include <vcl/wrkwin.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/svapp.hxx>
+#include <vcl/builderfactory.hxx>
 #include <svx/dlgutil.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/svxerr.hxx>
@@ -77,10 +78,7 @@ void LookUpComboBox::dispose()
     ComboBox::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLookUpComboBox(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new LookUpComboBox(pParent);
-}
+VCL_BUILDER_FACTORY(LookUpComboBox)
 
 void LookUpComboBox::init(SvxThesaurusDialog *pDialog)
 {
@@ -117,11 +115,7 @@ void ReplaceEdit::dispose()
     Edit::dispose();
 }
 
-
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeReplaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new ReplaceEdit(pParent);
-}
+VCL_BUILDER_FACTORY(ReplaceEdit)
 
 void ReplaceEdit::Modify()
 {
@@ -180,10 +174,7 @@ ThesaurusAlternativesCtrl::ThesaurusAlternativesCtrl(vcl::Window* pParent)
     SetHighlightRange();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeThesaurusAlternativesCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new ThesaurusAlternativesCtrl(pParent);
-}
+VCL_BUILDER_FACTORY(ThesaurusAlternativesCtrl)
 
 void ThesaurusAlternativesCtrl::init(SvxThesaurusDialog *pDialog)
 {
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 1e67b36..1ab5e73 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -20,6 +20,7 @@
 #include "connpooloptions.hxx"
 #include <svtools/editbrowsebox.hxx>
 #include <vcl/field.hxx>
+#include <vcl/builderfactory.hxx>
 #include "connpoolsettings.hxx"
 #include <svl/eitem.hxx>
 #include <cuires.hrc>
@@ -99,11 +100,7 @@ namespace offapp
         SetUniqueId(UID_OFA_CONNPOOL_DRIVERLIST_BACK);
     }
 
-    extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeDriverListControl(vcl::Window *pParent, VclBuilder::stringmap &)
-    {
-        return new DriverListControl(pParent);
-    }
-
+    VCL_BUILDER_FACTORY(DriverListControl)
 
     bool DriverListControl::IsTabAllowed(bool /*_bForward*/) const
     {
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 851753d..b246966 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -10,6 +10,7 @@
 #include "optaboutconfig.hxx"
 #include "optHeaderTabListbox.hxx"
 
+#include <vcl/builderfactory.hxx>
 #include <svtools/svlbitm.hxx>
 #include <svtools/treelistentry.hxx>
 #include <comphelper/processfactory.hxx>
@@ -54,11 +55,7 @@ struct Prop_Impl
     {}
 };
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeCuiCustomMultilineEdit(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new CuiCustomMultilineEdit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK);
-}
-
+VCL_BUILDER_FACTORY_ARGS(CuiCustomMultilineEdit,WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
 
 void CuiCustomMultilineEdit::KeyInput( const KeyEvent& rKeyEvent )
 {
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index cbb8a5f..506ca09 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -31,6 +31,7 @@
 #include <unotools/pathoptions.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <svx/svxdlg.hxx>
@@ -927,8 +928,9 @@ void ColorConfigCtrl_Impl::dispose()
     VclVBox::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorConfigCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
+VCL_BUILDER_DECL_FACTORY(ColorConfigCtrl)
 {
+    (void)rMap;
     return new ColorConfigCtrl_Impl(pParent);
 }
 
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 3b78f4c..b1c9973 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -28,6 +28,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/layout.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 #include <svx/dialogs.hrc>
 
 #include <linguistic/misc.hxx>
@@ -217,13 +218,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, ModifyHdl_Impl)
 
 // class SvxEditDictionaryDialog -------------------------------------------
 
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxDictEdit(vcl::Window *pParent, VclBuilder::stringmap&)
-{
-    WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK;
-    return new SvxDictEdit(pParent, nWinStyle);
-};
+VCL_BUILDER_FACTORY_ARGS(SvxDictEdit, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
 
 SvxEditDictionaryDialog::SvxEditDictionaryDialog(
             vcl::Window* pParent,
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 32bcd13..3694490 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -39,6 +39,7 @@
 #include <unotools/bootstrap.hxx>
 #include <vcl/help.hxx>
 #include <vcl/layout.hxx>
+#include <vcl/builderfactory.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <unotools/pathoptions.hxx>
 #include <unotools/securityoptions.hxx>
@@ -99,12 +100,7 @@ using namespace ::sfx2;
 
 #include <sal/config.h>
 
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxNoSpaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvxNoSpaceEdit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK);
-}
+VCL_BUILDER_FACTORY_ARGS(SvxNoSpaceEdit, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
 
 void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent )
 {
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 42dbdb5..35276a4 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <i18nutil/unicode.hxx>
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/field.hxx>
 #include <vcl/keycodes.hxx>
@@ -1752,11 +1752,7 @@ IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt)
     return 0;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeAutoCorrEdit(vcl::Window *pParent,
-    VclBuilder::stringmap &)
-{
-    return new AutoCorrEdit(pParent);
-}
+VCL_BUILDER_FACTORY(AutoCorrEdit)
 
 void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt )
 {
@@ -2461,7 +2457,7 @@ bool OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify(
     return nHandled;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeAutoCompleteMultiListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(AutoCompleteMultiListBox)
 {
     WinBits nWinBits = WB_TABSTOP;
 
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 85dbdbc..2c9998e 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -19,7 +19,7 @@
 
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <unotools/pathoptions.hxx>
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/idle.hxx>
@@ -216,8 +216,9 @@ BackgroundPreviewImpl::BackgroundPreviewImpl(vcl::Window* pParent)
     Invalidate(aDrawRect);
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeBackgroundPreview(vcl::Window *pParent, VclBuilder::stringmap &)
+VCL_BUILDER_DECL_FACTORY(BackgroundPreview)
 {
+    (void)rMap;
     return new BackgroundPreviewImpl(pParent);
 }
 
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 645867a..15c9541 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -32,7 +32,7 @@
 #include <cuires.hrc>
 #include <tools/fract.hxx>
 #include <svx/dialogs.hrc>
-#include <vcl/builder.hxx>
+#include <vcl/builderfactory.hxx>
 #include <vcl/settings.hxx>
 #include <boost/scoped_ptr.hpp>
 
@@ -790,7 +790,7 @@ Size SvxCropExample::GetOptimalSize() const
     return LogicToPixel(Size(78, 78), MAP_APPFONT);
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxCropExample(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+VCL_BUILDER_DECL_FACTORY(SvxCropExample)
 {
     WinBits nWinStyle = 0;
     OString sBorder = VclBuilder::extractCustomProperty(rMap);
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 5720e2d..63b08ef 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -23,6 +23,7 @@
 #include <vcl/builder.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <i18nlangtag/lang.h>
 #include <i18nlangtag/mslangid.hxx>
@@ -89,10 +90,7 @@ SvxNumberPreview::SvxNumberPreview(vcl::Window* pParent, WinBits nStyle)
     SetBorderStyle( WindowBorderStyle::MONO );
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxNumberPreview(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvxNumberPreview(pParent);
-}
+VCL_BUILDER_FACTORY(SvxNumberPreview)
 
 /*************************************************************************
 #*  Method:        NotifyChange
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index fcb392b..f0a3089 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -39,6 +39,7 @@
 #include <vcl/graph.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 #include "cuicharmap.hxx"
 #include <editeng/flstitem.hxx>
 #include <svx/dlgutil.hxx>
@@ -2363,13 +2364,10 @@ SvxNumberingPreview::SvxNumberingPreview(vcl::Window* pParent, WinBits nWinBits)
     SetBorderStyle(WindowBorderStyle::MONO);
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxNumberingPreview(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new SvxNumberingPreview(pParent, WB_BORDER);
-}
+VCL_BUILDER_FACTORY_ARGS(SvxNumberingPreview, WB_BORDER)
 
 // paint preview of numeration
-void    SvxNumberingPreview::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& /*rRect*/ )
+void SvxNumberingPreview::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& /*rRect*/ )
 {
     Size aSize(PixelToLogic(GetOutputSizePixel()));
 
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 1014873..5aee6ef 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -21,6 +21,7 @@
 #include <svtools/ruler.hxx>
 #include <svx/dialogs.hrc>
 #include <vcl/settings.hxx>
+#include <vcl/builderfactory.hxx>
 
 #include <cuires.hrc>
 #include <editeng/lrspitem.hxx>
@@ -59,10 +60,8 @@ public:
     void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; }
 };
 
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTabWin_Impl(vcl::Window *pParent, VclBuilder::stringmap &)
-{
-    return new TabWin_Impl(pParent, 0);
-}
+VCL_BUILDER_FACTORY_ARGS(TabWin_Impl, 0)
+
 // static ----------------------------------------------------------------
 
 const sal_uInt16 SvxTabulatorTabPage::pRanges[] =
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
new file mode 100644
index 0000000..b50a557
--- /dev/null
+++ b/include/vcl/builderfactory.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_VCL_BUILDER_FACTORY_HXX
+#define INCLUDED_VCL_BUILDER_FACTORY_HXX
+
+#include <vcl/builder.hxx>
+
+#define VCL_BUILDER_DECL_FACTORY(typeName) \
+    extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL \
+        make##typeName(vcl::Window *pParent, VclBuilder::stringmap &rMap)
+
+#define VCL_BUILDER_FACTORY(typeName) \
+    VCL_BUILDER_DECL_FACTORY(typeName) \
+    { \
+        (void)rMap; \
+        return new typeName(pParent); \
+    }
+
+#define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \
+    VCL_BUILDER_DECL_FACTORY(typeName) \
+    { \
+        (void)rMap; \
+        return new typeName(pParent,arg1); \
+    }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list