Commit Graph

508 Commits

Author SHA1 Message Date
Michael Stahl
ac010423b6 sw: clean up SwDoc::maPatternNms nonsense
Change-Id: I0a166d1b58b23cac96ae27d446d6d8ed2442df8e
2015-07-10 23:27:41 +02:00
Andrea Gelmini
e544f449ed Fix typos
Change-Id: I020c7ce4d9aa93cb0292378a410cdb9f7788e920
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-07-08 12:21:19 +02:00
Andrea Gelmini
462e986e0d Fix typos
Change-Id: Id9296115f30858e7fd470a199e59343a96d7deec
Reviewed-on: https://gerrit.libreoffice.org/16712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-07-04 10:18:19 +00:00
Bjoern Michaelsen
1ef03cad1a now rename the new CreateUnoCrsr2 to CreateUnoCrsr, as the old stuff is gone
Change-Id: I82f8ed0560750d4f7bec71ea8bd3c8089b884da7
2015-05-26 00:51:13 +02:00
Bjoern Michaelsen
b23eb203cc remove old SwUnoCrsrTbl and CreateUnoCrsr
Change-Id: I91e4c7f0e0231b7783affdce63c6ab395a4e219b
2015-05-26 00:51:13 +02:00
Bjoern Michaelsen
18cd31547f handle PamCorr also with the new container
Change-Id: I2eeb8dbe06d36c2882f443a2bc27bea54b97e3c7
2015-05-26 00:51:04 +02:00
Bjoern Michaelsen
ed1d7e2818 introduce CreateUnoCrsr2 to migrate to sane memory mngmt
Change-Id: Ia530827daa354555983c3c28c5aeec38bc3dbf11
2015-05-26 00:51:03 +02:00
Christian Lohmaier
ab465b90f6 bin/rename-sw-abbreviations.sh
renames the most annoying abbreviations in Writer (and partially
in the shared code too).

Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-20 13:05:49 +02:00
Katarina Behrens
3ccacb47fa tdf#89783: Allow more than 64k PageDescs
+ adjust related code using the functionality

Change-Id: I6fa4ad04137643009ee39522c36d6c9e6f3d2502
2015-05-18 13:54:12 +02:00
Miklos Vajna
3c0805e1f4 tdf#86639 SwEditShell: when setting para style, reset char attrs if needed
The old internal RTF filter used to call SwTxtNode::SetAttr() without
setting SetAttrMode::NOFORMATATTR, so character attributes which cover
the whole node got converted to paragraph attributes.  The new UNO
filter goes through SwXText::insertTextPortion(), which sets
SetAttrMode::NOFORMATATTR, so this doesn't happen. The result of this is
that when the UI sets a new paragraph style on the text node, then such
character attributes are no longer removed.

Given that in RTF you can't really have character properties on a
paragraph, going back to the document model produced by the old internal
filter doesn't sound like the good direction -- not to mention that
changing SwXText::insertTextPortion() this way would be an implicit API
change.

Fix the problem by tweaking SwEditShell::SetTxtFmtColl() instead, so
that it removes these full-text-node character attributes, too. The
logic in SwTxtNode::RstTxtAttr() can be extended later if necessary to
delete more attributes, but to be on the safe side, just handle the bare
minimum necessary to fix the problem for now.

Change-Id: I5faa3226fc0f9c18e005da185fe0830d8c393256
2015-05-14 11:39:16 +02:00
Stephan Bergmann
b53c2cd385 Replace IMPL_STATIC_LINK[_TYPED] with more useful variants
Change-Id: I9764e8860ee66cc94456eae879a9fc90d0ad850d
2015-05-10 11:25:46 +02:00
Michael Stahl
e07feb9457 sw: fix assert with frames anchored in redlines on rhbz490395-1.odt
SwRangeRedline::Show() will move nodes around in the nodes-array, which
means that using SwNodeIndex as a key in a map that has a lifetime
not limited by the stack is a bad idea, as the map will become unsorted.

Remove SwFrmFmtAnchorMap from SwDoc and replace it with new
SwNode::m_pAnchoredFlys to do the same mapping.

(regression from 738fb2ad77)

Change-Id: I396d92b9d0b2045e98bad6d0b374303cd4e62b59
2015-05-09 11:02:26 +02:00
Stephan Bergmann
c9b4c56811 Use typed Idle::SetIdleHdl Link
Change-Id: I189937950325dc4ef663f7f49cb45f38f8537de9
2015-05-05 12:05:38 +02:00
Noel Grandin
259820af71 loplugin:staticmethods
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-05-05 09:30:41 +02:00
Katarina Behrens
98436c4b53 tdf#89783: Adjust to new GetPos retval (size_t vs. sal_uInt16)
Some of the usages of GetPos were just misusing it to find out
whether a vector contains given element -- use Contains() in those
cases

This patch is partially based on work of Christoph Lutz

Conflicts:
	sw/source/filter/ww8/wrtw8esh.cxx
	sw/source/filter/ww8/wrtw8num.cxx

Change-Id: I40bedba905e7577ba23f69acee178e0ea7cc1521
2015-05-03 23:31:53 +02:00
Vasily Melenchuk
bc9d02b0ca tdf#89783: sal_uInt16 replacement by size_t: sections
These replacements allow LO to load, save and mail merge documents having
more than 65536 sections in total.

Change-Id: I0e70889b1edc6e472a39f1f2638ac3c70a0d7058

Signed-off-by: Katarina Behrens <Katarina.Behrens@cib.de>
2015-05-03 23:23:00 +02:00
Stephan Bergmann
3ead3ad52f Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior.  That way, individual uses of the
Link class can be updated over time.

All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).

(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)

Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-30 10:20:00 +02:00
Tor Lillqvist
d1ca0f4ed0 Bin some pointless comments and reduce some vertical whitespace
Bin pointless '// predeclarations' or '// forward declarations' comments.  If
a programmer doesn't know what a forward declaration is, well, why read C++
source code?

Also bin some pointless '// end of namespace foo' comments after namespace
blocks just a handful of lines long, and some superfluous vertical whitespace.

Change-Id: I2a31c5d73d9b4de8825fb8eb9e7559dbd7303ef9
2015-04-30 06:14:12 +03:00
Caolán McNamara
db41e27474 Resolves: tdf#87548 don't create a new list for each multiselection portion
create one list and share it among all the subsections

possibly a regression from/triggered by

 author	Oliver-Rainer Wittmann <orw@apache.org>	2014-03-18 14:33:39 (GMT)

 Resolves: #i124371# When changing the numbering or bullet styling...  of a set
 of paragraph which have more than one different List Style applied create a new
 List Style and put the paragraphs into a new list.

 (cherry picked from commit 0087ca89e3905009ed947c651f3dc70f3d61ea93)

Change-Id: I9416b97d6afe323ac99150fdcc23f71ecea98a58
2015-04-03 12:39:12 +01:00
Stephan Bergmann
6f3c52bb37 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Icb14a036ea9d7636359b6bc5e0af17568c0d54cb
2015-03-26 15:33:38 +01:00
Julien Nabet
25d3c618d8 Typo: formated->formatted
Change-Id: Iefd4d375a0dfb36732233852f906c6b85dccc2a5
2015-03-25 21:12:16 +01:00
Tobias Madl
826143684d Timer: Adapted all idle includes and enum uses
Change-Id: Id4ef36d6c80ad62306bdbaa7094c2cb0b8ff77da
2015-03-06 12:27:05 +00:00
Jan-Marek Glogowski
82d573e8bf Drop local FindPageDesc implementations
There are quite some places, which manually walk the vector of
SwPageDesc to find the named item. Replace all of them and
also drop the duplicated and unused GetPageDesc function.

Additionally adds a ContainsPageDesc function, which checks
the vector for the SwPageDesc pointer.

Change-Id: I7ade35b78d8208dc00ee56a8f83c3ebadaebb8af
Reviewed-on: https://gerrit.libreoffice.org/14508
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-03 10:28:37 +00:00
Noel Grandin
f9ba16e44b convert SW_CHAIN_ constants to enum class
Change-Id: If3cd86cbb0b01f975456b93b05232e18ec742828
2015-03-02 08:59:17 +02:00
Miklos Vajna
9a93b3c671 Extract SwDoc::dumpAsXml() from docnode
Change-Id: I49a35270d6ff2ea5c840a1f4f73d1f6a0701b2d5
2015-02-28 12:53:40 +01:00
Ursache Vladimir
50a36041e1 related tdf#89004 move to std:set instead of std::vector
Conflicts:
	sc/source/core/data/document10.cxx
	sw/source/core/doc/docfmt.cxx

Change-Id: I1312f476607ea3a78b162a7e59323b0a142f6629
2015-02-14 01:51:54 +01:00
Stephan Bergmann
ec3aae40ec loplugin:deletedspecial
Change-Id: Ia2b137e0167966a3d0b60f3c642a106834da8f1c
2015-02-07 12:36:03 +01:00
Caolán McNamara
309574394b callcatcher: large newly detected unused methods post de-virtualization
i.e lots now able to be detected after...

commit b44cbb26ef
Author: Noel Grandin <noel@peralex.com>
Date:   Tue Jan 20 12:38:10 2015 +0200

    new loplugin: change virtual methods to non-virtual

    Where we can prove that the virtual method is never overriden.

    In the case of pure-virtual methods, we remove the method entirely.
    Sometimes this leads to entire methods and fields being
    eliminated.

Change-Id: I605e2fa56f7186c3d3a764f3cd30f5cf7f881f9d
2015-01-29 23:42:26 +00:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Stephan Bergmann
4698eeea35 SwSection::GetFmt const-correctness
...otherwise, wouldn't make sense to have non-const/const overloads anyway.
Needs to introduce one const_cast into doctxm.cxx (which already contains quite
a handful), otherwise the required changes would turn into too much of an
avalanche.

Change-Id: I694c7a1df7089d83ee95d35ed09bb864e9703f7c
2015-01-21 14:03:43 +01:00
Michaël Lefèvre
28b61d7a28 fdo#75757 remove inheritance to std::vector
Conflicts:
	sw/source/core/doc/docnew.cxx

Change-Id: I4ba20e689b77e75bea75e5a60f50ff40577183e8
2015-01-07 13:14:02 +00:00
Caolán McNamara
79f115b91e boost::unordered_map->std::unordered_map
Change-Id: I2c65709cda6f10810452dfb8aa1a247cb3a5564f
2015-01-03 21:11:20 +00:00
Matteo Casalin
257ff5bea3 sal_uInt16 to size_t
Change-Id: I66239d89049f1386e5725e540c4dcc2b09c3ebf0
2014-12-25 18:21:11 +01:00
Matteo Casalin
d07f0997c5 sal_uInt16 to size_t
Change-Id: I5b63396fba55b717f35aee5718dd348a9d795786
2014-12-25 18:21:10 +01:00
Tobias Madl
545fafea1a changed some timer to idle
Change-Id: Ibd3a4f66cec6fde4fadc064f27ac44901d005b15
2014-12-09 12:34:51 +00:00
Tor Lillqvist
8b33808a11 Revert "loplugin: cstylecast"
The change was broken. Luckily MSVC noticed: sw\inc\doc.hxx(1707) :
warning C4717: 'SwDoc::GetNumberFormatter' : recursive on all control
paths, function will cause runtime stack overflow.

This reverts commit 7ca3303aaa.
2014-11-25 20:54:35 +02:00
Noel Grandin
7ca3303aaa loplugin: cstylecast
Change-Id: Idc6c34d8b3cfab35c7dc841a9ff70c218e0282df
2014-11-25 08:43:18 +02:00
Bjoern Michaelsen
1296f90632 move docfunc to own header
Change-Id: I5e1c66e09418e534bb47233f45c67206af20cab4
2014-11-19 02:24:27 +01:00
Matteo Casalin
1e61a6eaa7 Remove sal_True/sal_False from code and comments in sw includes
Change-Id: Icfbbae898749196e27199802ec728417d5205bc5
2014-11-16 16:52:45 +01:00
Andrea Gelmini
da40cac540 Fix common typos. No automatic tools. Handmade…
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959
Reviewed-on: https://gerrit.libreoffice.org/12164
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 11:04:11 +00:00
Noel Grandin
a2f66db3a6 loplugin: cstylecast
Change-Id: Ica3b54a7c331f0179294e2b52aadd884f53d53dc
2014-11-12 12:56:50 +02:00
Noel Grandin
36057c3a11 loplugin: cstylecast
Change-Id: If7ada4cba0b1098bba304f1ec9b860ec7df75e7a
2014-11-10 15:22:17 +02:00
Noel Grandin
5cb6144f21 loplugin: cstylecast
Change-Id: Ie57f543681790e662f6ac7d074ccb37925999790
2014-11-10 15:22:15 +02:00
Luboš Luňák
738fb2ad77 faster mapping from nodes to SwFrmFmt's anchored at them
The SwFrmFmtAnchorMap class provides reverse mapping
to SwFrmFmt::GetAnchor().GetCntntAnchor(), so that when code somewhere needs
to update SwFrmFmt's anchored at a position, it's not necessary to iterate
over all of them (which can be a large number e.g. with mail merge).

One special catch with the multimap of SwNodeIndex keys is that
the values of those keys change (whenever the node structure of the document
changes, indexes of nodes change as a result). This makes it impossible to use
any hashing container, as the hashes would change without the container
noticing, but multimap should work fine, as it just requires that the keys
remain sorted, and that is the case. Nevertheless, the old code in the two
converted places is intentionally left there in debug mode to verify the reverse
mapping is updated correctly.

I intentionally went with SwNodeIndex rather than SwPosition, as SwIndex
(the other component of SwPosition) was causing some trouble (see e.g. the
SwPosition comparison operator< , where two same positions are different if one
is registered and the other not) and it doesn't appear to be actually necessary.

Change-Id: I7f1768558f60155d4ba83c84aa7f9e34dc65ebf9
2014-11-09 19:45:27 +01:00
Luboš Luňák
ae5afe9bce compute page offset for mailmerge based on source document rather than target
This removes another need for doing repeated and expensive layouts of the target
document.

Change-Id: Id78bc3ccc71c17e42f858dc9660866b9c94dea3a
2014-11-06 16:54:52 +01:00
Luboš Luňák
a305a2c914 use bookmarks to mark mailmerge parts in a mailmerge document (fdo#80823)
Instead of page numbers, which
- was somewhat fragile (and broken, as it was actually off-by-one)
- required repeated re-layout of the increasingly large document, making
  mailmerge awfully slow. The re-layout is not removed by this commit, as
  it needs further checking whether it can be removed.
See the bugreport for details.

Change-Id: Ib09bd5f5a6a549c3d38ca40b0f32c0d2831fdd4c
2014-11-06 16:54:48 +01:00
Miklos Vajna
997055f50d SwDBManager::MergeMailFiles: set unique fly names at the end of the merge
When generating a unique fly name, we have to iterate over all the
existing flys to find out what's the first not used one, so doing this
for every new fly inserted by mail merge is O(n^2).

During import, we already skip this and only do it once at the end of
the import, which is O(n).

Fix the performance problem by skipping the unique fly name generating
when we produce a combined mail merge document as well, and just
generate them once the mail merge is complete.

For a test document having 12 text frames and 2000 mail merge records,
the times for css::text::MailMerge::execute() is 9m37.330s -> 8m18.811s.

Change-Id: Idfa8e9fe3acc93f1138f5bb12c2419c1492f8ff1
2014-10-31 10:57:58 +01:00
Caolán McNamara
1a2c28cf0d callcatcher: update unused code
Change-Id: I96b4d44e44389245f3ccc4a08198676461c6a38b
2014-10-22 13:11:34 +01:00
Miklos Vajna
7d966b1d68 SwDoc: remove unused methods
Change-Id: I073372b74d0362eaffdc1dddfbef8767e58b0fd6
2014-10-18 13:51:51 +02:00
Julien Nabet
4c12951a03 Typo: compatability->compatibility
Change-Id: If0b98a30452a9d1fcc340173deb6856755926471
2014-10-12 13:00:46 +02:00