Commit Graph

886 Commits

Author SHA1 Message Date
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
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
ea733ab5b6 Turn SfxItemState into a C++11 scoped enumeration
...to gain further confidence in the claim "that none of the existing
code tries to uses combinations of these enum values"
(d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState")

Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13
Reviewed-on: https://gerrit.libreoffice.org/11384
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-12 06:08:32 +00:00
f3d791f754 sw: [loplugin:externandnotdefined]
It turns out that document compare / merge and master document
insert file are all the callers of SwFindDocShell() so move the fix-up
there...

Change-Id: I912a464c3acab8d0adb7b5b659d62f629a15cb70
2014-09-10 18:45:23 +02:00
b56558717d fdo#83655: sw: RSID-only hint assertion when inserting in master document
For the temporary document there is no layout so SwTxtNode::MakeFrm()
isn't called.

(regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291)

Change-Id: I711d32a81519edd6840cc29f5cd9dbc57ef21982
2014-09-10 16:14:56 +02:00
513a3a6a01 coverity#704947 Dereference after null check
Change-Id: Id6eb50de48b8a674d7b48d1256b1529637155eb1
2014-09-08 09:17:06 +01:00
da44e4cce8 Use size_t consistently, constify, reduce scope
Change-Id: Ie5de70645becc5ac584f1b3ffe6048969d2a19a9
2014-09-06 12:08:13 +02:00
3284daa3ab coverity#704947 Dereference after null check
Change-Id: Iea0a789b842b9bb05e4c774460e56e2ed0f5f74e
2014-09-02 12:14:49 +01:00
57a4337e25 set names on a bunch more threads...
Change-Id: I4c2f2f0bcce52839033876ec991529721e06a3c8
2014-08-25 13:21:59 +02:00
a00778f9d3 Dump table attributes and page description items
Adds the SwPageDesc name to the dumpAsXml output of the
SwFmtPageDesc / RES_PAGEDESC SfxPoolItem and dumps the tables
attibutes.

Adtittionally this renames the unknown field name, so it doesn't
produce wrong XML output (blamed by "xmllint --format") and adds
the hex node type to the start and end node XML output.

Reviewed on:
	https://gerrit.libreoffice.org/11091

Change-Id: I3cde39d423e17909243675efdd39557a6bfffbd7
2014-08-25 09:27:09 +02:00
de6fd1b90f Avoid invalid downcasts to SwFmtHeader instead of SwFmtFooter
...which only happened to work because the two classes have very similar layout

Change-Id: Ie4bde807a2442a95ff515b065d4f45f257a32f34
2014-08-21 15:06:48 +02:00
9f01ba1b78 i#107771: sw: burn, UnoCallBack, burn!
Change-Id: Ifdb6d4b2e404bd160e6fcec3229691e750bdf698
2014-08-20 16:40:18 +02:00
e54015d06f i#107771: sw: make SwXFootnote a client of its format poolitem
In other words, stop registering at SwDoc's "UnoCallBack".

Change-Id: Ie73c707b0f43559cc78717c0879d5e9a9335a7ac
2014-08-20 16:40:17 +02:00
bbd97fe57d i#107771: sw: make SwXTextField a client of its format poolitem
In other words, stop registering at SwDoc's "UnoCallBack"

Change-Id: Ieb2639497fe5e8d71aa1c47952c007da76fcee84
2014-08-20 16:40:17 +02:00
e7c96f3e8f i#107771: sw: make SwXReferenceMark a client of its format poolitem
In other words, stop registering at SwDoc's "UnoCallBack"

Change-Id: I9e08966cf8e2d2a373867d81549c8887f73993c8
2014-08-20 16:40:15 +02:00
df4bd415c0 fix crashing on exit in static SvxBrushItem dtor
site of first ctor

Change-Id: I3316e91bc54439b74df30fdf02ff264a39489c29
2014-08-20 14:06:33 +01:00
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
47e2fd0dc8 Consistently use size_t and SAL_MAX_SIZE
Change-Id: Ibab89984ec94556ec368653b6db50c6c2e380dec
2014-08-16 21:52:32 +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
9d43f6d2c4 Refactored IDocumentLineNumberAccess.
This interface is obsolete and was deleted.

Change-Id: I56d37814f6e43f083ab3d199237ade06db287e18
2014-08-12 23:26:37 +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
3dafed2ede -Werror,-Wundefined-bool-conversion
Change-Id: Iff8db4c82abeeed0789d7012223a846f1058c353
2014-08-12 12:19:43 +02:00
b32539d065 sw: improve doc model xml dump of SwFmtAnchor
Change-Id: Icdfc370c4b525fd43d9d5935ff461534cf535233
2014-08-08 15:27:31 +02:00
88de419ea6 coverity#704947 Dereference after null check
Change-Id: I3e2e3d78e84515cc6e1caa6e105762726d2b9e56
2014-08-07 18:00:51 +01:00
58f837d226 Avoid unnecessary illegal downcasts from SwFrmFmt to SwSectionFmt
Change-Id: I2ca8d57a09b6f8c6d760b5fb6a3d2f94ad22ada3
2014-08-07 11:06:41 +02:00
ca16ec4346 Avoid illegal downcasts from BigPtrEntry to SwNode
...and while at it, remove the need for the TempBigPtrEntry derivation.

Change-Id: Ic758f646578a90a28632b1368fed209eb84f9c1c
2014-08-07 10:09:07 +02:00
b75e052d31 Call SwTxtNode-specific part of DelFrms while SwTxtNode is still SwTxtNode
...when SwCntntNode::DelFrms is called from ~SwTxtNode -> ~SwCntntNode.

* SwCntntNode::DelFrms now needs a flag to distinguish calls from inside
  ~SwCntntNode from other calls.  bIsDisposeAccTable happens to already serve
  that purpose, so I reused it, but that may be a bad idea from a semantic point
  of view?

* ~SwTxtNode is careful to mimic old behavior and only calls DelFrms_TxtNodePart
  if GetDepends() is true; no idea whether that's really necessary, though.

* Shifting the work done by DelFrms_TxtNodePart from within ~SwCntntNode to
  before ~SwTxtNode calls ~SwCntntNode hopefully has no negative consequences.

Change-Id: I1532b4cfef7fbf9ba82e64b919a08cbefa335421
2014-08-06 18:14:00 +02:00
48c90eb75f SwCntntNode::DelFrms already checks for GetDepends()
Change-Id: I9f7ccd372a570dc4dea98983c51419dce83f8be8
2014-08-06 18:13:59 +02:00
02e462f5b1 Remove unused bNeedDel parameter to SwCntntNode::DelFrms
Change-Id: Iedc5e8caafda868db853fdf328fbdc99bbf28e20
2014-08-06 18:13:59 +02:00
a47b51b415 Avoid fn ptr casts in SwNodes::ForEeach
...by moving ForEach from BigPtrArray down to its sole user SwNodes.

Change-Id: I6d326d3e1ac9dc6ac820e600973af420785d5a50
2014-08-05 16:30:31 +02:00
5ee87e861e Avoid undef downcast in base class ctor
Change-Id: I71eecfdc657b153f9289e8e9af52fba9ed22d3a8
2014-07-31 12:12:31 +02:00
05dda9a913 SwpHintsArray/SwpHints and related: sal_uInt16 to size_t
Change-Id: I9a7674109b05683287e12cbce6bc417b40ca5084
2014-07-22 23:50:42 +02:00
1e6ff8f7f8 XFillStyle -> css::drawing::FillStyle
Change-Id: I6b2fabd72fd34f4ac1b3a18f386c90794bc39ce4
2014-07-19 00:30:37 +02:00
a517898052 remove unnecessary "const &" qualifier from T* parameters
e.g. convert code like
    foo(X * const & p)
to
    foo(X * p)
since the "const &" part of it adds nothing useful.

Change-Id: Icf5f2041517259e7b6e055b75ed1e0e77c547da5
2014-07-18 14:24:19 +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
c8a8695d4d Refactored IDocumentListItems out of SwDoc.
Into the new class DocumentListItemsManager.

Change-Id: Ic86200280caa1b6e2c940bb12149235223ed0cd2
2014-07-15 15:44:03 +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
c62e854ee4 convert sw/ObservableThread to salhelper::SimpleReferenceObject
instead of re-implementing it's own reference counting

Change-Id: I2600b970544f1dfd84b987d1891c79e3c377bd1b
2014-07-11 14:41: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
f816087a1f coverity#704523 Division or modulo by zero
Change-Id: I165687b22f70a03d4bcb669a04d3495454d09042
2014-07-06 15:15:10 +01:00
dfeef9e970 remove unnecessary header macro wizardry
using the #define SW_DECL_SWSERVEROBJECT_DEFINED to turn typedefs
on and off. Rather just use SvRef<T> everywhere, like we do for
other reference types.

Change-Id: Id939c46c5861cd7440b66c5a84122f900ddb882c
2014-07-04 11:49:09 +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
05f5c4d4d6 DBG_ASSERT->assert
Change-Id: Ic2933fc686d3bb030291756bd94127ee7583c833
2014-06-27 08:55:56 +01:00
d89d816971 sw doc model xml dump: handle SwFmtFrmSize
Change-Id: Ie1a8dbc86c9725f3d238226c166ec657722c1770
2014-06-26 16:44:01 +02:00
be57d41dc6 Add sw::UndoManager::dumpAsXml()
So that it's easy to see where the implementation for a given undo
action is.

Change-Id: I652826d2933451b84a05eecc3982c8cbf2db3764
2014-06-24 12:35:09 +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