[Libreoffice-commits] core.git: 6 commits - avmedia/source basctl/source basebmp/test basic/source bean/native bridges/source canvas/source chart2/source codemaker/inc codemaker/source comphelper/inc connectivity/inc connectivity/source cppcanvas/source cui/source dbaccess/source desktop/source editeng/source extensions/source filter/source forms/source formula/source framework/source hwpfilter/source i18npool/source i18nutil/source idlc/source jvmfwk/source l10ntools/source libpng/StaticLibrary_png.mk lingucomponent/source oox/source package/source padmin/source registry/source remotebridges/source reportdesign/source rsc/source sal/osl sax/source scaddins/source sccomp/source scripting/source sc/source sd/source sfx2/source shell/source solenv/bin solenv/gbuild soltools/cpp sot/source starmath/source stoc/source svtools/source svx/source sw/source toolkit/source tools/source ucb/source unodevtools/Executable_skeletonmaker.mk unodevtools/inc unodevtools/source vbahelper/source vcl/generi c vcl/source vcl/unx writerfilter/source writerperfect/source xmloff/source xmlsecurity/source
Stephan Bergmann
sbergman at redhat.com
Wed Mar 27 01:37:27 PDT 2013
avmedia/source/gstreamer/gstplayer.cxx | 5
basctl/source/basicide/basidesh.cxx | 3
basebmp/test/bmpdemo.cxx | 5
basic/source/classes/sbxmod.cxx | 7
basic/source/runtime/methods.cxx | 1
basic/source/runtime/stdobj.cxx | 5
basic/source/runtime/stdobj1.cxx | 1
basic/source/sbx/sbxform.cxx | 6
bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c | 11
bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c | 4
bridges/source/cpp_uno/shared/types.cxx | 1
canvas/source/cairo/cairo_canvashelper.cxx | 1
chart2/source/controller/dialogs/dlg_CreationWizard.cxx | 1
chart2/source/controller/dialogs/dlg_NumberFormat.cxx | 1
codemaker/inc/codemaker/codemaker.hxx | 3
codemaker/inc/codemaker/dependencies.hxx | 7
codemaker/inc/codemaker/exceptiontree.hxx | 5
codemaker/inc/codemaker/typemanager.hxx | 104 ---
codemaker/source/codemaker/codemaker.cxx | 4
codemaker/source/codemaker/dependencies.cxx | 4
codemaker/source/codemaker/exceptiontree.cxx | 5
codemaker/source/codemaker/typemanager.cxx | 127 +---
codemaker/source/cppumaker/cppumaker.cxx | 25
codemaker/source/cppumaker/cpputype.cxx | 76 +-
codemaker/source/cppumaker/cpputype.hxx | 29 -
codemaker/source/cppumaker/includes.cxx | 7
codemaker/source/cppumaker/includes.hxx | 5
codemaker/source/javamaker/javamaker.cxx | 17
codemaker/source/javamaker/javatype.cxx | 132 ++--
codemaker/source/javamaker/javatype.hxx | 8
comphelper/inc/comphelper/stl_types.hxx | 8
connectivity/inc/connectivity/sqlparse.hxx | 3
connectivity/source/drivers/file/FResultSet.cxx | 3
connectivity/source/drivers/hsqldb/HStorageMap.cxx | 4
connectivity/source/drivers/hsqldb/StorageFileAccess.cxx | 6
connectivity/source/drivers/jdbc/ResultSetMetaData.cxx | 1
connectivity/source/drivers/mork/MNSProfileDiscover.cxx | 3
connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx | 3
connectivity/source/parse/sqlnode.cxx | 3
cppcanvas/source/mtfrenderer/emfplus.cxx | 5
cui/source/dialogs/dlgname.cxx | 2
cui/source/options/optgdlg.cxx | 4
cui/source/options/optgenrl.cxx | 2
cui/source/options/optlingu.cxx | 1
cui/source/options/treeopt.cxx | 6
cui/source/tabpages/macroass.cxx | 5
cui/source/tabpages/numpages.cxx | 2
dbaccess/source/filter/xml/xmlHelper.cxx | 2
dbaccess/source/filter/xml/xmlStyleImport.cxx | 6
dbaccess/source/ui/control/FieldDescControl.cxx | 4
dbaccess/source/ui/control/marktree.cxx | 2
dbaccess/source/ui/dlg/dbwizsetup.cxx | 3
dbaccess/source/ui/dlg/odbcconfig.cxx | 6
dbaccess/source/ui/misc/HtmlReader.cxx | 13
dbaccess/source/ui/misc/TokenWriter.cxx | 1
dbaccess/source/ui/querydesign/TableWindow.cxx | 3
dbaccess/source/ui/tabledesign/TEditControl.cxx | 10
dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx | 1
dbaccess/source/ui/uno/unoadmin.cxx | 2
desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 6
desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 1
desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 1
desktop/source/deployment/misc/dp_misc.cxx | 6
editeng/source/editeng/editundo.cxx | 3
editeng/source/editeng/eehtml.cxx | 3
editeng/source/items/flditem.cxx | 1
editeng/source/items/numitem.cxx | 2
editeng/source/items/svxfont.cxx | 3
editeng/source/misc/unolingu.cxx | 2
extensions/source/bibliography/bibbeam.cxx | 1
extensions/source/bibliography/bibcont.cxx | 1
extensions/source/bibliography/bibload.cxx | 2
extensions/source/nsplugin/source/npshell.cxx | 3
extensions/source/nsplugin/source/so_env.cxx | 8
extensions/source/propctrlr/formmetadata.cxx | 3
extensions/source/propctrlr/propcontroller.cxx | 2
extensions/source/scanner/grid.cxx | 4
filter/source/graphicfilter/etiff/etiff.cxx | 1
filter/source/graphicfilter/icgm/cgm.cxx | 2
filter/source/msfilter/msdffimp.cxx | 2
filter/source/msfilter/svdfppt.cxx | 5
forms/source/richtext/richtextcontrol.cxx | 14
forms/source/richtext/richtextengine.cxx | 3
forms/source/richtext/rtattributehandler.cxx | 6
forms/source/richtext/specialdispatchers.cxx | 1
forms/source/solar/component/navbarcontrol.cxx | 25
forms/source/xforms/model.cxx | 3
formula/source/ui/resource/ModuleHelper.cxx | 1
framework/source/classes/menumanager.cxx | 3
framework/source/services/substitutepathvars.cxx | 4
framework/source/uielement/controlmenucontroller.cxx | 4
framework/source/uielement/menubarmanager.cxx | 3
hwpfilter/source/fontmap.cxx | 1
hwpfilter/source/hcode.cxx | 10
hwpfilter/source/hgzip.cxx | 7
hwpfilter/source/hwpfile.cxx | 6
i18npool/source/calendar/calendar_hijri.cxx | 2
i18npool/source/calendar/calendar_jewish.cxx | 2
i18npool/source/nativenumber/nativenumbersupplier.cxx | 4
i18npool/source/registerservices/registerservices.cxx | 2
i18nutil/source/utility/unicode.cxx | 22
idlc/source/astexpression.cxx | 5
idlc/source/options.cxx | 5
jvmfwk/source/framework.cxx | 1
jvmfwk/source/fwkbase.cxx | 4
l10ntools/source/export.cxx | 1
l10ntools/source/export2.cxx | 2
libpng/StaticLibrary_png.mk | 2
lingucomponent/source/languageguessing/simpleguesser.cxx | 5
oox/source/drawingml/chart/objectformatter.cxx | 9
oox/source/export/chartexport.cxx | 12
oox/source/helper/propertymap.cxx | 1
package/source/zipapi/ZipFile.cxx | 2
package/source/zippackage/ZipPackage.cxx | 10
padmin/source/helper.cxx | 2
registry/source/reflwrit.cxx | 27 -
remotebridges/source/unourl_resolver/unourl_resolver.cxx | 3
reportdesign/source/core/api/ReportDefinition.cxx | 8
reportdesign/source/core/sdr/ModuleHelper.cxx | 1
reportdesign/source/core/sdr/RptModel.cxx | 4
reportdesign/source/filter/xml/xmlHelper.cxx | 4
reportdesign/source/ui/dlg/Condition.cxx | 2
reportdesign/source/ui/inspection/GeometryHandler.cxx | 9
reportdesign/source/ui/inspection/metadata.cxx | 9
reportdesign/source/ui/misc/toolboxcontroller.cxx | 3
reportdesign/source/ui/report/ReportController.cxx | 11
rsc/source/parser/rscyacc.y | 3
rsc/source/rscpp/cpp2.c | 1
rsc/source/rscpp/cpp5.c | 8
sal/osl/unx/diagnose.cxx | 7
sal/osl/unx/file.cxx | 2
sal/osl/unx/pipe.c | 1
sal/osl/unx/profile.c | 21
sal/osl/unx/socket.c | 9
sax/source/tools/converter.cxx | 1
sc/source/core/data/bigrange.cxx | 5
sc/source/core/data/dpsave.cxx | 2
sc/source/core/tool/appoptio.cxx | 2
sc/source/core/tool/docoptio.cxx | 2
sc/source/core/tool/inputopt.cxx | 6
sc/source/core/tool/interpr3.cxx | 1
sc/source/core/tool/rangelst.cxx | 2
sc/source/core/tool/viewopti.cxx | 3
sc/source/filter/excel/xlformula.cxx | 1
sc/source/filter/html/htmlpars.cxx | 1
sc/source/filter/oox/formulabase.cxx | 1
sc/source/ui/app/typemap.cxx | 3
sc/source/ui/dbgui/dapidata.cxx | 1
sc/source/ui/dbgui/dbnamdlg.cxx | 1
sc/source/ui/drawfunc/fuconpol.cxx | 7
sc/source/ui/drawfunc/futext2.cxx | 57 --
sc/source/ui/drawfunc/graphsh.cxx | 2
sc/source/ui/drawfunc/mediash.cxx | 3
sc/source/ui/miscdlgs/acredlin.cxx | 3
sc/source/ui/miscdlgs/highred.cxx | 5
sc/source/ui/miscdlgs/simpref.cxx | 6
sc/source/ui/namedlg/namedefdlg.cxx | 1
sc/source/ui/pagedlg/areasdlg.cxx | 1
sc/source/ui/pagedlg/tphfedit.cxx | 1
sc/source/ui/unoobj/docuno.cxx | 1
sc/source/ui/view/hdrcont.cxx | 4
sc/source/ui/view/olkact.cxx | 74 --
sc/source/ui/view/prevwsh2.cxx | 63 --
sc/source/ui/view/select.cxx | 2
sc/source/ui/view/tabview.cxx | 2
sc/source/ui/view/viewfun3.cxx | 43 -
scaddins/source/datefunc/datefunc.cxx | 1
scaddins/source/pricing/pricing.cxx | 2
sccomp/source/solver/solver.cxx | 2
scripting/source/provider/URIHelper.cxx | 2
sd/source/core/typemap.cxx | 24
sd/source/filter/cgm/sdcgmfilter.cxx | 5
sd/source/filter/eppt/eppt.cxx | 3
sd/source/filter/eppt/epptso.cxx | 2
sd/source/filter/eppt/pptx-epptooxml.cxx | 16
sd/source/filter/html/htmlex.cxx | 3
sd/source/ui/app/sddll2.cxx | 1
sd/source/ui/dlg/LayerTabBar.cxx | 3
sd/source/ui/dlg/PaneShells.cxx | 8
sd/source/ui/dlg/RemoteDialogClientBox.cxx | 4
sd/source/ui/dlg/diactrl.cxx | 1
sd/source/ui/func/fulinend.cxx | 3
sd/source/ui/view/ViewTabBar.cxx | 2
sd/source/ui/view/drviewsh.cxx | 3
sd/source/ui/view/drviewsi.cxx | 4
sd/source/ui/view/tabcontr.cxx | 2
sfx2/source/appl/appbas.cxx | 3
sfx2/source/appl/appmain.cxx | 3
sfx2/source/appl/impldde.cxx | 1
sfx2/source/appl/newhelp.cxx | 1
sfx2/source/bastyp/progress.cxx | 1
sfx2/source/control/dispatch.cxx | 4
sfx2/source/doc/doctempl.cxx | 1
sfx2/source/doc/doctemplates.cxx | 1
sfx2/source/doc/guisaveas.cxx | 1
sfx2/source/doc/new.cxx | 6
sfx2/source/view/sfxbasecontroller.cxx | 5
shell/source/backends/gconfbe/gconfaccess.cxx | 3
shell/source/tools/lngconvex/lngconvex.cxx | 2
solenv/bin/concat-deps.c | 2
solenv/gbuild/platform/com_GCC_defs.mk | 2
soltools/cpp/_lex.c | 8
sot/source/sdstor/stgstrms.cxx | 2
sot/source/sdstor/ucbstorage.cxx | 1
starmath/source/dialog.cxx | 3
starmath/source/edit.cxx | 5
starmath/source/parse.cxx | 2
starmath/source/typemap.cxx | 23
stoc/source/javavm/javavm.cxx | 9
svtools/source/config/slidesorterbaropt.cxx | 2
svtools/source/config/toolpanelopt.cxx | 2
svtools/source/contnr/templwin.cxx | 2
svtools/source/contnr/viewdataentry.cxx | 7
svtools/source/control/calendar.cxx | 2
svtools/source/control/headbar.cxx | 1
svx/source/dialog/framelinkarray.cxx | 2
svx/source/dialog/srchdlg.cxx | 3
svx/source/sdr/contact/viewcontactofgraphic.cxx | 4
svx/source/svdraw/svdattr.cxx | 6
svx/source/svdraw/svdobj.cxx | 3
svx/source/svdraw/svdtext.cxx | 3
svx/source/table/svdotable.cxx | 4
sw/source/core/doc/docredln.cxx | 4
sw/source/core/frmedt/tblsel.cxx | 1
sw/source/core/layout/layact.cxx | 12
sw/source/core/sw3io/sw3convert.cxx | 1
sw/source/core/swg/SwXMLTextBlocks.cxx | 3
sw/source/core/swg/SwXMLTextBlocks1.cxx | 4
sw/source/core/text/txtio.cxx | 4
sw/source/core/unocore/unoportenum.cxx | 6
sw/source/core/view/viewsh.cxx | 4
sw/source/filter/html/htmldraw.cxx | 4
sw/source/filter/html/swhtml.cxx | 1
sw/source/filter/xml/swxml.cxx | 5
sw/source/filter/xml/wrtxml.cxx | 6
sw/source/ui/app/apphdl.cxx | 2
sw/source/ui/config/uinums.cxx | 1
sw/source/ui/index/swuiidxmrk.cxx | 1
sw/source/ui/misc/swruler.cxx | 2
sw/source/ui/shells/basesh.cxx | 1
sw/source/ui/shells/slotadd.cxx | 1
sw/source/ui/shells/textsh.cxx | 7
sw/source/ui/uiview/view0.cxx | 10
sw/source/ui/vba/vbaapplication.cxx | 10
sw/source/ui/web/wtextsh.cxx | 4
sw/source/ui/web/wview.cxx | 10
toolkit/source/helper/property.cxx | 4
tools/source/debug/debug.cxx | 1
tools/source/fsys/dirent.cxx | 5
tools/source/zcodec/zcodec.cxx | 2
ucb/source/ucp/cmis/cmis_datasupplier.cxx | 2
ucb/source/ucp/cmis/cmis_url.cxx | 3
unodevtools/Executable_skeletonmaker.mk | 1
unodevtools/inc/unodevtools/options.hxx | 7
unodevtools/inc/unodevtools/typemanager.hxx | 83 ---
unodevtools/source/skeletonmaker/cppcompskeleton.cxx | 20
unodevtools/source/skeletonmaker/cpptypemaker.cxx | 36 -
unodevtools/source/skeletonmaker/javacompskeleton.cxx | 10
unodevtools/source/skeletonmaker/javatypemaker.cxx | 38 -
unodevtools/source/skeletonmaker/skeletoncommon.cxx | 42 -
unodevtools/source/skeletonmaker/skeletoncommon.hxx | 15
unodevtools/source/skeletonmaker/skeletoncpp.hxx | 26
unodevtools/source/skeletonmaker/skeletonjava.hxx | 24
unodevtools/source/skeletonmaker/skeletonmaker.cxx | 12
unodevtools/source/unodevtools/typemanager.cxx | 270 ----------
vbahelper/source/vbahelper/vbahelper.cxx | 5
vcl/generic/fontmanager/parseAFM.cxx | 2
vcl/generic/glyphs/graphite_serverfont.cxx | 4
vcl/source/control/prgsbar.cxx | 3
vcl/source/filter/sgvmain.cxx | 3
vcl/source/filter/sgvspln.cxx | 22
vcl/source/filter/sgvtext.cxx | 20
vcl/source/filter/wmf/emfwr.cxx | 67 --
vcl/source/filter/wmf/wmfwr.cxx | 108 ----
vcl/source/fontsubset/ttcr.cxx | 5
vcl/source/gdi/jobset.cxx | 2
vcl/source/gdi/pdfwriter_impl.cxx | 3
vcl/source/gdi/pngwrite.cxx | 2
vcl/source/gdi/sallayout.cxx | 2
vcl/source/glyphs/graphite_layout.cxx | 4
vcl/source/helper/lazydelete.cxx | 5
vcl/source/helper/threadex.cxx | 2
vcl/unx/generic/app/saldisp.cxx | 3
vcl/unx/generic/printer/ppdparser.cxx | 2
vcl/unx/gtk/a11y/atktextattributes.cxx | 1
vcl/unx/gtk/window/gloactiongroup.cxx | 2
vcl/unx/kde/kdedata.cxx | 8
vcl/unx/kde4/KDEXLib.cxx | 4
vcl/unx/kde4/VCLKDEApplication.cxx | 2
writerfilter/source/dmapper/ConversionHelper.cxx | 50 -
writerperfect/source/filter/DocumentElement.cxx | 2
xmloff/source/core/unoatrcn.cxx | 2
xmloff/source/core/xmlexp.cxx | 4
xmloff/source/core/xmlimp.cxx | 8
xmloff/source/draw/XMLNumberStyles.cxx | 1
xmloff/source/style/chrhghdl.cxx | 5
xmloff/source/style/chrlohdl.cxx | 5
xmloff/source/style/lspachdl.cxx | 5
xmloff/source/text/txtimppr.cxx | 1
xmloff/source/transform/OOo2Oasis.cxx | 3
xmloff/source/transform/Oasis2OOo.cxx | 3
xmlsecurity/source/helper/xsecctl.cxx | 3
302 files changed, 423 insertions(+), 2286 deletions(-)
New commits:
commit bb1f0c667f8b38bf27818fe1608beb4295d9c429
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 26 14:59:34 2013 +0100
Clean up codemaker/typemanager.hxx
Change-Id: I650efd6780070410eaf34993dd41ed1b8ada7c9a
diff --git a/codemaker/inc/codemaker/codemaker.hxx b/codemaker/inc/codemaker/codemaker.hxx
index c7aebf8..a1c3a14 100644
--- a/codemaker/inc/codemaker/codemaker.hxx
+++ b/codemaker/inc/codemaker/codemaker.hxx
@@ -23,6 +23,7 @@
#include "sal/config.h"
#include "codemaker/unotype.hxx"
#include "registry/types.h"
+#include "rtl/ref.hxx"
#include "sal/types.h"
#include <vector>
@@ -38,7 +39,7 @@ namespace codemaker {
rtl::OString convertString(rtl::OUString const & string);
codemaker::UnoType::Sort decomposeAndResolve(
- TypeManager const & manager, rtl::OString const & type,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
RTTypeClass * typeClass, rtl::OString * name, sal_Int32 * rank,
std::vector< rtl::OString > * arguments);
diff --git a/codemaker/inc/codemaker/dependencies.hxx b/codemaker/inc/codemaker/dependencies.hxx
index b46e7f3..1579392 100644
--- a/codemaker/inc/codemaker/dependencies.hxx
+++ b/codemaker/inc/codemaker/dependencies.hxx
@@ -20,6 +20,9 @@
#ifndef INCLUDED_CODEMAKER_DEPENDENCIES_HXX
#define INCLUDED_CODEMAKER_DEPENDENCIES_HXX
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include <boost/unordered_map.hpp>
@@ -58,7 +61,9 @@ public:
type, polymorphic struct type template, exception type, interface type,
typedef, module, constant group, service, or singleton
*/
- Dependencies(TypeManager const & manager, rtl::OString const & type);
+ Dependencies(
+ rtl::Reference< TypeManager > const & manager,
+ rtl::OString const & type);
~Dependencies();
diff --git a/codemaker/inc/codemaker/exceptiontree.hxx b/codemaker/inc/codemaker/exceptiontree.hxx
index e6fded6a..fed0e5b 100644
--- a/codemaker/inc/codemaker/exceptiontree.hxx
+++ b/codemaker/inc/codemaker/exceptiontree.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_CODEMAKER_EXCEPTIONTREE_HXX
#include "codemaker/global.hxx"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include <vector>
@@ -92,7 +93,9 @@ public:
if different calls to this member function use different, incompatible
type managers
*/
- void add(rtl::OString const & name, TypeManager const & manager)
+ void add(
+ rtl::OString const & name,
+ rtl::Reference< TypeManager > const & manager)
throw( CannotDumpException );
/**
diff --git a/codemaker/inc/codemaker/typemanager.hxx b/codemaker/inc/codemaker/typemanager.hxx
index 2024f8c..1b16115 100644
--- a/codemaker/inc/codemaker/typemanager.hxx
+++ b/codemaker/inc/codemaker/typemanager.hxx
@@ -23,6 +23,7 @@
#include "codemaker/global.hxx"
#include "registry/registry.hxx"
#include "registry/types.h"
+#include "salhelper/simplereferenceobject.hxx"
#include <boost/unordered_map.hpp>
#include <list>
@@ -42,91 +43,10 @@ typedef ::boost::unordered_map
EqualString
> T2TypeClassMap;
-struct TypeManagerImpl
-{
- TypeManagerImpl()
- : m_refCount(0)
- {}
-
- sal_Int32 m_refCount;
-};
-
-class TypeManager
+class TypeManager : public salhelper::SimpleReferenceObject
{
public:
TypeManager();
- virtual ~TypeManager();
-
- TypeManager( const TypeManager& value )
- : m_pImpl( value.m_pImpl )
- {
- acquire();
- }
-
- TypeManager& operator = ( const TypeManager& value )
- {
- release();
- m_pImpl = value.m_pImpl;
- acquire();
- return *this;
- }
-
- virtual sal_Bool isValidType(const ::rtl::OString&) const
- { return sal_False; }
-
- virtual ::rtl::OString getTypeName(RegistryKey&) const
- { return ::rtl::OString(); }
-
- virtual RegistryKey getTypeKey(const ::rtl::OString&, sal_Bool * = 0 ) const
- { return RegistryKey(); }
- virtual RegistryKeyList getTypeKeys(const ::rtl::OString&) const
- { return RegistryKeyList(); }
- virtual typereg::Reader getTypeReader(
- const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const = 0;
- virtual typereg::Reader getTypeReader(RegistryKey& rTypeKey) const = 0;
- virtual RTTypeClass getTypeClass(const ::rtl::OString&) const
- { return RT_TYPE_INVALID; }
- virtual RTTypeClass getTypeClass(RegistryKey&) const
- { return RT_TYPE_INVALID; }
-
- virtual void setBase(const ::rtl::OString&) {}
- virtual ::rtl::OString getBase() const { return ::rtl::OString(); }
-
- virtual sal_Int32 getSize() const { return 0; }
-
- static sal_Bool isBaseType(const ::rtl::OString& name);
-protected:
- sal_Int32 acquire();
- sal_Int32 release();
-
-protected:
- TypeManagerImpl* m_pImpl;
-};
-
-struct RegistryTypeManagerImpl
-{
- RegistryTypeManagerImpl()
- : m_base("/")
- {}
-
- T2TypeClassMap m_t2TypeClass;
- RegistryList m_registries;
- RegistryList m_extra_registries;
- ::rtl::OString m_base;
-};
-
-class RegistryTypeManager : public TypeManager
-{
-public:
- RegistryTypeManager();
- virtual ~RegistryTypeManager();
-
- RegistryTypeManager( const RegistryTypeManager& value )
- : TypeManager(value)
- , m_pImpl( value.m_pImpl )
- {
- acquire();
- }
sal_Bool init(const StringVector& regFiles, const StringVector& extraFiles = StringVector() );
@@ -145,19 +65,23 @@ public:
RTTypeClass getTypeClass(RegistryKey& rTypeKey) const;
void setBase(const ::rtl::OString& base);
- ::rtl::OString getBase() const { return m_pImpl->m_base; }
+ ::rtl::OString getBase() const { return m_base; }
+
+ sal_Int32 getSize() const { return m_t2TypeClass.size(); }
+
+ static sal_Bool isBaseType(const ::rtl::OString& name);
+
+private:
+ virtual ~TypeManager();
- sal_Int32 getSize() const { return m_pImpl->m_t2TypeClass.size(); }
-protected:
RegistryKey searchTypeKey(
const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const;
void freeRegistries();
- void acquire();
- void release();
-
-protected:
- RegistryTypeManagerImpl* m_pImpl;
+ mutable T2TypeClassMap m_t2TypeClass;
+ RegistryList m_registries;
+ RegistryList m_extra_registries;
+ ::rtl::OString m_base;
};
#endif // INCLUDED_CODEMAKER_TYPEMANAGER_HXX
diff --git a/codemaker/source/codemaker/codemaker.cxx b/codemaker/source/codemaker/codemaker.cxx
index bf5b618..b797a2c 100644
--- a/codemaker/source/codemaker/codemaker.cxx
+++ b/codemaker/source/codemaker/codemaker.cxx
@@ -63,7 +63,7 @@ rtl::OString convertString(rtl::OUString const & string) {
}
codemaker::UnoType::Sort decomposeAndResolve(
- TypeManager const & manager, rtl::OString const & type,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
RTTypeClass * typeClass, rtl::OString * name, sal_Int32 * rank,
std::vector< rtl::OString > * arguments)
@@ -95,7 +95,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
return sort;
case codemaker::UnoType::SORT_COMPLEX:
- typereg::Reader reader(manager.getTypeReader(*name));
+ typereg::Reader reader(manager->getTypeReader(*name));
*typeClass = reader.getTypeClass();
switch (*typeClass) {
case RT_TYPE_ENUM:
diff --git a/codemaker/source/codemaker/dependencies.cxx b/codemaker/source/codemaker/dependencies.cxx
index f3baf1c..d920ac4 100644
--- a/codemaker/source/codemaker/dependencies.cxx
+++ b/codemaker/source/codemaker/dependencies.cxx
@@ -42,7 +42,7 @@ struct Bad {};
}
Dependencies::Dependencies(
- TypeManager const & manager, rtl::OString const & type):
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type):
m_voidDependency(false), m_booleanDependency(false),
m_byteDependency(false), m_shortDependency(false),
m_unsignedShortDependency(false), m_longDependency(false),
@@ -52,7 +52,7 @@ Dependencies::Dependencies(
m_stringDependency(false), m_typeDependency(false), m_anyDependency(false),
m_sequenceDependency(false)
{
- typereg::Reader reader(manager.getTypeReader(type));
+ typereg::Reader reader(manager->getTypeReader(type));
m_valid = reader.isValid();
if (m_valid) {
// Not everything is checked for consistency, just things that are cheap
diff --git a/codemaker/source/codemaker/exceptiontree.cxx b/codemaker/source/codemaker/exceptiontree.cxx
index 8ec6f1f..52f9684 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -47,7 +47,8 @@ void ExceptionTreeNode::clearChildren() {
children.clear();
}
-void ExceptionTree::add(rtl::OString const & name, TypeManager const & manager)
+void ExceptionTree::add(
+ rtl::OString const & name, rtl::Reference< TypeManager > const & manager)
throw( CannotDumpException )
{
typedef std::vector< rtl::OString > OStringList;
@@ -59,7 +60,7 @@ void ExceptionTree::add(rtl::OString const & name, TypeManager const & manager)
break;
}
stringlist.push_back(n);
- typereg::Reader reader(manager.getTypeReader(n));
+ typereg::Reader reader(manager->getTypeReader(n));
if (!reader.isValid())
throw CannotDumpException(
::rtl::OString("Unknown type '" + n.replace('/', '.')
diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx
index 4e53e5f..116684d 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -28,32 +28,6 @@ using ::rtl::OString;
using ::rtl::OStringToOUString;
using ::rtl::OUStringToOString;
-TypeManager::TypeManager()
-{
- m_pImpl = new TypeManagerImpl();
- acquire();
-}
-
-TypeManager::~TypeManager()
-{
- release();
-}
-
-sal_Int32 TypeManager::acquire()
-{
- return osl_atomic_increment(&m_pImpl->m_refCount);
-}
-
-sal_Int32 TypeManager::release()
-{
- sal_Int32 refCount = 0;
- if (0 == (refCount = osl_atomic_decrement(&m_pImpl->m_refCount)) )
- {
- delete m_pImpl;
- }
- return refCount;
-}
-
sal_Bool TypeManager::isBaseType(const ::rtl::OString& name)
{
if ( name == "short" )
@@ -90,33 +64,14 @@ sal_Bool TypeManager::isBaseType(const ::rtl::OString& name)
return sal_False;
}
-RegistryTypeManager::RegistryTypeManager()
-{
- m_pImpl = new RegistryTypeManagerImpl();
- acquire();
-}
+TypeManager::TypeManager() {}
-RegistryTypeManager::~RegistryTypeManager()
-{
- release();
-}
-
-void RegistryTypeManager::acquire()
-{
- TypeManager::acquire();
-}
-
-void RegistryTypeManager::release()
+TypeManager::~TypeManager()
{
- if (0 == TypeManager::release())
- {
- freeRegistries();
-
- delete m_pImpl;
- }
+ freeRegistries();
}
-sal_Bool RegistryTypeManager::init(
+sal_Bool TypeManager::init(
const StringVector& regFiles,
StringVector const & extraFiles )
{
@@ -129,7 +84,7 @@ sal_Bool RegistryTypeManager::init(
while (iter != regFiles.end())
{
if (!tmpReg.open( convertToFileUrl(*iter), REG_READONLY))
- m_pImpl->m_registries.push_back(new Registry(tmpReg));
+ m_registries.push_back(new Registry(tmpReg));
else
{
freeRegistries();
@@ -141,7 +96,7 @@ sal_Bool RegistryTypeManager::init(
while (iter != extraFiles.end())
{
if (!tmpReg.open( convertToFileUrl(*iter), REG_READONLY))
- m_pImpl->m_extra_registries.push_back(new Registry(tmpReg));
+ m_extra_registries.push_back(new Registry(tmpReg));
else
{
freeRegistries();
@@ -153,11 +108,11 @@ sal_Bool RegistryTypeManager::init(
return sal_True;
}
-::rtl::OString RegistryTypeManager::getTypeName(RegistryKey& rTypeKey) const
+::rtl::OString TypeManager::getTypeName(RegistryKey& rTypeKey) const
{
OString typeName = OUStringToOString(rTypeKey.getName(), RTL_TEXTENCODING_UTF8);
- if (m_pImpl->m_base.getLength() > 1)
+ if (m_base.getLength() > 1)
typeName = typeName.copy(typeName.indexOf('/', 1) + 1);
else
typeName = typeName.copy(1);
@@ -165,7 +120,7 @@ sal_Bool RegistryTypeManager::init(
return typeName;
}
-typereg::Reader RegistryTypeManager::getTypeReader(
+typereg::Reader TypeManager::getTypeReader(
const OString& name, sal_Bool * pIsExtraType ) const
{
typereg::Reader reader;
@@ -190,7 +145,7 @@ typereg::Reader RegistryTypeManager::getTypeReader(
return reader;
}
-typereg::Reader RegistryTypeManager::getTypeReader(RegistryKey& rTypeKey) const
+typereg::Reader TypeManager::getTypeReader(RegistryKey& rTypeKey) const
{
typereg::Reader reader;
@@ -214,11 +169,11 @@ typereg::Reader RegistryTypeManager::getTypeReader(RegistryKey& rTypeKey) const
}
-RTTypeClass RegistryTypeManager::getTypeClass(const OString& name) const
+RTTypeClass TypeManager::getTypeClass(const OString& name) const
{
- if (m_pImpl->m_t2TypeClass.count(name) > 0)
+ if (m_t2TypeClass.count(name) > 0)
{
- return m_pImpl->m_t2TypeClass[name];
+ return m_t2TypeClass[name];
} else
{
RegistryKey key(searchTypeKey(name));
@@ -240,7 +195,7 @@ RTTypeClass RegistryTypeManager::getTypeClass(const OString& name) const
rtl_freeMemory(pBuffer);
- m_pImpl->m_t2TypeClass[name] = ret;
+ m_t2TypeClass[name] = ret;
return ret;
}
rtl_freeMemory(pBuffer);
@@ -251,13 +206,13 @@ RTTypeClass RegistryTypeManager::getTypeClass(const OString& name) const
return RT_TYPE_INVALID;
}
-RTTypeClass RegistryTypeManager::getTypeClass(RegistryKey& rTypeKey) const
+RTTypeClass TypeManager::getTypeClass(RegistryKey& rTypeKey) const
{
OString name = getTypeName(rTypeKey);
- if (m_pImpl->m_t2TypeClass.count(name) > 0)
+ if (m_t2TypeClass.count(name) > 0)
{
- return m_pImpl->m_t2TypeClass[name];
+ return m_t2TypeClass[name];
} else
{
if (rTypeKey.isValid())
@@ -277,7 +232,7 @@ RTTypeClass RegistryTypeManager::getTypeClass(RegistryKey& rTypeKey) const
rtl_freeMemory(pBuffer);
- m_pImpl->m_t2TypeClass[name] = ret;
+ m_t2TypeClass[name] = ret;
return ret;
}
rtl_freeMemory(pBuffer);
@@ -288,39 +243,39 @@ RTTypeClass RegistryTypeManager::getTypeClass(RegistryKey& rTypeKey) const
return RT_TYPE_INVALID;
}
-void RegistryTypeManager::setBase(const OString& base)
+void TypeManager::setBase(const OString& base)
{
if (base.lastIndexOf('/') == (base.getLength() - 1))
- m_pImpl->m_base += base.copy(0, base.lastIndexOf('/') - 1);
+ m_base += base.copy(0, base.lastIndexOf('/') - 1);
else
- m_pImpl->m_base += base;
+ m_base += base;
}
-void RegistryTypeManager::freeRegistries()
+void TypeManager::freeRegistries()
{
- RegistryList::const_iterator iter = m_pImpl->m_registries.begin();
- while (iter != m_pImpl->m_registries.end())
+ RegistryList::const_iterator iter = m_registries.begin();
+ while (iter != m_registries.end())
{
delete *iter;
++iter;
}
- iter = m_pImpl->m_extra_registries.begin();
- while (iter != m_pImpl->m_extra_registries.end())
+ iter = m_extra_registries.begin();
+ while (iter != m_extra_registries.end())
{
delete *iter;
++iter;
}
}
-RegistryKey RegistryTypeManager::searchTypeKey(const OString& name_, sal_Bool * pIsExtraType )
+RegistryKey TypeManager::searchTypeKey(const OString& name_, sal_Bool * pIsExtraType )
const
{
- OUString name( OStringToOUString(m_pImpl->m_base + "/" + name_, RTL_TEXTENCODING_UTF8) );
+ OUString name( OStringToOUString(m_base + "/" + name_, RTL_TEXTENCODING_UTF8) );
RegistryKey key, rootKey;
- RegistryList::const_iterator iter = m_pImpl->m_registries.begin();
- while (iter != m_pImpl->m_registries.end())
+ RegistryList::const_iterator iter = m_registries.begin();
+ while (iter != m_registries.end())
{
if (!(*iter)->openRootKey(rootKey))
{
@@ -333,8 +288,8 @@ RegistryKey RegistryTypeManager::searchTypeKey(const OString& name_, sal_Bool *
}
++iter;
}
- iter = m_pImpl->m_extra_registries.begin();
- while (iter != m_pImpl->m_extra_registries.end())
+ iter = m_extra_registries.begin();
+ while (iter != m_extra_registries.end())
{
if (!(*iter)->openRootKey(rootKey))
{
@@ -351,24 +306,24 @@ RegistryKey RegistryTypeManager::searchTypeKey(const OString& name_, sal_Bool *
return key;
}
-RegistryKeyList RegistryTypeManager::getTypeKeys(const ::rtl::OString& name_) const
+RegistryKeyList TypeManager::getTypeKeys(const ::rtl::OString& name_) const
{
RegistryKeyList keyList= RegistryKeyList();
OString tmpName;
- if ( name_ == "/" || name_ == m_pImpl->m_base ) {
- tmpName = m_pImpl->m_base;
+ if ( name_ == "/" || name_ == m_base ) {
+ tmpName = m_base;
} else {
- if ( m_pImpl->m_base == "/" )
+ if ( m_base == "/" )
tmpName = name_;
else
- tmpName = m_pImpl->m_base + "/" + name_;
+ tmpName = m_base + "/" + name_;
}
OUString name( OStringToOUString(tmpName, RTL_TEXTENCODING_UTF8) );
RegistryKey key, rootKey;
- RegistryList::const_iterator iter = m_pImpl->m_registries.begin();
- while (iter != m_pImpl->m_registries.end())
+ RegistryList::const_iterator iter = m_registries.begin();
+ while (iter != m_registries.end())
{
if (!(*iter)->openRootKey(rootKey))
{
@@ -379,8 +334,8 @@ RegistryKeyList RegistryTypeManager::getTypeKeys(const ::rtl::OString& name_) co
}
++iter;
}
- iter = m_pImpl->m_extra_registries.begin();
- while (iter != m_pImpl->m_extra_registries.end())
+ iter = m_extra_registries.begin();
+ while (iter != m_extra_registries.end())
{
if (!(*iter)->openRootKey(rootKey))
{
diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx
index 38b8cce..d18a952 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -20,6 +20,7 @@
#include <stdio.h>
+#include "rtl/ref.hxx"
#include "sal/main.h"
#include "codemaker/typemanager.hxx"
@@ -40,17 +41,19 @@ void failed(rtl::OString const & typeName, CppuOptions * options) {
}
void produce(
- RegistryKey& rTypeKey, bool bIsExtraType, TypeManager const & typeMgr,
+ RegistryKey& rTypeKey, bool bIsExtraType,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated, CppuOptions * options)
{
if (!produceType(rTypeKey, bIsExtraType, typeMgr, generated, options)) {
- OString typeName = typeMgr.getTypeName(rTypeKey);
+ OString typeName = typeMgr->getTypeName(rTypeKey);
failed(typeName, options);
}
}
void produce(
- rtl::OString const & typeName, TypeManager const & typeMgr,
+ rtl::OString const & typeName,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated, CppuOptions * options)
{
if (!produceType(typeName, typeMgr, generated, options)) {
@@ -59,17 +62,17 @@ void produce(
}
void produceAllTypes(RegistryKey& rTypeKey, bool bIsExtraType,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions,
sal_Bool bFullScope)
throw( CannotDumpException )
{
- OString typeName = typeMgr.getTypeName(rTypeKey);
+ OString typeName = typeMgr->getTypeName(rTypeKey);
produce(rTypeKey, bIsExtraType, typeMgr, generated, pOptions);
- RegistryKeyList typeKeys = typeMgr.getTypeKeys(typeName);
+ RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
RegistryKeyList::const_iterator iter = typeKeys.begin();
RegistryKey key, subKey;
RegistryKeyArray subKeys;
@@ -100,7 +103,7 @@ void produceAllTypes(RegistryKey& rTypeKey, bool bIsExtraType,
}
void produceAllTypes(const OString& typeName,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions,
sal_Bool bFullScope)
@@ -108,7 +111,7 @@ void produceAllTypes(const OString& typeName,
{
produce(typeName, typeMgr, generated, pOptions);
- RegistryKeyList typeKeys = typeMgr.getTypeKeys(typeName);
+ RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
RegistryKeyList::const_iterator iter = typeKeys.begin();
RegistryKey key, subKey;
RegistryKeyArray subKeys;
@@ -156,9 +159,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
exit(99);
}
- RegistryTypeManager typeMgr;
+ rtl::Reference< TypeManager > typeMgr(new TypeManager);
- if (!typeMgr.init(options.getInputFiles(), options.getExtraInputFiles()))
+ if (!typeMgr->init(options.getInputFiles(), options.getExtraInputFiles()))
{
fprintf(stderr, "%s : init registries failed, check your registry files.\n", options.getProgramName().getStr());
exit(99);
@@ -166,7 +169,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (options.isValid("-B"))
{
- typeMgr.setBase(options.getOption("-B"));
+ typeMgr->setBase(options.getOption("-B"));
}
codemaker::GeneratedTypeSet generated;
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 5513d24..b5e5268 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -27,6 +27,7 @@
#include "registry/reader.hxx"
#include "rtl/alloc.h"
+#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
#include "rtl/strbuf.hxx"
@@ -151,7 +152,7 @@ bool isBootstrapType(rtl::OString const & name) {
//*************************************************************************
CppuType::CppuType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: m_inheritedMemberCount(0)
, m_cppuTypeLeak(false)
, m_cppuTypeDynamic(true)
@@ -422,7 +423,7 @@ void CppuType::addDefaultHIncludes(codemaker::cppumaker::Includes & includes)
{
//TODO: Only include what is really needed
includes.addCppuMacrosHxx();
- if (m_typeMgr.getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
+ if (m_typeMgr->getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
includes.addReference();
}
}
@@ -434,7 +435,7 @@ void CppuType::addDefaultHxxIncludes(codemaker::cppumaker::Includes & includes)
includes.addRtlInstanceHxx();
includes.addOslMutexHxx();
includes.addType();
- if (m_typeMgr.getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
+ if (m_typeMgr->getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
includes.addReference();
}
}
@@ -470,10 +471,10 @@ void CppuType::dumpInitializer(
break;
case codemaker::UnoType::SORT_COMPLEX:
- switch (m_typeMgr.getTypeClass(t)) {
+ switch (m_typeMgr->getTypeClass(t)) {
case RT_TYPE_ENUM:
{
- typereg::Reader reader(m_typeMgr.getTypeReader(t));
+ typereg::Reader reader(m_typeMgr->getTypeReader(t));
OSL_ASSERT(reader.isValid());
out << scopedCppName(t) << "_"
<< rtl::OUStringToOString(
@@ -879,7 +880,7 @@ sal_uInt32 CppuType::checkInheritedMemberCount(const typereg::Reader* pReader)
}
if (!superType.isEmpty())
{
- typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
+ typereg::Reader aSuperReader(m_typeMgr->getTypeReader(superType));
if ( aSuperReader.isValid() )
{
count = checkInheritedMemberCount(&aSuperReader);
@@ -923,7 +924,7 @@ OString CppuType::getTypeClass(const OString& type, sal_Bool bCStyle)
if (!type.isEmpty())
{
typeName = type;
- rtTypeClass = m_typeMgr.getTypeClass(typeName);
+ rtTypeClass = m_typeMgr->getTypeClass(typeName);
} else
{
typeName = m_typeName;
@@ -1004,7 +1005,7 @@ void CppuType::dumpType(FileStream& o, const OString& type,
codemaker::UnoType::decompose(
checkRealBaseType(type, true), &seqNum, &args));
- RTTypeClass typeClass = m_typeMgr.getTypeClass(relType);
+ RTTypeClass typeClass = m_typeMgr->getTypeClass(relType);
if (bConst) o << "const ";
@@ -1074,7 +1075,7 @@ void CppuType::dumpCppuGetType(FileStream& o, const OString& type, sal_Bool bDec
if (eDeclFlag == CPPUTYPEDECL_ONLYINTERFACES)
{
- if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE)
+ if (m_typeMgr->getTypeClass(relType) == RT_TYPE_INTERFACE)
{
o << indent() << "::cppu::UnoType< ";
dumpType(o, type, false, false, false, true);
@@ -1092,7 +1093,7 @@ void CppuType::dumpCppuGetType(FileStream& o, const OString& type, sal_Bool bDec
} else
{
if (eDeclFlag == CPPUTYPEDECL_NOINTERFACES &&
- m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE)
+ m_typeMgr->getTypeClass(relType) == RT_TYPE_INTERFACE)
return;
o << indent() << "::cppu::UnoType< ";
@@ -1146,7 +1147,7 @@ bool CppuType::passByReference(rtl::OString const & unoType) {
return true;
case codemaker::UnoType::SORT_COMPLEX:
- return m_typeMgr.getTypeClass(type) != RT_TYPE_ENUM;
+ return m_typeMgr->getTypeClass(type) != RT_TYPE_ENUM;
}
}
@@ -1156,12 +1157,12 @@ OString CppuType::resolveTypedefs(const OString& type) const
RegistryKey key;
RTTypeClass typeClass;
- sal_Bool isTypeDef = (m_typeMgr.getTypeClass(baseType) == RT_TYPE_TYPEDEF);
+ sal_Bool isTypeDef = (m_typeMgr->getTypeClass(baseType) == RT_TYPE_TYPEDEF);
typereg::Reader reader;
while (isTypeDef)
{
- reader = m_typeMgr.getTypeReader(baseType);
+ reader = m_typeMgr->getTypeReader(baseType);
if (reader.isValid())
{
@@ -1188,12 +1189,12 @@ OString CppuType::checkRealBaseType(const OString& type, sal_Bool bResolveTypeOn
RegistryKey key;
RTTypeClass typeClass;
- sal_Bool mustBeChecked = (m_typeMgr.getTypeClass(baseType) == RT_TYPE_TYPEDEF);
+ sal_Bool mustBeChecked = (m_typeMgr->getTypeClass(baseType) == RT_TYPE_TYPEDEF);
typereg::Reader reader;
while (mustBeChecked)
{
- reader = m_typeMgr.getTypeReader(baseType);
+ reader = m_typeMgr->getTypeReader(baseType);
if (reader.isValid())
{
@@ -1359,7 +1360,7 @@ void dumpDeprecation(FileStream & o, bool deprecated) {
InterfaceType::InterfaceType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
m_inheritedMemberCount = 0;
@@ -1865,7 +1866,9 @@ namespace {
class BaseOffset {
public:
- BaseOffset(TypeManager const & theManager, typereg::Reader const & reader);
+ BaseOffset(
+ rtl::Reference< TypeManager > const & theManager,
+ typereg::Reader const & reader);
sal_Int32 get() const { return offset; }
@@ -1874,13 +1877,14 @@ private:
void calculate(typereg::Reader const & reader);
- TypeManager const & manager;
+ rtl::Reference< TypeManager > manager;
std::set< rtl::OString > set;
sal_Int32 offset;
};
BaseOffset::BaseOffset(
- TypeManager const & theManager, typereg::Reader const & reader):
+ rtl::Reference< TypeManager > const & theManager,
+ typereg::Reader const & reader):
manager(theManager)
{
offset = 0;
@@ -1890,7 +1894,7 @@ BaseOffset::BaseOffset(
void BaseOffset::calculateBases(typereg::Reader const & reader) {
for (sal_Int16 i = 0; i < reader.getSuperTypeCount(); ++i) {
typereg::Reader super(
- manager.getTypeReader(
+ manager->getTypeReader(
rtl::OUStringToOString(
reader.getSuperTypeName(i), RTL_TEXTENCODING_UTF8)));
if (super.isValid()) {
@@ -2323,7 +2327,7 @@ sal_Int32 InterfaceType::dumpAttributeExceptionTypeNames(
//*************************************************************************
ConstantsType::ConstantsType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
}
@@ -2441,7 +2445,7 @@ sal_Bool ConstantsType::dumpHxxFile(
//*************************************************************************
ModuleType::ModuleType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: ConstantsType(typeReader, typeName, typeMgr)
{
}
@@ -2481,7 +2485,7 @@ void dumpTypeParameterName(FileStream & out, rtl::OString const & name) {
StructureType::StructureType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
}
@@ -3086,7 +3090,7 @@ sal_Bool StructureType::dumpSuperMember(FileStream& o, const OString& superType,
if (!superType.isEmpty())
{
- typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
+ typereg::Reader aSuperReader(m_typeMgr->getTypeReader(superType));
if (aSuperReader.isValid())
{
@@ -3230,7 +3234,7 @@ void StructureType::dumpTemplateParameters(FileStream & out) const {
//*************************************************************************
ExceptionType::ExceptionType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
}
@@ -3527,7 +3531,7 @@ sal_Bool ExceptionType::dumpSuperMember(FileStream& o, const OString& superType,
if (!superType.isEmpty())
{
- typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
+ typereg::Reader aSuperReader(m_typeMgr->getTypeReader(superType));
if (aSuperReader.isValid())
{
@@ -3580,7 +3584,7 @@ sal_Bool ExceptionType::dumpSuperMember(FileStream& o, const OString& superType,
//*************************************************************************
EnumType::EnumType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
}
@@ -3767,7 +3771,7 @@ void EnumType::dumpComprehensiveGetCppuType(FileStream& o)
//*************************************************************************
TypeDefType::TypeDefType(typereg::Reader& typeReader,
const OString& typeName,
- const TypeManager& typeMgr)
+ rtl::Reference< TypeManager > const & typeMgr)
: CppuType(typeReader, typeName, typeMgr)
{
}
@@ -4208,7 +4212,7 @@ void ServiceType::dumpCatchClauses(
//*************************************************************************
bool SingletonType::isInterfaceBased() {
- return (m_typeMgr.getTypeClass(
+ return (m_typeMgr->getTypeClass(
rtl::OUStringToOString(
m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8)))
== RT_TYPE_INTERFACE;
@@ -4285,19 +4289,19 @@ sal_Bool SingletonType::dumpHxxFile(
// produceType
//*************************************************************************
bool produceType(const OString& typeName,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions)
throw( CannotDumpException )
{
- if (typeName == "/" || typeName == typeMgr.getBase() ||
+ if (typeName == "/" || typeName == typeMgr->getBase() ||
TypeManager::isBaseType(typeName) || generated.contains(typeName))
{
return true;
}
sal_Bool bIsExtraType = sal_False;
- typereg::Reader reader(typeMgr.getTypeReader(typeName, &bIsExtraType));
+ typereg::Reader reader(typeMgr->getTypeReader(typeName, &bIsExtraType));
if (bIsExtraType) {
generated.add(typeName);
return true;
@@ -4419,14 +4423,14 @@ bool produceType(const OString& typeName,
}
bool produceType(RegistryKey& rTypeKey, bool bIsExtraType,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions)
throw( CannotDumpException )
{
- OString typeName = typeMgr.getTypeName(rTypeKey);
+ OString typeName = typeMgr->getTypeName(rTypeKey);
- if (typeName == "/" ||typeName == typeMgr.getBase() ||
+ if (typeName == "/" ||typeName == typeMgr->getBase() ||
TypeManager::isBaseType(typeName) || generated.contains(typeName))
{
return true;
@@ -4437,7 +4441,7 @@ bool produceType(RegistryKey& rTypeKey, bool bIsExtraType,
return true;
}
- typereg::Reader reader(typeMgr.getTypeReader(rTypeKey));
+ typereg::Reader reader(typeMgr->getTypeReader(rTypeKey));
if (!reader.isValid()) {
return false;
}
diff --git a/codemaker/source/cppumaker/cpputype.hxx b/codemaker/source/cppumaker/cpputype.hxx
index b80b3d8..09d0e51 100644
--- a/codemaker/source/cppumaker/cpputype.hxx
+++ b/codemaker/source/cppumaker/cpputype.hxx
@@ -26,6 +26,7 @@
#include "codemaker/commoncpp.hxx"
#include "registry/reader.hxx"
#include "registry/types.h"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
namespace rtl { class OUString; }
@@ -50,7 +51,7 @@ class CppuType
public:
CppuType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~CppuType();
@@ -144,7 +145,7 @@ protected:
::rtl::OString m_typeName;
::rtl::OString m_name;
typereg::Reader m_reader;
- TypeManager const & m_typeMgr;
+ rtl::Reference< TypeManager > m_typeMgr;
codemaker::Dependencies m_dependencies;
private:
@@ -157,7 +158,7 @@ class InterfaceType : public CppuType
public:
InterfaceType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~InterfaceType();
@@ -218,7 +219,7 @@ class ConstantsType : public CppuType
public:
ConstantsType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~ConstantsType();
@@ -235,7 +236,7 @@ class ModuleType : public ConstantsType
public:
ModuleType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~ModuleType();
@@ -248,7 +249,7 @@ class StructureType : public CppuType
public:
StructureType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~StructureType();
@@ -286,7 +287,7 @@ class ExceptionType : public CppuType
public:
ExceptionType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~ExceptionType();
@@ -302,7 +303,7 @@ class EnumType : public CppuType
public:
EnumType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~EnumType();
@@ -319,7 +320,7 @@ class TypeDefType : public CppuType
public:
TypeDefType(typereg::Reader& typeReader,
const ::rtl::OString& typeName,
- const TypeManager& typeMgr);
+ rtl::Reference< TypeManager > const & typeMgr);
virtual ~TypeDefType();
@@ -332,7 +333,7 @@ class ConstructiveType: public CppuType {
public:
ConstructiveType(
typereg::Reader & reader, rtl::OString const & name,
- TypeManager const & manager):
+ rtl::Reference< TypeManager > const & manager):
CppuType(reader, name, manager) {}
virtual sal_Bool dumpHFile(
@@ -347,7 +348,7 @@ class ServiceType: public ConstructiveType {
public:
ServiceType(
typereg::Reader & reader, rtl::OString const & name,
- TypeManager const & manager):
+ rtl::Reference< TypeManager > const & manager):
ConstructiveType(reader, name, manager) {}
bool isSingleInterfaceBased();
@@ -371,7 +372,7 @@ class SingletonType: public ConstructiveType {
public:
SingletonType(
typereg::Reader & reader, rtl::OString const & name,
- TypeManager const & manager):
+ rtl::Reference< TypeManager > const & manager):
ConstructiveType(reader, name, manager) {}
bool isInterfaceBased();
@@ -382,13 +383,13 @@ public:
};
bool produceType(const ::rtl::OString& typeName,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions)
throw( CannotDumpException );
bool produceType(RegistryKey& typeName, bool bIsExtraType,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
CppuOptions* pOptions)
throw( CannotDumpException );
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx
index 9ee0eb5..0b0f83b 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -28,6 +28,7 @@
#include "codemaker/unotype.hxx"
#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
@@ -37,8 +38,8 @@
using codemaker::cppumaker::Includes;
Includes::Includes(
- TypeManager const & manager, codemaker::Dependencies const & dependencies,
- bool hpp):
+ rtl::Reference< TypeManager > const & manager,
+ codemaker::Dependencies const & dependencies, bool hpp):
m_manager(manager), m_map(dependencies.getMap()), m_hpp(hpp),
m_includeCassert(false), m_includeAny(dependencies.hasAnyDependency()),
m_includeReference(false),
@@ -275,7 +276,7 @@ void Includes::dumpInclude(
}
bool Includes::isInterfaceType(rtl::OString const & registryType) const {
- return m_manager.getTypeClass(registryType) == RT_TYPE_INTERFACE;
+ return m_manager->getTypeClass(registryType) == RT_TYPE_INTERFACE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/includes.hxx b/codemaker/source/cppumaker/includes.hxx
index dafc659..8fdf445 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
#include "codemaker/dependencies.hxx"
+#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
class FileStream;
@@ -31,7 +32,7 @@ namespace codemaker { namespace cppumaker {
class Includes {
public:
Includes(
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
codemaker::Dependencies const & dependencies, bool hpp);
~Includes();
@@ -70,7 +71,7 @@ private:
bool isInterfaceType(rtl::OString const & registryType) const;
- TypeManager const & m_manager;
+ rtl::Reference< TypeManager > m_manager;
codemaker::Dependencies::Map m_map;
bool m_hpp;
bool m_includeCassert;
diff --git a/codemaker/source/javamaker/javamaker.cxx b/codemaker/source/javamaker/javamaker.cxx
index 182eb2d..549913f 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -20,6 +20,7 @@
#include <stdio.h>
+#include "rtl/ref.hxx"
#include "sal/main.h"
#include "codemaker/typemanager.hxx"
@@ -30,13 +31,13 @@
using ::rtl::OUString;
using ::rtl::OString;
sal_Bool produceAllTypes(RegistryKey& rTypeKey, sal_Bool bIsExtraType,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
JavaOptions* pOptions,
sal_Bool bFullScope)
throw( CannotDumpException )
{
- OString typeName = typeMgr.getTypeName(rTypeKey);
+ OString typeName = typeMgr->getTypeName(rTypeKey);
if (!produceType(rTypeKey, bIsExtraType, typeMgr, generated, pOptions))
{
@@ -46,7 +47,7 @@ sal_Bool produceAllTypes(RegistryKey& rTypeKey, sal_Bool bIsExtraType,
exit(99);
}
- RegistryKeyList typeKeys = typeMgr.getTypeKeys(typeName);
+ RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
RegistryKeyList::const_iterator iter = typeKeys.begin();
RegistryKey key, subKey;
RegistryKeyArray subKeys;
@@ -82,7 +83,7 @@ sal_Bool produceAllTypes(RegistryKey& rTypeKey, sal_Bool bIsExtraType,
}
sal_Bool produceAllTypes(const OString& typeName,
- TypeManager const & typeMgr,
+ rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
JavaOptions* pOptions,
sal_Bool bFullScope)
@@ -96,7 +97,7 @@ sal_Bool produceAllTypes(const OString& typeName,
exit(99);
}
- RegistryKeyList typeKeys = typeMgr.getTypeKeys(typeName);
+ RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
RegistryKeyList::const_iterator iter = typeKeys.begin();
RegistryKey key, subKey;
RegistryKeyArray subKeys;
@@ -147,9 +148,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
exit(99);
}
- RegistryTypeManager typeMgr;
+ rtl::Reference< TypeManager > typeMgr(new TypeManager);
- if (!typeMgr.init(options.getInputFiles(), options.getExtraInputFiles()))
+ if (!typeMgr->init(options.getInputFiles(), options.getExtraInputFiles()))
{
fprintf(stderr, "%s : init registries failed, check your registry files.\n", options.getProgramName().getStr());
exit(99);
@@ -157,7 +158,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (options.isValid("-B"))
{
- typeMgr.setBase(options.getOption("-B"));
+ typeMgr->setBase(options.getOption("-B"));
}
try
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 247d5eb..6136619 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -35,6 +35,7 @@
#include "registry/reader.hxx"
#include "registry/refltype.hxx"
#include "registry/types.h"
+#include "rtl/ref.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/string.h"
#include "rtl/string.hxx"
@@ -58,7 +59,7 @@ namespace {
// helper function for createUnoName
void appendUnoName(
- TypeManager const & manager, rtl::OString const & nucleus, sal_Int32 rank,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & nucleus, sal_Int32 rank,
std::vector< rtl::OString > const & arguments, rtl::OStringBuffer * buffer)
{
OSL_ASSERT(rank >= 0 && buffer != 0);
@@ -91,7 +92,7 @@ void appendUnoName(
// type, polymorphic struct type template, or interface type, decomposed into
// nucleus, rank, and arguments) into a core UNO type name:
rtl::OString createUnoName(
- TypeManager const & manager, rtl::OString const & nucleus, sal_Int32 rank,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & nucleus, sal_Int32 rank,
std::vector< rtl::OString > const & arguments)
{
rtl::OStringBuffer buf;
@@ -138,14 +139,15 @@ struct PolymorphicUnoType {
};
SpecialType translateUnoTypeToDescriptor(
- TypeManager const & manager, rtl::OString const & type, bool array,
- bool classType, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
+ bool array, bool classType, Dependencies * dependencies,
rtl::OStringBuffer * descriptor, rtl::OStringBuffer * signature,
bool * needsSignature, PolymorphicUnoType * polymorphicUnoType);
SpecialType translateUnoTypeToDescriptor(
- TypeManager const & manager, codemaker::UnoType::Sort sort,
- RTTypeClass typeClass, rtl::OString const & nucleus, sal_Int32 rank,
+ rtl::Reference< TypeManager > const & manager,
+ codemaker::UnoType::Sort sort, RTTypeClass typeClass,
+ rtl::OString const & nucleus, sal_Int32 rank,
std::vector< rtl::OString > const & arguments, bool array, bool classType,
Dependencies * dependencies, rtl::OStringBuffer * descriptor,
rtl::OStringBuffer * signature, bool * needsSignature,
@@ -258,8 +260,8 @@ SpecialType translateUnoTypeToDescriptor(
}
SpecialType translateUnoTypeToDescriptor(
- TypeManager const & manager, rtl::OString const & type, bool array,
- bool classType, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
+ bool array, bool classType, Dependencies * dependencies,
rtl::OStringBuffer * descriptor, rtl::OStringBuffer * signature,
bool * needsSignature, PolymorphicUnoType * polymorphicUnoType)
{
@@ -277,7 +279,7 @@ SpecialType translateUnoTypeToDescriptor(
}
SpecialType getFieldDescriptor(
- TypeManager const & manager, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
rtl::OString const & type, rtl::OString * descriptor,
rtl::OString * signature, PolymorphicUnoType * polymorphicUnoType)
{
@@ -302,8 +304,9 @@ SpecialType getFieldDescriptor(
class MethodDescriptor {
public:
MethodDescriptor(
- TypeManager const & manager, Dependencies * dependencies,
- rtl::OString const & returnType, SpecialType * specialReturnType,
+ rtl::Reference< TypeManager > const & manager,
+ Dependencies * dependencies, rtl::OString const & returnType,
+ SpecialType * specialReturnType,
PolymorphicUnoType * polymorphicUnoType);
SpecialType addParameter(
@@ -317,7 +320,7 @@ public:
rtl::OString getSignature() const;
private:
- TypeManager const & m_manager;
+ rtl::Reference< TypeManager > m_manager;
Dependencies * m_dependencies;
rtl::OStringBuffer m_descriptorStart;
rtl::OString m_descriptorEnd;
@@ -327,7 +330,7 @@ private:
};
MethodDescriptor::MethodDescriptor(
- TypeManager const & manager, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
rtl::OString const & returnType, SpecialType * specialReturnType,
PolymorphicUnoType * polymorphicUnoType):
m_manager(manager), m_dependencies(dependencies), m_needsSignature(false)
@@ -663,11 +666,12 @@ void addTypeInfo(
}
typedef void (* handleUnoTypeRegistryEntityFunction)(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies);
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies);
void handleEnumType(
- SAL_UNUSED_PARAMETER TypeManager const &,
+ SAL_UNUSED_PARAMETER rtl::Reference< TypeManager > const &,
JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
SAL_UNUSED_PARAMETER Dependencies *)
{
@@ -838,7 +842,7 @@ void handleEnumType(
}
void addField(
- TypeManager const & manager, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
ClassFile * classFile, std::vector< TypeInfo > * typeInfo,
sal_Int32 typeParameterIndex, rtl::OString const & type,
rtl::OString const & name, sal_Int32 index)
@@ -864,10 +868,10 @@ void addField(
}
sal_uInt16 addFieldInit(
- TypeManager const & manager, rtl::OString const & className,
- rtl::OString const & fieldName, bool typeParameter,
- rtl::OString const & fieldType, Dependencies * dependencies,
- ClassFile::Code * code)
+ rtl::Reference< TypeManager > const & manager,
+ rtl::OString const & className, rtl::OString const & fieldName,
+ bool typeParameter, rtl::OString const & fieldType,
+ Dependencies * dependencies, ClassFile::Code * code)
{
OSL_ASSERT(dependencies != 0 && code != 0);
if (typeParameter) {
@@ -905,7 +909,7 @@ sal_uInt16 addFieldInit(
case RT_TYPE_ENUM:
{
code->loadLocalReference(0);
- typereg::Reader reader(manager.getTypeReader(nucleus));
+ typereg::Reader reader(manager->getTypeReader(nucleus));
if (reader.getFieldCount() == 0) {
throw CannotDumpException("Bad type information"); //TODO
}
@@ -981,8 +985,8 @@ sal_uInt16 addFieldInit(
}
sal_uInt16 addLoadLocal(
- TypeManager const & manager, ClassFile::Code * code, sal_uInt16 * index,
- bool typeParameter, rtl::OString const & type, bool any,
+ rtl::Reference< TypeManager > const & manager, ClassFile::Code * code,
+ sal_uInt16 * index, bool typeParameter, rtl::OString const & type, bool any,
Dependencies * dependencies)
{
OSL_ASSERT(
@@ -1321,13 +1325,13 @@ sal_uInt16 addLoadLocal(
}
void addBaseArguments(
- TypeManager const & manager, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
MethodDescriptor * methodDescriptor, ClassFile::Code * code,
RTTypeClass typeClass, rtl::OString const & type, sal_uInt16 * index)
{
OSL_ASSERT(
dependencies != 0 && methodDescriptor != 0 && code != 0 && index != 0);
- typereg::Reader reader(manager.getTypeReader(type));
+ typereg::Reader reader(manager->getTypeReader(type));
if (!reader.isValid() || reader.getTypeClass() != typeClass
|| codemaker::convertString(reader.getTypeName()) != type
|| reader.getMethodCount() != 0 || reader.getReferenceCount() != 0)
@@ -1373,7 +1377,7 @@ void addBaseArguments(
}
sal_uInt16 addDirectArgument(
- TypeManager const & manager, Dependencies * dependencies,
+ rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
MethodDescriptor * methodDescriptor, ClassFile::Code * code,
sal_uInt16 * index, rtl::OString const & className,
rtl::OString const & fieldName, bool typeParameter,
@@ -1397,8 +1401,9 @@ sal_uInt16 addDirectArgument(
}
void handleAggregatingType(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
if (reader.getMethodCount() != 0)
@@ -1615,9 +1620,10 @@ void handleAggregatingType(
}
void createExceptionsAttribute(
- TypeManager const & manager, typereg::Reader const & reader,
- sal_uInt16 methodIndex, Dependencies * dependencies,
- std::vector< rtl::OString > * exceptions, codemaker::ExceptionTree * tree)
+ rtl::Reference< TypeManager > const & manager,
+ typereg::Reader const & reader, sal_uInt16 methodIndex,
+ Dependencies * dependencies, std::vector< rtl::OString > * exceptions,
+ codemaker::ExceptionTree * tree)
{
OSL_ASSERT(dependencies != 0 && exceptions != 0);
sal_uInt16 n = reader.getMethodExceptionCount(methodIndex);
@@ -1634,8 +1640,9 @@ void createExceptionsAttribute(
}
void handleInterfaceType(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
@@ -1855,7 +1862,7 @@ void handleInterfaceType(
}
void handleTypedef(
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
SAL_UNUSED_PARAMETER JavaOptions /*TODO const*/ &,
typereg::Reader const & reader, Dependencies * dependencies)
{
@@ -1895,9 +1902,9 @@ void handleTypedef(
}
void addConstant(
- TypeManager const & manager, typereg::Reader const & reader,
- bool publishable, sal_uInt16 index, Dependencies * dependencies,
- ClassFile * classFile)
+ rtl::Reference< TypeManager > const & manager,
+ typereg::Reader const & reader, bool publishable, sal_uInt16 index,
+ Dependencies * dependencies, ClassFile * classFile)
{
OSL_ASSERT(dependencies != 0 && classFile != 0);
RTFieldAccess flags = reader.getFieldFlags(index);
@@ -2010,8 +2017,9 @@ void addConstant(
}
void handleConstantGroup(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
if (reader.getSuperTypeCount() != 0 || reader.getMethodCount() != 0
@@ -2037,8 +2045,9 @@ void handleConstantGroup(
}
void handleModule(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
if (reader.getSuperTypeCount() != 0 || reader.getMethodCount() != 0
@@ -2084,11 +2093,12 @@ void addExceptionHandlers(
}
void addConstructor(
- TypeManager const & manager, rtl::OString const & realJavaBaseName,
- rtl::OString const & unoName, rtl::OString const & className,
- typereg::Reader const & reader, sal_uInt16 methodIndex,
- rtl::OString const & methodName, rtl::OString const & returnType,
- bool defaultConstructor, Dependencies * dependencies, ClassFile * classFile)
+ rtl::Reference< TypeManager > const & manager,
+ rtl::OString const & realJavaBaseName, rtl::OString const & unoName,
+ rtl::OString const & className, typereg::Reader const & reader,
+ sal_uInt16 methodIndex, rtl::OString const & methodName,
+ rtl::OString const & returnType, bool defaultConstructor,
+ Dependencies * dependencies, ClassFile * classFile)
{
OSL_ASSERT(dependencies != 0 && classFile != 0);
MethodDescriptor desc(manager, dependencies, returnType, 0, 0);
@@ -2230,8 +2240,9 @@ void addConstructor(
}
void handleService(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
sal_uInt16 superTypes = reader.getSuperTypeCount();
@@ -2347,8 +2358,9 @@ void handleService(
}
void handleSingleton(
- TypeManager const & manager, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies * dependencies)
+ rtl::Reference< TypeManager > const & manager,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);
if (reader.getSuperTypeCount() != 1 || reader.getFieldCount() != 0
@@ -2359,7 +2371,7 @@ void handleSingleton(
}
rtl::OString base(codemaker::convertString(reader.getSuperTypeName(0)));
rtl::OString realJavaBaseName(base.replace('/', '.'));
- switch (manager.getTypeReader(base).getTypeClass()) {
+ switch (manager->getTypeReader(base).getTypeClass()) {
case RT_TYPE_INTERFACE:
break;
@@ -2470,16 +2482,16 @@ void handleSingleton(
}
bool produceType(
- rtl::OString const & type, TypeManager const & manager,
+ rtl::OString const & type, rtl::Reference< TypeManager > const & manager,
codemaker::GeneratedTypeSet & generated, JavaOptions * options)
{
OSL_ASSERT(options != 0);
- if (type == "/" || type == manager.getBase() || generated.contains(type))
+ if (type == "/" || type == manager->getBase() || generated.contains(type))
{
return true;
}
sal_Bool extra = sal_False;
- typereg::Reader reader(manager.getTypeReader(type, &extra));
+ typereg::Reader reader(manager->getTypeReader(type, &extra));
if (extra) {
generated.add(type);
return true;
@@ -2540,17 +2552,19 @@ bool produceType(
}
bool produceType(
- RegistryKey & rTypeKey, bool bIsExtraType, TypeManager const & manager,
+ RegistryKey & rTypeKey, bool bIsExtraType,
+ rtl::Reference< TypeManager > const & manager,
codemaker::GeneratedTypeSet & generated, JavaOptions * options)
{
- ::rtl::OString typeName = manager.getTypeName(rTypeKey);
+ ::rtl::OString typeName = manager->getTypeName(rTypeKey);
OSL_ASSERT(options != 0);
- if (typeName == "/" || typeName == manager.getBase() || generated.contains(typeName))
+ if (typeName == "/" || typeName == manager->getBase()
+ || generated.contains(typeName))
{
return true;
}
- typereg::Reader reader(manager.getTypeReader(rTypeKey));
+ typereg::Reader reader(manager->getTypeReader(rTypeKey));
if (bIsExtraType) {
generated.add(typeName);
return true;
diff --git a/codemaker/source/javamaker/javatype.hxx b/codemaker/source/javamaker/javatype.hxx
index c1da979..5161628 100644
--- a/codemaker/source/javamaker/javatype.hxx
+++ b/codemaker/source/javamaker/javatype.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_CODEMAKER_SOURCE_JAVAMAKER_JAVATYPE_HXX
#define INCLUDED_CODEMAKER_SOURCE_JAVAMAKER_JAVATYPE_HXX
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+
namespace codemaker { class GeneratedTypeSet; }
namespace rtl { class OString; }
class JavaOptions;
@@ -27,10 +31,10 @@ class TypeManager;
class RegistryKey;
bool produceType(
- rtl::OString const & type, TypeManager const & manager,
+ rtl::OString const & type, rtl::Reference< TypeManager > const & manager,
codemaker::GeneratedTypeSet & generated, JavaOptions * pOptions);
-bool produceType(RegistryKey& typeName, bool bIsExtraType, TypeManager const & typeMgr,
+bool produceType(RegistryKey& typeName, bool bIsExtraType, rtl::Reference< TypeManager > const & typeMgr,
codemaker::GeneratedTypeSet & generated,
JavaOptions* pOptions);
diff --git a/unodevtools/Executable_skeletonmaker.mk b/unodevtools/Executable_skeletonmaker.mk
index 433ba38..1d00f3b 100644
--- a/unodevtools/Executable_skeletonmaker.mk
+++ b/unodevtools/Executable_skeletonmaker.mk
@@ -54,7 +54,6 @@ $(eval $(call gb_Executable_use_static_libraries,uno-skeletonmaker,\
$(eval $(call gb_Executable_add_exception_objects,uno-skeletonmaker,\
unodevtools/source/unodevtools/options \
unodevtools/source/unodevtools/typeblob \
- unodevtools/source/unodevtools/typemanager \
unodevtools/source/skeletonmaker/skeletonmaker \
unodevtools/source/skeletonmaker/skeletoncommon \
unodevtools/source/skeletonmaker/javatypemaker \
diff --git a/unodevtools/inc/unodevtools/options.hxx b/unodevtools/inc/unodevtools/options.hxx
index a321bc9..7c1a9c1 100644
--- a/unodevtools/inc/unodevtools/options.hxx
+++ b/unodevtools/inc/unodevtools/options.hxx
@@ -20,11 +20,10 @@
#ifndef INCLUDED_UNODEVTOOLS_OPTIONS_HXX
#define INCLUDED_UNODEVTOOLS_OPTIONS_HXX
-#include <rtl/ustrbuf.hxx>
+#include "sal/config.h"
-namespace com { namespace sun { namespace star { namespace uno {
-class RuntimeException;
-} } } }
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <rtl/ustrbuf.hxx>
namespace unodevtools {
diff --git a/unodevtools/inc/unodevtools/typemanager.hxx b/unodevtools/inc/unodevtools/typemanager.hxx
deleted file mode 100644
index c280776..0000000
--- a/unodevtools/inc/unodevtools/typemanager.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_UNODEVTOOLS_TYPEMANAGER_HXX
-#define INCLUDED_UNODEVTOOLS_TYPEMANAGER_HXX
-
-#include <codemaker/typemanager.hxx>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-
-#include <boost/unordered_map.hpp>
-#include <vector>
-
-class RegistryKey;
-
-namespace typereg { class Reader; }
-
-typedef boost::unordered_map
-<
- ::rtl::OString, // Typename
- RTTypeClass, // TypeClass
- HashString,
- EqualString
-> T2TypeClassMap;
-
-namespace unodevtools {
-
-struct UnoTypeManagerImpl
-{
- UnoTypeManagerImpl() {}
-
- T2TypeClassMap m_t2TypeClass;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XHierarchicalNameAccess> m_tdmgr;
-};
-
-class UnoTypeManager : public TypeManager
-{
-public:
- UnoTypeManager();
- ~UnoTypeManager();
-
- UnoTypeManager( const UnoTypeManager& value )
- : TypeManager(value)
- , m_pImpl( value.m_pImpl )
- {}
-
- sal_Bool init(const ::std::vector< ::rtl::OUString > registries);
-
- sal_Bool isValidType(const ::rtl::OString& name) const;
- ::rtl::OString getTypeName(RegistryKey& rTypeKey) const;
- typereg::Reader getTypeReader(
- const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const;
- typereg::Reader getTypeReader(RegistryKey& rTypeKey) const;
- RTTypeClass getTypeClass(const ::rtl::OString& name) const;
- RTTypeClass getTypeClass(RegistryKey& rTypeKey) const;
-
-protected:
- void release();
-
- UnoTypeManagerImpl* m_pImpl;
-};
-
-}
-
-#endif // _UNODEVTOOLS_TYPEMANAGER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index 8f42cd4..5604962 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -499,7 +499,7 @@ void generateXDispatchProvider(std::ostream& o,
void generateAddinConstructorAndHelper(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager, const OString & classname,
+ rtl::Reference< TypeManager > const & manager, const OString & classname,
const boost::unordered_set< OString, OStringHash >& interfaces)
{
o << classname << "::" << classname
@@ -575,7 +575,7 @@ void generateAddinConstructorAndHelper(std::ostream& o,
void generateMemberInitialization(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
AttributeInfo const & members)
{
if (!members.empty()) {
@@ -602,7 +602,7 @@ void generateMemberInitialization(std::ostream& o,
void generateMemberDeclaration(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
AttributeInfo const & members)
{
for (AttributeInfo::const_iterator i(members.begin());
@@ -617,7 +617,7 @@ void generateMemberDeclaration(std::ostream& o,
OString generateClassDefinition(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
OString const & classname,
boost::unordered_set< OString, OStringHash > const & interfaces,
AttributeInfo const & properties,
@@ -705,7 +705,7 @@ OString generateClassDefinition(std::ostream& o,
codemaker::GeneratedTypeSet generated;
while (it != interfaces.end())
{
- typereg::Reader reader(manager.getTypeReader((*it).replace('.','/')));
+ typereg::Reader reader(manager->getTypeReader((*it).replace('.','/')));
printMethods(o, options, manager, reader, generated, "", "", " ",
true, propertyhelper);
++it;
@@ -880,7 +880,7 @@ void generateXServiceInfoBodies(std::ostream& o,
void generateMethodBodies(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
boost::unordered_set< OString, OStringHash > const & interfaces,
OString const & classname,
OString const & comphelpernamespace,
@@ -895,7 +895,7 @@ void generateMethodBodies(std::ostream& o,
generateXServiceInfoBodies(o, name, comphelpernamespace);
generated.add(*iter);
} else {
- typereg::Reader reader(manager.getTypeReader((*iter).replace('.','/')));
+ typereg::Reader reader(manager->getTypeReader((*iter).replace('.','/')));
printMethods(o, options, manager, reader, generated, "_",
name, "", true, propertyhelper);
}
@@ -905,7 +905,7 @@ void generateMethodBodies(std::ostream& o,
void generateQueryInterface(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< OString, OStringHash >& interfaces,
OString const & parentname,
OString const & classname,
@@ -954,7 +954,7 @@ void generateQueryInterface(std::ostream& o,
}
void generateSkeleton(ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
std::vector< OString > const & types)
{
// special handling of calc add-ins
@@ -1093,7 +1093,7 @@ void generateSkeleton(ProgramOptions const & options,
}
void generateCalcAddin(ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
std::vector< OString > const & types)
{
boost::unordered_set< OString, OStringHash > interfaces;
diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
index e95b503..640d054 100644
--- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
@@ -28,7 +28,7 @@ using namespace ::codemaker::cpp;
namespace skeletonmaker { namespace cpp {
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
codemaker::UnoType::Sort sort, RTTypeClass typeClass,
OString const & name, sal_Int32 rank,
std::vector< OString > const & arguments, short referenceType,
@@ -63,7 +63,7 @@ void printType(std::ostream & o,
if (defaultvalue && referenceType == 16) {
if (typeClass == RT_TYPE_ENUM) {
- typereg::Reader reader(manager.getTypeReader(name));
+ typereg::Reader reader(manager->getTypeReader(name));
o << name.copy(name.lastIndexOf('/'))
<< "_"
<< codemaker::convertString(reader.getFieldName(0));
@@ -122,7 +122,7 @@ void printType(std::ostream & o,
}
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type, short referenceType, bool defaultvalue)
{
RTTypeClass typeClass;
@@ -137,7 +137,7 @@ void printType(std::ostream & o,
}
bool printConstructorParameters(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, typereg::Reader const & outerReader,
std::vector< OString > const & arguments)
{
@@ -145,7 +145,7 @@ bool printConstructorParameters(std::ostream & o,
if (reader.getSuperTypeCount() != 0) {
OString super(
codemaker::convertString(reader.getSuperTypeName(0)));
- typereg::Reader superReader(manager.getTypeReader(super));
+ typereg::Reader superReader(manager->getTypeReader(super));
if (!superReader.isValid())
throw CannotDumpException("Bad type library entity " + super);
@@ -186,7 +186,7 @@ bool printConstructorParameters(std::ostream & o,
}
void printConstructor(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader,
std::vector< OString > const & arguments)
{
@@ -199,7 +199,7 @@ void printConstructor(std::ostream & o,
}
void printMethodParameters(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, sal_uInt16 method, bool previous,
bool withtype)
{
@@ -235,7 +235,7 @@ void printMethodParameters(std::ostream & o,
}
void printExceptionSpecification(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, sal_uInt16 method)
{
o << ((options.shortnames) ? " throw (css::uno::RuntimeException" :
@@ -367,7 +367,7 @@ void generateXDispatchProvider(std::ostream& o,
void printMethods(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, codemaker::GeneratedTypeSet & generated,
OString const & delegate, OString const & classname,
OString const & indentation, bool defaultvalue,
@@ -456,7 +456,7 @@ void printMethods(std::ostream & o,
if (options.all || defaultvalue) {
for (sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i) {
typereg::Reader super(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(i))));
if (!super.isValid()) {
@@ -642,7 +642,7 @@ void printMethods(std::ostream & o,
}
void printConstructionMethods(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader)
{
for (sal_uInt16 i = 0; i < reader.getMethodCount(); ++i) {
@@ -671,7 +671,7 @@ void printConstructionMethods(std::ostream & o,
}
void printServiceMembers(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, OString const & type,
OString const & delegate)
{
@@ -709,7 +709,7 @@ void printServiceMembers(std::ostream & o,
}
void printMapsToCppType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
codemaker::UnoType::Sort sort, RTTypeClass typeClass,
OString const & name, sal_Int32 rank,
std::vector< OString > const & arguments, const char * cppTypeSort)
@@ -728,7 +728,7 @@ void printMapsToCppType(std::ostream & o,
}
void generateDocumentation(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type, OString const & delegate)
{
if (type.indexOf('/') >= 0)
@@ -760,7 +760,7 @@ void generateDocumentation(std::ostream & o,
} else if (sort != codemaker::UnoType::SORT_COMPLEX) {
o << " simple type";
} else {
- typereg::Reader reader(manager.getTypeReader(name));
+ typereg::Reader reader(manager->getTypeReader(name));
if (!reader.isValid())
throw CannotDumpException("Bad type library entity " + name);
@@ -803,7 +803,7 @@ void generateDocumentation(std::ostream & o,
break;
case RT_TYPE_SINGLETON:
- if ((manager.getTypeReader(
+ if ((manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))).getTypeClass())
== RT_TYPE_INTERFACE)
@@ -839,7 +839,7 @@ void generateDocumentation(std::ostream & o,
o << '\n';
}
} else {
- typereg::Reader reader(manager.getTypeReader(name));
+ typereg::Reader reader(manager->getTypeReader(name));
if (!reader.isValid())
throw CannotDumpException("Bad type library entity " + name);
@@ -933,7 +933,7 @@ void generateDocumentation(std::ostream & o,
case RT_TYPE_SINGLETON:
if (reader.getSuperTypeCount() > 0 &&
- ((manager.getTypeReader(
+ ((manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))).
getTypeClass()) == RT_TYPE_INTERFACE) )
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 4ddaf59..6110e9c 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -503,7 +503,7 @@ void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & opt
void generateMethodBodies(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< OString, OStringHash >& interfaces,
const OString& indentation, bool usepropertymixin)
{
@@ -559,7 +559,7 @@ void generateMethodBodies(std::ostream& o,
continue;
}
}
- typereg::Reader reader(manager.getTypeReader(type.replace('.','/')));
+ typereg::Reader reader(manager->getTypeReader(type.replace('.','/')));
printMethods(o, options, manager, reader, generated, "_",
indentation, true, usepropertymixin);
}
@@ -575,7 +575,7 @@ static const char* propcomment=
void generateAddinConstructorAndHelper(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager, const OString & classname,
+ rtl::Reference< TypeManager > const & manager, const OString & classname,
const boost::unordered_set< OString, OStringHash >& services,
const boost::unordered_set< OString, OStringHash >& interfaces)
{
@@ -720,7 +720,7 @@ void generateAddinConstructorAndHelper(std::ostream& o,
void generateClassDefinition(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const OString & classname,
const boost::unordered_set< OString, OStringHash >& services,
const boost::unordered_set< OString, OStringHash >& interfaces,
@@ -840,7 +840,7 @@ void generateClassDefinition(std::ostream& o,
}
void generateSkeleton(ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
std::vector< OString > const & types)
{
boost::unordered_set< OString, OStringHash > interfaces;
diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx
index 7e7f86c..155bd05 100644
--- a/unodevtools/source/skeletonmaker/javatypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx
@@ -27,12 +27,12 @@ using namespace ::rtl;
namespace skeletonmaker { namespace java {
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type, bool referenceType,
bool defaultvalue);
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
codemaker::UnoType::Sort sort, RTTypeClass typeClass,
OString const & name, sal_Int32 rank,
std::vector< OString > const & arguments, bool referenceType,
@@ -115,7 +115,7 @@ void printType(std::ostream & o,
}
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type, bool referenceType, bool defaultvalue)
{
RTTypeClass typeClass;
@@ -130,7 +130,7 @@ void printType(std::ostream & o,
}
bool printConstructorParameters(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, typereg::Reader const & outerReader,
std::vector< OString > const & arguments)
{
@@ -138,7 +138,7 @@ bool printConstructorParameters(std::ostream & o,
if ( reader.getSuperTypeCount() != 0 ) {
OString super(
codemaker::convertString(reader.getSuperTypeName(0)));
- typereg::Reader superReader(manager.getTypeReader(super));
+ typereg::Reader superReader(manager->getTypeReader(super));
if ( !superReader.isValid() ) {
throw CannotDumpException("Bad type library entity " + super);
}
@@ -180,7 +180,7 @@ bool printConstructorParameters(std::ostream & o,
}
void printConstructor(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader,
std::vector< OString > const & arguments)
{
@@ -191,7 +191,7 @@ void printConstructor(std::ostream & o,
}
void printMethodParameters(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, sal_uInt16 method, bool previous,
bool withtype)
{
@@ -226,7 +226,7 @@ void printMethodParameters(std::ostream & o,
}
void printExceptionSpecification(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, sal_uInt16 method)
{
if ( reader.getMethodExceptionCount(method) > 0 ) {
@@ -345,7 +345,7 @@ void generateXFastPropertySetBodies(std::ostream& o);
void generateXPropertyAccessBodies(std::ostream& o);
void printMethods(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader,
codemaker::GeneratedTypeSet & generated,
OString const & delegate, OString const & indentation,
@@ -384,7 +384,7 @@ void printMethods(std::ostream & o,
if ( options.all || defaultvalue ) {
for (sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i) {
typereg::Reader super(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
@@ -544,7 +544,7 @@ void printMethods(std::ostream & o,
}
void printConstructionMethods(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader)
{
for ( sal_uInt16 i = 0; i < reader.getMethodCount(); ++i ) {
@@ -569,11 +569,11 @@ void printConstructionMethods(std::ostream & o,
}
void generateDocumentation(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type);
void printServiceMembers(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader, OString const & type,
OString const & delegate)
{
@@ -608,7 +608,7 @@ void printServiceMembers(std::ostream & o,
}
void printMapsToJavaType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
codemaker::UnoType::Sort sort, RTTypeClass typeClass,
OString const & name, sal_Int32 rank,
std::vector< OString > const & arguments, const char * javaTypeSort)
@@ -628,7 +628,7 @@ void printMapsToJavaType(std::ostream & o,
}
void generateDocumentation(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
OString const & type, OString const & delegate)
{
if ( type.indexOf('/') >= 0 ) {
@@ -658,7 +658,7 @@ void generateDocumentation(std::ostream & o,
} else if ( sort != codemaker::UnoType::SORT_COMPLEX ) {
o << " simple type";
} else {
- typereg::Reader reader(manager.getTypeReader(name));
+ typereg::Reader reader(manager->getTypeReader(name));
if ( !reader.isValid() ) {
throw CannotDumpException("Bad type library entity " + name);
}
@@ -702,7 +702,7 @@ void generateDocumentation(std::ostream & o,
break;
case RT_TYPE_SINGLETON:
- if ( (manager.getTypeReader(
+ if ( (manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))).getTypeClass())
== RT_TYPE_INTERFACE )
@@ -736,7 +736,7 @@ void generateDocumentation(std::ostream & o,
options, manager, sort, typeClass, name, rank, arguments, 0);
o << '\n';
} else {
- typereg::Reader reader(manager.getTypeReader(name));
+ typereg::Reader reader(manager->getTypeReader(name));
if ( !reader.isValid() ) {
throw CannotDumpException("Bad type library entity " + name);
}
@@ -820,7 +820,7 @@ void generateDocumentation(std::ostream & o,
case RT_TYPE_SINGLETON:
if ( reader.getSuperTypeCount() > 0 &&
- ((manager.getTypeReader(
+ ((manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))).getTypeClass())
== RT_TYPE_INTERFACE) ) {
diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
index e32fda2..1b63eda 100644
--- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx
+++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
@@ -91,7 +91,7 @@ bool getOutputStream(ProgramOptions const & options,
}
codemaker::UnoType::Sort decomposeResolveAndCheck(
- TypeManager const & manager, OString const & type,
+ rtl::Reference< TypeManager > const & manager, OString const & type,
bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
RTTypeClass * typeClass, OString * name, sal_Int32 * rank,
std::vector< OString > * arguments)
@@ -125,7 +125,7 @@ bool containsAttribute(AttributeInfo& attributes, OString const & attrname)
}
// collect attributes including inherited attributes
-void checkAttributes(TypeManager const & manager,
+void checkAttributes(rtl::Reference< TypeManager > const & manager,
const typereg::Reader& reader,
AttributeInfo& attributes,
boost::unordered_set< OString, OStringHash >& propinterfaces)
@@ -140,7 +140,7 @@ void checkAttributes(TypeManager const & manager,
}
for ( sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i ) {
- typereg::Reader supertype(manager.getTypeReader(
+ typereg::Reader supertype(manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(i))));
if ( !supertype.isValid() ) {
@@ -167,7 +167,7 @@ void checkAttributes(TypeManager const & manager,
}
}
-void checkType(TypeManager const & manager,
+void checkType(rtl::Reference< TypeManager > const & manager,
OString const & type,
boost::unordered_set< OString, OStringHash >& interfaceTypes,
boost::unordered_set< OString, OStringHash >& serviceTypes,
@@ -175,7 +175,7 @@ void checkType(TypeManager const & manager,
{
OString binType(type.replace('.', '/'));
- typereg::Reader reader(manager.getTypeReader(binType));
+ typereg::Reader reader(manager->getTypeReader(binType));
if ( !reader.isValid() ) {
throw CannotDumpException("Bad type library entity " + binType);
}
@@ -205,7 +205,7 @@ void checkType(TypeManager const & manager,
if ( interfaceTypes.find(supername) == interfaceTypes.end() ) {
interfaceTypes.insert(supername);
- typereg::Reader supertype(manager.getTypeReader(
+ typereg::Reader supertype(manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))));
if ( !supertype.isValid() ) {
@@ -288,7 +288,7 @@ void checkDefaultInterfaces(
}
}
-bool checkServiceProperties(TypeManager const & manager,
+bool checkServiceProperties(rtl::Reference< TypeManager > const & manager,
const typereg::Reader & reader)
{
if ( reader.getFieldCount() > 0 )
@@ -298,7 +298,7 @@ bool checkServiceProperties(TypeManager const & manager,
for ( sal_uInt16 i = 0; i < reader.getReferenceCount(); ++i ) {
if ( reader.getReferenceSort(i) == RT_REF_EXPORTS ) {
typereg::Reader refreader(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(reader.getReferenceTypeName(i))));
if ( checkServiceProperties(manager, refreader) )
@@ -312,7 +312,7 @@ bool checkServiceProperties(TypeManager const & manager,
OString checkPropertyHelper(
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< OString, OStringHash >& services,
const boost::unordered_set< OString, OStringHash >& interfaces,
AttributeInfo& attributes,
@@ -331,13 +331,13 @@ OString checkPropertyHelper(
bool oldStyleWithProperties = false;
while ( iter != end ) {
- typereg::Reader reader(manager.getTypeReader((*iter).replace('.', '/')));
+ typereg::Reader reader(manager->getTypeReader((*iter).replace('.', '/')));
if ( !services.empty() ) {
if ( options.supportpropertysetmixin && reader.getSuperTypeCount() > 0 )
{
typereg::Reader supertype(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(0))));
if ( !supertype.isValid() ) {
@@ -371,7 +371,7 @@ OString checkPropertyHelper(
return (oldStyleWithProperties ? "_" : "");
}
-bool checkXComponentSupport(TypeManager const & manager,
+bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader)
{
static OUString s( "com/sun/star/lang/XComponent");
@@ -380,7 +380,7 @@ bool checkXComponentSupport(TypeManager const & manager,
for ( sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i ) {
typereg::Reader super(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
@@ -399,7 +399,7 @@ bool checkXComponentSupport(TypeManager const & manager,
// if XComponent is directly specified, return true and remove it from the
// supported interfaces list
-bool checkXComponentSupport(TypeManager const & manager,
+bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
boost::unordered_set< OString, OStringHash >& interfaces)
{
if ( interfaces.empty() )
@@ -412,7 +412,7 @@ bool checkXComponentSupport(TypeManager const & manager,
interfaces.erase("com.sun.star.lang.XComponent");
return true;
}
- typereg::Reader reader(manager.getTypeReader((*iter).replace('.', '/')));
+ typereg::Reader reader(manager->getTypeReader((*iter).replace('.', '/')));
if ( checkXComponentSupport(manager, reader) )
return true;
++iter;
@@ -465,7 +465,7 @@ sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader,
// This function checks if the specified types for parameters and return
// types are allowed add-in types, for more info see the com.sun.star.sheet.AddIn
// service description
-bool checkAddinType(TypeManager const & manager,
+bool checkAddinType(rtl::Reference< TypeManager > const & manager,
OString const & type, bool & bLastAny,
bool & bHasXPropertySet, bool bIsReturn)
{
@@ -515,7 +515,7 @@ bool checkAddinType(TypeManager const & manager,
return false;
}
-void checkAddInTypes(TypeManager const & manager,
+void checkAddInTypes(rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader)
{
OString sType(codemaker::convertString(reader.getTypeName()).replace('/', '.'));
@@ -568,7 +568,7 @@ void checkAddInTypes(TypeManager const & manager,
void generateFunctionParamterMap(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader,
::codemaker::GeneratedTypeSet & generated,
bool bFirst)
@@ -590,7 +590,7 @@ void generateFunctionParamterMap(std::ostream& o,
for ( sal_uInt16 i = 0; i < reader.getSuperTypeCount(); ++i ) {
typereg::Reader super(
- manager.getTypeReader(
+ manager->getTypeReader(
codemaker::convertString(
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
@@ -669,14 +669,14 @@ void generateFunctionParamterMap(std::ostream& o,
void generateFunctionParameterMap(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< OString, OStringHash >& interfaces)
{
::codemaker::GeneratedTypeSet generated;
bool bFirst = true;
boost::unordered_set< OString, OStringHash >::const_iterator iter = interfaces.begin();
while ( iter != interfaces.end() ) {
- typereg::Reader reader(manager.getTypeReader((*iter).replace('.','/')));
+ typereg::Reader reader(manager->getTypeReader((*iter).replace('.','/')));
if (!reader.isValid()) {
throw CannotDumpException(
"Bad type library entity "
diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.hxx b/unodevtools/source/skeletonmaker/skeletoncommon.hxx
index 93a27c6..8fc3951 100644
--- a/unodevtools/source/skeletonmaker/skeletoncommon.hxx
+++ b/unodevtools/source/skeletonmaker/skeletoncommon.hxx
@@ -19,6 +19,9 @@
#ifndef INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
#define INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include "registry/reader.hxx"
#include "codemaker/typemanager.hxx"
@@ -95,12 +98,12 @@ bool getOutputStream(ProgramOptions const & options,
rtl::OString & tmpSourceFileName);
codemaker::UnoType::Sort decomposeResolveAndCheck(
- TypeManager const & manager, rtl::OString const & type,
+ rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
RTTypeClass * typeClass, rtl::OString * name, sal_Int32 * rank,
std::vector< rtl::OString > * arguments);
-void checkType(TypeManager const & manager,
+void checkType(rtl::Reference< TypeManager > const & manager,
rtl::OString const & type,
boost::unordered_set< rtl::OString, rtl::OStringHash >& interfaceTypes,
boost::unordered_set< rtl::OString, rtl::OStringHash >& serviceTypes,
@@ -112,7 +115,7 @@ void checkDefaultInterfaces(
const rtl::OString & propertyhelper);
rtl::OString checkPropertyHelper(
- ProgramOptions const & options, TypeManager const & manager,
+ ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< rtl::OString, rtl::OStringHash >& services,
const boost::unordered_set< rtl::OString, rtl::OStringHash >& interfaces,
AttributeInfo& attributes,
@@ -127,7 +130,7 @@ rtl::OString checkPropertyHelper(
@param reader a registry type reader of an interface defining
calc add-in functions
*/
-void checkAddInTypes(TypeManager const & manager,
+void checkAddInTypes(rtl::Reference< TypeManager > const & manager,
typereg::Reader const & reader);
@@ -141,7 +144,7 @@ void checkAddInTypes(TypeManager const & manager,
@return true if XComponent have to be supported
*/
-bool checkXComponentSupport(TypeManager const & manager,
+bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
boost::unordered_set< rtl::OString, rtl::OStringHash >& interfaces);
@@ -151,7 +154,7 @@ sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader,
void generateFunctionParameterMap(std::ostream& o,
ProgramOptions const & options,
- TypeManager const & manager,
+ rtl::Reference< TypeManager > const & manager,
const boost::unordered_set< ::rtl::OString, ::rtl::OStringHash >& interfaces);
}
diff --git a/unodevtools/source/skeletonmaker/skeletoncpp.hxx b/unodevtools/source/skeletonmaker/skeletoncpp.hxx
index 3d05e43..3ce20d1 100644
--- a/unodevtools/source/skeletonmaker/skeletoncpp.hxx
+++ b/unodevtools/source/skeletonmaker/skeletoncpp.hxx
@@ -34,21 +34,21 @@ namespace skeletonmaker { namespace cpp {
// 8 = default construction for example for return types, means "return <type>();"
// 16 = default member initialization in a constructor
void printType(std::ostream & o,
- ProgramOptions const & options, TypeManager const & manager,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list