summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfimport/data/ooo77837-1.odtbin0 -> 15724 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx5
-rw-r--r--sw/source/core/layout/flowfrm.cxx14
3 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/ooo77837-1.odt b/sw/qa/extras/odfimport/data/ooo77837-1.odt
new file mode 100644
index 000000000000..7be4f2b3e33b
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/ooo77837-1.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index dd32fb6da717..7c6e2e257137 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -319,6 +319,11 @@ DECLARE_ODFIMPORT_TEST(testCalcFtnCntnt, "ooo32780-1.odt")
//this was a CalcFtnCntnt crash
}
+DECLARE_ODFIMPORT_TEST(testMoveSubTree, "ooo77837-1.odt")
+{
+ //this was a MoveSubTree crash
+}
+
DECLARE_ODFIMPORT_TEST(testFdo75872_ooo33, "fdo75872_ooo33.odt")
{
// graphics default style: line color and fill color changed
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index f4a67d49f33a..365413aff33b 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -574,9 +574,23 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
SwPageFrm *pOldPage = m_rThis.FindPageFrm();
+ //JoinLock pParent for the lifetime of the Cut/Paste call to avoid
+ //SwSectionFrm::MergeNext removing the pParent we're trying to reparent
+ //into
+ bool bOldJoinLocked(false);
+ SwFlowFrm *pParentFlow = SwFlowFrm::CastFlowFrm(pParent);
+ if (pParentFlow)
+ {
+ bOldJoinLocked = pParentFlow->IsJoinLocked();
+ pParentFlow->LockJoin();
+ }
+
SwLayoutFrm *pOldParent = CutTree( &m_rThis );
const bool bInvaLay = PasteTree( &m_rThis, pParent, pSibling, pOldParent );
+ if (pParentFlow && !bOldJoinLocked)
+ pParentFlow->UnlockJoin();
+
// If, by cutting & pasting, an empty SectionFrm came into existence, it should
// disappear automatically.
SwSectionFrm *pSct;