Commit Graph

834 Commits

Author SHA1 Message Date
384cb5ff7b Consistently use size_t and SAL_MAX_SIZE
Instead of a mix of sal_uIntPtr, sal_uLong, int, and so on.
Also change CONTAINER_ENTRY_NOTFOUND=ULONG_MAX to SAL_MAX_SIZE as
return value in case of failure and in the related tests.

Change-Id: Ie778a849253b4be84fbcdab9557b7c4240233927
2014-08-16 21:52:28 +02:00
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
5494954b26 Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.

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

Change-Id: I91c9097b091ff6118d58fd15fff2a4cefe0171fd
2014-08-12 23:26:38 +02:00
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
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
2903d85d61 fix deleting an image anchored to last paragraph in document
It only compared nodes instead of SwPositions, thus refusing to delete
anything anchored at the last content node. Also, select-all makes
rEnd point to the last content node, after its content. So if
an anchor-to-char image is anchored at the end of the paragraph,
it points to this place, too, so that must be checked.

Change-Id: Ie0ba6ed59f47e59492ad88577392884cadb52106
2014-08-12 20:23:16 +02:00
3dafed2ede -Werror,-Wundefined-bool-conversion
Change-Id: Iff8db4c82abeeed0789d7012223a846f1058c353
2014-08-12 12:19:43 +02:00
183bde5bf5 Related: fdo#81641 implement undo of Conditional Text style creation
and deletion

Change-Id: I694ae8f917c74305cd30037c3c3833a980354948
2014-07-24 12:46:55 +01:00
05dda9a913 SwpHintsArray/SwpHints and related: sal_uInt16 to size_t
Change-Id: I9a7674109b05683287e12cbce6bc417b40ca5084
2014-07-22 23:50:42 +02:00
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
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
c88a3d3e8c Refactored IDocumentChartDataProviderAccess in SwDoc.
Into the new class DocumentChartDataProviderManager.

Change-Id: I3be038ba276642546223c0c2fba3bea21980b33d
2014-07-15 15:44:02 +02:00
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
65438659a1 sw: work around mysterious MSVC warning C4258
Cleraly the variable "n" from line 999 is not in scope in
line 1054 or line 1057?

Change-Id: I8ca321e6030390ad0192e4dceb37d87b6f06f0a5
2014-07-08 14:31:31 +02:00
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
7d9bb549d4 Related: #i124638# Second step of DrawingLayer FillAttributes...
for Writer objects, now added support for Paragraph and PageStyle (including
Header and Footer) for direct attributes and style attributes

(cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)

Conflicts:
	cui/source/factory/dlgfact.cxx
	cui/source/factory/dlgfact.hxx
	cui/source/inc/bbdlg.hxx
	cui/source/inc/cuires.hrc
	cui/source/tabpages/bbdlg.cxx
	cui/source/tabpages/bbdlg.src
	cui/source/tabpages/page.cxx
	cui/source/tabpages/tparea.cxx
	include/svx/pagectrl.hxx
	include/svx/svxdlg.hxx
	include/svx/svxids.hrc
	include/xmloff/PageMasterStyleMap.hxx
	include/xmloff/prstylei.hxx
	include/xmloff/txtprmap.hxx
	svx/Package_inc.mk
	svx/inc/svx/hdft.hxx
	svx/source/dialog/hdft.cxx
	svx/source/dialog/pagectrl.cxx
	svx/source/tbxctrls/tbxcolorupdate.cxx
	svx/source/unodraw/unobrushitemhelper.cxx
	sw/Library_sw.mk
	sw/inc/fillattributes.hxx
	sw/inc/format.hxx
	sw/inc/frmatr.hxx
	sw/inc/frmfmt.hxx
	sw/inc/hintids.hxx
	sw/inc/hints.hxx
	sw/inc/ndtxt.hxx
	sw/inc/node.hxx
	sw/inc/swunohelper.hxx
	sw/inc/unobrushitemhelper.hxx
	sw/inc/unoprnms.hxx
	sw/source/core/attr/format.cxx
	sw/source/core/attr/hints.cxx
	sw/source/core/doc/docdesc.cxx
	sw/source/core/doc/docdraw.cxx
	sw/source/core/doc/docfmt.cxx
	sw/source/core/doc/docnew.cxx
	sw/source/core/doc/docredln.cxx
	sw/source/core/doc/poolfmt.cxx
	sw/source/core/doc/visiturl.cxx
	sw/source/core/docnode/node.cxx
	sw/source/core/inc/frame.hxx
	sw/source/core/inc/frmtool.hxx
	sw/source/core/inc/rolbck.hxx
	sw/source/core/layout/atrfrm.cxx
	sw/source/core/layout/fillattributes.cxx
	sw/source/core/layout/findfrm.cxx
	sw/source/core/layout/paintfrm.cxx
	sw/source/core/txtnode/ndtxt.cxx
	sw/source/core/txtnode/thints.cxx
	sw/source/core/txtnode/txtedt.cxx
	sw/source/core/undo/rolbck.cxx
	sw/source/core/unocore/swunohelper.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/core/unocore/unomap.cxx
	sw/source/core/unocore/unoparagraph.cxx
	sw/source/core/unocore/unoprnms.cxx
	sw/source/core/unocore/unostyle.cxx
	sw/source/ui/chrdlg/paradlg.src
	sw/source/ui/chrdlg/pardlg.cxx
	sw/source/ui/fmtui/tmpdlg.cxx
	sw/source/ui/fmtui/tmpdlg.src
	sw/source/uibase/app/docst.cxx
	sw/source/uibase/app/docstyle.cxx
	sw/source/uibase/frmdlg/colex.cxx
	sw/source/uibase/shells/basesh.cxx
	sw/source/uibase/shells/textsh1.cxx
	sw/source/uibase/uiview/viewstat.cxx
	sw/source/uibase/utlui/uitool.cxx
	xmloff/inc/PageMasterImportContext.hxx
	xmloff/inc/xmloff/XMLShapeStyleContext.hxx
	xmloff/source/draw/XMLShapeStyleContext.cxx
	xmloff/source/draw/sdpropls.hxx
	xmloff/source/style/PageMasterExportPropMapper.cxx
	xmloff/source/style/PageMasterImportContext.cxx
	xmloff/source/style/PageMasterPropHdlFactory.cxx
	xmloff/source/style/PageMasterStyleMap.cxx
	xmloff/source/style/prstylei.cxx
	xmloff/source/text/txtexppr.cxx
	xmloff/source/text/txtprhdl.cxx
	xmloff/source/text/txtprmap.cxx
	xmloff/source/text/txtstyli.cxx

Conflicts:
	svx/source/dialog/hdft.cxx
	sw/source/core/doc/visiturl.cxx
	sw/source/core/txtnode/thints.cxx
	sw/source/core/txtnode/txtatr2.cxx
	sw/source/core/unocore/unostyle.cxx

Change-Id: I7e8779db6c0cbd1e242b63eab888f468f2de509a
2014-07-01 13:30:09 +02:00
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
4523dd0544 Called C++ object pointer is null
Change-Id: I88efc4be6ff869ef97a2b398d43f7b7914debfc6
2014-06-30 09:46:16 +01:00
bd479676f2 sal_uInt16 to size_t
Change-Id: I8b045cf44b3e62616c8c3e0a896524af13310dd3
2014-06-28 11:17:55 +02:00
5247da4e4a sal_uInt16 to sal_Int32 and remove/fix comments
Change-Id: Icf49a339fb23d6217dd0bc41c9012233717ad808
2014-06-28 11:17:53 +02:00
37953bfacc sal_uInt16 to size_t
Change-Id: Ib4a3f8401e2ddd4cb76c76c968151799c86b5845
2014-06-28 11:17:51 +02:00
bd16f1cebc sal_uInt16 to size_t
Change-Id: I5fe887cdb800a5f5cc6f6277b52a5f02c1b9bb84
2014-06-28 11:17:49 +02:00
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
e48a233960 loplugin:unreffun: also warn about redundant redeclarations
Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
2014-06-27 15:27:39 +02:00
a531676d6d fix broken redlines after undoing column count change (cp#1000071)
Changing a document with redlines to two columns and then using undo
set some redlines to point to the end of the document (done by
the call to RemoveIdxFromSection() in SwUndoInsSection::UndoImpl()).

Change-Id: I88b563b88beebcd1c3cb21fe61bb56cdb12cdc41
2014-06-24 17:00:23 +02:00
e2080e70fe new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
   class A {
     struct X x;
     public X* getX() { return &x; }
   }
which can be:
     public X& getX() { return x; }

Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-24 11:34:21 +02:00
1d38cb3655 fdo#71076, fdo#71767: Preserve number formats when charts are copied.
Change-Id: If5ae8852152012483237e7602e56a0c46ea8748a
2014-06-19 14:46:56 -04:00
67820a9037 coverity#705037 Unchecked dynamic_cast
Change-Id: I9f6c8ceafd09b4a5d4e951e01e1a06b2b5265181
2014-06-19 10:26:50 +01:00
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
060fc66193 Fix
Change-Id: I6a759eb3c5bff4dcf4603d648053e17a6d4ff837
2014-06-13 10:24:14 +02:00
5028475adb fdo#75757: Remove inheritance from std::vector
Problem: Many classes inherit directly from std::vector
See comment#6 by kendy for more details.

Solution: Removed class SwpHstry altogether and moved its
destructor's functionality to SwHistory's destructor.
Changed type of m_SwpHstry from SwpHstry to vector<SwHistoryHint*>

Change-Id: I32a7e111fef7c5e7b83ecee6469e173b5a21a5bf
Reviewed-on: https://gerrit.libreoffice.org/9725
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-06-13 07:26:48 +00:00
2da8a60702 Revert "Change sw::mark::IMark::GetOtherMarkPos return type from ref
... to pointer"

CrossRefBookmark::GetOtherMarkPos() is apparently not supposed to be
called, so just replace the undefined null-reference with a call to
abort().

This reverts commit dcf0ac048ce745774f401ada72b051757298c559.

Change-Id: I55b4accb4f42031df5671e8a30897e3aff9b56f9
2014-06-11 16:08:34 +02:00
dcf0ac048c Change sw::mark::IMark::GetOtherMarkPos return type from ref to pointer
...so CrossRefBookmark::GetOtherMarkPos can legitimately return a null pointer

Change-Id: I88774cf0d139d017d67d6727ee01214997a73636
2014-06-10 19:44:04 +02:00
a72ea67d52 decouple CntntStore so it can be refactored
Change-Id: I26554a0e269d63830fd84b37a4323f40c80fc014
2014-06-10 10:14:58 +02:00
e5fe5601a6 create factory function for encapsulation
Change-Id: I4cf6ca2855787102f6f9edd477e0d6e4c6a43503
2014-06-10 10:14:57 +02:00
bbcf8a2ea8 typedef the internal type
Change-Id: I11e785427add72b56bc48cfac1640211dfba6cc6
2014-06-10 10:14:57 +02:00
b651ed7a67 sw: fix some assertions that still use removed SwDoc methods
Change-Id: Ia33dff51cdb58030ec11ec499ee5c518fba31641
2014-06-03 19:12:05 +02:00
86075a3f0f Split out IDocumentDrawModelAccess from SwDoc.
To the new class DocumentDrawModelManager.
All moved methods and members have the same in thew new class.

Change-Id: I89ad0e0c4a42885d5810e834983ea8e8e6c0a2d2
2014-06-03 19:12:05 +02:00
dded2e2549 sal_uInt16 to size_t
Change-Id: Ia8795223224a6d2772f12ad41d7691517db80714
2014-06-01 20:20:00 +02:00
0a3fe4c281 Remove ASCII art and useless comments from sw module
Change-Id: I3ba4ac78fd4810e006b1034bbe7c28b1803895d2
Reviewed-on: https://gerrit.libreoffice.org/9494
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:46:44 -05:00
2505961439 coverity#705269 Missing break in switch
Change-Id: I574ea32f23d60a185e915d32bd163fe4ea7bd6aa
2014-05-26 10:18:25 +01:00
60b21e85a0 WaE: -Wunused-variable
Change-Id: I821560e86a45ac53f4886bedd957e5d2dd30e3cd
2014-05-19 20:04:25 +02:00
3db8d606d5 hrc and src files: squeeze multiple newlines
for i in `find . -name *.src -or -name *.hrc`; do FILE=$(cat -s "$i"); echo "$FILE" > "$i"; done

Change-Id: I2bac5ad3e1eb3c566e5c867ccf45893a19e1561e
2014-05-19 20:04:22 +02:00
59d7d8674a coverity#708472 Uninitialized scalar field
Change-Id: I09767fe28069e195b568ce91c62770a85cc7c6ab
2014-05-10 21:12:58 +01:00
a82de8698a fdo#57197: sw: fix crash on Undo of table row insert on 1-row table
... with accessibility enabled: the SwCellFrms are deleted, but the
entry in the SwAccessibleMap::mpFrmMap is not removed, because Dispose
returns early since the connections to the nodes have been severed already.

This then crashes in some questionable code that iterates over and uses
the frame pointers in mpFrmMap that was added in
76c549eb01dcb7b5bf28a271ce00e386f3d388ba (where previously only the
WeakReferences were used out of that map).

Change-Id: I13885c6ab9a92e34e95925f275e15c20fdc600b7
2014-05-05 23:54:22 +02:00
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00
5f982c22ff SwUndoSplitTbl::UndoImpl(): avoid assert from ~SwIndexReg
Can be triggered by moving view cursor into new paragraph before Undo.

Change-Id: I8386611a8eabd1c3b6edfacd0226358df52cbe66
2014-05-03 00:51:38 +02:00
bc0c939270 fdo#57197: sw: fix crash on Undo of table row/column insert
The _SaveTable::CreateNew() will call _FndBox::DelFrms() but at that
point the SwTableBoxes have already been deleted; so do that earlier.

Change-Id: I868c8fffbddeb1ea6df724fb68cac732eeee2eba
2014-05-03 00:49:15 +02:00
e06131e966 SwUndoDelete::RedoImpl(): avoid assert from ~SwIndexReg
1. insert header
2. insert table in header
3. put cursor in bottom right cell
4. Ctrl+Shift+Delete
5. Undo
6. Redo

Problem is that the shell cursors never get corrected in step 6.
Replace the previous hacky after-the-fact fixup of rPam only with call
to PaMCorrAbs.  [there does not appear to be any other case than
bDelFullPara where this branch is taken, which make the next one look
kind of weird?]

Change-Id: If3583f83e66fff4d3367a1532e443aed780a5e6c
2014-05-03 00:49:10 +02:00