[Libreoffice-commits] core.git: basic/inc basic/source connectivity/source cppcanvas/source dbaccess/source editeng/source idl/inc include/basic include/editeng include/filter include/sfx2 include/sot include/svtools include/svx include/tools include/unotools include/xmloff sc/inc sc/qa sc/source sd/inc sd/source sfx2/source sot/source starmath/qa starmath/source sw/inc sw/qa sw/source xmloff/source

Stephan Bergmann sbergman at redhat.com
Mon Apr 7 03:39:04 PDT 2014


 basic/inc/sbprop.hxx                            |    2 
 basic/source/inc/sbjsmeth.hxx                   |    2 
 basic/source/inc/sbunoobj.hxx                   |   10 +-
 connectivity/source/inc/dbase/dindexnode.hxx    |    5 -
 cppcanvas/source/mtfrenderer/emfplus.cxx        |    2 
 dbaccess/source/ui/inc/HtmlReader.hxx           |    2 
 dbaccess/source/ui/inc/RtfReader.hxx            |    2 
 editeng/source/editeng/eehtml.hxx               |    3 
 editeng/source/editeng/eertfpar.hxx             |    4 
 idl/inc/basobj.hxx                              |   11 +-
 idl/inc/hash.hxx                                |    2 
 idl/inc/module.hxx                              |    2 
 idl/inc/object.hxx                              |    6 -
 idl/inc/slot.hxx                                |    2 
 idl/inc/types.hxx                               |   19 ++--
 include/basic/sbmeth.hxx                        |    2 
 include/basic/sbmod.hxx                         |    2 
 include/basic/sbstar.hxx                        |    2 
 include/basic/sbx.hxx                           |   14 ---
 include/basic/sbxcore.hxx                       |    2 
 include/basic/sbxobj.hxx                        |    3 
 include/basic/sbxprop.hxx                       |    3 
 include/basic/sbxvar.hxx                        |    6 -
 include/editeng/svxacorr.hxx                    |    3 
 include/filter/msfilter/msdffimp.hxx            |    1 
 include/sfx2/app.hxx                            |    2 
 include/sfx2/docfile.hxx                        |    2 
 include/sfx2/doctempl.hxx                       |    4 
 include/sfx2/hintpost.hxx                       |    2 
 include/sfx2/linkmgr.hxx                        |    4 
 include/sfx2/linksrc.hxx                        |    2 
 include/sfx2/lnkbase.hxx                        |    2 
 include/sfx2/objsh.hxx                          |    4 
 include/sfx2/viewfrm.hxx                        |    2 
 include/sot/object.hxx                          |    2 
 include/sot/storage.hxx                         |    6 -
 include/svtools/editbrowsebox.hxx               |    9 --
 include/svtools/svparser.hxx                    |    9 --
 include/svtools/transfer.hxx                    |    2 
 include/svx/gridctrl.hxx                        |    6 -
 include/svx/svdmodel.hxx                        |    1 
 include/tools/pstm.hxx                          |    4 
 include/tools/ref.hxx                           |  100 +++++++++++-------------
 include/tools/stream.hxx                        |    6 -
 include/unotools/ucblockbytes.hxx               |    7 -
 include/xmloff/xmlictxt.hxx                     |    4 
 sc/inc/chartuno.hxx                             |    2 
 sc/inc/externalrefmgr.hxx                       |    1 
 sc/inc/global.hxx                               |    3 
 sc/inc/rangelst.hxx                             |    4 
 sc/qa/unit/helper/qahelper.hxx                  |    4 
 sc/source/core/data/global.cxx                  |    2 
 sc/source/filter/inc/ftools.hxx                 |    3 
 sc/source/filter/xml/XMLStylesImportHelper.hxx  |    2 
 sc/source/ui/inc/docsh.hxx                      |    6 -
 sc/source/ui/inc/viewdata.hxx                   |    2 
 sd/inc/drawdoc.hxx                              |    4 
 sd/source/ui/inc/DrawDocShell.hxx               |    4 
 sd/source/ui/inc/sdtreelb.hxx                   |    2 
 sd/source/ui/inc/sdxfer.hxx                     |    1 
 sfx2/source/doc/doctempl.cxx                    |    6 -
 sot/source/sdstor/ucbstorage.cxx                |    4 
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |    3 
 starmath/qa/cppunit/test_starmath.cxx           |    3 
 starmath/source/ElementsDockingWindow.cxx       |    3 
 sw/inc/IMark.hxx                                |    5 -
 sw/inc/section.hxx                              |    3 
 sw/inc/shellio.hxx                              |    3 
 sw/inc/swserv.hxx                               |    2 
 sw/inc/swtable.hxx                              |    3 
 sw/inc/viewsh.hxx                               |    1 
 sw/qa/core/filters-test.cxx                     |    3 
 sw/qa/core/macros-test.cxx                      |    3 
 sw/qa/core/uwriter.cxx                          |    3 
 sw/source/core/crsr/bookmrk.cxx                 |    2 
 sw/source/core/doc/swserv.cxx                   |    2 
 sw/source/core/docnode/section.cxx              |    2 
 sw/source/core/docnode/swbaslnk.cxx             |    2 
 sw/source/core/inc/bookmrk.hxx                  |    1 
 sw/source/core/table/swtable.cxx                |    2 
 sw/source/core/uibase/dochdl/gloshdl.cxx        |    1 
 sw/source/core/uibase/inc/glosdoc.hxx           |    2 
 sw/source/core/uibase/inc/unoatxt.hxx           |    2 
 sw/source/core/uibase/misc/glshell.cxx          |    2 
 sw/source/core/uibase/uno/unoatxt.cxx           |    1 
 sw/source/filter/ww8/wrtww8.hxx                 |    2 
 sw/source/filter/xml/xmlitmap.hxx               |    3 
 xmloff/source/forms/elementimport.hxx           |    2 
 xmloff/source/forms/layerimport.cxx             |    2 
 xmloff/source/forms/layerimport.hxx             |    3 
 xmloff/source/forms/propertyimport.hxx          |    2 
 91 files changed, 160 insertions(+), 250 deletions(-)

New commits:
commit 8f6c55a839d790c9268c1d0686f3eaf2f23484cb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 7 12:31:09 2014 +0200

    Replace SV_DECL/IMPL_REF macros with SvRef template
    
    Change-Id: I0ef2e67f6d61e0ce118c0f5e926b8194ef9d8058

diff --git a/basic/inc/sbprop.hxx b/basic/inc/sbprop.hxx
index 678de56..b736aee 100644
--- a/basic/inc/sbprop.hxx
+++ b/basic/inc/sbprop.hxx
@@ -41,7 +41,7 @@ public:
     SbModule* GetModule() { return pMod; }
 };
 
-SV_DECL_IMPL_REF(SbProperty)
+typedef tools::SvRef<SbProperty> SbPropertyRef;
 
 class BASIC_DLLPUBLIC SbProcedureProperty : public SbxProperty
 {
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index 8f790fa..2b744a0 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -37,7 +37,7 @@ public:
     TYPEINFO_OVERRIDE();
 };
 
-SV_DECL_IMPL_REF(SbJScriptMethod)
+typedef tools::SvRef<SbJScriptMethod> SbJScriptMethodRef;
 
 #endif
 
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index ae9cb67..dec4e34 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -97,7 +97,7 @@ public:
     ::com::sun::star::uno::Any getUnoAny();
     void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SbUnoStructRefObject);
+typedef tools::SvRef<SbUnoStructRefObject> SbUnoStructRefObjectRef;
 
 class SbUnoObject: public SbxObject
 {
@@ -143,7 +143,7 @@ public:
     bool isNativeCOMObject( void )
         { return bNativeCOMObject; }
 };
-SV_DECL_IMPL_REF(SbUnoObject);
+typedef tools::SvRef<SbUnoObject> SbUnoObjectRef;
 
 // #67781 delete return values of the uno-methods
 void clearUnoMethods( void );
@@ -240,7 +240,7 @@ public:
     const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& getUnoClass( void ) { return m_xClass; }
 
 };
-SV_DECL_IMPL_REF(SbUnoClass);
+typedef tools::SvRef<SbUnoClass> SbUnoClassRef;
 
 
 // function to find a global identifier in
@@ -267,7 +267,7 @@ public:
 
     void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SbUnoService);
+typedef tools::SvRef<SbUnoService> SbUnoServiceRef;
 
 SbUnoService* findUnoService( const OUString& rName );
 
@@ -307,7 +307,7 @@ public:
 
     void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SbUnoSingleton);
+typedef tools::SvRef<SbUnoSingleton> SbUnoSingletonRef;
 
 SbUnoSingleton* findUnoSingleton( const OUString& rName );
 
diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx
index 42ada7c..b00537a 100644
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ b/connectivity/source/inc/dbase/dindexnode.hxx
@@ -86,7 +86,8 @@ namespace connectivity
 
         // Index Page Pointer
 
-        SV_DECL_REF(ONDXPage) // Base class - because we need to store additional information
+        class ONDXPage;
+        typedef tools::SvRef<ONDXPage> ONDXPageRef; // Base class - because we need to store additional information
 
 
         class ONDXPagePtr : public ONDXPageRef
@@ -188,8 +189,6 @@ namespace connectivity
 #endif
         };
 
-        SV_IMPL_REF(ONDXPage);
-
         SvStream& WriteONDXPagePtr(SvStream &rStream, const ONDXPagePtr&);
         SvStream& operator >> (SvStream &rStream, ONDXPagePtr&);
 
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 62fe8f8..fed5096 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1686,7 +1686,7 @@ namespace cppcanvas
                             SAL_INFO("cppcanvas.emf", "EMF+ adjusted angles: start " <<
                                      (360.0*startAngle/M_PI) << ", end: " << (360.0*endAngle/M_PI));
 
-                            B2DPolygon polygon = tools::createPolygonFromEllipseSegment (mappedCenter, mappedSize.getX (), mappedSize.getY (), startAngle, endAngle);
+                            B2DPolygon polygon = basegfx::tools::createPolygonFromEllipseSegment (mappedCenter, mappedSize.getX (), mappedSize.getY (), startAngle, endAngle);
                             polygon.append (mappedCenter);
                             polygon.setClosed (true);
 
diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx
index 283149f..8d158ce 100644
--- a/dbaccess/source/ui/inc/HtmlReader.hxx
+++ b/dbaccess/source/ui/inc/HtmlReader.hxx
@@ -72,7 +72,7 @@ namespace dbaui
         ///< @attention recovers only valid data if 1. CTOR has been used
     };
 
-    SV_DECL_IMPL_REF( OHTMLReader );
+    typedef tools::SvRef<OHTMLReader> OHTMLReaderRef;
 }
 #endif
 
diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx
index ad7381c..533bf77 100644
--- a/dbaccess/source/ui/inc/RtfReader.hxx
+++ b/dbaccess/source/ui/inc/RtfReader.hxx
@@ -61,7 +61,7 @@ namespace dbaui
         virtual void            release() SAL_OVERRIDE;
     };
 
-    SV_DECL_IMPL_REF( ORTFReader );
+    typedef tools::SvRef<ORTFReader> ORTFReaderRef;
 }
 #endif
 
diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index e17fcc5..9bb455d 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -77,8 +77,7 @@ public:
     const EditSelection&    GetCurSelection() const { return aCurSel; }
 };
 
-SV_DECL_REF( EditHTMLParser )
-SV_IMPL_REF( EditHTMLParser );
+typedef tools::SvRef<EditHTMLParser> EditHTMLParserRef;
 
 #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EEHTML_HXX
 
diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx
index 4a5c3ca..e662aad 100644
--- a/editeng/source/editeng/eertfpar.hxx
+++ b/editeng/source/editeng/eertfpar.hxx
@@ -112,9 +112,7 @@ public:
     EditPaM     GetCurPaM() const                   { return aCurSel.Max(); }
 };
 
-SV_DECL_REF( EditRTFParser )
-SV_IMPL_REF( EditRTFParser );
-
+typedef tools::SvRef<EditRTFParser> EditRTFParserRef;
 
 #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EERTFPAR_HXX
 
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index 623dedb..d09ef13 100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -72,7 +72,7 @@ public:
     virtual void        Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
                                 WriteType, WriteAttribute = 0 );
 };
-SV_DECL_IMPL_REF(SvMetaObject)
+typedef tools::SvRef<SvMetaObject> SvMetaObjectRef;
 
 class SvMetaObjectMemberList : public SvDeclPersistList<SvMetaObject *> {};
 
@@ -141,12 +141,12 @@ public:
                                        WriteType, WriteAttribute = 0) SAL_OVERRIDE;
     void                WriteDescription( SvStream& rOutStm );
 };
-SV_DECL_IMPL_REF(SvMetaName)
+typedef tools::SvRef<SvMetaName> SvMetaNameRef;
 
 class SvMetaNameMemberList : public SvDeclPersistList<SvMetaName *> {};
 
-
-SV_DECL_REF(SvMetaReference)
+class SvMetaReference;
+typedef tools::SvRef<SvMetaReference> SvMetaReferenceRef;
 class SvMetaReference : public SvMetaName
 {
 protected:
@@ -190,7 +190,6 @@ public:
     void                SetRef( SvMetaReference * pRef  )
                         { aRef = pRef; }
 };
-SV_IMPL_REF(SvMetaReference)
 
 class SvMetaReferenceMemberList : public SvDeclPersistList<SvMetaReference *> {};
 
@@ -225,7 +224,7 @@ protected:
     virtual void        WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
                                           WriteType, WriteAttribute = 0) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SvMetaExtern)
+typedef tools::SvRef<SvMetaExtern> SvMetaExternRef;
 
 class SvMetaExternMemberList : public SvDeclPersistList<SvMetaExtern *> {};
 
diff --git a/idl/inc/hash.hxx b/idl/inc/hash.hxx
index 5cf0b83..267b514 100644
--- a/idl/inc/hash.hxx
+++ b/idl/inc/hash.hxx
@@ -92,7 +92,7 @@ public:
         }
 };
 
-SV_DECL_IMPL_REF(SvStringHashEntry)
+typedef tools::SvRef<SvStringHashEntry> SvStringHashEntryRef;
 
 typedef ::std::vector< SvStringHashEntry* > SvStringHashList;
 
diff --git a/idl/inc/module.hxx b/idl/inc/module.hxx
index 5200a27..ff76450 100644
--- a/idl/inc/module.hxx
+++ b/idl/inc/module.hxx
@@ -89,7 +89,7 @@ public:
     virtual void        WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
                                     HelpIdTable& rTable );
 };
-SV_DECL_IMPL_REF(SvMetaModule)
+typedef tools::SvRef<SvMetaModule> SvMetaModuleRef;
 
 class SvMetaModuleMemberList : public SvDeclPersistList<SvMetaModule *> {};
 
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 55f839d..7f26446 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -39,7 +39,7 @@ typedef std::vector< SvSlotElement* > SvSlotElementList;
 class SvMetaClass;
 typedef ::std::vector< SvMetaClass* > SvMetaClassList;
 
-SV_DECL_REF(SvMetaClass)
+typedef tools::SvRef<SvMetaClass> SvMetaClassRef;
 class SvClassElement : public SvPersistBase
 {
     SvBOOL                      aAutomation;
@@ -65,7 +65,7 @@ public:
                     { return xClass; }
 };
 
-SV_DECL_IMPL_REF(SvClassElement)
+typedef tools::SvRef<SvClassElement> SvClassElementRef;
 
 class SvClassElementMemberList : public SvDeclPersistList<SvClassElement *> {};
 
@@ -134,8 +134,6 @@ public:
     virtual void        WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
                                 HelpIdTable& rTable );
 };
-SV_IMPL_REF(SvMetaClass)
-
 
 #endif // _OBJECT_HXX
 
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index c0041ef..48a85c0 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -253,7 +253,7 @@ public:
                                   HelpIdTable& rIdTable ) SAL_OVERRIDE;
     virtual void        WriteCSV( SvIdlDataBase&, SvStream& ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SvMetaSlot)
+typedef tools::SvRef<SvMetaSlot> SvMetaSlotRef;
 
 class SvMetaSlotMemberList : public SvDeclPersistList<SvMetaSlot *> {};
 
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index b127d70..ee0d363 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -31,10 +31,8 @@ typedef std::vector< SvSlotElement* > SvSlotElementList;
 class SvMetaSlot;
 typedef std::map<sal_uLong, SvMetaSlot*> HelpIdTable;
 
-SV_DECL_REF(SvMetaType)
-SV_DECL_REF(SvMetaAttribute)
-
-class SvMetaAttributeMemberList : public SvDeclPersistList<SvMetaAttribute *> {};
+class SvMetaType;
+typedef tools::SvRef<SvMetaType> SvMetaTypeRef;
 
 class SvMetaAttribute : public SvMetaReference
 {
@@ -120,8 +118,10 @@ public:
     void                FillIDTable(HelpIdTable& rIDTable);
     OString        Compare( SvMetaAttribute *pAttr );
 };
-SV_IMPL_REF(SvMetaAttribute)
 
+typedef tools::SvRef<SvMetaAttribute> SvMetaAttributeRef;
+
+class SvMetaAttributeMemberList : public SvDeclPersistList<SvMetaAttribute *> {};
 
 enum { CALL_VALUE, CALL_POINTER, CALL_REFERENCE };
 enum { TYPE_METHOD, TYPE_STRUCT, TYPE_BASE, TYPE_ENUM, TYPE_UNION,
@@ -236,7 +236,6 @@ public:
     void                WriteParamNames( SvIdlDataBase & rBase, SvStream & rOutStm,
                                         const OString& rChief );
 };
-SV_IMPL_REF(SvMetaType)
 
 class SvMetaTypeMemberList : public SvDeclPersistList<SvMetaType *> {};
 
@@ -246,7 +245,7 @@ public:
             SV_DECL_META_FACTORY1( SvMetaTypeString, SvMetaType, 19 )
             SvMetaTypeString();
 };
-SV_DECL_IMPL_REF(SvMetaTypeString)
+typedef tools::SvRef<SvMetaTypeString> SvMetaTypeStringRef;
 
 class SvMetaTypeStringMemberList : public SvDeclPersistList<SvMetaTypeString *> {};
 
@@ -262,7 +261,7 @@ public:
     virtual void        Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
                                   WriteType, WriteAttribute = 0 ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SvMetaEnumValue)
+typedef tools::SvRef<SvMetaEnumValue> SvMetaEnumValueRef;
 
 class SvMetaEnumValueMemberList : public SvDeclPersistList<SvMetaEnumValue *> {};
 
@@ -293,7 +292,7 @@ public:
                                 sal_uInt16 nTab,
                                   WriteType, WriteAttribute = 0 ) SAL_OVERRIDE;
 };
-SV_DECL_IMPL_REF(SvMetaTypeEnum)
+typedef tools::SvRef<SvMetaTypeEnum> SvMetaTypeEnumRef;
 
 class SvMetaTypeEnumMemberList : public SvDeclPersistList<SvMetaTypeEnum *> {};
 
@@ -303,7 +302,7 @@ public:
             SV_DECL_META_FACTORY1( SvMetaTypevoid, SvMetaName, 22 )
             SvMetaTypevoid();
 };
-SV_DECL_IMPL_REF(SvMetaTypevoid)
+typedef tools::SvRef<SvMetaTypevoid> SvMetaTypevoidRef;
 class SvMetaTypevoidMemberList : public SvDeclPersistList<SvMetaTypevoid *> {};
 
 
diff --git a/include/basic/sbmeth.hxx b/include/basic/sbmeth.hxx
index d38e652..5ca27f6 100644
--- a/include/basic/sbmeth.hxx
+++ b/include/basic/sbmeth.hxx
@@ -67,7 +67,7 @@ public:
     virtual void    Broadcast( sal_uIntPtr nHintId ) SAL_OVERRIDE;
 };
 
-SV_DECL_IMPL_REF(SbMethod)
+typedef tools::SvRef<SbMethod> SbMethodRef;
 
 class BASIC_DLLPUBLIC SbIfaceMapperMethod : public SbMethod
 {
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx
index c5acf15..c65f055 100644
--- a/include/basic/sbmod.hxx
+++ b/include/basic/sbmod.hxx
@@ -139,7 +139,7 @@ public:
     OUString GetKeywordCase( const OUString& sKeyword ) const;
 };
 
-SV_DECL_IMPL_REF(SbModule)
+typedef tools::SvRef<SbModule> SbModuleRef;
 
 // Object class for instances of class modules
 class BASIC_DLLPUBLIC SbClassModuleObject : public SbModule
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index 5078c20..2eec72b 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -176,7 +176,7 @@ public:
         GetModelFromBasic( SbxObject* pBasic );
 };
 
-SV_DECL_IMPL_REF(StarBASIC)
+typedef tools::SvRef<StarBASIC> StarBASICRef;
 
 #endif
 
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
index a904bf3..1ab7ed3 100644
--- a/include/basic/sbx.hxx
+++ b/include/basic/sbx.hxx
@@ -116,7 +116,6 @@ public:
 // declared datatype, if they are not SbxVARIANT.
 
 class SbxVarRefs;
-class SbxVariableRef;
 
 class BASIC_DLLPUBLIC SbxArray : public SbxBase
 {
@@ -256,24 +255,17 @@ public:
     const OUString& GetElementClass() const { return aElemClass; }
 };
 
-SV_IMPL_REF(SbxBase)
-
-SV_IMPL_REF(SbxVariable)
-
 #ifndef SBX_ARRAY_DECL_DEFINED
 #define SBX_ARRAY_DECL_DEFINED
-SV_DECL_REF(SbxArray)
+typedef tools::SvRef<SbxArray> SbxArrayRef;
 #endif
-SV_IMPL_REF(SbxArray)
 
 #ifndef SBX_INFO_DECL_DEFINED
 #define SBX_INFO_DECL_DEFINED
-SV_DECL_REF(SbxInfo)
+typedef tools::SvRef<SbxInfo> SbxInfoRef;
 #endif
-SV_IMPL_REF(SbxInfo)
 
-SV_DECL_REF(SbxDimArray)
-SV_IMPL_REF(SbxDimArray)
+typedef tools::SvRef<SbxDimArray> SbxDimArrayRef;
 
 #endif
 
diff --git a/include/basic/sbxcore.hxx b/include/basic/sbxcore.hxx
index 5bf2b2e..079b961 100644
--- a/include/basic/sbxcore.hxx
+++ b/include/basic/sbxcore.hxx
@@ -106,7 +106,7 @@ public:
     static SbxObject* CreateObject( const OUString& );
 };
 
-SV_DECL_REF(SbxBase)
+typedef tools::SvRef<SbxBase> SbxBaseRef;
 
 inline void SbxBase::SetFlags( sal_uInt16 n )
 { nFlags = n; }
diff --git a/include/basic/sbxobj.hxx b/include/basic/sbxobj.hxx
index 586af9f..c6c09cf 100644
--- a/include/basic/sbxobj.hxx
+++ b/include/basic/sbxobj.hxx
@@ -88,8 +88,7 @@ public:
     void Dump( SvStream&, bool bDumpAll=false );
 };
 
-SV_DECL_REF(SbxObject)
-SV_IMPL_REF(SbxObject)
+typedef tools::SvRef<SbxObject> SbxObjectRef;
 
 #endif // INCLUDED_BASIC_SBXOBJ_HXX
 
diff --git a/include/basic/sbxprop.hxx b/include/basic/sbxprop.hxx
index 3a9cd23..6587b7f 100644
--- a/include/basic/sbxprop.hxx
+++ b/include/basic/sbxprop.hxx
@@ -36,8 +36,7 @@ public:
     virtual SbxClassType GetClass() const SAL_OVERRIDE;
 };
 
-SV_DECL_REF(SbxProperty)
-SV_IMPL_REF(SbxProperty)
+typedef tools::SvRef<SbxProperty> SbxPropertyRef;
 
 #endif
 
diff --git a/include/basic/sbxvar.hxx b/include/basic/sbxvar.hxx
index 789cec6..1204df2 100644
--- a/include/basic/sbxvar.hxx
+++ b/include/basic/sbxvar.hxx
@@ -270,12 +270,12 @@ class SbxInfo;
 
 #ifndef SBX_ARRAY_DECL_DEFINED
 #define SBX_ARRAY_DECL_DEFINED
-SV_DECL_REF(SbxArray)
+typedef tools::SvRef<SbxArray> SbxArrayRef;
 #endif
 
 #ifndef SBX_INFO_DECL_DEFINED
 #define SBX_INFO_DECL_DEFINED
-SV_DECL_REF(SbxInfo)
+typedef tools::SvRef<SbxInfo> SbxInfoRef;
 #endif
 
 class SfxBroadcaster;
@@ -349,7 +349,7 @@ public:
     static sal_uInt16 MakeHashCode( const OUString& rName );
 };
 
-SV_DECL_REF(SbxVariable)
+typedef tools::SvRef<SbxVariable> SbxVariableRef;
 
 #endif // INCLUDED_BASIC_SBXVAR_HXX
 
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 72015b5..d4529a5 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/embed/XStorage.hpp>
 
 #include <o3tl/sorted_vector.hxx>
+#include <sot/storage.hxx>
 #include <tools/rtti.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <tools/time.hxx>
@@ -39,8 +40,6 @@ class CharClass;
 class SfxPoolItem;
 class SvxAutoCorrect;
 class SfxObjectShell;
-class SotStorageRef;
-class SotStorage;
 class Window;
 
 struct CompareSvStringsISortDtor
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index add42ee..c290948 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -53,7 +53,6 @@ class Graphic;
 class SvStream;
 class SdrObject;
 class SdrOle2Obj;
-class SotStorageRef;
 class Polygon;
 class PolyPolygon;
 class FmFormModel;
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index f3b72cd..b628e95 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -116,7 +116,7 @@ DECL_OBJHINT( SfxStringHint, OUString );
 
 #ifndef SFX_DECL_OBJECTSHELL_DEFINED
 #define SFX_DECL_OBJECTSHELL_DEFINED
-SV_DECL_REF(SfxObjectShell)
+typedef tools::SvRef<SfxObjectShell> SfxObjectShellRef;
 #endif
 
 class SfxObjectShellLock;
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 2ed484a..ab85627 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -272,7 +272,7 @@ public:
     static sal_uInt32   CreatePasswordToModifyHash( const OUString& aPasswd, bool bWriter );
 };
 
-SV_DECL_IMPL_REF( SfxMedium )
+typedef tools::SvRef<SfxMedium> SfxMediumRef;
 
 typedef ::std::vector< SfxMedium* > SfxMediumList;
 
diff --git a/include/sfx2/doctempl.hxx b/include/sfx2/doctempl.hxx
index 36008bc..6ba3a18 100644
--- a/include/sfx2/doctempl.hxx
+++ b/include/sfx2/doctempl.hxx
@@ -31,14 +31,14 @@ class SfxObjectShell;
 
 #ifndef SFX_DECL_OBJECTSHELL_DEFINED
 #define SFX_DECL_OBJECTSHELL_DEFINED
-SV_DECL_REF(SfxObjectShell)
+typedef tools::SvRef<SfxObjectShell> SfxObjectShellRef;
 #endif
 
 class SfxDocTemplate_Impl;
 
 #ifndef SFX_DECL_DOCTEMPLATES_DEFINED
 #define SFX_DECL_DOCTEMPLATES_DEFINED
-SV_DECL_REF(SfxDocTemplate_Impl)
+typedef tools::SvRef<SfxDocTemplate_Impl> SfxDocTemplate_ImplRef;
 #endif
 
 // class SfxDocumentTemplates --------------------------------------------
diff --git a/include/sfx2/hintpost.hxx b/include/sfx2/hintpost.hxx
index f840f96..6b562a7 100644
--- a/include/sfx2/hintpost.hxx
+++ b/include/sfx2/hintpost.hxx
@@ -61,7 +61,7 @@ public:
 
 
 
-SV_DECL_IMPL_REF(SfxHintPoster);
+typedef tools::SvRef<SfxHintPoster> SfxHintPosterRef;
 
 #endif
 
diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index 3865594..37e0a0b 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -23,6 +23,7 @@
 #include <sal/config.h>
 #include <sfx2/dllapi.h>
 #include <sfx2/linksrc.hxx>
+#include <sfx2/lnkbase.hxx>
 #include <set>
 #include <vector>
 
@@ -43,9 +44,6 @@ namespace sfx2
     // FormatID "RegisterStatusInfoId" and a string as the data container.
     // This contains the following enum.
 
-class SvBaseLink;
-class SvBaseLinkRef;
-
 typedef std::vector<SvBaseLinkRef*> SvBaseLinks;
 
 typedef std::set<SvLinkSource*> SvLinkSources;
diff --git a/include/sfx2/linksrc.hxx b/include/sfx2/linksrc.hxx
index e9d5c9a..19ad30e 100644
--- a/include/sfx2/linksrc.hxx
+++ b/include/sfx2/linksrc.hxx
@@ -113,7 +113,7 @@ public:
     void clearStreamToLoadFrom();
 };
 
-SV_DECL_IMPL_REF(SvLinkSource);
+typedef tools::SvRef<SvLinkSource> SvLinkSourceRef;
 
 }
 #endif
diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index c83adaa..cd97ee3 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -168,7 +168,7 @@ public:
     FileDialogHelper & GetInsertFileDialog(const OUString& rFactory) const;
 };
 
-SV_DECL_IMPL_REF(SvBaseLink);
+typedef tools::SvRef<SvBaseLink> SvBaseLinkRef;
 
 }
 
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index e35c618..84757d4 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -717,7 +717,7 @@ public:
 
 #ifndef SFX_DECL_OBJECTSHELL_DEFINED
 #define SFX_DECL_OBJECTSHELL_DEFINED
-SV_DECL_REF(SfxObjectShell)
+typedef tools::SvRef<SfxObjectShell> SfxObjectShellRef;
 #endif
 
 class SfxObjectShellLock
@@ -765,8 +765,6 @@ inline SfxObjectShellLock & SfxObjectShellLock::
 inline SfxObjectShellLock & SfxObjectShellLock::operator = ( SfxObjectShell * pObjP )
 { return *this = SfxObjectShellLock( pObjP ); }
 
-SV_IMPL_REF(SfxObjectShell)
-
 class AutoReloadTimer_Impl : public Timer
 {
     OUString          aUrl;
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 289d11b..86e6f0c 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -59,7 +59,7 @@ namespace svtools
 
 #ifndef SFX_DECL_OBJECTSHELL_DEFINED
 #define SFX_DECL_OBJECTSHELL_DEFINED
-SV_DECL_REF(SfxObjectShell)
+typedef tools::SvRef<SfxObjectShell> SfxObjectShellRef;
 #endif
 
 class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
diff --git a/include/sot/object.hxx b/include/sot/object.hxx
index fb34846..164402b 100644
--- a/include/sot/object.hxx
+++ b/include/sot/object.hxx
@@ -138,7 +138,7 @@ private:
 };
 
 //==================class SotObjectRef======================================
-SV_DECL_IMPL_REF(SotObject)
+typedef tools::SvRef<SotObject> SotObjectRef;
 
 #endif // _IFACE_HXX
 
diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx
index a82efb1..8a31d7f 100644
--- a/include/sot/storage.hxx
+++ b/include/sot/storage.hxx
@@ -88,9 +88,8 @@ public:
 
 #ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED
 #define SOT_DECL_SOTSTORAGESTREAM_DEFINED
-SV_DECL_REF(SotStorageStream)
+typedef tools::SvRef<SotStorageStream> SotStorageStreamRef;
 #endif
-SV_IMPL_REF(SotStorageStream)
 
 namespace ucbhelper
 {
@@ -224,9 +223,8 @@ public:
 
 #ifndef SOT_DECL_SOTSTORAGE_DEFINED
 #define SOT_DECL_SOTSTORAGE_DEFINED
-SV_DECL_REF(SotStorage)
+typedef tools::SvRef<SotStorage> SotStorageRef;
 #endif
-SV_IMPL_REF(SotStorage)
 
 #define SvStorage SotStorage
 #define SvStorageRef SotStorageRef
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 74b5904..4ea02f9 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -74,13 +74,6 @@ class FormattedField;
 
 namespace svt
 {
-
-
-    class CellControllerRef;
-
-
-    //= CellController
-
     class SVT_DLLPUBLIC CellController : public SvRefBase
     {
         friend class EditBrowseBox;
@@ -116,7 +109,7 @@ namespace svt
         virtual bool WantMouseEvent() const;
     };
 
-    SV_DECL_IMPL_REF(CellController);
+    typedef tools::SvRef<CellController> CellControllerRef;
 
 
     //= IEditImplementation
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index c85d6d6..3e21473e 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -174,11 +174,8 @@ public:
 
 #ifndef GOODIES_DECL_SVPARSER_DEFINED
 #define GOODIES_DECL_SVPARSER_DEFINED
-SV_DECL_REF(SvParser)
+typedef tools::SvRef<SvParser> SvParserRef;
 #endif
-SV_IMPL_REF(SvParser)
-
-
 
 inline sal_uLong SvParser::SetLineNr( sal_uLong nlNum )
 {   sal_uLong nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
@@ -201,8 +198,6 @@ inline sal_uInt16 SvParser::GetCharSize() const
  *
  *======================================================================*/
 
-SV_DECL_REF(SvKeyValueIterator)
-
 class SvKeyValue
 {
     /** Representation.
@@ -271,7 +266,7 @@ public:
     virtual void Append   (const SvKeyValue &rKeyVal);
 };
 
-SV_IMPL_REF(SvKeyValueIterator);
+typedef tools::SvRef<SvKeyValueIterator> SvKeyValueIteratorRef;
 
 #endif // INCLUDED_SVTOOLS_SVPARSER_HXX
 
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 49019eb..62e9a13 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -24,6 +24,7 @@
 #include <tools/globname.hxx>
 #include <tools/gen.hxx>
 #include <sot/formats.hxx>
+#include <sot/storage.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <cppuhelper/implbase4.hxx>
 #include <com/sun/star/frame/XTerminateListener.hpp>
@@ -44,7 +45,6 @@ class BitmapEx;
 class GDIMetaFile;
 class Graphic;
 class ImageMap;
-class SotStorageStreamRef;
 class INetBookmark;
 class INetImage;
 class FileList;
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index d42cfa3..e222f04 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -90,7 +90,7 @@ public:
     bool    IsModified() const { return m_eStatus == GRS_MODIFIED; }
 };
 
-SV_DECL_REF(DbGridRow)
+typedef tools::SvRef<DbGridRow> DbGridRowRef;
 
 
 // DbGridControl
@@ -597,10 +597,6 @@ private:
     using BrowseBox::InsertHandleColumn;
 };
 
-
-SV_IMPL_REF(DbGridRow);
-
-
 #endif // INCLUDED_SVX_GRIDCTRL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 049e2f0..3c1e6e5 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -73,7 +73,6 @@ class SvxForbiddenCharactersTable;
 class SvNumberFormatter;
 class SotStorage;
 class SdrOutlinerCache;
-class SotStorageRef;
 class SdrUndoFactory;
 class ImageMap;
 namespace comphelper
diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx
index adfa1fb..fc5f659 100644
--- a/include/tools/pstm.hxx
+++ b/include/tools/pstm.hxx
@@ -51,7 +51,7 @@ class TOOLS_DLLPUBLIC SvRttiBase : public SvRefBase
 public:
             TYPEINFO();
 };
-SV_DECL_IMPL_REF(SvRttiBase)
+typedef tools::SvRef<SvRttiBase> SvRttiBaseRef;
 
 #define SV_DECL_PERSIST( Class, CLASS_ID )                          \
     TYPEINFO_OVERRIDE();                                                     \
@@ -98,7 +98,7 @@ public:
     TOOLS_DLLPUBLIC friend SvPersistStream& operator >> ( SvPersistStream & rStm,
                                           SvPersistBase *& rpObj );
 };
-SV_DECL_IMPL_REF(SvPersistBase)
+typedef tools::SvRef<SvPersistBase> SvPersistBaseRef;
 
 class SvPersistListWriteable
 {
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index e66fbb4..0bf519e 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -22,58 +22,54 @@
 #include <tools/toolsdllapi.h>
 #include <vector>
 
-#define SV_DECL_REF( ClassName )                \
-class ClassName;                                \
-class ClassName##Ref                            \
-{                                               \
-protected:                                      \
-    ClassName * pObj;                           \
-public:                                         \
-    inline               ClassName##Ref() { pObj = 0; }                 \
-    inline               ClassName##Ref( const ClassName##Ref & rObj ); \
-    inline               ClassName##Ref( ClassName * pObjP );           \
-    inline void          Clear();                                       \
-    inline               ~ClassName##Ref();                             \
-    inline ClassName##Ref & operator = ( const ClassName##Ref & rObj ); \
-    inline ClassName##Ref & operator = ( ClassName * pObj );            \
-    inline bool        Is() const { return pObj != NULL; }          \
-    inline ClassName *     operator &  () const { return pObj; }        \
-    inline ClassName *     operator -> () const { return pObj; }        \
-    inline ClassName &     operator *  () const { return *pObj; }       \
-    inline operator ClassName * () const { return pObj; }               \
+namespace tools {
+
+template<typename T> class SvRef {
+public:
+    SvRef(): pObj(0) {}
+
+    SvRef(SvRef const & rObj): pObj(rObj.pObj)
+    { if (pObj != 0) pObj->AddNextRef(); }
+
+    SvRef(T * pObjP): pObj(pObjP) { if (pObj != 0) pObj->AddRef(); }
+
+    ~SvRef() { if (pObj != 0) pObj->ReleaseReference(); }
+
+    void Clear() {
+        if (pObj != 0) {
+            T * pRefObj = pObj;
+            pObj = 0;
+            pRefObj->ReleaseReference();
+        }
+    }
+
+    SvRef & operator =(SvRef const & rObj) {
+        if (rObj.pObj != 0) {
+            rObj.pObj->AddNextRef();
+        }
+        T * pRefObj = pObj;
+        pObj = rObj.pObj;
+        if (pRefObj != 0) {
+            pRefObj->ReleaseReference();
+        }
+        return *this;
+    }
+
+    bool Is() const { return pObj != 0; }
+
+    T * operator &() const { return pObj; }
+
+    T * operator ->() const { return pObj; }
+
+    T & operator *() const { return *pObj; }
+
+    operator T *() const { return pObj; }
+
+protected:
+    T * pObj;
 };
 
-#define SV_IMPL_REF( ClassName )                                \
-inline ClassName##Ref::ClassName##Ref( const ClassName##Ref & rObj )        \
-    { pObj = rObj.pObj; if( pObj ) { pObj->AddNextRef(); } }                \
-inline ClassName##Ref::ClassName##Ref( ClassName * pObjP )                  \
-{ pObj = pObjP; if( pObj ) { pObj->AddRef(); } }                            \
-inline void ClassName##Ref::Clear()                                         \
-{                                                                           \
-    if( pObj )                                                              \
-    {                                                                       \
-        ClassName* const pRefObj = pObj;                                    \
-        pObj = 0;                                                           \
-        pRefObj->ReleaseReference();                                        \
-    }                                                                       \
-}                                                                           \
-inline ClassName##Ref::~ClassName##Ref()                                    \
-{ if( pObj ) { pObj->ReleaseReference(); } }                                \
-inline ClassName##Ref & ClassName##Ref::                                    \
-            operator = ( const ClassName##Ref & rObj )                      \
-{                                                                           \
-    if( rObj.pObj ) rObj.pObj->AddNextRef();                                \
-    ClassName* const pRefObj = pObj;                                        \
-    pObj = rObj.pObj;                                                       \
-    if( pRefObj ) { pRefObj->ReleaseReference(); }                          \
-    return *this;                                                           \
-}                                                                           \
-inline ClassName##Ref & ClassName##Ref::operator = ( ClassName * pObjP )    \
-{ return *this = ClassName##Ref( pObjP ); }
-
-#define SV_DECL_IMPL_REF(ClassName)             \
-    SV_DECL_REF(ClassName)                      \
-    SV_IMPL_REF(ClassName)
+}
 
 template<typename T>
 class SvRefMemberList : private std::vector<T>
@@ -174,7 +170,7 @@ public:
     sal_uIntPtr     GetRefCount() const { return nRefCount; }
 };
 
-SV_DECL_IMPL_REF(SvRefBase)
+typedef tools::SvRef<SvRefBase> SvRefBaseRef;
 
 class SvCompatWeakHdl : public SvRefBase
 {
@@ -187,7 +183,7 @@ public:
     void* GetObj() { return _pObj; }
 };
 
-SV_DECL_IMPL_REF( SvCompatWeakHdl )
+typedef tools::SvRef<SvCompatWeakHdl> SvCompatWeakHdlRef;
 
 class SvCompatWeakBase
 {
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index bb0b392..c823739 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -134,7 +134,7 @@ public:
     virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
 };
 
-SV_DECL_IMPL_REF(SvLockBytes);
+typedef tools::SvRef<SvLockBytes> SvLockBytesRef;
 
 // SvOpenLockBytes
 
@@ -157,7 +157,7 @@ public:
     virtual void    Terminate() = 0;
 };
 
-SV_DECL_IMPL_REF(SvOpenLockBytes);
+typedef tools::SvRef<SvOpenLockBytes> SvOpenLockBytesRef;
 
 // SvAsyncLockBytes
 
@@ -187,7 +187,7 @@ public:
     virtual void    Terminate() SAL_OVERRIDE { m_bTerminated = true; }
 };
 
-SV_DECL_IMPL_REF(SvAsyncLockBytes);
+typedef tools::SvRef<SvAsyncLockBytes> SvAsyncLockBytesRef;
 
 // SvStream
 
diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx
index 8ebac86..a5a0875 100644
--- a/include/unotools/ucblockbytes.hxx
+++ b/include/unotools/ucblockbytes.hxx
@@ -65,7 +65,8 @@ namespace com
 
 namespace utl
 {
-SV_DECL_REF( UcbLockBytes )
+class UcbLockBytes;
+typedef tools::SvRef<UcbLockBytes> UcbLockBytesRef;
 
 class UcbLockBytesHandler : public SvRefBase
 {
@@ -87,7 +88,7 @@ public:
     bool            IsActive() const { return m_bActive; }
 };
 
-SV_DECL_IMPL_REF( UcbLockBytesHandler )
+typedef tools::SvRef<UcbLockBytesHandler> UcbLockBytesHandlerRef;
 
 class UNOTOOLS_DLLPUBLIC UcbLockBytes : public virtual SvLockBytes
 {
@@ -188,8 +189,6 @@ public:
     void                    SetStreamValid_Impl();
 };
 
-SV_IMPL_REF( UcbLockBytes );
-
 }
 
 #endif
diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index afa9698..bd21e95 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -96,9 +96,7 @@ public:
     virtual void onDemandRescueUsefulDataFromTemporary( const SvXMLImportContext& rCandidate );
 };
 
-SV_DECL_REF( SvXMLImportContext )
-SV_IMPL_REF( SvXMLImportContext )
-
+typedef tools::SvRef<SvXMLImportContext> SvXMLImportContextRef;
 
 #endif // INCLUDED_XMLOFF_XMLICTXT_HXX
 
diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx
index 8eaffad..f5c5bb65 100644
--- a/sc/inc/chartuno.hxx
+++ b/sc/inc/chartuno.hxx
@@ -21,6 +21,7 @@
 #define SC_CHARTUNO_HXX
 
 #include "address.hxx"
+#include "rangelst.hxx"
 #include <svl/lstner.hxx>
 #include <comphelper/proparrhlp.hxx>
 #include <comphelper/propertycontainer.hxx>
@@ -37,7 +38,6 @@
 
 
 class ScDocShell;
-class ScRangeListRef;
 class ScChartObj;
 
 
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 0c3f0ec..6764d03 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -44,7 +44,6 @@
 
 class ScDocument;
 class ScTokenArray;
-class SfxObjectShellRef;
 class Window;
 class ScFormulaCell;
 
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 0d94fb3..d950d34 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -433,7 +433,6 @@ struct ScImportParam
 
 class ScDocument;
 class ScDocShell;
-class ScDocShellRef;
 class SvxSearchItem;
 class ScAutoFormat;
 class FuncCollection;
@@ -550,7 +549,7 @@ public:
     SC_DLLPUBLIC static double              nScreenPPTX;
     SC_DLLPUBLIC static double              nScreenPPTY;
 
-    static ScDocShellRef*   pDrawClipDocShellRef;
+    static tools::SvRef<ScDocShell>*   pDrawClipDocShellRef;
 
     static sal_uInt16           nDefFontHeight;
     SC_DLLPUBLIC static sal_uInt16           nStdRowHeight;
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 2505e14..4a35b91 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -96,7 +96,7 @@ private:
     typedef std::vector<ScRange*>::iterator iterator;
     typedef std::vector<ScRange*>::const_iterator const_iterator;
 };
-SV_DECL_IMPL_REF( ScRangeList );
+typedef tools::SvRef<ScRangeList> ScRangeListRef;
 
 
 // RangePairList:
@@ -132,7 +132,7 @@ public:
 private:
     ::std::vector< ScRangePair* > maPairs;
 };
-SV_DECL_IMPL_REF( ScRangePairList );
+typedef tools::SvRef<ScRangePairList> ScRangePairListRef;
 
 extern "C"
 int SAL_CALL ScRangePairList_QsortNameCompare( const void*, const void* );
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index f982f97..bb715d6 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -12,6 +12,7 @@
 
 #include "scdllapi.h"
 #include "debughelper.hxx"
+#include "docsh.hxx"
 #include "address.hxx"
 
 #include <test/bootstrapfixture.hxx>
@@ -169,9 +170,6 @@ struct assertion_traits<ScRange>
 
 }
 
-class ScDocShellRef;
-class ScDocShell;
-
 class SCQAHELPER_DLLPUBLIC ScBootstrapFixture : public test::BootstrapFixture
 {
 protected:
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index fb2a578..b1f833a 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -81,7 +81,7 @@
 #include "editutil.hxx"
 
 
-ScDocShellRef*  ScGlobal::pDrawClipDocShellRef = NULL;
+tools::SvRef<ScDocShell>*  ScGlobal::pDrawClipDocShellRef = NULL;
 SvxSearchItem*  ScGlobal::pSearchItem = NULL;
 ScAutoFormat*   ScGlobal::pAutoFormat = NULL;
 FuncCollection* ScGlobal::pFuncCollection = NULL;
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 40431c2..e2008b1 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -24,6 +24,7 @@
 #include <map>
 #include <limits>
 #include <sal/macros.h>
+#include <sot/storage.hxx>
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
 #include <oox/helper/helper.hxx>
@@ -123,8 +124,6 @@ class SfxPoolItem;
 class SfxItemSet;
 class ScStyleSheet;
 class ScStyleSheetPool;
-class SotStorageRef;
-class SotStorageStreamRef;
 class SvStream;
 
 /** Contains static methods used anywhere in the filters. */
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.hxx b/sc/source/filter/xml/XMLStylesImportHelper.hxx
index ac564f5..14eef00 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.hxx
@@ -105,7 +105,7 @@ public:
     void InsertCol(const sal_Int32 nCol, const sal_Int32 nTab, ScDocument* pDoc);
     void SetStylesToRanges(const OUString* pStyleName, ScXMLImport& rImport);
 };
-SV_DECL_IMPL_REF( ScMyStyleRanges );
+typedef tools::SvRef<ScMyStyleRanges> ScMyStyleRangesRef;
 
 struct ScMyStyle
 {
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 623a507..60c2657 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -439,10 +439,8 @@ public:
 
 void UpdateAcceptChangesDialog();
 
-
-SV_DECL_REF(ScDocShell)
-SV_IMPL_REF(ScDocShell)
-
+class ScDocShell;
+typedef tools::SvRef<ScDocShell> ScDocShellRef;
 
 /** Create before modifications of the document and destroy thereafter.
     Call SetDocumentModified() at an instance of this class instead of at
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 0ec932d..bc091ad 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -20,6 +20,7 @@
 #define SC_VIEWDATA_HXX
 
 #include <sfx2/zoomitem.hxx>
+#include "rangelst.hxx"
 #include "scdllapi.h"
 #include "viewopti.hxx"
 
@@ -97,7 +98,6 @@ class SfxObjectShell;
 class SfxBindings;
 class SfxDispatcher;
 class ScPatternAttr;
-class ScRangeListRef;
 class ScExtDocOptions;
 class ScViewData;
 class ScMarkData;
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 038ad6d..e110c01 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -81,11 +81,11 @@ class SdCustomShowList;
 
 namespace sd
 {
+class DrawDocShell;
 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
-SV_DECL_REF(DrawDocShell)
+typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
 #endif
-class DrawDocShell;
 class UndoManager;
 class ShapeList;
 class FrameView;
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 2396e3f..b34f7d4 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -231,11 +231,9 @@ public:
 
 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
-SV_DECL_REF(DrawDocShell)
+typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
 #endif
 
-SV_IMPL_REF (DrawDocShell)
-
 } // end of namespace sd
 
 #endif
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 2fb6716..b433668 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -49,7 +49,7 @@ class ViewShell;
 class DrawDocShell;
 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
-SV_DECL_REF(DrawDocShell)
+typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
 #endif
 }
 
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index 76f724c..01a9739 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -38,7 +38,6 @@ class DrawDocShell;
 class View;
 }
 
-class SfxObjectShellRef;
 class SdTransferable : public TransferableHelper, public SfxListener
 {
 public:
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 91ebe2d..f92ac47 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -264,13 +264,9 @@ public:
 
 #ifndef SFX_DECL_DOCTEMPLATES_DEFINED
 #define SFX_DECL_DOCTEMPLATES_DEFINED
-SV_DECL_REF(SfxDocTemplate_Impl)
+typedef tools::SvRef<SfxDocTemplate_Impl> SfxDocTemplate_ImplRef;
 #endif
 
-SV_IMPL_REF(SfxDocTemplate_Impl)
-
-
-
 SfxDocTemplate_Impl *gpTemplateData = 0;
 
 
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index c955492..ecdf6fb 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -459,7 +459,7 @@ public:
     void                        PrepareCachedForReopen( StreamMode nMode );
 };
 
-SV_DECL_IMPL_REF( UCBStorageStream_Impl );
+typedef tools::SvRef<UCBStorageStream_Impl> UCBStorageStream_ImplRef;
 
 struct UCBStorageElement_Impl;
 typedef ::std::vector< UCBStorageElement_Impl* > UCBStorageElementList_Impl;
@@ -536,7 +536,7 @@ public:
     void                        SetError( long nError );
 };
 
-SV_DECL_IMPL_REF( UCBStorage_Impl );
+typedef tools::SvRef<UCBStorage_Impl> UCBStorage_ImplRef;
 
 // this struct contains all necessary information on an element inside a UCBStorage
 struct UCBStorageElement_Impl
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 91cdd65..e5c8626 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -18,8 +18,7 @@
 #include <visitors.hxx>
 #include <cursor.hxx>
 
-SV_DECL_REF(SmDocShell)
-SV_IMPL_REF(SmDocShell)
+typedef tools::SvRef<SmDocShell> SmDocShellRef;
 
 using namespace ::com::sun::star;
 
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index f8cf438..deeade8 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -27,8 +27,7 @@
 
 #include <sfx2/zoomitem.hxx>
 
-SV_DECL_REF(SmDocShell)
-SV_IMPL_REF(SmDocShell)
+typedef tools::SvRef<SmDocShell> SmDocShellRef;
 
 using namespace ::com::sun::star;
 
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index d5e2772..d46f350 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -28,8 +28,7 @@
 #include <svl/stritem.hxx>
 #include <sfx2/dispatch.hxx>
 
-SV_DECL_REF(SmDocShell)
-SV_IMPL_REF(SmDocShell)
+typedef tools::SvRef<SmDocShell> SmDocShellRef;
 
 SmElement::SmElement(SmNodePointer pNode, const OUString& aText, const OUString& aHelpText) :
     mpNode(pNode),
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index ba2b0f4..7a03295 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -27,11 +27,6 @@
 #include <map>
 #include "swdll.hxx"
 
-#ifndef SW_DECL_SWSERVEROBJECT_DEFINED
-#define SW_DECL_SWSERVEROBJECT_DEFINED
-SV_DECL_REF( SwServerObject )
-#endif
-
 struct SwPosition;
 
 namespace sw { namespace mark
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 21df9cd..f42b0c8 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -43,7 +43,8 @@ class SwTOXBase;
 
 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
 #define SW_DECL_SWSERVEROBJECT_DEFINED
-SV_DECL_REF( SwServerObject )
+class SwServerObject;
+typedef tools::SvRef<SwServerObject> SwServerObjectRef;
 #endif
 
 typedef std::vector<SwSection*> SwSections;
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index c28fb75..bdb3aea 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -464,9 +464,8 @@ public:
 
 #ifndef SW_DECL_WRITER_DEFINED
 #define SW_DECL_WRITER_DEFINED
-SV_DECL_REF(Writer)
+typedef tools::SvRef<Writer> WriterRef;
 #endif
-SV_IMPL_REF(Writer)
 
 // Base class for all storage writers.
 class SW_DLLPUBLIC StgWriter : public Writer
diff --git a/sw/inc/swserv.hxx b/sw/inc/swserv.hxx
index 606dc10..6ae3099 100644
--- a/sw/inc/swserv.hxx
+++ b/sw/inc/swserv.hxx
@@ -78,7 +78,7 @@ public:
 
 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
 #define SW_DECL_SWSERVEROBJECT_DEFINED
-SV_DECL_REF( SwServerObject )
+typedef tools::SvRef<SwServerObject> SwServerObjectRef;
 #endif
 
 #endif // INCLUDED_SW_INC_SWSERV_HXX
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index e003e2f..c98cc0c 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -61,7 +61,8 @@ struct Parm;
 
 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
 #define SW_DECL_SWSERVEROBJECT_DEFINED
-SV_DECL_REF( SwServerObject )
+class SwServerObject;
+typedef tools::SvRef<SwServerObject> SwServerObjectRef;
 #endif
 
 class SwTableLines : public std::vector<SwTableLine*> {
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 9cd7d14..22a4ff8 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -34,7 +34,6 @@
 namespace com { namespace sun { namespace star { namespace accessibility {
            class XAccessible; } } } }
 
-class SfxObjectShellRef;
 class SwDoc;
 class IDocumentSettingAccess;
 class IDocumentDeviceAccess;
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index ca05576..3cbad56 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -31,8 +31,7 @@
 #include "shellres.hxx"
 #include "docufld.hxx"
 
-SV_DECL_REF(SwDocShell)
-SV_IMPL_REF(SwDocShell)
+typedef tools::SvRef<SwDocShell> SwDocShellRef;
 
 using namespace ::com::sun::star;
 
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index d21fb9e..221f681 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -39,8 +39,7 @@
 #include <doc.hxx>
 #include "docsh.hxx"
 
-SV_DECL_REF(SwDocShell)
-SV_IMPL_REF(SwDocShell)
+typedef tools::SvRef<SwDocShell> SwDocShellRef;
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index b32e824..b6d8dee 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -52,8 +52,7 @@
 #include "modeltoviewhelper.hxx"
 #include "scriptinfo.hxx"
 
-SV_DECL_REF(SwDocShell)
-SV_IMPL_REF(SwDocShell)
+typedef tools::SvRef<SwDocShell> SwDocShellRef;
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 1fb0b05..5bd6dc9 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -31,8 +31,6 @@
 #include <rtl/random.h>
 #include <xmloff/odffields.hxx>
 
-SV_IMPL_REF( SwServerObject )
-
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index e8c83b7..7d5e534 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -33,8 +33,6 @@
 
 using namespace ::com::sun::star;
 
-SV_IMPL_REF( SwServerObject )
-
 SwServerObject::~SwServerObject()
 {
 }
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index e57287a..5895eb4 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -60,8 +60,6 @@
 
 using namespace ::com::sun::star;
 
-SV_IMPL_REF( SwServerObject )
-
 class SwIntrnlSectRefLink : public SwBaseLink
 {
     SwSectionFmt& rSectFmt;
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 633ef61..d451b92 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -55,8 +55,6 @@ static bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pG
 
 TYPEINIT1( SwBaseLink, ::sfx2::SvBaseLink );
 
-SV_IMPL_REF( SwServerObject )
-
 static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
 {
     //call fist all not SwNoTxtFrames, then the SwNoTxtFrames.
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 3184a10..dc5cb5d 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -27,6 +27,7 @@
 #include <map>
 #include <rtl/ustring.hxx>
 #include <IMark.hxx>
+#include <swserv.hxx>
 
 namespace com {
     namespace sun {
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index a55b9a5..19f1c61 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -72,8 +72,6 @@ TYPEINIT1( SwTableFmt, SwFrmFmt );
 TYPEINIT1( SwTableBoxFmt, SwFrmFmt );
 TYPEINIT1( SwTableLineFmt, SwFrmFmt );
 
-SV_IMPL_REF( SwServerObject )
-
 #define COLFUZZY 20
 
 void ChgTextToNum( SwTableBox& rBox, const OUString& rTxt, const Color* pCol,
diff --git a/sw/source/core/uibase/dochdl/gloshdl.cxx b/sw/source/core/uibase/dochdl/gloshdl.cxx
index e2cb03c..172a24f 100644
--- a/sw/source/core/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/core/uibase/dochdl/gloshdl.cxx
@@ -70,7 +70,6 @@ struct TextBlockInfo_Impl
     OUString sGroupName;
 };
 typedef boost::ptr_vector<TextBlockInfo_Impl> TextBlockInfoArr;
-SV_IMPL_REF( SwDocShell )
 
 // Dialog for edit templates
 void SwGlossaryHdl::GlossaryDlg()
diff --git a/sw/source/core/uibase/inc/glosdoc.hxx b/sw/source/core/uibase/inc/glosdoc.hxx
index a5213b1..4c2e633 100644
--- a/sw/source/core/uibase/inc/glosdoc.hxx
+++ b/sw/source/core/uibase/inc/glosdoc.hxx
@@ -28,7 +28,7 @@ class SwDocShell;
 #ifndef SW_DECL_SWDOCSHELL_DEFINED
 #define SW_DECL_SWDOCSHELL_DEFINED
 #include <tools/ref.hxx>
-SV_DECL_REF( SwDocShell )
+typedef tools::SvRef<SwDocShell> SwDocShellRef;
 #endif
 #include <cppuhelper/weakref.hxx>
 
diff --git a/sw/source/core/uibase/inc/unoatxt.hxx b/sw/source/core/uibase/inc/unoatxt.hxx
index 1e65f7a..d3871bf 100644
--- a/sw/source/core/uibase/inc/unoatxt.hxx
+++ b/sw/source/core/uibase/inc/unoatxt.hxx
@@ -44,7 +44,7 @@ class SwXBodyText;
 #ifndef SW_DECL_SWDOCSHELL_DEFINED
 #define SW_DECL_SWDOCSHELL_DEFINED
 #include <tools/ref.hxx>
-SV_DECL_REF( SwDocShell )
+typedef tools::SvRef<SwDocShell> SwDocShellRef;
 #endif
 
 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
diff --git a/sw/source/core/uibase/misc/glshell.cxx b/sw/source/core/uibase/misc/glshell.cxx
index dc26db2..e78ca09 100644
--- a/sw/source/core/uibase/misc/glshell.cxx
+++ b/sw/source/core/uibase/misc/glshell.cxx
@@ -194,8 +194,6 @@ bool SwWebGlosDocShell::Save()
     }
 }
 
-SV_IMPL_REF ( SwDocShell )
-
 SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString& rShortName, sal_Bool bShow )
 {
     SwDocShellRef xDocSh;
diff --git a/sw/source/core/uibase/uno/unoatxt.cxx b/sw/source/core/uibase/uno/unoatxt.cxx
index 5d5ebbd..54e9c49 100644
--- a/sw/source/core/uibase/uno/unoatxt.cxx
+++ b/sw/source/core/uibase/uno/unoatxt.cxx
@@ -51,7 +51,6 @@
 
 #include <boost/scoped_ptr.hpp>
 
-SV_IMPL_REF ( SwDocShell )
 using namespace ::com::sun::star;
 
 uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 8259875..d607c8c 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WRTWW8_HXX
 #define INCLUDED_SW_SOURCE_FILTER_WW8_WRTWW8_HXX
 
+#include <sot/storage.hxx>
 #include <tools/solar.h>
 #include <tools/gen.hxx>
 #include <editeng/editdata.hxx>
@@ -115,7 +116,6 @@ namespace com { namespace sun { namespace star { namespace embed {
 class XEmbeddedObject;
 } } } }
 typedef std::map<const com::sun::star::embed::XEmbeddedObject*, sal_Int32> WW8OleMap;
-class SvStorageRef;
 struct WW8_PdAttrDesc;
 class SvxBrushItem;
 
diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx
index 031853f..23fda32 100644
--- a/sw/source/filter/xml/xmlitmap.hxx
+++ b/sw/source/filter/xml/xmlitmap.hxx
@@ -74,8 +74,7 @@ public:
     sal_uInt16 getCount() const;
 };
 
-SV_DECL_REF( SvXMLItemMapEntries )
-SV_IMPL_REF( SvXMLItemMapEntries )
+typedef tools::SvRef<SvXMLItemMapEntries> SvXMLItemMapEntriesRef;
 
 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLITMAP_HXX
 
diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx
index 93014b3..a108908 100644
--- a/xmloff/source/forms/elementimport.hxx
+++ b/xmloff/source/forms/elementimport.hxx
@@ -519,7 +519,7 @@ namespace xmloff
         void implSelectCurrentItem();
         void implDefaultSelectCurrentItem();
     };
-    SV_DECL_IMPL_REF(OListAndComboImport);
+    typedef tools::SvRef<OListAndComboImport> OListAndComboImportRef;
 
     //= OListOptionImport
     /** helper class for importing a single <form:option> element.
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index b640b2a..1666686 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -53,8 +53,6 @@
 #include <rtl/strbuf.hxx>
 #include <algorithm>
 
-SV_IMPL_REF( SvXMLStylesContext );
-
 namespace xmloff
 {
 
diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx
index 86beb9e..dee6ad9 100644
--- a/xmloff/source/forms/layerimport.hxx
+++ b/xmloff/source/forms/layerimport.hxx
@@ -35,8 +35,9 @@
 class SvXMLImport;
 class SvXMLImportContext;
 class SvXMLStyleContext;
+class SvXMLStylesContext;
 
-SV_DECL_REF( SvXMLStylesContext )
+typedef tools::SvRef<SvXMLStylesContext> SvXMLStylesContextRef;
     // unfortunately, we can't put this into our namespace, as the macro expands to (amongst others) a forward
     // declaration of the class name, which then would be in the namespace, too
 
diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx
index e27fd52..d67474d 100644
--- a/xmloff/source/forms/propertyimport.hxx
+++ b/xmloff/source/forms/propertyimport.hxx
@@ -146,7 +146,7 @@ namespace xmloff
             m_aGenericValues.push_back(_rProp);
         }
     };
-    SV_DECL_IMPL_REF( OPropertyImport )
+    typedef tools::SvRef<OPropertyImport> OPropertyImportRef;
 
     //= OPropertyElementsContext
     /** helper class for importing the <form:properties> element


More information about the Libreoffice-commits mailing list