summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/drawpage.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx2
-rw-r--r--sc/source/ui/unoobj/TablePivotCharts.cxx2
-rw-r--r--sc/source/ui/unoobj/celllistsource.cxx8
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx6
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.cxx8
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx82
-rw-r--r--sc/source/ui/unoobj/datauno.cxx2
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx10
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx4
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx6
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx4
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx2
-rw-r--r--sc/source/ui/unoobj/servuno.cxx8
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx10
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx16
-rw-r--r--sc/source/ui/vba/vbaaxes.cxx2
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx2
24 files changed, 96 insertions, 96 deletions
diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx
index 6b6f029fb205..9baa9be3ca6a 100644
--- a/sc/source/core/data/drawpage.cxx
+++ b/sc/source/core/data/drawpage.cxx
@@ -45,7 +45,7 @@ rtl::Reference<SdrPage> ScDrawPage::CloneSdrPage(SdrModel& rTargetModel) const
css::uno::Reference< css::uno::XInterface > ScDrawPage::createUnoPage()
{
- return static_cast<cppu::OWeakObject*>( new ScPageObj( this ) );
+ return cppu::getXWeak( new ScPageObj( this ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 66ab24b9e76f..07d076fe26d6 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -140,7 +140,7 @@ void lcl_ChartInit(const uno::Reference <embed::XEmbeddedObject>& xObj, ScViewDa
xReceiver->attachDataProvider(xDataProvider);
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( static_cast<cppu::OWeakObject*>(pDocShell->GetModel()), uno::UNO_QUERY );
+ uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( getXWeak(pDocShell->GetModel()), uno::UNO_QUERY );
xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
// Same behavior as with old chart: Always assume data series in columns
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 8206ffef7f65..617f2208a9f9 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -253,7 +253,7 @@ css::uno::Reference< css::accessibility::XAccessible > ScEditWindow::CreateAcces
{
rtl::Reference<ScAccessibleEditControlObject> tmp = new ScAccessibleEditControlObject(this, ScAccessibleEditObject::EditControl);
mxAcc = tmp.get();
- return css::uno::Reference<css::accessibility::XAccessible>(static_cast<cppu::OWeakObject*>(tmp.get()), css::uno::UNO_QUERY_THROW);
+ return tmp;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 10d62b9ffc37..b25b1702cfe1 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -167,7 +167,7 @@ void PivotTableDataProvider::Notify(SfxBroadcaster& /*rBroadcaster*/, const SfxH
m_bNeedsUpdate = true;
for (uno::Reference<util::XModifyListener> const & xListener : m_aValueListeners)
{
- css::chart::ChartDataChangeEvent aEvent(static_cast<cppu::OWeakObject*>(this),
+ css::chart::ChartDataChangeEvent aEvent(getXWeak(),
css::chart::ChartDataChangeType_ALL,
0, 0, 0, 0);
xListener->modified(aEvent);
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx
index 7bc7731cd1b0..f69a8298c393 100644
--- a/sc/source/ui/unoobj/TablePivotCharts.cxx
+++ b/sc/source/ui/unoobj/TablePivotCharts.cxx
@@ -139,7 +139,7 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName,
{
xReceiver->attachDataProvider(xDataProvider);
- uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(static_cast<cppu::OWeakObject*>(m_pDocShell->GetModel()), uno::UNO_QUERY);
+ uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(cppu::getXWeak(m_pDocShell->GetModel()), uno::UNO_QUERY);
xReceiver->attachNumberFormatsSupplier(xNumberFormatsSupplier);
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx
index 81942e44fc09..bca1e0a6956f 100644
--- a/sc/source/ui/unoobj/celllistsource.cxx
+++ b/sc/source/ui/unoobj/celllistsource.cxx
@@ -133,7 +133,7 @@ namespace calc
void OCellListSource::checkInitialized()
{
if ( !m_bInitialized )
- throw NotInitializedException("CellListSource is not initialized", static_cast<cppu::OWeakObject*>(this));
+ throw NotInitializedException("CellListSource is not initialized", getXWeak());
}
OUString SAL_CALL OCellListSource::getImplementationName( )
@@ -347,7 +347,7 @@ namespace calc
void SAL_CALL OCellListSource::initialize( const Sequence< Any >& _rArguments )
{
if ( m_bInitialized )
- throw RuntimeException("CellListSource is already initialized", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("CellListSource is already initialized", getXWeak());
// get the cell address
CellRangeAddress aRangeAddress;
@@ -370,7 +370,7 @@ namespace calc
}
if ( !bFoundAddress )
- throw RuntimeException("Cell not found", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Cell not found", getXWeak());
// determine the range we're bound to
try
@@ -404,7 +404,7 @@ namespace calc
}
if ( !m_xRange.is() )
- throw RuntimeException("Failed to retrieve cell range", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to retrieve cell range", getXWeak());
Reference<XModifyBroadcaster> xBroadcaster( m_xRange, UNO_QUERY );
if ( xBroadcaster.is() )
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 3dc012c0acd1..55f72d3dce09 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1521,7 +1521,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
// dispose listeners
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
for (uno::Reference<util::XModifyListener> & xValueListener : aValueListeners)
xValueListener->disposing( aEvent );
@@ -1547,7 +1547,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
// SfxHintId::DataChanged.
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
// the EventObject holds a Ref to this object until after the listener calls
@@ -3829,7 +3829,7 @@ uno::Reference<uno::XInterface> ScCellRangesBase::Find_Impl(
if (bFound)
{
ScAddress aFoundPos( nCol, nRow, nTab );
- xRet.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocShell, aFoundPos )));
+ xRet.set(cppu::getXWeak(new ScCellObj( pDocShell, aFoundPos )));
}
}
}
diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx
index 6a5b764546b6..fd8b43f9578e 100644
--- a/sc/source/ui/unoobj/cellvaluebinding.cxx
+++ b/sc/source/ui/unoobj/cellvaluebinding.cxx
@@ -400,7 +400,7 @@ namespace calc
void OCellValueBinding::checkInitialized()
{
if ( !m_bInitialized )
- throw NotInitializedException("CellValueBinding is not initialized", static_cast<cppu::OWeakObject*>(this));
+ throw NotInitializedException("CellValueBinding is not initialized", getXWeak());
}
void OCellValueBinding::checkValueType( const Type& _rType ) const
@@ -493,7 +493,7 @@ namespace calc
void SAL_CALL OCellValueBinding::initialize( const Sequence< Any >& _rArguments )
{
if ( m_bInitialized )
- throw RuntimeException("CellValueBinding is already initialized", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("CellValueBinding is already initialized", getXWeak());
// get the cell address
CellAddress aAddress;
@@ -516,7 +516,7 @@ namespace calc
}
if ( !bFoundAddress )
- throw RuntimeException("Cell not found", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Cell not found", getXWeak());
// get the cell object
try
@@ -548,7 +548,7 @@ namespace calc
}
if ( !m_xCell.is() )
- throw RuntimeException("Failed to retrieve cell object", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to retrieve cell object", getXWeak());
m_xCellText.set(m_xCell, css::uno::UNO_QUERY);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index cc8f6a06dd31..e8df8eaf97e9 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2892,7 +2892,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
{
m_xDataArray.reset(new std::vector<Item>);
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
if( m_pDocument )
{
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 25f356eed2e7..aa0554b27f7c 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -222,7 +222,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
else
sRangeStr = "all";
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( static_cast<cppu::OWeakObject*>(pDocShell->GetModel()), uno::UNO_QUERY );
+ uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( cppu::getXWeak(pDocShell->GetModel()), uno::UNO_QUERY );
xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
// set arguments
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 7247b655bf23..ab98584947d0 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -409,18 +409,18 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName,
if (!xDescriptor.is()) return;
if ( !aNewName.isEmpty() && hasByName( aNewName ) )
- throw IllegalArgumentException("Name \"" + aNewName + "\" already exists", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name \"" + aNewName + "\" already exists", getXWeak(), 0);
if (!pDocShell)
- throw RuntimeException("DocShell is null", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("DocShell is null", getXWeak());
auto pImp = dynamic_cast<ScDataPilotDescriptorBase*>( xDescriptor.get() );
if (!pImp)
- throw RuntimeException("Failed to get ScDataPilotDescriptor", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get ScDataPilotDescriptor", getXWeak());
ScDPObject* pNewObj = pImp->GetDPObject();
if (!pNewObj)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
ScRange aOutputRange(static_cast<SCCOL>(aOutputAddress.Column), static_cast<SCROW>(aOutputAddress.Row), static_cast<SCTAB>(aOutputAddress.Sheet),
static_cast<SCCOL>(aOutputAddress.Column), static_cast<SCROW>(aOutputAddress.Row), static_cast<SCTAB>(aOutputAddress.Sheet));
@@ -436,7 +436,7 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName,
ScDBDocFunc aFunc(*pDocShell);
if (!aFunc.CreatePivotTable(*pNewObj, true, true))
- throw RuntimeException("Failed to create pivot table", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to create pivot table", getXWeak());
}
void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName )
@@ -610,7 +610,7 @@ CellRangeAddress SAL_CALL ScDataPilotDescriptorBase::getSourceRange()
ScDPObject* pDPObject(GetDPObject());
if (!pDPObject)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
CellRangeAddress aRet;
if (pDPObject->IsSheetData())
@@ -624,7 +624,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setSourceRange( const CellRangeAddress&
ScDPObject* pDPObject = GetDPObject();
if (!pDPObject)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
ScSheetSourceDesc aSheetDesc(&pDocShell->GetDocument());
if (pDPObject->IsSheetData())
@@ -1124,7 +1124,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDataPilotTableObj::getDrillDownData(const C
ScAddress aAddr2(static_cast<SCCOL>(aAddr.Column), static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
ScDPObject* pObj = GetDPObject();
if (!pObj)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
pObj->GetDrillDownData(aAddr2, aTabData);
return aTabData;
@@ -1137,7 +1137,7 @@ DataPilotTablePositionData SAL_CALL ScDataPilotTableObj::getPositionData(const C
ScAddress aAddr2(static_cast<SCCOL>(aAddr.Column), static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
ScDPObject* pObj = GetDPObject();
if (!pObj)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
pObj->GetPositionData(aAddr2, aPosData);
return aPosData;
@@ -1148,10 +1148,10 @@ void SAL_CALL ScDataPilotTableObj::insertDrillDownSheet(const CellAddress& aAddr
SolarMutexGuard aGuard;
ScDPObject* pDPObj = GetDPObject();
if (!pDPObj)
- throw RuntimeException("Failed to get DPObject", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get DPObject", getXWeak());
ScTabViewShell* pViewSh = GetDocShell()->GetBestViewShell();
if (!pViewSh)
- throw RuntimeException("Failed to get ViewShell", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Failed to get ViewShell", getXWeak());
Sequence<DataPilotFieldFilter> aFilters;
pDPObj->GetDataFieldPositionData(
@@ -1165,7 +1165,7 @@ CellRangeAddress SAL_CALL ScDataPilotTableObj::getOutputRangeByType( sal_Int32 n
if (nType < 0 || nType > DataPilotOutputRangeType::RESULT)
throw IllegalArgumentException("nType must be between 0 and " +
OUString::number(DataPilotOutputRangeType::RESULT) + ", got " + OUString::number(nType),
- static_cast<cppu::OWeakObject*>(this), 0);
+ getXWeak(), 0);
CellRangeAddress aRet;
if (ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName))
@@ -1234,7 +1234,7 @@ void ScDataPilotTableObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
void ScDataPilotTableObj::Refreshed_Impl()
{
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
// the EventObject holds a Ref to this object until after the listener calls
@@ -2383,13 +2383,13 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
SolarMutexGuard aGuard;
if( !rItems.hasElements() )
- throw IllegalArgumentException("rItems is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("rItems is empty", getXWeak(), 0);
Reference< XMembersAccess > xMembers = GetMembers();
if (!xMembers.is())
{
SAL_WARN("sc.ui", "Cannot access members of the field object.");
- throw RuntimeException("Cannot access members of the field object", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Cannot access members of the field object", getXWeak());
}
for (const OUString& aEntryName : rItems)
@@ -2397,7 +2397,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
if (!xMembers->hasByName(aEntryName))
{
SAL_WARN("sc.ui", "There is no member with that name: " + aEntryName + ".");
- throw IllegalArgumentException("There is no member with name \"" + aEntryName + "\"", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("There is no member with name \"" + aEntryName + "\"", getXWeak(), 0);
}
}
@@ -2539,7 +2539,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
// Avoid throwing exception that's not specified in the method signature.
throw css::lang::WrappedTargetRuntimeException(
"Cannot find field with name \"" + sNewDim + "\"",
- static_cast<cppu::OWeakObject*>(this), anyEx );
+ getXWeak(), anyEx );
}
}
}
@@ -2552,17 +2552,17 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con
using namespace ::com::sun::star::sheet::DataPilotFieldGroupBy;
if( !rInfo.HasDateValues )
- throw IllegalArgumentException("HasDateValues is not set", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("HasDateValues is not set", getXWeak(), 0);
if( !lclCheckMinMaxStep( rInfo ) )
- throw IllegalArgumentException("min/max/step", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("min/max/step", getXWeak(), 0);
// only a single date flag is allowed
if( (rInfo.GroupBy == 0) || (rInfo.GroupBy > YEARS) || ((rInfo.GroupBy & (rInfo.GroupBy - 1)) != 0) )
- throw IllegalArgumentException("Invalid GroupBy value: " + OUString::number(rInfo.GroupBy), static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Invalid GroupBy value: " + OUString::number(rInfo.GroupBy), getXWeak(), 0);
// step must be zero, if something else than DAYS is specified
if( rInfo.Step >= ((rInfo.GroupBy == DAYS) ? 32768.0 : 1.0) )
- throw IllegalArgumentException("Invalid step value: " + OUString::number(rInfo.Step), static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Invalid step value: " + OUString::number(rInfo.Step), getXWeak(), 0);
OUString aGroupDimName;
ScDPObject* pDPObj = nullptr;
@@ -2752,16 +2752,16 @@ void SAL_CALL ScDataPilotFieldGroupsObj::replaceByName( const OUString& rName, c
SolarMutexGuard aGuard;
if( rName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
ScFieldGroups::iterator aIt = implFindByName( rName );
if( aIt == maGroups.end() )
- throw NoSuchElementException("Name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + rName + "\" not found", getXWeak());
// read all item names provided by the passed object
ScFieldGroupMembers aMembers;
if( !lclExtractGroupMembers( aMembers, rElement ) )
- throw IllegalArgumentException("Invalid element object", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Invalid element object", getXWeak(), 0);
// copy and forget, faster than vector assignment
aIt->maMembers.swap( aMembers );
@@ -2774,16 +2774,16 @@ void SAL_CALL ScDataPilotFieldGroupsObj::insertByName( const OUString& rName, co
SolarMutexGuard aGuard;
if( rName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
ScFieldGroups::iterator aIt = implFindByName( rName );
if( aIt != maGroups.end() )
- throw ElementExistException("Name \"" + rName + "\" already exists", static_cast<cppu::OWeakObject*>(this));
+ throw ElementExistException("Name \"" + rName + "\" already exists", getXWeak());
// read all item names provided by the passed object
ScFieldGroupMembers aMembers;
if( !lclExtractGroupMembers( aMembers, rElement ) )
- throw IllegalArgumentException("Invalid element object", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Invalid element object", getXWeak(), 0);
// create the new entry if no error has been occurred
maGroups.emplace_back();
@@ -2797,11 +2797,11 @@ void SAL_CALL ScDataPilotFieldGroupsObj::removeByName( const OUString& rName )
SolarMutexGuard aGuard;
if( rName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
ScFieldGroups::iterator aIt = implFindByName( rName );
if( aIt == maGroups.end() )
- throw NoSuchElementException("Name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + rName + "\" not found", getXWeak());
maGroups.erase( aIt );
}
@@ -2850,7 +2850,7 @@ ScFieldGroup& ScDataPilotFieldGroupsObj::getFieldGroup( const OUString& rName )
SolarMutexGuard aGuard;
ScFieldGroups::iterator aIt = implFindByName( rName );
if( aIt == maGroups.end() )
- throw RuntimeException("Field Group with name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Field Group with name \"" + rName + "\" not found", getXWeak());
return *aIt;
}
@@ -2860,10 +2860,10 @@ void ScDataPilotFieldGroupsObj::renameFieldGroup( const OUString& rOldName, cons
ScFieldGroups::iterator aOldIt = implFindByName( rOldName );
ScFieldGroups::iterator aNewIt = implFindByName( rNewName );
if( aOldIt == maGroups.end() )
- throw RuntimeException("Field Group with name \"" + rOldName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Field Group with name \"" + rOldName + "\" not found", getXWeak());
// new name must not exist yet
if( (aNewIt != maGroups.end()) && (aNewIt != aOldIt) )
- throw RuntimeException("Field Group with name \"" + rOldName + "\" already exists", static_cast<cppu::OWeakObject*>(this));
+ throw RuntimeException("Field Group with name \"" + rOldName + "\" already exists", getXWeak());
aOldIt->maName = rNewName;
}
@@ -2907,7 +2907,7 @@ Any SAL_CALL ScDataPilotFieldGroupObj::getByName( const OUString& rName )
ScFieldGroupMembers& rMembers = mxParent->getFieldGroup( maGroupName ).maMembers;
ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
if( aIt == rMembers.end() )
- throw NoSuchElementException("Name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + rName + "\" not found", getXWeak());
return Any( Reference< XNamed >( new ScDataPilotFieldGroupItemObj( *this, *aIt ) ) );
}
@@ -2933,7 +2933,7 @@ void SAL_CALL ScDataPilotFieldGroupObj::replaceByName( const OUString& rName, co
// it should be possible to quickly rename an item -> accept string or XNamed
OUString aNewName = lclExtractMember( rElement );
if( rName.isEmpty() || aNewName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
if( rName == aNewName )
return;
@@ -2941,9 +2941,9 @@ void SAL_CALL ScDataPilotFieldGroupObj::replaceByName( const OUString& rName, co
ScFieldGroupMembers::iterator aOldIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
ScFieldGroupMembers::iterator aNewIt = ::std::find( rMembers.begin(), rMembers.end(), aNewName );
if( aOldIt == rMembers.end() )
- throw NoSuchElementException("Name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + rName + "\" not found", getXWeak());
if( aNewIt != rMembers.end() )
- throw IllegalArgumentException("Name \"" + rName + "\" already exists", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name \"" + rName + "\" already exists", getXWeak(), 0);
*aOldIt = aNewName;
}
@@ -2955,12 +2955,12 @@ void SAL_CALL ScDataPilotFieldGroupObj::insertByName( const OUString& rName, con
// we will ignore the passed element and just try to insert the name
if( rName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
ScFieldGroupMembers& rMembers = mxParent->getFieldGroup( maGroupName ).maMembers;
ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
if( aIt != rMembers.end() )
- throw IllegalArgumentException("Name \"" + rName + "\" already exists", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name \"" + rName + "\" already exists", getXWeak(), 0);
rMembers.push_back( rName );
}
@@ -2969,11 +2969,11 @@ void SAL_CALL ScDataPilotFieldGroupObj::removeByName( const OUString& rName )
SolarMutexGuard aGuard;
if( rName.isEmpty() )
- throw IllegalArgumentException("Name is empty", static_cast<cppu::OWeakObject*>(this), 0);
+ throw IllegalArgumentException("Name is empty", getXWeak(), 0);
ScFieldGroupMembers& rMembers = mxParent->getFieldGroup( maGroupName ).maMembers;
ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
if( aIt == rMembers.end() )
- throw NoSuchElementException("Name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + rName + "\" not found", getXWeak());
rMembers.erase( aIt );
}
@@ -3094,7 +3094,7 @@ Any SAL_CALL ScDataPilotItemsObj::getByName( const OUString& aName )
}
++nItem;
}
- throw NoSuchElementException("Name \"" + aName + "\" not found", static_cast<cppu::OWeakObject*>(this));
+ throw NoSuchElementException("Name \"" + aName + "\" not found", getXWeak());
}
return Any();
}
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 5d4dc4761cbd..71b28feb35dd 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1892,7 +1892,7 @@ void SAL_CALL ScDatabaseRangeObj::removeRefreshListener(
void ScDatabaseRangeObj::Refreshed_Impl()
{
lang::EventObject aEvent;
- aEvent.Source = static_cast<cppu::OWeakObject*>(this);
+ aEvent.Source = getXWeak();
for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
xRefreshListener->refreshed( aEvent );
}
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 7f743c5e6777..d14f7ca497a2 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -259,7 +259,7 @@ void SAL_CALL ScDispatch::addStatusListener(
// initial state
frame::FeatureStateEvent aEvent;
aEvent.IsEnabled = true;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
aEvent.FeatureURL = aURL;
if ( aURL.Complete == cURLDocDataSource )
@@ -336,7 +336,7 @@ void SAL_CALL ScDispatch::selectionChanged( const css::lang::EventObject& /* aEv
return;
frame::FeatureStateEvent aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
aEvent.FeatureURL.Complete = cURLDocDataSource;
lcl_FillDataSource( aEvent, aNewImport ); // modifies State, IsEnabled
@@ -356,7 +356,7 @@ void SAL_CALL ScDispatch::disposing( const css::lang::EventObject& rSource )
bListeningToView = false;
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source = getXWeak();
for (uno::Reference<frame::XStatusListener> & xDataSourceListener : aDataSourceListeners)
xDataSourceListener->disposing( aEvent );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index cf744dd97bec..33ffbd393f12 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -429,7 +429,7 @@ uno::Reference< uno::XAggregation> const & ScModelObj::GetFormatter()
xFormatter = nullptr;
if (xNumberAgg.is())
- xNumberAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
+ xNumberAgg->setDelegator( getXWeak() );
osl_atomic_decrement( &m_refCount );
} // if ( !xNumberAgg.is() )
return xNumberAgg;
@@ -3302,7 +3302,7 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r
if ( pDocShell && HasChangesListeners() )
{
util::ChangesEvent aEvent;
- aEvent.Source.set( static_cast< cppu::OWeakObject* >( this ) );
+ aEvent.Source.set(getXWeak());
aEvent.Base <<= aEvent.Source;
size_t nRangeCount = rRanges.size();
@@ -3376,12 +3376,12 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r
{
ScRange const & rRange = aTabRanges[ 0 ];
if ( rRange.aStart == rRange.aEnd )
- xTarget.set( static_cast<cppu::OWeakObject*>( new ScCellObj( pDocShell, rRange.aStart ) ) );
+ xTarget.set( cppu::getXWeak( new ScCellObj( pDocShell, rRange.aStart ) ) );
else
- xTarget.set( static_cast<cppu::OWeakObject*>( new ScCellRangeObj( pDocShell, rRange ) ) );
+ xTarget.set( cppu::getXWeak( new ScCellRangeObj( pDocShell, rRange ) ) );
}
else
- xTarget.set( static_cast<cppu::OWeakObject*>( new ScCellRangesObj( pDocShell, aTabRanges ) ) );
+ xTarget.set( cppu::getXWeak( new ScCellRangesObj( pDocShell, aTabRanges ) ) );
uno::Sequence<uno::Any> aParams{ uno::Any(xTarget) };
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 4f179d782f94..bdd3271a8b8b 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -292,7 +292,7 @@ ScCellFieldsObj::~ScCellFieldsObj()
if (maRefreshListeners.getLength(g))
{
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
maRefreshListeners.disposeAndClear(g, aEvent);
}
}
@@ -430,7 +430,7 @@ ScHeaderFieldsObj::~ScHeaderFieldsObj()
if (maRefreshListeners.getLength(g))
{
lang::EventObject aEvent;
- aEvent.Source = static_cast<cppu::OWeakObject*>(this);
+ aEvent.Source = getXWeak();
maRefreshListeners.disposeAndClear(g, aEvent);
}
}
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 6d22a06559d8..63345c0c9761 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -181,7 +181,7 @@ void SAL_CALL ScSheetLinkObj::removeRefreshListener(
void ScSheetLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
xRefreshListener->refreshed( aEvent );
}
@@ -703,7 +703,7 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener(
void ScAreaLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
xRefreshListener->refreshed( aEvent );
}
@@ -1175,7 +1175,7 @@ void ScDDELinkObj::setResults( const uno::Sequence< uno::Sequence< uno::Any > >&
void ScDDELinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
xRefreshListener->refreshed( aEvent );
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index a49748b1a951..abdebf96b31e 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -469,12 +469,12 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const OUString& aName,
case ScRangeData::IsNameValidType::NAME_INVALID_CELL_REF:
throw uno::RuntimeException(
"Invalid name. Reference to a cell, or a range of cells not allowed",
- uno::Reference<uno::XInterface>(static_cast<::cppu::OWeakObject*>(this)));
+ getXWeak());
break;
case ScRangeData::IsNameValidType::NAME_INVALID_BAD_STRING:
throw uno::RuntimeException(
"Invalid name. Start with a letter, use only letters, numbers and underscore",
- uno::Reference<uno::XInterface>(static_cast<::cppu::OWeakObject*>(this)));
+ getXWeak());
break;
case ScRangeData::IsNameValidType::NAME_VALID:
if (ScRangeName* pNames = GetRangeName_Impl();
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index 0018e3e569a9..4e99431dd47a 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -89,7 +89,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScAnnotationObj::getParent()
//! find and reset existing object ???
if (pDocShell)
- return static_cast<cppu::OWeakObject*>(new ScCellObj( pDocShell, aCellPos ));
+ return cppu::getXWeak(new ScCellObj( pDocShell, aCellPos ));
return nullptr;
}
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index d135ad68abfa..8680179f162a 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -511,18 +511,18 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
// Support creation of GraphicStorageHandler and EmbeddedObjectResolver
case Type::EXPORT_GRAPHIC_STORAGE_HANDLER:
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write )));
+ xRet.set(getXWeak(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Write )));
break;
case Type::IMPORT_GRAPHIC_STORAGE_HANDLER:
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read )));
+ xRet.set(getXWeak(new SvXMLGraphicHelper( SvXMLGraphicHelperMode::Read )));
break;
case Type::EXPORT_EOR:
if (pDocShell)
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLEmbeddedObjectHelper( *pDocShell, SvXMLEmbeddedObjectHelperMode::Write )));
+ xRet.set(getXWeak(new SvXMLEmbeddedObjectHelper( *pDocShell, SvXMLEmbeddedObjectHelperMode::Write )));
break;
case Type::IMPORT_EOR:
if (pDocShell)
- xRet.set(static_cast<cppu::OWeakObject *>(new SvXMLEmbeddedObjectHelper( *pDocShell, SvXMLEmbeddedObjectHelperMode::Read )));
+ xRet.set(getXWeak(new SvXMLEmbeddedObjectHelper( *pDocShell, SvXMLEmbeddedObjectHelperMode::Read )));
break;
case Type::VALBIND:
case Type::LISTCELLBIND:
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 67931eab9a83..29f34158bb2a 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -99,7 +99,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) :
{
xShape = nullptr; // during setDelegator, mxShapeAgg must be the only ref
- mxShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
+ mxShapeAgg->setDelegator( getXWeak() );
xShape.set(uno::Reference<drawing::XShape>( mxShapeAgg, uno::UNO_QUERY ));
@@ -316,7 +316,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
{
uno::Reference<sheet::XCellRangeAddressable> xRangeAdd(aValue, uno::UNO_QUERY);
if (!xRangeAdd.is())
- throw lang::IllegalArgumentException("only XCell or XSpreadsheet objects allowed", static_cast<cppu::OWeakObject*>(this), 0);
+ throw lang::IllegalArgumentException("only XCell or XSpreadsheet objects allowed", getXWeak(), 0);
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -702,9 +702,9 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
{
uno::Reference< uno::XInterface > xAnchor;
if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
- xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, pAnchor->maStart)));
+ xAnchor.set(cppu::getXWeak(new ScCellObj( pDocSh, pAnchor->maStart)));
else
- xAnchor.set(static_cast<cppu::OWeakObject*>(new ScTableSheetObj( pDocSh, nTab )));
+ xAnchor.set(cppu::getXWeak(new ScTableSheetObj( pDocSh, nTab )));
aAny <<= xAnchor;
}
}
@@ -1292,7 +1292,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent()
{
const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObj, nTab );
if( pCaptData )
- return static_cast< ::cppu::OWeakObject* >( new ScCellObj( pDocSh, pCaptData->maStart ) );
+ return cppu::getXWeak( new ScCellObj( pDocSh, pCaptData->maStart ) );
}
}
}
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index a97c12e3dec5..681a97f09e3c 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -926,7 +926,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const OUString& sPropertyN
if ( sPropertyName != "DisplayName" )
{
- throw beans::UnknownPropertyException( "unknown property: " + sPropertyName, static_cast<OWeakObject *>(this) );
+ throw beans::UnknownPropertyException( "unknown property: " + sPropertyName, getXWeak() );
}
SolarMutexGuard aGuard;
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index bfde44272010..0056a737543c 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -941,7 +941,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
}
}
- return uno::Any(uno::Reference<uno::XInterface>(static_cast<cppu::OWeakObject*>(pObj.get())));
+ return uno::Any(uno::Reference(cppu::getXWeak(pObj.get())));
}
// XEnumerationAccess
@@ -1295,7 +1295,7 @@ bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e )
void ScTabViewObj::EndMouseListening()
{
lang::EventObject aEvent;
- aEvent.Source = static_cast<cppu::OWeakObject*>(this);
+ aEvent.Source = getXWeak();
for (const auto& rListener : aMouseClickHandlers)
{
try
@@ -1312,7 +1312,7 @@ void ScTabViewObj::EndMouseListening()
void ScTabViewObj::EndActivationListening()
{
lang::EventObject aEvent;
- aEvent.Source = static_cast<cppu::OWeakObject*>(this);
+ aEvent.Source = getXWeak();
for (const auto& rListener : aActivationListeners)
{
try
@@ -1661,7 +1661,7 @@ void ScTabViewObj::SelectionChanged()
SfxRequest aReq( SID_STYLE_END_PREVIEW, SfxCallMode::SLOT, reqList );
aShell.ExecuteStyle( aReq );
lang::EventObject aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
for (const auto& rListener : aSelectionChgListeners)
rListener->selectionChanged( aEvent );
@@ -1940,7 +1940,7 @@ void SAL_CALL ScTabViewObj::removeVetoableChangeListener( const OUString& /* Pro
void ScTabViewObj::VisAreaChanged()
{
beans::PropertyChangeEvent aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
for (const auto& rListener : aPropertyChgListeners)
rListener->propertyChange( aEvent );
}
@@ -2029,7 +2029,7 @@ void SAL_CALL ScTabViewObj::removeRangeSelectionChangeListener(
void ScTabViewObj::RangeSelDone( const OUString& rText )
{
sheet::RangeSelectionEvent aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
aEvent.RangeDescriptor = rText;
// copy on the stack because listener could remove itself
@@ -2042,7 +2042,7 @@ void ScTabViewObj::RangeSelDone( const OUString& rText )
void ScTabViewObj::RangeSelAborted( const OUString& rText )
{
sheet::RangeSelectionEvent aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
aEvent.RangeDescriptor = rText;
// copy on the stack because listener could remove itself
@@ -2055,7 +2055,7 @@ void ScTabViewObj::RangeSelAborted( const OUString& rText )
void ScTabViewObj::RangeSelChanged( const OUString& rText )
{
sheet::RangeSelectionEvent aEvent;
- aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
+ aEvent.Source.set(getXWeak());
aEvent.RangeDescriptor = rText;
// copy on the stack because listener could remove itself
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index 1976af701967..5dc3fb7a07e9 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -131,7 +131,7 @@ public:
css::uno::Any anyEx = cppu::getCaughtException();
throw css::lang::WrappedTargetException(
"Error Getting Index!",
- static_cast < OWeakObject * > ( this ),
+ getXWeak(),
anyEx );
}
}
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index 968bae6878ea..3cc7788bb823 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -75,7 +75,7 @@ public:
css::uno::Any anyEx(cppu::getCaughtException());
throw lang::WrappedTargetException(
"Error creating ScVbaChartObject!",
- static_cast < OWeakObject * > ( this ),
+ getXWeak(),
anyEx );
}
return ret;