summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/unocore/unoframe.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index d9db73e540ea..294db651c919 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3096,6 +3096,14 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{} );
aSet.SetParent(&pFormat->GetAttrSet());
SwFormatAnchor aAnchor = aSet.Get(RES_ANCHOR);
+
+ if (aAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
+ {
+ throw lang::IllegalArgumentException(
+ "SwXFrame::attach(): re-anchoring AS_CHAR not supported",
+ *this, 0);
+ }
+
aAnchor.SetAnchor( aIntPam.Start() );
aSet.Put(aAnchor);
pDoc->SetFlyFrameAttr( *pFormat, aSet );