summaryrefslogtreecommitdiff
path: root/sw/source/core/undo/untbl.cxx
AgeCommit message (Collapse)AuthorFilesLines
2017-07-23coverity#1415615 avoid Dereference null return value warningCaolán McNamara1-4/+4
Change-Id: I248dcafbb2cfdd7a8dd9270ef56bcccc1b9b0ee5
2017-07-21migrate to boost::gettextCaolán McNamara1-1/+1
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-06-26fdo#43157 convert OSL_ASSERT to assert in sw/source/coreBernhard Widl1-1/+1
Change-Id: I6ffd9832ff1085c84fde8763045f3d1cb02137e2 Reviewed-on: https://gerrit.libreoffice.org/38974 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-19Make SfxItemSet ranges correct by construction: Fix static casesStephan Bergmann1-13/+25
...with the aid of an extended compilerplugins/clang/store/sfxitemsetrewrite.cxx (which in turn needed a small addition to compilerplugins/clang/check.hxx). Enable svl::detail::validGap check for the static case, but keep it disabled for now for the dynamic case. Change-Id: I4846ba8e99aff94a86518e2cb5044e575093386e
2017-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann1-12/+12
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT) that each individual range has an upper bound not smaller than its lower bound. Arguably, all SfxItemSet instances should fulfill the stronger guarantees required and checked by MergeRange. And in many cases the ranges are statically known, so that the checking can happen at compile time. Therefore, replace the two SfxItemSet ctors taking explicit ranges with two other ctors that actually do proper checking. The (templated) overload taking an svl::Items struct should be used in all cases where the range values are statically known at compile time, while the overload taking a std::initializer_list<Pair> is for the remaining cases (that can only do runtime checking via assert). Most of those latter cases are simple cases with a single range covering a single item, but a few are more complex. (At least some of the uses of the existing SfxItemSet overload taking a const sal_uInt16* pWhichPairTable can probably also be strengthened, but that is left for another day.) This commit is the first in a series of two. Apart from the manual changes to compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and svl/source/items/itemset.cxx, it only consists of automatic rewriting of the relevant SfxItemSet ctor calls (plus a few required manual fixes, see next). But it does not yet check that the individual ranges are properly sorted (see the TODO in svl::detail::validGap). That check will be enabled, and the ensuing manual fixes will be made in a follow-up commit, to reduce the likelyhood of accidents. There were three cases of necessary manual intervention: * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in braced-init-list syntax now, so needs explicit narrowing conversion to sal_uInt16. * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually. * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx, sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx, sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx, some comments had to be put back (see "TODO: the replaced range can contain relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx). A few uses of the variadic form erroneously used nullptr instead of 0 for termination. But this should have been harmless even if promoted std::nullptr_t is larger than promoted sal_uInt16, assuming that the part of the nullptr value that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly, some uses made the harmless error of using 0L instead of 0. Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35 Reviewed-on: https://gerrit.libreoffice.org/38861 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-14Use unique_ptr for UnodTableCpyTable_Entry membersStephan Bergmann1-38/+26
Change-Id: I925523d3c3fde2d82aa2509aef2c62c8e9686f40
2017-06-05Improved loplugin:cstylecast to reference types: swStephan Bergmann1-2/+2
Change-Id: I7206d3325b4bfedb852d559b68dc1678da524b41
2017-05-19make string translation loading more uniformCaolán McNamara1-2/+2
change various ResId classes that use conversion operator to OUString to functions that return a OUString drop various defines drop unnecessary toString calls Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92 Reviewed-on: https://gerrit.libreoffice.org/37817 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-07revert OSL_ASSERT changesChris Sherlock1-1/+1
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert sw module away from OSL_ASSERT to assertChris Sherlock1-1/+1
Change-Id: I2018d669e4886040882c90012ad2b2c9f8a07331
2017-04-21remove some old MSVC workaroundsNoel Grandin1-8/+0
Change-Id: I6abd8aaffb27b3c85df7c0518f7f576be4e32222 Reviewed-on: https://gerrit.libreoffice.org/36660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-13convert TableChgWidthHeightType to o3tl::typed_flagsNoel Grandin1-14/+15
Change-Id: I9009f3302f4d117744d80f8816ddd177bae6639d Reviewed-on: https://gerrit.libreoffice.org/36460 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-20convert RndStdIds to scoped enumNoel Grandin1-2/+2
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0 Reviewed-on: https://gerrit.libreoffice.org/35328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-16convert SwUndoId to scoped enumNoel Grandin1-23/+23
Change-Id: I782fdd53641c0d7c629265b6179de70aa54382f9 Reviewed-on: https://gerrit.libreoffice.org/35246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-13convert SplitTable_HeadlineOption to scoped enumNoel Grandin1-8/+10
Change-Id: I5a9ea036b8827a84e646488b2b57012ebadd4d0a
2017-01-26loplugin: unnecessary destructor swNoel Grandin1-5/+0
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>
2017-01-18new loplugin: useuniqueptr: sw part 2Noel Grandin1-25/+15
Change-Id: Ifa901f75072d8474d8a97ca57c2b5b48d8c6b79d Reviewed-on: https://gerrit.libreoffice.org/33250 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09New loplugin:externvar: swStephan Bergmann1-2/+2
Change-Id: If850989ee513d29ed373df0c6dd9905ec694026c
2016-11-29convert ND constants to o3tl::typed_flagsNoel Grandin1-2/+2
Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3 Reviewed-on: https://gerrit.libreoffice.org/31343 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19coverity#1371270 Missing move assignment operatorCaolán McNamara1-1/+1
Change-Id: I9a5656fa3a4d4283a1daec957da9d909390d9eb2
2016-09-30tdf#75757 Remove inheritance from std containerTakeshi Abe1-8/+0
Change-Id: I476c83ea195281f977bb6fa5019f983609ff3a6e Reviewed-on: https://gerrit.libreoffice.org/29347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-09-08convert nsRedlineMode_t to typed_flagsNoel Grandin1-35/+34
including fixing a bug in SwXMLExport::exportDoc where it was ORing with a constant from a different type: nsRedlineType_t::REDLINE_INSERT Change-Id: I2bb154c9a35d106e64fd1a8b6e928d0384c9fafe
2016-08-29Get rid of pointless indirect function pointer variablesTor Lillqvist1-5/+5
Change-Id: Ic8eddec51d59b531ae22421b796a148267b9f3c1
2016-08-29Convert SwFrameFormats to boost::multi_indexJan-Marek Glogowski1-1/+1
This is almost the same situation as SwPageDescs. What makes this more complicated is the fact, that actually duplicated draw objects are allowed, in regard to the key values "type" and "name". And actually for some types, duplicate names are not allowed, e.g. SwDoc::FindFlyByName( const OUString& rName, sal_Int8 nNdTyp ) expects a single result! Change-Id: I6e0ea1099c1c1e6cfe90926170e27179722e88b8
2016-08-18cppcheck: noCopyConstructorCaolán McNamara1-0/+11
Change-Id: Id5323cb6f52666f85965e11b07e4f2bca8af4e78
2016-08-16GSoC Writer Table Styles; Update by exampleJakub Trzebiatowski1-0/+26
+ Added possibility to update style by example. + Fixed SwTableAutoFormat::GetBoxFormat Change-Id: I80d9334ceda0ef7e0984fb54731850034b44cd44 Reviewed-on: https://gerrit.libreoffice.org/28063 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-08-10GSoC Writer Table Styles; Create by example; fix undoJakub Trzebiatowski1-0/+63
- Create style by example, tracked by undo; - Fixed delete style, now is tracked by undo Change-Id: Ic39b549b0b970b1b15001d527a82fb26e4a630aa Reviewed-on: https://gerrit.libreoffice.org/27990 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-29sw undo: implement SfxUndoAction::GetViewShellId() interfaceMiklos Vajna1-16/+16
With this, it's possible to tell which view shell created which undo actions. It's visible only in the doc model xml dump only, though. Change-Id: Ia76d218a1d8b578aaad00ab733c772b10dda39f0 Reviewed-on: https://gerrit.libreoffice.org/27693 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-30tdf#98226: fix undo of table AutoFormatMichael Stahl1-3/+10
The new call to SwTable::SetTableStyleName() was not recorded in SwUndoTableAutoFormat and hence persisted even after Undo. (regression from 73f4a06c0bce51c7c8b9ae9adfdc7ffac27d06b4) Change-Id: Ia7f769dafa62f02ff8e4b0596b48266190c7a69b
2016-05-12clang-tidy modernize-loop-convert in swNoel Grandin1-3/+3
Change-Id: I1f4a0ad6658bd3154c48940296aa8edc1ea1612c Reviewed-on: https://gerrit.libreoffice.org/24876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann1-2/+2
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-04-22Avoid reserved identifiersStephan Bergmann1-90/+90
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-12Avoid reserved identifierStephan Bergmann1-10/+10
Change-Id: I5f512c2519fa4305527a80ee34ea51a620dcdc2c
2016-02-29loplugin:unuseddefaultparam in sw (part2)Noel Grandin1-3/+1
Change-Id: I7eefd83d7f84c0a6301fd3ba37d77463d809e5f9
2016-02-22loplugin:commaoperator in sw/Noel Grandin1-9/+26
Change-Id: I9b00755707687e4c10c02bf49866571f2c44d8ba
2016-01-13tdf#96067: fix crash in undo of table row insertionOliver Specht1-1/+1
create SwIterator with SwLayoutFrame instead of SwTabFrame the wrong usage worked with tools/rtti because of incomplete type information above of SwLayoutFrame Change-Id: I9967fa1b534fc28dc5e0cd1fa5b64179faa9b94d Reviewed-on: https://gerrit.libreoffice.org/21394 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2016-01-05tdf#94205: Use o3tl::make_unique insted of new+std::move.Sheikha AL-Hinai1-4/+3
Change-Id: I9ff14760479d2ac882546e2e5b74ab750ba2fa4b Reviewed-on: https://gerrit.libreoffice.org/20984 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon1-35/+35
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-69/+69
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-10-30sw: prefix members of SwNodeMiklos Vajna1-3/+3
Change-Id: I3ce33c8ea0c09948785621785d199ece6eda128a
2015-10-27sw: prefix members of SwTableFormulaUpdateMiklos Vajna1-7/+7
Change-Id: Id9e18c67a4fa6e3646ac33cd616838819d1f10d8
2015-10-19loplugin:defaultparamsStephan Bergmann1-1/+1
Change-Id: Ib5b0e87064b6dcff03f6b77287a80ee2a03b8799
2015-10-12sw: replace boost::ptr_vector with std::vector<std::unique_ptr>Michael Stahl1-14/+14
Change-Id: I72ec77d4226c98abbe849a03dc009f46f695923b
2015-10-12sw: replace boost::ptr_vector with std::vector<std::unique_ptr>Michael Stahl1-10/+9
Change-Id: I35063a241937137c4ebf4393dd880fa7cb7c8546
2015-10-12sw: replace boost::ptr_vector with std::vector<std::unique_ptr>Michael Stahl1-8/+9
Change-Id: Ib0a0d596ce262783b8850d4d9c0142391cc59284
2015-10-12sw: replace boost::ptr_vector with std::vector<std::unique_ptr>Michael Stahl1-12/+13
Change-Id: I7fc78b64a12212f4c9bd280b0ebf2a55235461d3
2015-10-06 tdf#94559: 4th step to remove rtti.hxxOliver Specht1-3/+3
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-10-01sw: replace boost::ptr_vector with std::vector<std::unique_ptr>Michael Stahl1-0/+3
Change-Id: I821a853a0e4776d2b5ba2ca69d421ec0af8e865e
2015-08-20loplugin: defaultparamsNoel Grandin1-8/+8
Change-Id: I4c6b966a54e18cdbb0c64b6e93804a306b5d2638
2015-07-14sw: _SaveTable::CreateNew() fix invalid cast ...Michael Stahl1-2/+3
... of SwTableFormat to SwTableBoxFormat for the temporary SwTableBox. Change-Id: I74118b1b028bd71561f9afe6acd1cc95991a3761