summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/sbx/sbxarray.cxx6
-rw-r--r--toolkit/source/awt/vclxwindow.cxx2
2 files changed, 7 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index 668b4df03bc5..c6ccb208065c 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -198,10 +198,14 @@ void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
if( eType != SbxOBJECT || pVar->GetClass() != SbxClassType::Object )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef( nIdx );
+ // tdf#122250. It is possible that I hold the last reference to myself, so check, otherwise I might
+ // call SetFlag on myself after I have died.
+ bool removingMyself = rRef.get() && rRef->GetParameters() == this && GetRefCount() == 1;
if(rRef.get() != pVar )
{
rRef = pVar;
- SetFlag( SbxFlagBits::Modified );
+ if (!removingMyself)
+ SetFlag( SbxFlagBits::Modified );
}
}
}
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 45c7d1dcdc62..6d89c13f3697 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -1722,6 +1722,8 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any&
WinBits nStyle = pWindow->GetStyle();
sal_uInt16 nTmp = 0;
Value >>= nTmp;
+ // clear any dodgy bits passed in, can come from dodgy extensions
+ nTmp &= o3tl::typed_flags<WindowBorderStyle>::mask;
WindowBorderStyle nBorder = static_cast<WindowBorderStyle>(nTmp);
if ( !bool(nBorder) )
{