Commit Graph

479 Commits

Author SHA1 Message Date
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
Luboš Luňák
d3a04fdebf copy document defaults/properties for separate mailmerge result files
Also remove code duplication (that I'm not even sure why it's there).

Change-Id: I9a20fe0de9b34adbd03155712869bb19f5969f9b
2014-10-09 17:15:25 +02:00
Stephan Bergmann
25a76ef791 sw: std::auto_ptr -> std::unique_ptr
Change-Id: I60ac3706b9be335c31039ed0997cb8215808ddaa
2014-10-01 17:35:11 +02:00
Jan-Marek Glogowski
4687ce0675 Constify dumpAsXml and friends
All these dump functions should never change the dumped objects
so 'const' all of them.

Change-Id: Id83422e3950a73e48feb4708fbd4c251506997e0
2014-10-01 10:32:43 +02:00
Jan-Marek Glogowski
cde554a731 fdo#81782 MM: copy most document properties
Mail merge wasn't copying the document properties into the target
document. It also has to copy most document properties into the
working copy, as ConvertFieldsToText is called just there.

Change-Id: I7e07fec712c225f667d960a94f4eb3fd0b83f041
Reviewed-on: https://gerrit.libreoffice.org/10987
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-24 16:11:07 +00:00
Krisztian Pinter
e75a3b87cb Remove unnecessary include
Change-Id: I46c7af376aacb824a0d4298674423cc227b592f3
2014-09-17 10:19:29 +02:00
Krisztian Pinter
5f27596bed Add writer document font colors to color palettes
Change-Id: If3fedc45586eee068c40e92da87d5d550a456a64
2014-09-17 10:19:29 +02:00
Michael Stahl
3b11057b75 sw: rename SwDoc::Append to something unique
Change-Id: Ibb9db5ecdea6439df20fc1ee609267dcdd864405
2014-09-12 21:51:08 +02:00
Jan-Marek Glogowski
c808802e94 MM: introduce SwDoc::Append helper function
This drops all the specialized, workaround code from MM, introduced
to use the SwFEShell::Paste function and additionally merges
and renames SwDoc::Paste into SwDoc::Append.

There is still a little common codepath, therefore this adds
comments to always update both functions.

Change-Id: I704b3ef3257dd977dac95e16e25049ff8ade97ed
Reviewed-on: https://gerrit.libreoffice.org/10967
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-10 11:06:01 +00:00
Tor Lillqvist
30ae83c268 fdo#82577: Handle KeyCode
Put the VCL KeyCode class in the vcl namespace. Avoids clash with the X11
KeyCode typedef.

Change-Id: I624c9d937f7c5f5986d313b6c5f060bd8bb7e028
2014-08-23 22:33:30 +03:00
Michael Stahl
9f01ba1b78 i#107771: sw: burn, UnoCallBack, burn!
Change-Id: Ifdb6d4b2e404bd160e6fcec3229691e750bdf698
2014-08-20 16:40:18 +02:00
Valentin Kettner
15295ab6db Refactored SwDoc::GetEditShell .
Removed its output paramater as GetCurrentViewShell should be
used instead and added a const version.

Change-Id: Iad8b57553b6e93e3472ce8c6905d08e8d49af770
2014-08-19 21:57:06 +02:00
Takeshi Abe
44afb981a5 fdo#75757: remove inheritance to std::vector
by replacing it with a typedef.

Change-Id: Iaa88086e3c5195012982dd625bfd589de2e484a2
Reviewed-on: https://gerrit.libreoffice.org/11017
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-08-19 08:30:44 -05:00
Valentin Kettner
1f4d9846ae Refactored IDocumentExternalData out of SwDoc.
Into the new class DocumentExternalDataManager.

Change-Id: Ib863daec170044c46143b47a91739d4c0940d963
2014-08-12 23:26:39 +02:00
Valentin Kettner
535971f3a1 Refactored IDocumentStylePoolAccess out of SwDoc.
Added non const SwDoc::GetDfltTxtFmtColl and SwDoc::GetTxtFmtColls
and SwDoc::GetCharFmts.
Had to make the manager friend of SwTxtFmtColl and SwConditionTxtFmtColl
Had to make SwDoc::_MakeCharFmt and SwDoc::_MakeFrmFmt public.

Change-Id: I19a36d91f92b3781a6c4313ec12eb8f7d4dfacc3
2014-08-12 23:26:38 +02:00
Valentin Kettner
5494954b26 Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.

Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12 23:26:38 +02:00
Valentin Kettner
64e13a1456 Refactored IDocumentState out of SwDoc.
Into the new class DocumentStateManager.

Change-Id: I91c9097b091ff6118d58fd15fff2a4cefe0171fd
2014-08-12 23:26:38 +02:00
Valentin Kettner
9cc617afcd Refactored IDocumentStatistics our of SwDoc.
Into the new class DocumentStatisticsManager.

Change-Id: I281232dc09dbd79c2faf3c2a78ae49625bbe88ee
2014-08-12 23:26:37 +02:00
Valentin Kettner
9d43f6d2c4 Refactored IDocumentLineNumberAccess.
This interface is obsolete and was deleted.

Change-Id: I56d37814f6e43f083ab3d199237ade06db287e18
2014-08-12 23:26:37 +02:00
Valentin Kettner
69e5f335ab Refactored IDocumentFieldsAccess out of SwDoc.
Into the new class DocumentFieldsManager.
Removed SwDoc::_MakeFldList because it is not defined anywhere.
Also moved a few non interface methods that belong to the manager.

Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
2014-08-12 23:26:36 +02:00
Valentin Kettner
274f1811b9 Refactored IDocumentRedlineAccess out of SwDoc.
Into the new class DocumentRedlineManager.
Added an non const version of GetRedlineTbl to the interface.
Also Moved SetAutoFmtRedlineComment which is not part of interface.

Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
2014-08-12 23:26:36 +02:00
Valentin Kettner
f634ec520f Refactored IDocumentContentOperations out of SwDoc.
Into the new class DocumentContentOperationsManager.

Made SwNodes in sw/inc/ndarr.hxx friend class to
DocumentContentOperationsManager so it can call DelNodes at end of
DocumentContentOperationsManager::DeleteSection .

Added DeleteAutoCorrExceptWord to SwDoc, its needed in the Manager.

Added a non const version of SwDoc::GetDfltGrfFmtColl() to SwDoc
because its needed in the Manager.

Made SwDoc a friend class to DocumentContentOperationsManager so it
can call SwDoc::checkRedlining and SwDocL::_MakeFlySection.

Moved SwDoc::CopyImpl_ , SwDoc::CopyWithFlyInFly and
SwDoc::CopyFlyInFlyImpl into the Manager.

Moved "struct ParaRstFmt" and "lcl_RstTxtAttr" from docfmt.cxx
in DocumentContentOperationsManager.hxx .

Change-Id: Icaab57f4a8c158a85e549ecb4aacc752bc95bbc9
2014-07-15 15:44:04 +02:00
Valentin Kettner
3fed83524d Refactored IDocumentOutlineNodes out of SwDoc.
Into the new class DocumentOutlineNodesManager.

Change-Id: I05581391a1474872113ae91d6429709d181cabfe
2014-07-15 15:44:04 +02:00
Valentin Kettner
87cb919c7c Refactored IDocumentListsAccess out of SwDoc.
In the new class DocumentListsManager.
The method listfunc::CreateUniqueListId was also moved there.
Added a new method deleteListsByDefaultListStyle to the Interface,
which is needed for SwDoc::DelNumRule.

Change-Id: I75ea554a57d9402d2fcfeaedf9fbe50fbae2b020
2014-07-15 15:44:03 +02:00
Valentin Kettner
c8a8695d4d Refactored IDocumentListItems out of SwDoc.
Into the new class DocumentListItemsManager.

Change-Id: Ic86200280caa1b6e2c940bb12149235223ed0cd2
2014-07-15 15:44:03 +02:00
Valentin Kettner
54ca3a6efa Refactored IDocumentLinksAdministration out of SwDoc.
To the new class DocumentLinksAdministrationManager.
Additional to the Interface methods SwDoc::SelectServerObj was also moved
and sw/source/core/doc/docdde.cxx was deleted as it became empty.
Also fixed OUString usage in IDocumentLinksAdministration.hxx .

Change-Id: I1f2bf0881a7d4add9c657b6441851ae14ad8d161
2014-07-15 15:44:03 +02:00
Valentin Kettner
a27e8f6c8d Refactored IDocumentTimerAccess in SwDoc into DocumentTimerManager.
Change-Id: Idb39ef2cdc34e0c0e7853de0a656f579ca3528da
2014-07-15 15:44:02 +02:00
Valentin Kettner
c88a3d3e8c Refactored IDocumentChartDataProviderAccess in SwDoc.
Into the new class DocumentChartDataProviderManager.

Change-Id: I3be038ba276642546223c0c2fba3bea21980b33d
2014-07-15 15:44:02 +02:00
Armin Le Grand
378dc6ef20 Related: #i124638# Corrected relationship between DrawModel and...
DocShell in Writer, made SwDrawModel and handling more known

(includes suspicious removal of setting SID_ATTR_LINEEND_WIDTH_DEFAULT)

(cherry picked from commit a7ccadbf3b1ac378ca15d3630d48f48734700e5c)

Conflicts:
	sw/inc/IDocumentDrawModelAccess.hxx
	sw/inc/doc.hxx
	sw/inc/docsh.hxx
	sw/inc/dpage.hxx
	sw/inc/drawdoc.hxx
	sw/source/core/access/accmap.cxx
	sw/source/core/doc/doc.cxx
	sw/source/core/doc/docdesc.cxx
	sw/source/core/doc/docdraw.cxx
	sw/source/core/doc/docfly.cxx
	sw/source/core/doc/doclay.cxx
	sw/source/core/doc/docnew.cxx
	sw/source/core/draw/dcontact.cxx
	sw/source/core/draw/dpage.cxx
	sw/source/core/draw/drawdoc.cxx
	sw/source/core/frmedt/feshview.cxx
	sw/source/core/layout/fly.cxx
	sw/source/core/layout/frmtool.cxx
	sw/source/core/layout/newfrm.cxx
	sw/source/core/layout/paintfrm.cxx
	sw/source/core/undo/docundo.cxx
	sw/source/core/undo/unattr.cxx
	sw/source/core/unocore/unodraw.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/core/view/vdraw.cxx
	sw/source/core/view/viewimp.cxx
	sw/source/core/view/viewsh.cxx
	sw/source/filter/html/htmldrawreader.cxx
	sw/source/filter/rtf/rtffly.cxx
	sw/source/filter/rtf/swparrtf.cxx
	sw/source/filter/ww8/docxattributeoutput.cxx
	sw/source/filter/ww8/rtfattributeoutput.cxx
	sw/source/filter/ww8/wrtw8esh.cxx
	sw/source/filter/ww8/wrtww8.cxx
	sw/source/filter/ww8/ww8graf.cxx
	sw/source/filter/xml/swxml.cxx
	sw/source/filter/xml/xmlexp.cxx
	sw/source/filter/xml/xmlimp.cxx
	sw/source/ui/app/docshdrw.cxx
	sw/source/ui/uiview/view.cxx
	sw/source/ui/uno/unodefaults.cxx
	sw/source/uibase/app/docst.cxx
	sw/source/uibase/app/docstyle.cxx
	sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
	sw/source/uibase/lingu/sdrhhcwrap.cxx
	sw/source/uibase/shells/drwbassh.cxx
	sw/source/uibase/shells/frmsh.cxx
	sw/source/uibase/shells/grfsh.cxx
	sw/source/uibase/shells/textsh1.cxx
	sw/source/uibase/uno/unotxdoc.cxx
	sw/source/uibase/utlui/content.cxx

Conflicts:
	sw/source/uibase/app/docshdrw.cxx

Change-Id: Icb99eaa7bfb1eb8922a9fd928b5e4149821130dd
2014-07-01 13:30:10 +02:00
Oliver-Rainer Wittmann
b733d208b0 Related: #i78498# Do not keep OutlineLevel attribute at paragraph...
when a Paragraph Style is assigned.

(cherry picked from commit 6a1564284d90c7e175f7848520924f7f6a5884b7)
(cherry picked from commit 4a381b1124f60b76cabb558fa24827448a1caab0)

Conflicts:
	sw/inc/doc.hxx
	sw/inc/editsh.hxx
	sw/inc/fmtcol.hxx
	sw/inc/ndtxt.hxx
	sw/source/core/attr/format.cxx
	sw/source/core/doc/docfmt.cxx
	sw/source/core/doc/docglbl.cxx
	sw/source/core/doc/doctxm.cxx
	sw/source/core/doc/fmtcol.cxx
	sw/source/core/edit/edfcol.cxx
	sw/source/core/txtnode/ndtxt.cxx
	sw/source/core/undo/unfmco.cxx
	sw/source/core/unocore/unosett.cxx
	sw/source/core/unocore/unostyle.cxx

Change-Id: Ifa1214876df296f2e1210cc4a35f2df67f9f6bc4
2014-06-27 17:22:09 +01:00