summaryrefslogtreecommitdiff
path: root/sw/inc/edimp.hxx
blob: 1434f3e297cb0fde6ad7bf2c8db3ac0f52198a4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_SW_INC_EDIMP_HXX
#define INCLUDED_SW_INC_EDIMP_HXX

#include <tools/solar.h>
#include <o3tl/sorted_vector.hxx>

class SwPaM;
class SwNodeIndex;

// Macros to iterate over all ranges.
#define PCURCRSR (_pStartCrsr)

#define FOREACHPAM_START(pCURSH) \
    {\
        SwPaM *_pStartCrsr = (pCURSH), *__pStartCrsr = _pStartCrsr; \
        do {

#define FOREACHPAM_END() \
        } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); \
    }



struct SwPamRange
{
    sal_uLong nStart, nEnd;

    SwPamRange() : nStart( 0 ), nEnd( 0 )   {}
    SwPamRange( sal_uLong nS, sal_uLong nE ) : nStart( nS ), nEnd( nE ) {}

    bool operator==( const SwPamRange& rRg ) const
        { return nStart == rRg.nStart ? true : false; }
    bool operator<( const SwPamRange& rRg ) const
        { return nStart < rRg.nStart ? true : false; }
};

class _SwPamRanges : public o3tl::sorted_vector<SwPamRange> {};

class SwPamRanges : private _SwPamRanges
{
public:
    SwPamRanges( const SwPaM& rRing );

    void Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 );
    SwPaM& SetPam( sal_uInt16 nArrPos, SwPaM& rPam );

    sal_uInt16 Count() const
                {   return _SwPamRanges::size(); }
    SwPamRange operator[]( sal_uInt16 nPos ) const
                { return _SwPamRanges::operator[](nPos); }
};


#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tive2DIDBlock in everywhereTomaž Vajngerl Change-Id: I3fcba604ee3bc95274700ae7406f27e292cd09ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88154 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2020-01-11loplugin:finalclasses in svxNoel Grandin Change-Id: I1048585a88c93a67a945914046108d2b8434419e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-10-08loplugin:constfields in svxNoel Grandin Change-Id: I643e8686e015ca85dd96221f1c93038f4fddf27b Reviewed-on: https://gerrit.libreoffice.org/61182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2016-11-08reduce copying when decomposing drawinglayer primitivesNoel Grandin instead of returning a Primitive2DContainer from each method which we are then going to immediately append to another container, pass down a single container by reference which we can append to Change-Id: I0f28a499d2ec54f7111a7044c30099767aa079e1 Reviewed-on: https://gerrit.libreoffice.org/30258 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2016-10-12loplugin:countusersofdefaultparams in svxNoel Grandin Change-Id: I610d8347129ac25420730ed7bf2855a5bdd0120f Reviewed-on: https://gerrit.libreoffice.org/29692 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> 2016-02-09Remove excess newlinesChris Sherlock A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> 2015-12-11tdf#69977: uno::Sequence is expensiveNoel Grandin when used as a mutable data-structure. Plain std::vector halves the time taken to display the chart dialog Create a class to represent the std::vector we are going to be passing around, and move some of the utility methods into it to make the code prettier. Also create an optimised append(&&) method for the common case of appending small temporaries. Change-Id: I7f5b43fb4a8a84e40e6a52fcb7e9f974091b4485 2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274 2015-07-16loplugin:unusedmethods svx(part2)Noel Grandin Change-Id: I161360e2f3113c4814fe1c2c095e602b2c93dcd7 Reviewed-on: https://gerrit.libreoffice.org/17120 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2014-05-15Resolves fdo#70681: fixincludeguards.pl: all that's leftThomas Arnhold Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5 Reviewed-on: https://gerrit.libreoffice.org/9360 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org> 2014-05-06Move headers included only in svx from include/svx/sdr/* to svx/inc/sdr/*Tor Lillqvist Change-Id: I084cbab30dfb0a7d567d1b172a79320687d20a06