summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/CntntIdxStore.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-21 14:56:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-07-21 15:09:46 +0100
commita58e46482c2af06ee9be26313db3513f906d6c0b (patch)
treee8eafa7d59a14f9e120d9511cd7579dd1f2abf95 /sw/source/core/doc/CntntIdxStore.cxx
parenta3094a1f898b9efb765fe822fc507d3be4369361 (diff)
Resolves: tdf#95340 orig lcl_ChkUnoCrsrPaM had reversed 'set' to lcl_ChkPaM
merge lcl_ChkUnoCrsrPaM and lcl_ChkPaM keeping the original logic, turns out they differed in how they swapped the mark and point Change-Id: Id2575c9690442494c3286a26ab099e8c4c62f884
Diffstat (limited to 'sw/source/core/doc/CntntIdxStore.cxx')
-rw-r--r--sw/source/core/doc/CntntIdxStore.cxx29
1 files changed, 10 insertions, 19 deletions
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index 82de6b39cc8b..d51b87a7cbb7 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -187,33 +187,24 @@ namespace
static inline void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos)
{ bOther ? pMark->SetOtherMarkPos(*pPos) : pMark->SetMarkPos(*pPos); };
};
- static void lcl_ChkUnoCrsrPaM(std::vector<PaMEntry>& rPamEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, 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() };
- rPamEntries.push_back(aEntry);
- }
- }
- static void lcl_ChkUnoCrsrPaMBoth(std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
- {
- lcl_ChkUnoCrsrPaM(rPaMEntries, nNode, nContent, rPaM, true);
- lcl_ChkUnoCrsrPaM(rPaMEntries, nNode, nContent, rPaM, false);
- }
- inline void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bPoint)
- {
- const SwPosition* pPos = &rPaM.GetBound( bPoint );
- 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