sw/source/core/docnode/ndtbl.cxx | 5 +++++ sw/source/uibase/shells/basesh.cxx | 3 +++ sw/source/uibase/shells/textsh1.cxx | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 08c4ed96cc94df4a3859aa167e92e6f6da9c2ce7 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Mon Jan 8 09:28:07 2024 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Mon Jan 8 09:28:26 2024 +0100 Revert "Related tdf#76007: Make it possible to insert a Table in a Footnote or Endnote" This reverts commit 75680dd751062b7ca34ff91e03de3add3fc973c6. I won't be able to debug layout problems indicated by Miklos. Change-Id: Ie610949a229468ba00d04b3542e14bdb68d7e1dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161752 Tested-by: Julien Nabet <serval2...@yahoo.fr> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/sw/qa/core/data/html/pass/ofz5909-1.html b/sw/qa/core/data/html/fail/ofz5909-1.html similarity index 100% rename from sw/qa/core/data/html/pass/ofz5909-1.html rename to sw/qa/core/data/html/fail/ofz5909-1.html diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index c6aa9ddb67c5..a7a2bee478da 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -347,6 +347,11 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, assert(nCols && "Table without rows?"); { + // Do not copy into Footnotes! + if( rPos.GetNode() < GetNodes().GetEndOfInserts() && + rPos.GetNode().GetIndex() >= GetNodes().GetEndOfInserts().StartOfSectionIndex() ) + return nullptr; + // If the ColumnArray has a wrong count, ignore it! if( pColArr && static_cast<size_t>(nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->size() ) diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 7ab234a80044..c96945ccdf30 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -3066,6 +3066,9 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) const SfxItemSet* pArgs = _rRequest.GetArgs(); SwWrtShell& rSh = GetShell(); + if ( rSh.GetFrameType( nullptr, true ) & FrameTypeFlags::FOOTNOTE ) + return; + SwView &rTempView = GetView(); // Because GetView() does not work after the shell exchange bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON); bool bCallEndUndo = false; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index c8c83fc29115..f23d5a229ec9 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -2337,7 +2337,8 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_INSERT_TABLE: if ( rSh.CursorInsideInputField() - || rSh.GetTableFormat() ) + || rSh.GetTableFormat() + || (rSh.GetFrameType(nullptr,true) & FrameTypeFlags::FOOTNOTE) ) { rSet.DisableItem( nWhich ); }