summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2017-06-17create o3tl::array_viewNoel Grandin
A very basic implementation of the proposed std::array_view, similar to clang's llvm::ArrayRef. Mostly cribbed from the string_view implementation :-) Use it for the SfxDispatcher::setSlotFilter function Change-Id: Ife7e4971741b41827e145787899872c9b2bea82b Reviewed-on: https://gerrit.libreoffice.org/38817 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17TransferableObjectDescriptor::mnOle2Misc field is unusedNoel Grandin
which means that SfxObjectShell::GetMiscStatus becomes unused Change-Id: I5c89a2cd5c77c7f08a57fdac08237aab514fc7fa Reviewed-on: https://gerrit.libreoffice.org/38843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann
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-16tdf#85161 implement ooxml SYMBOL field instructionMark Hung
Only font name switch (f) is implemented. Change-Id: I09df8230dff3cf0619065da69bfaf3caad0a39ae Reviewed-on: https://gerrit.libreoffice.org/38654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-06-16Profiling API: add ProfileZonesLászló Németh
Change-Id: Ie5669bd75d9b4be047d98402cb69ac313ab618df Reviewed-on: https://gerrit.libreoffice.org/38787 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-16tdf#108524 sw: allow move of frame inside section without columnsMiklos Vajna
The intention here is to deny the move of a frame that's inside a table inside a section. But the code also checked if there a column frame in-between, so it allowed the move for a frame in a section with 2 cols, but not without columns (which does not sound intentional, since that's a simpler case). So drop the requirement to have a column frame between the argument and the section frame, just check that there is no table frame in between. This is needed, but not enough to split the section in the bugdoc (but at least now the content of the section is marked as movable). Change-Id: I9155b291a19c692efc30f01f8e206fac5f1ccf81 Reviewed-on: https://gerrit.libreoffice.org/38858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-16tdf#108486 Only apply hyperlink settings if something did changeSamuel Mehrbrodt
Change-Id: Idc601e9ca4ac3ea429d3b514ad6af4198954ca33 Reviewed-on: https://gerrit.libreoffice.org/38859 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-06-16CPPUNIT_ASSERT_EQUAL type-mismatchStephan Bergmann
Change-Id: Icd115383970d351ed8b224bbbd18e98ae0cc8f0d
2017-06-16sw RTF filter: more cleanup of redundant virtual keywordsMiklos Vajna
Change-Id: Ia2596e11f303edf5e1b81ab90062fd93df42159b Reviewed-on: https://gerrit.libreoffice.org/38847 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-15tdf#103091 sw: add unit test for conditional style import/exportMichael Stahl
Change-Id: I0af54a66679e66d7d2d05aba5dd341a9126ce631
2017-06-15tdf#108524 sw: try to split rows that contain 1-col sectionsMiklos Vajna
We used to not even attempt to split a row that contains sections. Relax this condition and try to split the row in case the table itself is not in a section (to avoid recursion) and the section has no columns. This is needed, but not enough to split the section in the bugdoc. Change-Id: I6ad0d6eb18611f108ae29e4feea7101ffe552c48 Reviewed-on: https://gerrit.libreoffice.org/38824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-15Fix typosAndrea Gelmini
Change-Id: Iea1f82e95c37bdf778941a568d61f17f179f838d Reviewed-on: https://gerrit.libreoffice.org/38795 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-06-15This SfxItemSet appears to be unusedStephan Bergmann
...at least ever since 7b0b5cdfeed656b279bc32cd929630d5fc25878b "initial import" Change-Id: I16b02bd3bfd687b0e451840cd53d93866e9c0f0e Reviewed-on: https://gerrit.libreoffice.org/38816 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-15This SfxItemSet appears to be unusedStephan Bergmann
...at least ever since 7b0b5cdfeed656b279bc32cd929630d5fc25878b "initial import" Change-Id: I66f937ec5d465340a49fa63174b941d7bbf2f439 Reviewed-on: https://gerrit.libreoffice.org/38826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-15ofz: fix another leakCaolán McNamara
Change-Id: I488ee070ab781011e357db6858188d2b706cb348
2017-06-15ofz: fix a leakCaolán McNamara
Change-Id: Ifd730a0f162ab5032665926d66debe716b0579df
2017-06-15tdf#39468 Translate German comments/terms in sw/source/filter/ww8/ww8par5.cxxJens Carl
Change-Id: I544aaadb6809204a0ab8864367fc9f267a5327c6 Reviewed-on: https://gerrit.libreoffice.org/38812 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-06-15tdf#39468 Translate German comments/terms in sw/source/filter/html/swhtml.cxxJens Carl
Tenth set of translations. Change-Id: I0192796240b1f6080941e0a8c33b4767c8c502d8 Reviewed-on: https://gerrit.libreoffice.org/38815 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-06-15Related: tdf#108524 sw: dump follow/precede of cell frames in layout xml dumpMiklos Vajna
These point to the other cell frame on the previous/next page (in case the cell frame is split across multiple pages). Change-Id: Ic03cf9a194a49320d84dbdb5176fa737e5d6520d Reviewed-on: https://gerrit.libreoffice.org/38818 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-15Watermark: RTF font import and exportSzymon Kłos
* font size * font family * rotation * TextPath geometry - working transparency & color * revert TextBox export removed by mistake Change-Id: I3f6df86809ae57dc40c275652a96b19d2a3d7eba Reviewed-on: https://gerrit.libreoffice.org/38494 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-15cid#1412761,1412762: Avoid signed intermediary resultsStephan Bergmann
Change-Id: If7432eecc4bc3fa40754aa6d378b3175073aea1e
2017-06-15Use unique_ptr for SwFormatClipboard membersStephan Bergmann
Change-Id: I2d37be7c86481040c64de87f188320cdc3258659
2017-06-15use std::unique_ptr in FlatFndBoxNoel Grandin
and extend o3tl::make_unique to cope with arrays Change-Id: I84caa46ab5060f9777bfe275f229499cb0b407be Reviewed-on: https://gerrit.libreoffice.org/38794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14Use unique_ptr for HTMLAttrContext::pFrameItemSetStephan Bergmann
Change-Id: I90d0461be7b9df1200bc3eef6ae1d6dbb20f7c5b
2017-06-14Use unique_ptr for SwASCIIParser::pItemSetStephan Bergmann
Change-Id: Ib4eb12d9615308568e316cfb96250f1d72d70a06
2017-06-14Use unique_ptr for SwXTextPortion::GetPropertyValue paramStephan Bergmann
Change-Id: Ib20981fa47220d3122807a1f567d9f2fb54f5e76
2017-06-14Use unique_ptr for UnodTableCpyTable_Entry membersStephan Bergmann
Change-Id: I925523d3c3fde2d82aa2509aef2c62c8e9686f40
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14Use unique_ptr for SwRedlineItr::pSetStephan Bergmann
Change-Id: I6dc4cbfeb7413b4ce2ef7a588f4337f75eefd5af
2017-06-14use more SAL_N_ELEMENTS part 1Noel Grandin
- teach comphelper::containerToSequence to handle sized arrays - also use range based for-loop where appropriate. Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99 Reviewed-on: https://gerrit.libreoffice.org/38769 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14tdf#43157 Clean up OSL_ASSERT, DBG_ASSERT, etc.Thomas Beck
Cleaned out the rest of OSL_ASSERT in docxattributeoutput, keeping consistency with the rest of the function where they were found. Change-Id: I87c637d11a184cb002168c5d1151a0f3112f69c1 Reviewed-on: https://gerrit.libreoffice.org/38774 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-06-14tdf#39468 Translate German comments/terms in sw/source/filter/html/swhtml.cxxJens Carl
Ninth set of translations. Change-Id: I8c92692529872cfbca4adcfde950b1738e3834a7 Reviewed-on: https://gerrit.libreoffice.org/38623 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-14Use vector<unique_ptr> for FlatFndBox::ppItemSetsStephan Bergmann
(ppItemSets' members were apparently leaked in the past) Change-Id: I6687646cef7a6fa1e38f220944fa69ed18bdd12a
2017-06-14tdf#104640, tdf#108469: Insert image where the cursor isXisco Fauli
Partially revert 72a4987434368bfb0b15f5ebb70a52 Besides, add bDelta to the condition so the statement is false if the image is resized Change-Id: Ib07d328e040c38c63a30f6230ed9f6b605d76d9f Reviewed-on: https://gerrit.libreoffice.org/38705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2017-06-14tdf#97362: TextPortionEnumerationTest partially migrated to python ↵jmzambon
(test_portion_enumeration_test.py) Add footnote tests: - test_refmark_point - test_refmark - test_toxmark_point - test_toxmark - test_hyperlink - test_hyperlink_empty - test_ruby - test_ruby_empty Change-Id: I0920517b5e8806a5fc46708822fed33006f03fd5 Reviewed-on: https://gerrit.libreoffice.org/38418 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-14Let CreateItemSet return unique_ptrStephan Bergmann
...and address resulting loplugin:useuniqueptr Change-Id: Ia79eb8d59ce5092b2d93b656eab687096baedf17
2017-06-14tdf#39468 translate german comments in swBernhard Widl
Change-Id: I22114e9c8adaad67f71811f2b44fdd8a6d6e7f7b Reviewed-on: https://gerrit.libreoffice.org/38767 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-06-13tdf#108494 incorrect Watermark positionSzymon Kłos
Change-Id: Iec1dba66604af008ad8b6b1c20cd508048144463 Reviewed-on: https://gerrit.libreoffice.org/38722 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2017-06-13tdf#103091 conditional style conditions not savedTroy Rollo
Change-Id: Iccf3eb531ee3382d27105e5ccce6013707a646b6 Reviewed-on: https://gerrit.libreoffice.org/38451 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-13Use unique_ptr for SfxPrinter::pOptionsStephan Bergmann
Change-Id: I46be77225c0323f8b7f293de9c022f0de6f425b7
2017-06-13tdf#95489 use internal name for quotation character styleYousuf Philips
Change-Id: I48ecac1d75cbf30cc73cdcb5a3be0d91b295694f Reviewed-on: https://gerrit.libreoffice.org/38655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
2017-06-13tdf#85940 Add basic character styles to context menuYousuf Philips
Change-Id: Id25768dfd2c8db530a31ddf8a31108f9b5c67855 Reviewed-on: https://gerrit.libreoffice.org/38652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
2017-06-13tdf#107618 DOCX export: fix missing header when doc ends with sectionMiklos Vajna
See commit b6e62dc0dc2b284c825f1182a67bb2f9259a30ce (tdf#106492 DOCX export: fix duplicated section break at doc end, 2017-03-21) for the context, this is one more case where it's not OK to suppress the two section breaks at the end of a document, since the suppressed section break is the one that provides the headers / footers. Change-Id: I4abd7895436e4d2e08fd7b7ff4aabbac8d65f7fb Reviewed-on: https://gerrit.libreoffice.org/38721 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-13Watermark: fix rotation calculationSzymon Kłos
* when angle > 180 was used calculated value was 0 * values are rounded Change-Id: I0cade407883a60d8d802b487668882e95f42ddce Reviewed-on: https://gerrit.libreoffice.org/38597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-12Fix typosAndrea Gelmini
Change-Id: Ib2ba32d48d3df16b0b20deea84416fe15a2d7176 Reviewed-on: https://gerrit.libreoffice.org/38650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-12cleanup unused css/frame/* includesJochen Nitschke
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12tdf#103311 Conditionally disable Next button on MM Wizard page 4Gabor Kelemen
The user has to set up either an address block on page 3 or a greeting on page 4 to be able to progress to page 5. The 5th page is already disabled if these are not enabled but the Next button on page 4 is always enabled. Now the Next button gets enabled/disabled if the 5th page is enabled/disabled by UpdateRoadmap(). Change-Id: If216d935ebebb3fc6a4e1488ec2dfc716db41c3e Reviewed-on: https://gerrit.libreoffice.org/38610 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-12tdf#108055 RTF: Header and Footer are added multiple times.Thomas Beck
Made it so Header/Footer of a certain section can only be added once. This change should only affect RTF-Files. Added Unittest Change-Id: I55025984e343d04da7fc0f201164ef39e3a26202 Reviewed-on: https://gerrit.libreoffice.org/37814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-12sw: prefix members of SwNotePropsMiklos Vajna
Change-Id: If1d50504d9d7efcb0f6b1b5ddf570d3016f40be5 Reviewed-on: https://gerrit.libreoffice.org/38686 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-12sw: GCC still complains about "multi-line comment" [-Werror=comment]Michael Stahl
Apparently a trailing space after the "\" does not prevent the warning? Let's work around harder... Change-Id: I05239697b26cd53df719ed520826db60a7805417