Kaydet (Commit) a5b9d2aa authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Andras Timar

sw: erroneous vector assignment in SwTable::OldMerge()

+    rLineBoxes = pFndBox->GetLines()[nEnd]->GetBoxes();

This actually assigns the boxes vector of the last line to the first
line, which the previous code didn't do.

Notably after converting the types from boost::ptr_vector to
std::vector<std::unique_ptr>, the assignment produces a several page
error message from both GCC and clang, and infuriatingly neither
compiler was able to tell on which line in tblrwcl.cxx the template
was instantiated, so i had to bisect that.

(regression from be5e4247)

Change-Id: I646e3ca678895480d38ec48f38d720458860a985
(cherry picked from commit 8bf0e60d)
Reviewed-on: https://gerrit.libreoffice.org/18379Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 8c8965ca
...@@ -1613,17 +1613,15 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes, ...@@ -1613,17 +1613,15 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
_InsULPara aPara( pTableNd, true, true, pLeftBox, pMergeBox, pRightBox, pInsLine ); _InsULPara aPara( pTableNd, true, true, pLeftBox, pMergeBox, pRightBox, pInsLine );
// Move the overlapping upper/lower Lines of the selected Area // Move the overlapping upper/lower Lines of the selected Area
_FndBoxes& rLineBoxes = pFndBox->GetLines().front().GetBoxes(); for (auto & it : pFndBox->GetLines().front().GetBoxes())
for (_FndBoxes::iterator it = rLineBoxes.begin(); it != rLineBoxes.end(); ++it)
{ {
lcl_Merge_MoveBox(*it, &aPara); lcl_Merge_MoveBox(it, &aPara);
} }
aPara.SetLower( pInsLine ); aPara.SetLower( pInsLine );
const auto nEnd = pFndBox->GetLines().size()-1; const auto nEnd = pFndBox->GetLines().size()-1;
rLineBoxes = pFndBox->GetLines()[nEnd].GetBoxes(); for (auto & it : pFndBox->GetLines()[nEnd].GetBoxes())
for (_FndBoxes::iterator it = rLineBoxes.begin(); it != rLineBoxes.end(); ++it)
{ {
lcl_Merge_MoveBox(*it, &aPara); lcl_Merge_MoveBox(it, &aPara);
} }
// Move the Boxes extending into the selected Area from left/right // Move the Boxes extending into the selected Area from left/right
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment