[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Dec 14 03:46:01 PST 2012
sw/source/core/layout/trvlfrm.cxx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 4703b45c8fd6b72c8cb797492b14e48b5e1c38f7
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 13 01:28:59 2012 +0100
fdo#58142: fix frame selection in SwPageFrm::GetCrsrOfst:
The function does not handle the case where a paragraph was hit but no
background frame was hit properly, which may or may not (depending on
the platform) cause it to return a position of a frame when that is
undesirable, such as when called from SwWrtShell::UnSelectFrm().
When UnselectFrm() leaves a frame selected pasting multiple pictures
leads to a crash.
(regression from e8fbe97900f13305b17015d9044993bde4adab36)
Change-Id: I3604825f654c523a37f47a9fc660647d8b3e7077
(cherry picked from commit 2fc4af311656e7d019ca802d23444e5161f820ee)
Reviewed-on: https://gerrit.libreoffice.org/1314
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 2ffc033..ee907cd 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -275,8 +275,12 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if ( ( bTestBackground && bBackRet ) || !bTextRet )
{
bRet = bBackRet;
- pPos->nNode = aBackPos.nNode;
- pPos->nContent = aBackPos.nContent;
+ (*pPos) = aBackPos;
+ }
+ else if (bTextRet && !bBackRet)
+ {
+ bRet = bTextRet;
+ (*pPos) = aTextPos;
}
else
{
@@ -314,14 +318,12 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if ( bValidTextDistance && bValidBackDistance && basegfx::fTools::more( nTextDistance, nBackDistance ) )
{
bRet = bBackRet;
- pPos->nNode = aBackPos.nNode;
- pPos->nContent = aBackPos.nContent;
+ (*pPos) = aBackPos;
}
else
{
bRet = bTextRet;
- pPos->nNode = aTextPos.nNode;
- pPos->nContent = aTextPos.nContent;
+ (*pPos) = aTextPos;
}
}
}
More information about the Libreoffice-commits
mailing list