summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-21 14:29:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-25 07:27:49 +0000
commit3583db525c118a4a2adea843698c9619cfd7f221 (patch)
tree892f071003ba6e9cb4f60dcfeaa36807e0e607f0 /sw
parentf833183e9c2eeb323f85ca2d03f764228f9b14fa (diff)
Resolves: tdf#95340 orig lcl_ChkUnoCrsrPaM had reversed 'set' to lcl_ChkPaM
restore lcl_ChkUnoCrsrPaM (cherry picked from commit 133ad42956ff38fe94020cd9aab316c9dfceff60) update to new naming and casting (cherry picked from commit dcae0b482ca78fc9cd6f8523f53aad8c8b486b0f) bChkSelDirection is always false (cherry picked from commit 12d9292cd948dbf78bdcab4a46694563b3cce3cf) rename lcl_ChkUnoCrsrPaM and split it up to be like lcl_ChkPaM[Both] (cherry picked from commit a3094a1f898b9efb765fe822fc507d3be4369361) merge lcl_ChkUnoCrsrPaM and lcl_ChkPaM keeping the original logic, turns out they differed in how they swapped the mark and point (cherry picked from commit a58e46482c2af06ee9be26313db3513f906d6c0b) Change-Id: Iab155151226f3a7f00ca649bd690c4391ade8a52 389efc2f45f3110932318882faea82ab8565f89a 1aaf2c17d76ac1d69dfcc268ae1b689c0f1c3fa2 8850031da3901fb3d828c3af20f98ca741fc2a4a d2575c9690442494c3286a26ab099e8c4c62f884 Reviewed-on: https://gerrit.libreoffice.org/27382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/CntntIdxStore.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index 5cb63da189d2..d51b87a7cbb7 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -187,19 +187,24 @@ namespace
static inline void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos)
{ bOther ? pMark->SetOtherMarkPos(*pPos) : pMark->SetMarkPos(*pPos); };
};
- inline void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bPoint)
+ inline void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, bool bSetMark)
{
- const SwPosition* pPos = &rPaM.GetBound( bPoint );
+ const SwPosition* pPos = &rPaM.GetBound(bGetPoint);
if( pPos->nNode.GetIndex() == nNode && pPos->nContent.GetIndex() < nContent )
{
- const PaMEntry aEntry = { &rPaM, bPoint, pPos->nContent.GetIndex() };
+ const PaMEntry aEntry = { &rPaM, bSetMark, pPos->nContent.GetIndex() };
rPaMEntries.push_back(aEntry);
}
}
inline void lcl_ChkPaMBoth( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
{
- lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true);
- lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false);
+ lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, true);
+ lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, false);
+ }
+ inline void lcl_ChkUnoCrsrPaMBoth(std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
+ {
+ lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, false);
+ lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, true);
}
#if 0
@@ -386,14 +391,14 @@ void ContentIdxStoreImpl::SaveUnoCursors(SwDoc* pDoc, sal_uLong nNode, sal_Int32
continue;
for(SwPaM& rPaM : pUnoCursor.get()->GetRingContainer())
{
- lcl_ChkPaMBoth( m_aUnoCursorEntries, nNode, nContent, rPaM);
+ lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
}
const SwUnoTableCursor* pUnoTableCursor = dynamic_cast<const SwUnoTableCursor*>(pUnoCursor.get());
if( pUnoTableCursor )
{
for(SwPaM& rPaM : (&(const_cast<SwUnoTableCursor*>(pUnoTableCursor))->GetSelRing())->GetRingContainer())
{
- lcl_ChkPaMBoth( m_aUnoCursorEntries, nNode, nContent, rPaM);
+ lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
}
}
}