summaryrefslogtreecommitdiff
path: root/sw/inc/section.hxx
AgeCommit message (Collapse)Author
2022-08-04clang-tidy modernize-pass-by-value in swNoel Grandin
Change-Id: Ie5c250c64f95e649d33d3f3da7b54e81a4b81d0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137781 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21use more concrete UNO classes in writerNoel Grandin
as opposed to opaque UNO interfaces. This is a prelude which enables performance work because now I can regular C++ method Change-Id: I9bcfdca1000b4439431c9ea3b17bed081d80f0b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05tdf#148299 Don't unmotivatedly mess with spaces in file namesStephan Bergmann
This conversion of double to single spaces had been done ever since 84a3db80b4fd66c6854b3135b5f69b61fd828e62 "initial import", but it is unclear to me why. The same conversion functionality is also used at two places in sw/source/ui/dialog/uiregionsw.cxx. Not sure if it has any motivation there, so lets keep that intact for now. Change-Id: I0558f015c53f69a9a405891b9dad21a98de3533c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133841 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-22Add XWeak constructor and operator= to uno::WeakReferenceNoel Grandin
which is faster since we can skip the UNO_QUERY. Change-Id: Id95ad9f3568213e974bd13659d92d4ea94dbfbd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130282 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-11tdf#146605 sw: try to fix SwSectionFormat notificationsMichael Stahl
SwSectionFormat no longer notifies via its SwModify to SwClient listeners, but only via SvtBroadcaster, so SwSection and SwSectionFrame need to be SvtListeners. This can be seen when changing the footnote-at-end setting in the section dialog, if the SwSection doesn't get the event the footnote numbers aren't adapted to a new restart value, if the SwSectionFrame doesn't get the event the footnote container isn't moved. This is of course not pretty but hopefully it will be refactored further in the future. (regression from commit 2e32f4ed5af16a68c97a50806a42ffa2d10f1d7a) Change-Id: I93c616e209a01fc5d4c8eba701a6ddce5d5b432e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128257 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-10sw: stop inheriting SwSectionData::m_bProtectFlag from parent sectionMichael Stahl
This is actually no longer inherited by accident since commit 2e32f4ed5af16a68c97a50806a42ffa2d10f1d7a because it replaced the SwSectionFormat::Modify()->ModifyBroadcast()->CallSwClientNotify()->CallSwClientNotify() with a call to GetNotifier()->Broadcast(), and apparently SwSection is a SwClient of SwSectionFormat but not a SvtListener. But some consider the new behaviour useful, as previously there was no way to un-protect a section inside an outer protected section at all, while in this way every section can have its own independent protection flag. (The m_bEditInReadonlyFlag is not used for this purpose, as it is only for the case when the document was loaded ReadOnly.) So make it more explicit by removing the SwSection inheritance code. A similar change was made for hidden flag in commit 91b0024965908c692bea40f47c58ea9d1bf8a596 Change-Id: I29d3c84309a84267573950775f2a1c6353623724 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128221 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-12-01sw doc model xml dump: show the format of section nodesMiklos Vajna
The SwSectionNode has an SwSection, which is registered in an SwSectionFormat, which finally tells us if it's a protected one. Change-Id: Ie46c516f900f1c479c11cbbaf061973400614a2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126151 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-08Fix typosAndrea Gelmini
Change-Id: I42d38399726acb1d044b4b9f032de96ded00e5bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121542 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-08-30tdf#103612 sw: fix confusing inheritance of section hidden flagMichael Stahl
SwSectionData has 3 confusing boolean members for hiding: * m_bHidden corresponds to the Hide checkbox in the UI * m_bCondHiddenFlag stores the result of evaluating the hide condition * m_bHiddenFlag is the final computed result that indicates that this section is hidden Now, the first 2 flags determine m_bHiddenFlag = true, but there's another possibility: m_bHiddenFlag is also true if there is a parent section for which m_bHiddenFlag is true (because of course this hides all section content including nested sections)... the latter situation is apparently handled in SwSectionFormat::UpdateParent(). The code in SwSection::SwSection() checks the parent's m_bHiddenFlag but then sets the child's m_bHidden, which looks very wrong, so remove this. Also adapt 2 other places that look like they should be checking a different flag. Change-Id: I58d9c878b58ad6cd878f450072178006b4c7ebb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121314 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2020-10-26Section/SectionFormat: Modify no more ...Bjoern Michaelsen
Change-Id: I4f890013401c0ca1313ec0b9f6c2827019759446 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104778 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-05-09compact namespace in swNoel Grandin
Change-Id: Ie2c3e3f95a687b12b89bcfc5cad44fb7a1d4568f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93862 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-31convert enum to scoped in SvBaseLinkNoel Grandin
Change-Id: Ief399381ac27764fce95ee053c322571a07b671c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91366 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-11convert LinkCreateType to scoped enumNoel Grandin
Change-Id: Ia31648d2dbd6eb5d878d7dcc904d1b05b6c1619c Reviewed-on: https://gerrit.libreoffice.org/84852 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-11convert SectionType to scoped enumNoel Grandin
Change-Id: Ib05b88b05c90b835107128f42c70170660788d00 Reviewed-on: https://gerrit.libreoffice.org/84851 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-19tdf#121186: sync itemset and supportsFullDrawingLayerFillAttributeSetMike Kaganski
In the bugdoc, there are three separate section styles, first of which (Sect1) has fo:background-color attribute set to #ffffff, others with no background-related attributes. The sections using the styles are nested, the outermost one using the style Sect1 with background color. When the XML is read, SwXTextSection::attach is called, which fills an item set with values stored in an SwTextSectionProperties_Impl struct, SvxBrushItem with color value of 0x00ffffff among them. The resulting set contains the SvxBrushItem item (WhichId = RES_BACKGROUND = 105). No XATTR_FILL_FIRST .. XATTR_FILL_LAST are put into the set. When later the Edit Sections dialog is opened, SectRepr objects are constructed for each section, and the brush is taken from section's format using makeBackgroundBrushItem. It checks supportsFullDrawingLayerFillAttributeSet, and if yes, uses getSvxBrushItemFromSourceSet to fill in the SvxBrushItem; the latter only considers XATTR_FILL_FIRST .. XATTR_FILL_LAST in the passed set. For the SwSectionFormat, supportsFullDrawingLayerFillAttributeSet inherited from SwFrameFormat returns true, which means that existing RES_BACKGROUND item is ignored, and default transparent color is returned. Fix by returning false from supportsFullDrawingLayerFillAttributeSet for SwSectionFormat. This makes nested sections' properties and behaviour match what was in older versions (4.0), where all three nested sections took white fill; and only setting innermost section's fill to none made it transparent (show document's background). Change-Id: Id0b4fce221cfa9c54097e69a3acfdf018a1043b5 Reviewed-on: https://gerrit.libreoffice.org/83016 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-04loplugin:finalclasses in sw/incNoel Grandin
Change-Id: I084502d8c5607f103ef987b54252ef95341f0bef Reviewed-on: https://gerrit.libreoffice.org/81981 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-19improve and enable loplugin:fragiledestructorNoel Grandin
Where the problem was benign and the class was not extended, I marked the class as final. Where the problem was benign and the class was extended, I marked the relevant callee methods as final. Other cases were excluded in the plugin. Change-Id: Idb762fb2206af4e8b534aa35ff77f8368c7909bc Reviewed-on: https://gerrit.libreoffice.org/79089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28use the xmlTextWriterPtr typedef consistentlyNoel Grandin
this is the single biggest chunk of stuff my upcoming paramtypedef loplugin will warn about, so do it separately Change-Id: I412e69e76406d6d947101885d4cd92c65e021508 Reviewed-on: https://gerrit.libreoffice.org/68486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-12make SwFormat a ::sw::BroadcastingModifyBjoern Michaelsen
- clean up SwSection..Hint: Lazily reusing the Dying HintId is evil - switch the SwChartDataSequence to SvtListener - add some description to RuntimeException Change-Id: I897a63030f207cabe4d1ba7de0c25c6c581ffd1f Reviewed-on: https://gerrit.libreoffice.org/65816 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-05-13dont use SwClient/SwModify in unocore: HeadFootTextBjoern Michaelsen
Change-Id: Icf0fa7ec07c8c52981c50bc03a34ae0fa9683fcf Reviewed-on: https://gerrit.libreoffice.org/54184 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-05-12dont use SwClient/SwModify in unocore: SectionBjoern Michaelsen
Change-Id: Ic594c5129664b309ce1b6ddd0c715a17df5a3265 Reviewed-on: https://gerrit.libreoffice.org/54091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-01-02loplugin:passstuffbyref improved return in swNoel Grandin
Change-Id: I4484ac461761e4c46364b4f473c7e62f8ec72103 Reviewed-on: https://gerrit.libreoffice.org/47243 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-21Make SwSection::GetSectionName() return a reference to the nameTor Lillqvist
Has a small but measureable impact on the time it takes to load a specific pathological (huge) customer document. The load time drops from 1min 46s to 1min 38s on my machine. Reviewed-on: https://gerrit.libreoffice.org/46847 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 9675f307fbd7961b3d00f810dad3eacc9920e07d) Change-Id: I93b603f369528187980d644a5364fa9bcf2f4615 Reviewed-on: https://gerrit.libreoffice.org/46904 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2017-10-23loplugin:includeform: swStephan Bergmann
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-02-13convert SectionSort to scoped enumNoel Grandin
and drop read-only SORTSECT_NAME enumerator Change-Id: Ibb192b0857161560a666e6ffdc2125bc6fc552c5
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26loplugin: unnecessary destructor swNoel Grandin
Change-Id: I27dcd289177bd6a63f07d75fb3cfd5c14fa2ee9d Reviewed-on: https://gerrit.libreoffice.org/33572 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08convert SFX_HINT to scoped enumNoel Grandin
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08Indentation fixesMiklos Vajna
Change-Id: I35de0c30a3f4f82bc923e467d5f0acf0ed90684f
2016-10-18tdf#89307: Removed T* SvRef::opeartor &()Jacek Fraczek
Usage has been replaced with SvRef::get() or removed where applicable. Change-Id: I49f108910b668466134c40940b53fc3ab2acd816 Reviewed-on: https://gerrit.libreoffice.org/29780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-23perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 relatedEike Rathke
There were over 150 places in *::Notify() functions that did some dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast operations come with quite some cost, so avoid if possible. Specifically for ScFormulaCell::Notify() that created a bottleneck in scenarios where cells were notified that already handled a previous notification. In mass operations doing the dynamic_cast before it could be decided whether having to act on it or not this made 2/3 of all time spent in the Notify() call. To get rid of that rename/move SfxSimpleHint to SfxHint and let classes derive from SfxHint instead of SfxSimpleHint. This comes only with a slight cost that an additional sal_uInt32 is transported in such hints, initialized to 0, but this is neglectable compared to the huge gain. For the rare cases where a Notify() actually expects both, an SfxHint (formerly SfxSimpleHint) and a derived hint, this changed order of the dynamic_cast involved so the simple SfxHint::GetId() is handled last. Modules using such combinations can further optimize by treating the simple SfxHint::GetId() first once verified that none of the other derived hints use an ID not equal to zero respectively none of the ID values the simple hint uses. Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce Reviewed-on: https://gerrit.libreoffice.org/29205 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-19loplugin:countusersofdefaultparams in swNoel Grandin
Change-Id: I668bfe93d77b06385544651583bcf71f6b5df2fc
2016-04-14loplugin:passstuffbyref in swNoel Grandin
Change-Id: I124bdd4f28c7d7508e77b902dfa23c398454bf38
2016-03-04loplugin:unuseddefaultparam in swNoel Grandin
Change-Id: I1a8a25c09ae0c8ba39fcedb032562df93fdd6ba4
2016-02-29loplugin:unuseddefaultparam in sw (part3)Noel Grandin
Change-Id: Ibff7ac9718929349ee7daa3febb0f8fe4a9fa4db
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-115th step to remove tools/rtti.hxxOliver Specht
tools/rtti.hxx removed completed the interface of some Sdr.* Items and removed pseudo items Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a Reviewed-on: https://gerrit.libreoffice.org/19837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-06com::sun::star->css in sw/incNoel Grandin
Change-Id: I6ffdb1deaa32156c65f997a1a1056928b7cd863d Reviewed-on: https://gerrit.libreoffice.org/19803 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-27inline SvBaseLinkRef typedefNoel Grandin
Change-Id: I0684db21c260e38d1d2e32eb5924cf7e25212b4d
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-06 tdf#94559: 4th step to remove rtti.hxxOliver Specht
replaced use of PTR_CAST, IS_TYPE, ISA in idl, editeng, sc, sd, sw, sfx2, sot, starmath Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653 Reviewed-on: https://gerrit.libreoffice.org/19132 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-07-21loplugin:unusedmethods swNoel Grandin
Change-Id: Ied51535fa169451fc4991237122817a34a59f6fe Reviewed-on: https://gerrit.libreoffice.org/17256 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-05-20bin/rename-sw-abbreviations.shlibreoffice-5-0-branch-pointChristian Lohmaier
renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-05loplugin:staticmethodsNoel Grandin
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-04-05Filled vector already provides nuber of itemsMatteo Casalin
But taking advantages of range-for loops is even better Change-Id: I79c6721ca63482c0ed40dad828ba736eeae92b6c
2015-03-24convert sfxlink to enum classNoel Grandin
Change-Id: I4466af8d40e7860b20a26c5ccf2265ee40c5a9ab
2015-02-16sw: clean up remaining format collection dumpersMiklos Vajna
Change-Id: I00833847c3c9410312205751a89d319a3143d516
2015-01-22Some more loplugin:cstylecast: swStephan Bergmann
note the two TODOs about suspicious casts Change-Id: I324fa05b30a5c8aa1d9e9a6d488a1e295226e788