summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/writerhelper.cxx
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14clang-tidy modernize-use-emplace in swNoel Grandin1-2/+2
Change-Id: I92fd035824f247dc61edfb18c54b960a7733fdf7 Reviewed-on: https://gerrit.libreoffice.org/42244 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13Fraction: make conversion operators and constructor explicitNoel Grandin1-2/+2
and simplify some of the calculations that needed to be changed. Which resulted in one unit test needing to change by one pixel, let's hope not an indication of a real problem. Change-Id: Ie56434f35f4e58d21ee6f671392e93dc7542fca3 Reviewed-on: https://gerrit.libreoffice.org/42240 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from integer constants in initialiser/call expressionsNoel Grandin1-2/+2
Change-Id: Iae081567c4fa5b88edbd12cf2fbafd2b8f31b300 Reviewed-on: https://gerrit.libreoffice.org/41214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin1-1/+1
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-07loplugin:constparams in sw part8Noel Grandin1-1/+1
Change-Id: I0fb51270da4b8f3049f1af2c2c788e516b3641e8 Reviewed-on: https://gerrit.libreoffice.org/40821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20sw: std::copy_if is now availableTakeshi Abe1-16/+1
Change-Id: I78c4832ba966609fd9e2fa70b1addf4b640692fb Reviewed-on: https://gerrit.libreoffice.org/40185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07C++11 remove std::binary_function bases from functorsJochen Nitschke1-3/+1
std::binary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::binary_function base class was used by deprecated std::bind2nd, this was solved in individual commits. The members first_argument_type and second_argument_type were used in chart2/source/controller/dialogs/DataBrowserModel.cxx: DataBrowserModel::implColumnLess and are inlined in this commit. Change-Id: I60ded60a8d4afd59e15ac15a58e18d2498c9be5a Reviewed-on: https://gerrit.libreoffice.org/39659 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03C++11 remove std::unary_function bases from functorsJochen Nitschke1-3/+2
std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-21ofz#2340 null deferences on close redlinesCaolán McNamara1-2/+2
Change-Id: I5e270f160f51b7ffa7059dfd17f31d8ec5919a3e
2017-05-09tdf#39468: Translate German comments in sw/source/filter/ww8/writerhelper.cxxJens Carl1-2/+1
Change-Id: I1a7bf4a97952674147029457e0a0ff12cd541cba Reviewed-on: https://gerrit.libreoffice.org/37420 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-24clang-tidy readability-simplify-boolean-expr in swNoel Grandin1-3/+1
Change-Id: Ib3ec37b8280c527fa712192db043b348c3427c50 Reviewed-on: https://gerrit.libreoffice.org/36877 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-1/+1
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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-16Clean up integers representing "redline authors"Stephan Bergmann1-1/+1
Unlinke in previous such clean-up commits, there appears to be no sufficiently exposed container type whose size_type could be used throughout, so resorting to the generic std::size_t in this case. Change-Id: I3cfbcbe5cce1bfcff2efbb4f8a509fe80ab12151
2017-02-06Add missing #includesStephan Bergmann1-0/+3
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-01-18new loplugin: useuniqueptr: sw part 2Noel Grandin1-4/+4
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>
2016-12-14sw: WW8 import: try to prevent overlapping field-marks and redlinesMichael Stahl1-0/+56
As one knows, the features of Writer's document model that most impress by their sheer quality of implementation are redlines and field marks. Unsurprisingly, if the two meet in the context of the WW8 import, epic disasters are imminent; ooo83574-1.doc is one such train wreck that asserts with: sw/source/core/crsr/bookmrk.cxx:111: void {anonymous}::lcl_RemoveFieldMarks(sw::mark::Fieldmark*, SwDoc*, sal_Unicode, sal_Unicode): Assertion `pStartTextNode->GetText()[rStart.nContent.GetIndex()] == aStartMark' failed. This happens when, at the end of the import, the redlines are hidden by moving them into their special SwNodes section. The reason why this one asserts is that a previous SwRedline erroneously deleted the start dummy char of this field mark, because that SwRedline had the wrong start/end positions. In Word the problematic paragraph is shown like this, where \a\b mark fields and I D F redlines: "Coming out of the work of Rummler and Brache’s \a(Rummler & Brache, 1995)(1995)\b work is the is the notion IIIIIIIIIIIIDDDDDDDDDDDDDDDDDDDDD IIIIIIIIIIIIIIIIIIIIIIIIDDDDDD DDDDDDDDDDDDIIIIIII another” \a(p. 9)\b\a(Rummler & Brache, 1995, p. 9)\b.. ( italics in the original)" IIIIII DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD IDDDIDDDDDDDDDDDDDDDDDDDDDDDD FFFFFFFFFFFFFFFFFFFFFFFFFF The first mis-positioned redline here ranges from 71 to 79, ")(1995)\b", so it deletes the end dummy char of the field mark. It should range from 72 to 78. This commit adds some rather crude hacks which appear to work to avoid the problem: 1. when a field mark is inserted, the start positions of the redlines may need to be moved 2. when the end position of a redline is set, it may need adjustment to exclude a field-mark that ends at the same position Change-Id: I723f1858c84def2c063e2cb126317d06e8ac98b5
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-11-23tdf#42949 Remove unnecessary headers from sw/source/filtersBartosz Kosiorek1-1/+0
Change-Id: I5f4d3fed6e8fd484ba5da835e2954f3c2042f33b Reviewed-on: https://gerrit.libreoffice.org/31087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-21convert inventorId to scoped enumNoel Grandin1-2/+2
SW_DRAWLAYER had the same value as SC_DRAWLAYER, so I merged it into the ScOrSwDraw enum constant Change-Id: I5c45d378c00364d11cc960c9e48a6e3f10928724 Reviewed-on: https://gerrit.libreoffice.org/31037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-12convert GET_POOLID constants to scoped enumNoel Grandin1-3/+2
Change-Id: Ifc54789d12d0b024ed28f13ec78b5c10afa902de
2016-10-05convert MapUnit to scoped enumNoel Grandin1-2/+2
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-08convert nsRedlineMode_t to typed_flagsNoel Grandin1-5/+5
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-17convert SvxBreak to scoped enumNoel Grandin1-1/+1
Change-Id: If8b79ed617e5662550bd73bd1506d047217f2313
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann1-1/+1
Change-Id: I5c33d8ed3551d9ad4432824995bfdc3f73cfc5f8
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon1-11/+11
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-10sw: rename sw::Frame in the WW8 filter to ww8::FrameMiklos Vajna1-22/+25
This way it's more clear that sw::FrameClient has nothing to do with sw::Frame, also later renaming SwFrm to SwFrame won't cause confusion about why do we have both sw::Frame and SwFrame. Change-Id: I87c4d199d418c77fdbb600fc388c8b9f026cb0fa
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-23/+23
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-06com::sun::star->css in sw/source/coreNoel Grandin1-2/+2
Change-Id: I30016977f1be8fb53dd239367d043de92a9467d9
2015-10-02Fix typosAndrea Gelmini1-1/+1
Change-Id: I724f2b709f7bd417b5a522e063c0a2f2b5c3dad1 Reviewed-on: https://gerrit.libreoffice.org/18987 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-08-17Put Polygon from tools under tools:: namespaceNorbert Thiebaud1-5/+5
Polygon is one of these names that Clash with some system objects A similar work has been done earlier with PolyPolygon. Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5 Reviewed-on: https://gerrit.libreoffice.org/17789 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-06-05sw: WW8 export: avoid invalidated positions in sw::FramesMichael Stahl1-1/+21
When exporting ooo67907-1.doc we get ~SwIndexReg assert because there's a frame anchored in a redline, and the SwPosition in the sw::Frame for it is invalidated during SetRedlineMode because the node it points to is deleted. Add another horrible workaround to the redline trainwreck. Change-Id: Ia9b2393c77f42502862daaa30fd54eb3b040a214
2015-05-26cppcheck: noExplicitConstructorCaolán McNamara1-2/+2
Change-Id: I955b04396d27e88ce228f180275955071da83ec6
2015-05-20bin/rename-sw-abbreviations.shlibreoffice-5-0-branch-pointChristian Lohmaier1-67/+67
renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-02-07loplugin:deletedspecialStephan Bergmann1-2/+1
Change-Id: Ia2b137e0167966a3d0b60f3c642a106834da8f1c
2014-11-07Make GetTwipSize() call SwapIn() by itself in case of invalid sizeZolnai Tamás1-20/+2
Change-Id: I5bc6cf097e61d65007dde531af4a213b19e8ca5b
2014-11-07MS export: don't need to manually swapout images after swapin themZolnai Tamás1-3/+0
We have some good auto mechanisms for that. Change-Id: I487dbf4a5fc69c7563dfbc5c21f9ebdb05ba6b9e
2014-10-23Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"Jan Holesovsky1-9/+9
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba. Conflicts: cui/source/tabpages/transfrm.cxx svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx tools/source/generic/rational.cxx Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
2014-10-23Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"Jan Holesovsky1-6/+6
This reverts commit 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e. Conflicts: svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
2014-10-16fdo#84854 it seems long is not enough on 32 bitDavid Tardon1-6/+6
Fraction used BigInt internally for computations, rational does nothing like that. Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-09fdo#81356: convert Fraction to boost::rational<long> - wipJuan Picca1-9/+9
* Added rational util functions used by Fraction class not available in the boost::rational class. * Replaced usage of Fraction by boost::rational<long> * Removed code that relies on: 1. fraction.IsValid() -- rational only allow valid values, ie denominator() != 0 2. rational.denominator() == 0 -- always false 3. rational.denominator() < 0 -- always false but implementation detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation * Simplified code that relies on: 1. rational.denominator() != 0 -- always true * BUGS EXIST because Fraction allows the creation of invalid values but boost::rational throws the exception boost::bad_rational Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9 Reviewed-on: https://gerrit.libreoffice.org/11551 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-09-30fdo#82577: Handle PolyPolygonNoel Grandin1-2/+2
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows PolyPolygon typedef. Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-12Turn SfxItemState into a C++11 scoped enumerationStephan Bergmann1-1/+1
...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-08-12Refactored IDocumentStylePoolAccess out of SwDoc.Valentin Kettner1-2/+3
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-12Refactored IDocumentLayoutAccess out of SwDoc.Valentin Kettner1-1/+2
Into the new class DocumentLayoutManager. Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12Refactored IDocumentRedlineAccess out of SwDoc.Valentin Kettner1-4/+4
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-12DOC export: factor out wrap polygon handling to to sw::utilMiklos Vajna1-0/+30
So that it'll be possible to reuse it in the DOCX exporter. Change-Id: Ib7371c92c4fd93d7c6f3271ca81311bac8f1a1a7
2014-08-12-Werror,-Wundefined-bool-conversionStephan Bergmann1-2/+2
Change-Id: Iff8db4c82abeeed0789d7012223a846f1058c353
2014-06-09loplugin: inlinesimplememberfunctionsNoel Grandin1-4/+0
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-03Split out IDocumentDrawModelAccess from SwDoc.Valentin Kettner1-3/+4
To the new class DocumentDrawModelManager. All moved methods and members have the same in thew new class. Change-Id: I89ad0e0c4a42885d5810e834983ea8e8e6c0a2d2