diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-02 22:57:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-03 09:39:15 +0100 |
commit | d39221a3db76ea30ebba0d4fd8975bf63c90a101 (patch) | |
tree | f5617b2dc6228064108edf3040311eaf01788776 | |
parent | bf72f920855a14129bbe128b87e3a1a307780986 (diff) |
use standard template for this throughout
23 files changed, 213 insertions, 280 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index fa5fc7c8b..58d0709f9 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -46,8 +46,8 @@ #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <editeng/brshitem.hxx> -#include <rtl/uuid.h> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <sfx2/objsh.hxx> #include <vcl/svapp.hxx> @@ -314,19 +314,16 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessibleCellBase::getTypes() return comphelper::concatSequences(ScAccessibleCellBaseImpl::getTypes(), ScAccessibleContextBase::getTypes()); } +namespace +{ + class theScAccessibleCellBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleCellBaseImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleCellBase::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleCellBaseImplementationId::get().getSeq(); } sal_Bool ScAccessibleCellBase::IsEditable( diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 81f72dd4f..ae98971eb 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -35,13 +35,13 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/beans/PropertyChangeEvent.hpp> -#include <rtl/uuid.h> #include <tools/debug.hxx> #include <tools/gen.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <toolkit/helper/convert.hxx> #include <svl/smplhint.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/unohelp.hxx> #include <tools/color.hxx> @@ -523,19 +523,16 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessibleContextBase::getTypes() return comphelper::concatSequences(ScAccessibleContextBaseWeakImpl::getTypes(), ScAccessibleContextBaseImplEvent::getTypes()); } +namespace +{ + class theScAccessibleContextBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleContextBaseImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleContextBase::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleContextBaseImplementationId::get().getSeq(); } //===== internal ============================================================ diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 2006f78f5..a594ed2b2 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -39,11 +39,11 @@ #include <com/sun/star/accessibility/AccessibleTableModelChange.hpp> #include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp> #include <tools/debug.hxx> -#include <rtl/uuid.h> #include <toolkit/helper/convert.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include "scitems.hxx" #include <editeng/fontitem.hxx> #include <editeng/fhgtitem.hxx> @@ -212,17 +212,6 @@ Rectangle ScAccessibleCsvControl::GetBoundingBox() const throw( RuntimeException return implGetControl().GetWindowExtentsRelative( implGetControl().GetAccessibleParentWindow() ); } -void ScAccessibleCsvControl::getUuid( Sequence< sal_Int8 >& rSeq ) -{ - SolarMutexGuard aGuard; - ensureAlive(); - if( !rSeq.hasElements() ) - { - rSeq.realloc( 16 ); - rtl_createUuid( reinterpret_cast< sal_uInt8* >( rSeq.getArray() ), NULL, sal_True ); - } -} - void ScAccessibleCsvControl::ensureAlive() const throw( DisposedException ) { if( !implIsAlive() ) @@ -785,11 +774,14 @@ Sequence< ::com::sun::star::uno::Type > SAL_CALL ScAccessibleCsvRuler::getTypes( return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq ); } +namespace +{ + class theScAccessibleCsvRulerImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleCsvRulerImplementationId > {}; +} + Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvRuler::getImplementationId() throw( RuntimeException ) { - static Sequence< sal_Int8 > aSeq; - getUuid( aSeq ); - return aSeq; + return theScAccessibleCsvRulerImplementationId::get().getSeq(); } @@ -1293,11 +1285,14 @@ Sequence< ::com::sun::star::uno::Type > SAL_CALL ScAccessibleCsvGrid::getTypes() return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq ); } +namespace +{ + class theScAccessibleCsvGridImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleCsvGridImplementationId > {}; +} + Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvGrid::getImplementationId() throw( RuntimeException ) { - static Sequence< sal_Int8 > aSeq; - getUuid( aSeq ); - return aSeq; + return theScAccessibleCsvGridImplementationId::get().getSeq(); } diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx index 68448b905..59c946a01 100644 --- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <unotools/accessiblestatesethelper.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <tools/gen.hxx> #include <toolkit/helper/convert.hxx> #include <vcl/svapp.hxx> @@ -464,18 +464,15 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotControl::getAc ///===== XTypeProvider =================================================== +namespace +{ + class theScAccessibleDataPilotControlImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleDataPilotControlImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleDataPilotControlImplementationId::get().getSeq(); } //===== internal ======================================================== @@ -678,18 +675,15 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAcc ///===== XTypeProvider =================================================== +namespace +{ + class theScAccessibleDataPilotButtonImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleDataPilotButtonImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationId(void) throw (::com::sun::star::uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleDataPilotButtonImplementationId::get().getSeq(); } ::rtl::OUString SAL_CALL ScAccessibleDataPilotButton::createAccessibleDescription(void) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 979e05b68..8f9e1660b 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -60,6 +60,7 @@ #include <svx/AccessibleShapeTreeInfo.hxx> #include <svx/AccessibleShapeInfo.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <sfx2/viewfrm.hxx> #include <svx/unoshcol.hxx> #include <svx/unoshape.hxx> @@ -1820,19 +1821,16 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessibleDocument::getTypes() return comphelper::concatSequences(ScAccessibleDocumentImpl::getTypes(), ScAccessibleContextBase::getTypes()); } +namespace +{ + class theScAccessibleDocumentImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleDocumentImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDocument::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleDocumentImplementationId::get().getSeq(); } ///===== IAccessibleViewForwarder ======================================== diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index ad3353d20..51bd3f618 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -62,6 +62,7 @@ #include <svx/unoshape.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/svapp.hxx> +#include <comphelper/servicehelper.hxx> #include <vector> #include <list> @@ -1620,19 +1621,16 @@ uno::Sequence< ::rtl::OUString> SAL_CALL ScAccessibleDocumentPagePreview::getSup //===== XTypeProvider ======================================================= +namespace +{ + class theScAccessibleDocumentPagePreviewImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleDocumentPagePreviewImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDocumentPagePreview::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleDocumentPagePreviewImplementationId::get().getSeq(); } //===== internal ======================================================== diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index ad5ebbf29..973dbcccb 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -39,7 +39,7 @@ #include <unotools/accessiblestatesethelper.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <svx/AccessibleTextHelper.hxx> #include <editeng/editview.hxx> #include <editeng/editeng.hxx> @@ -291,19 +291,16 @@ void SAL_CALL //===== XTypeProvider ======================================================= +namespace +{ + class theScAccessibleEditObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleEditObjectImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleEditObject::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleEditObjectImplementationId::get().getSeq(); } //==== internal ========================================================= diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 9d919a232..d8512c74b 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -43,7 +43,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <editeng/editobj.hxx> #include <svx/AccessibleTextHelper.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/helper/convert.hxx> @@ -215,19 +215,16 @@ uno::Sequence< ::rtl::OUString> SAL_CALL //===== XTypeProvider ======================================================= +namespace +{ + class theScAccessiblePageHeaderAreaImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessiblePageHeaderAreaImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePageHeaderArea::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessiblePageHeaderAreaImplementationId::get().getSeq(); } //===== internal ============================================================== diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 0a0a88e05..6a0d99632 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -44,7 +44,7 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <toolkit/helper/convert.hxx> - +#include <comphelper/servicehelper.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> using namespace ::com::sun::star; @@ -211,19 +211,16 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAccessiblePreviewCell::getSupportedServi //===== XTypeProvider ======================================================= +namespace +{ + class theScAccessiblePreviewCellImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessiblePreviewCellImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePreviewCell::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessiblePreviewCellImplementationId::get().getSeq(); } //==== internal ========================================================= diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 6f321d8b1..84ece9181 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -50,6 +50,7 @@ #include <svl/smplhint.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <toolkit/helper/convert.hxx> using namespace ::com::sun::star; @@ -302,19 +303,16 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessiblePreviewHeaderCell::getTypes() return comphelper::concatSequences(ScAccessiblePreviewHeaderCellImpl::getTypes(), ScAccessibleContextBase::getTypes()); } +namespace +{ + class theScAccessiblePreviewHeaderCellImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessiblePreviewHeaderCellImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePreviewHeaderCell::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessiblePreviewHeaderCellImplementationId::get().getSeq(); } //==== internal ========================================================= diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 24fd28b08..45abfedca 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -51,6 +51,7 @@ #include <svl/smplhint.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -602,16 +603,15 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessiblePreviewTable::getTypes() return comphelper::concatSequences(ScAccessiblePreviewTableImpl::getTypes(), ScAccessibleContextBase::getTypes()); } +namespace +{ + class theScAccessiblePreviewTableImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessiblePreviewTableImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePreviewTable::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessiblePreviewTableImplementationId::get().getSeq(); } //==== internal ========================================================= diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 528ce563c..94639bed4 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -44,7 +44,7 @@ #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <tools/gen.hxx> #include <svtools/colorcfg.hxx> #include <vcl/svapp.hxx> @@ -827,19 +827,16 @@ uno::Sequence< ::rtl::OUString> SAL_CALL //===== XTypeProvider ======================================================= +namespace +{ + class theScAccessibleSpreadsheetImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleSpreadsheetImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleSpreadsheet::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleSpreadsheetImplementationId::get().getSeq(); } ///===== XAccessibleEventBroadcaster ===================================== diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index d701996d6..1138a5e28 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -39,8 +39,8 @@ #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleTableModelChange.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> -#include <rtl/uuid.h> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <vcl/svapp.hxx> @@ -453,19 +453,16 @@ uno::Sequence< uno::Type > SAL_CALL ScAccessibleTableBase::getTypes() return comphelper::concatSequences(ScAccessibleTableBaseImpl::getTypes(), ScAccessibleContextBase::getTypes()); } +namespace +{ + class theScAccessibleTableBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScAccessibleTableBaseImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScAccessibleTableBase::getImplementationId(void) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - IsObjectValid(); - static uno::Sequence<sal_Int8> aId; - if (aId.getLength() == 0) - { - aId.realloc (16); - rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True); - } - return aId; + return theScAccessibleTableBaseImplementationId::get().getSeq(); } void ScAccessibleTableBase::CommitTableModelChange(sal_Int32 nStartRow, sal_Int32 nStartCol, sal_Int32 nEndRow, sal_Int32 nEndCol, sal_uInt16 nId) diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 244780270..3169fb0c9 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -46,6 +46,7 @@ #include <unotools/tempfile.hxx> #include <unotools/ucbstreamhelper.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/servicehelper.hxx> #include <svtools/embedtransfer.hxx> #include <sot/storage.hxx> @@ -783,17 +784,14 @@ void ScDrawTransferObj::InitDocShell() } } +namespace +{ + class theScDrawTransferObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScDrawTransferObjUnoTunnelId > {}; +} + const com::sun::star::uno::Sequence< sal_Int8 >& ScDrawTransferObj::getUnoTunnelId() { - static com::sun::star::uno::Sequence< sal_Int8 > aSeq; - if( !aSeq.getLength() ) - { - static osl::Mutex aCreateMutex; - osl::Guard< osl::Mutex > aGuard( aCreateMutex ); - aSeq.realloc( 16 ); - rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True ); - } - return aSeq; + return theScDrawTransferObjUnoTunnelId::get().getSeq(); } sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ) diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx index d5a08f9d0..e5aeb97ab 100644 --- a/sc/source/ui/inc/AccessibleCsvControl.hxx +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -113,9 +113,6 @@ protected: /** Returns this object's current bounding box relative to the parent object. */ virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException ); - /** Creates a new UUID in rSeq, if it is empty. Locks mutex internally. */ - void getUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq ); - /** Returns whether the object is alive. Must be called with locked mutex. */ inline bool implIsAlive() const { return !rBHelper.bDisposed && !rBHelper.bInDispose && mpControl; } /** Throws an exception, if the object is disposed/disposing or any pointer diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index cb40ffa7e..202796013 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -50,7 +50,7 @@ #include <sfx2/bindings.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <float.h> // DBL_MIN #include <com/sun/star/awt/XBitmap.hpp> @@ -1722,16 +1722,15 @@ uno::Sequence<uno::Type> SAL_CALL ScCellRangesBase::getTypes() throw(uno::Runtim return aTypes; } +namespace +{ + class theScCellRangesBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellRangesBaseImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellRangesBase::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellRangesBaseImplementationId::get().getSeq(); } // --- @@ -4169,16 +4168,15 @@ uno::Sequence<uno::Type> SAL_CALL ScCellRangesObj::getTypes() throw(uno::Runtime return aTypes; } +namespace +{ + class theScCellRangesObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellRangesObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellRangesObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellRangesObjImplementationId::get().getSeq(); } // XCellRanges @@ -4833,16 +4831,15 @@ uno::Sequence<uno::Type> SAL_CALL ScCellRangeObj::getTypes() throw(uno::RuntimeE return aTypes; } +namespace +{ + class theScCellRangeObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellRangeObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellRangeObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellRangeObjImplementationId::get().getSeq(); } // XCellRange @@ -6141,15 +6138,14 @@ uno::Sequence<uno::Type> SAL_CALL ScCellObj::getTypes() throw(uno::RuntimeExcept return aTypes; } +namespace +{ + class theScCellObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellObjImplementationId::get().getSeq(); } // Hilfsfunktionen @@ -6934,15 +6930,14 @@ uno::Sequence<uno::Type> SAL_CALL ScTableSheetObj::getTypes() throw(uno::Runtime return aTypes; } +namespace +{ + class theScTableSheetObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScTableSheetObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScTableSheetObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScTableSheetObjImplementationId::get().getSeq(); } // Hilfsfunktionen @@ -8756,15 +8751,14 @@ uno::Sequence<uno::Type> SAL_CALL ScTableColumnObj::getTypes() throw(uno::Runtim return aTypes; } +namespace +{ + class theScTableColumnObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScTableColumnObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScTableColumnObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScTableColumnObjImplementationId::get().getSeq(); } // XNamed diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index 299560672..84fe95124 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -35,7 +35,7 @@ #include <svl/intitem.hxx> #include <svl/zforlist.hxx> #include <vcl/svapp.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include "cursuno.hxx" #include "cellsuno.hxx" @@ -103,15 +103,14 @@ uno::Sequence<uno::Type> SAL_CALL ScCellCursorObj::getTypes() throw(uno::Runtime return aTypes; } +namespace +{ + class theScCellCursorObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellCursorObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellCursorObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellCursorObjImplementationId::get().getSeq(); } // XSheetCellCursor diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 1f51ac578..a8c6b03b6 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -32,7 +32,6 @@ #include <algorithm> #include <svl/smplhint.hxx> #include <vcl/svapp.hxx> -#include <rtl/uuid.h> #include "dapiuno.hxx" #include "datauno.hxx" @@ -671,16 +670,15 @@ Sequence< uno::Type > SAL_CALL ScDataPilotDescriptorBase::getTypes() return aTypes; } +namespace +{ + class theScDataPilotDescriptorBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScDataPilotDescriptorBaseImplementationId > {}; +} + Sequence<sal_Int8> SAL_CALL ScDataPilotDescriptorBase::getImplementationId() throw(RuntimeException) { - static Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScDataPilotDescriptorBaseImplementationId::get().getSeq(); } void ScDataPilotDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) @@ -1169,16 +1167,15 @@ Sequence< uno::Type > SAL_CALL ScDataPilotTableObj::getTypes() throw(RuntimeExce return aTypes; } +namespace +{ + class theScDataPilotTableObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScDataPilotTableObjImplementationId > {}; +} + Sequence<sal_Int8> SAL_CALL ScDataPilotTableObj::getImplementationId() throw(RuntimeException) { - static Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScDataPilotTableObjImplementationId::get().getSeq(); } // --- diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 39f64047c..0c15e6533 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/script/vba/XVBAEventProcessor.hpp> #include <com/sun/star/reflection/XIdlClassProvider.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/servicehelper.hxx> #include "docuno.hxx" #include "cellsuno.hxx" @@ -544,16 +545,15 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes() throw(uno::RuntimeExcep return aTypes; } +namespace +{ + class theScModelObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScModelObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScModelObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScModelObjImplementationId::get().getSeq(); } void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 78e53929c..45f66149f 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -37,7 +37,7 @@ #include <editeng/editeng.hxx> #include <editeng/editobj.hxx> #include <editeng/flditem.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> @@ -482,16 +482,15 @@ uno::Sequence<uno::Type> SAL_CALL ScCellFieldObj::getTypes() throw(uno::RuntimeE return aTypes; } +namespace +{ + class theScCellFieldObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScCellFieldObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScCellFieldObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScCellFieldObjImplementationId::get().getSeq(); } uno::Any SAL_CALL ScCellFieldObj::queryInterface( const uno::Type& rType ) @@ -1141,16 +1140,15 @@ uno::Sequence<uno::Type> SAL_CALL ScHeaderFieldObj::getTypes() throw(uno::Runtim return aTypes; } +namespace +{ + class theScHeaderFieldObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScHeaderFieldObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScHeaderFieldObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScHeaderFieldObjImplementationId::get().getSeq(); } uno::Any SAL_CALL ScHeaderFieldObj::queryInterface( const uno::Type& rType ) diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index d87eedb44..57e39c07a 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -50,7 +50,7 @@ #include <sfx2/printer.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <toolkit/helper/convert.hxx> #include <vcl/svapp.hxx> @@ -187,16 +187,15 @@ uno::Sequence<uno::Type> SAL_CALL ScViewPaneBase::getTypes() throw(uno::RuntimeE return aTypes; } +namespace +{ + class theScViewPaneBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theScViewPaneBaseImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScViewPaneBase::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScViewPaneBaseImplementationId::get().getSeq(); } // XViewPane @@ -746,16 +745,15 @@ uno::Sequence<uno::Type> SAL_CALL ScTabViewObj::getTypes() throw(uno::RuntimeExc return aTypes; } +namespace +{ + class theScTabViewObjImplementationId : public rtl::Static< UnoTunnelIdInit, theScTabViewObjImplementationId > {}; +} + uno::Sequence<sal_Int8> SAL_CALL ScTabViewObj::getImplementationId() throw(uno::RuntimeException) { - static uno::Sequence< sal_Int8 > aId; - if( aId.getLength() == 0 ) - { - aId.realloc( 16 ); - rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); - } - return aId; + return theScTabViewObjImplementationId::get().getSeq(); } // XDocumentView diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 963c70eb7..9e0a47478 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -28,6 +28,7 @@ #include <vbahelper/helperdecl.hxx> #include <tools/urlobj.hxx> #include <comphelper/unwrapargs.hxx> +#include <comphelper/servicehelper.hxx> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/util/XProtectable.hpp> @@ -233,21 +234,15 @@ ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, init(); } +namespace +{ + class theScVbaWorkbookUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScVbaWorkbookUnoTunnelId > {}; +} + const uno::Sequence<sal_Int8>& ScVbaWorkbook::getUnoTunnelId() { - static uno::Sequence< sal_Int8 > aSeq; - - if( !aSeq.getLength() ) - { - static osl::Mutex aCreateMutex; - osl::Guard< osl::Mutex > aGuard( aCreateMutex ); - - aSeq.realloc( 16 ); - rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True ); - } - - return aSeq; + return theScVbaWorkbookUnoTunnelId::get().getSeq(); } uno::Reference< excel::XWorksheet > diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 60029f76c..35a1b7a73 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -70,6 +70,7 @@ #include <ooo/vba/excel/XlSheetVisibility.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/servicehelper.hxx> #include <vbahelper/vbashapes.hxx> #include <com/sun/star/script/vba/VBAEventId.hpp> @@ -222,20 +223,14 @@ ScVbaWorksheet::~ScVbaWorksheet() { } -const uno::Sequence<sal_Int8>& ScVbaWorksheet::getUnoTunnelId() +namespace { - static uno::Sequence< sal_Int8 > aSeq; - - if( !aSeq.getLength() ) - { - static osl::Mutex aCreateMutex; - osl::Guard< osl::Mutex > aGuard( aCreateMutex ); - - aSeq.realloc( 16 ); - rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True ); - } + class theScVbaWorksheetUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScVbaWorksheetUnoTunnelId > {}; +} - return aSeq; +const uno::Sequence<sal_Int8>& ScVbaWorksheet::getUnoTunnelId() +{ + return theScVbaWorksheetUnoTunnelId::get().getSeq(); } uno::Reference< ov::excel::XWorksheet > |