summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2018-06-05tdf#117843 DOCX import: disable compat increased spacing in header/footerMiklos Vajna1-1/+3
It's only relevant for the body text. (cherry picked from commit 09a37fe50f36ced755bc326fb6b4c1b6fdf61f86) Change-Id: Id894604ed9b2c19400eeabbd2966f104d8b34aab Reviewed-on: https://gerrit.libreoffice.org/55335 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-29tdf#117503 DOCX import: fix out of sync first/later top marginMiklos Vajna1-1/+26
Improve the synchronization between the first page and follow page style, so that when the DOC export invokes sw::util::IsPlausableSingleWordSection(), it recognizes that originally these were the same Word section. If they don't match up, then the exporter will insert an explicit section break, meaning we get one more page in the export result compared to the original. (cherry picked from commit b7ae863efeb082816cc4fe660527a9650d90e186) Change-Id: I336cf347698187cdede47be2659cec51e4381e85 Reviewed-on: https://gerrit.libreoffice.org/54988 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-24revert tdf#76817 ooxmlimport: connect Heading to existing numbersJustin Luth4-6/+1
tdf#50774 has an example document which was broken by 6.1 commit 8e9e705de29a1a3d9b964c9350aa2a3a17cce6f9. Reverting does a couple of things: -go back to previous behaviour (right or wrong) - no regression. -gives an opportunity to find documents broken by reverting - i.e. it will give an indication as to which state has more broken docs. Can be re-visited in 6.2. -gives me an option to escape from this horrible mess without causing a regression in a production release of LO. Change-Id: Ib594b76d5533a0c4807cf70ef706c107e52cddcf Reviewed-on: https://gerrit.libreoffice.org/54293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-05-20tdf#117502 fix graphical bullets for OOXML and RTFTomaž Vajngerl3-18/+19
This change has multiple parts: - Move "BulletAsImage" test from ODT only to globalfilter and run it on ODT, DOC, DOCX, RTF formats and extend checks of the XGraphic used for the bullets and the size. - Check if GIF is animated as we need to know this in unloaded graphic or bullets aren't rendered correctly if we assume they are animated. - Use "Graphic" property in writerfilter to get the graphic from a XShape and not the "Bitmap" property which returns a Graphic as a MetaFile and not the original Graphic. - Make sure "GraphicBitmap" is filled with XBitmap and not with XGraphic. - Change "testFDO74215" to use the expected bullet size as it is in the original document. Looks like the initial bug was just asserting the bullet size is set to a value (non-zero). Change-Id: I6b151c0bf9f426669e07522f0fc699fbb652046b Reviewed-on: https://gerrit.libreoffice.org/54477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-18Fix some IWYU warningsMiklos Vajna3-2/+32
Change-Id: I11d874caad9174fb1a70121f1772e117753ee519 Reviewed-on: https://gerrit.libreoffice.org/54503 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-17New o3tl::temporary to simplify calls of std::modfStephan Bergmann1-3/+2
...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-17loplugin:redundantcast improvements for floating-integer conversionsStephan Bergmann1-1/+3
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016 Reviewed-on: https://gerrit.libreoffice.org/54416 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-16tdf#117504 ooxmlimport: check paragraph props for actual styleJustin Luth2-2/+13
m_sCurrentParaStyleName sounds like a nice idea, and has been around since the initial fork, but by the time finishParagraph() rolls around, the chances that it is still accurate are rather low. Anything that contains a paragraph (like comments, textboxes, shapes, tables, flys etc) might have modified that value. This fix queries the current paragraph itself to see if PROP_PARA_STYLE_NAME is set, which it typically is by lcl_startParagraphGroup() except when IsInShape(). If it isn't specified, then fallback to the previous result, which still may not be accurate, but at least it won't be a regression. It is too late in the development cycle to look into fully eliminating m_sCurrentParaStyleName. I hope to investigate that in the 6.2 development cycle. Change-Id: I124688d864f553dd5778b3593f511cc41d31c262 Reviewed-on: https://gerrit.libreoffice.org/54085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-14writerfilter NFC: save ConvertedParaStyleName, not WW8NameJustin Luth3-11/+10
and rename m_sCurrentParaStyleId -> m_sCurrentParaStyleName This is prep work for tdf#117504, where the value saved in m_sCurrentParaStyleId is not accurate. Since the actual value saved inside the paragraph properties is the ConvertStyleName(), lets use the LO-version of the style name, so that FindStyleSheetByConvertedStyleName() can be used for either the paragraph's PropertyValue or m_pImpl->m_sCurrentParaStyleName. Change-Id: I8aed80094417ea91f2515e666dc05ecbb021a128 Reviewed-on: https://gerrit.libreoffice.org/54084 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-10tdf#79315 Fix wp:effectExtent issue when exporting inline picture to DOCX.Victor Mireyev1-0/+7
Change-Id: I250bb365593c6a06f1d99f28b36e8bde183b16e6 Reviewed-on: https://gerrit.libreoffice.org/53679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-10writerfilter, writerperfect: various small cleanupsMiklos Vajna2-3/+3
Change-Id: Iea26b73bd91ed178cc4f2279c23246d79f48a6be Reviewed-on: https://gerrit.libreoffice.org/54063 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-05-09Fix some IWYU warningsMiklos Vajna3-6/+38
Change-Id: Iab61e0a7cac2dc89e6b04875a62894b181aa0ff4 Reviewed-on: https://gerrit.libreoffice.org/54016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-09tdf#117137: DOCX import: don't try to set grab-bag as UNO propJustin Luth1-1/+1
This modifies commit a6f2199e9888cb75960f1d35034bd44fb45e5565 "DOCX import: don't try to set grab-gag props as UNO props" Perhaps that commit should simply be reverted, but I will trust that the commit was mostly OK and simply adjust the logic so that *InteropGrabBag is ignored as before. Doing this resolves MSO being unable to open a specific document and LO missing some numbering during LO round-tripping. Probably these are just side-effects from other locations in the code that couldn't deal with these unexpected properties. For example, the numbering.xml file is malformed, since it is missing the w14: namespace. Unfortunately, I failed in my attempt to create a minimal test document. Change-Id: Idf88cd09d96546b7f03d326afb5f6e58439bcf20 Reviewed-on: https://gerrit.libreoffice.org/53271 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-05-08tdf#117403 RTF import: fix lost cell border of merged cellMiklos Vajna1-4/+31
If two source cells have different border types, then Writer takes the second, Word takes the first. So mimic the MSO behavior explicitly in dmapper. Change-Id: I25adc62e024a929216c7b05fec44e1f602f28285 Reviewed-on: https://gerrit.libreoffice.org/53956 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-05-07[API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphicTomaž Vajngerl1-1/+10
*BackGraphicURL include the following properties: - BackGraphicURL - FooterBackGraphicURL - HeaderBackGraphicURL - ParaBackGraphicURL This were removed, but for backwards compatibility this commit adds them back again and depreactes them in the UNO API. The behaviour also changes as internal vnd.sun.star.GraphicObject scheme URLs aren't supported so this properties can only be set and only if a external URL is provided. If getting such a property then a RuntimeException will be thrown. [ Miklos Vajna: fixed up sw/qa and writerfilter bits. ] Change-Id: If60011837da96197b576bfe2671ecafccad736c7 Reviewed-on: https://gerrit.libreoffice.org/53511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-04tdf#117171 DOCX export/import of cardinalText, ordinalTextLászló Németh1-4/+7
and ordinal (indicator) numbering styles. Change-Id: Ia4030c8a170bad67e0b52ec685a49faa77552ccf Reviewed-on: https://gerrit.libreoffice.org/53831 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-05-03tdf#117268: treat erroneous \itap0 the same way as Word doesMike Kaganski1-0/+7
... so that if we are inside a table, it would not convert table paragraphs into top-level paragraphs. (The in-the-wild documents with this invalid input are, e.g., generated by Consultant+ legal reference database). Change-Id: I45eb9073a0651bc963badb84229ce5ae437f1a8c Reviewed-on: https://gerrit.libreoffice.org/53790 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-03tdf#116801 DOCX import: char styles have no IsAutoUpdate propertyMiklos Vajna1-2/+2
See sw/source/core/unocore/unomapproperties.hxx:447, UNO_NAME_IS_AUTO_UPDATE is part of the COMMON_PARA_STYLE_PROPERTIES define. So it's not "list styles don't have this", but "only paragraph styles have this". Change-Id: I1c256b087cdc2e7e341f55d717ef8e678fc69fb4 Reviewed-on: https://gerrit.libreoffice.org/53766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-28loplugin:countusersofdefaultparamsNoel Grandin1-1/+1
Change-Id: I84868b3115c534a8240394283cc3beedf8cb3a80 Reviewed-on: https://gerrit.libreoffice.org/53543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-26tdf#117246 RTF import: don't loose page breaks inside nested groupsMiklos Vajna1-0/+9
Regression from e3f254ab8211fbab7541cde2100a35c875b0c240 (RTF import: fix spurious page breaks at doc end (related: rhbz#1065629), 2014-02-27), the problem was that now we update the parser state to remember the next section break should set the break type of the current section to "next page", but this state should be remembered once the RTF group ends ("}" character), otherwise \page will be represented with a continuous break, i.e. lost. Change-Id: I69a8413f45e17e11d6d676c7bfd13ca7560b4d43 Reviewed-on: https://gerrit.libreoffice.org/53498 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-24tdf#116841 RTF import: fix default value of left para margin from numberingMiklos Vajna1-0/+5
The left mragin value is usually spelled out in RTF and DOCX, but this bugdoc used the WW6 RTF markup to declare the numbering rules and there the margin value was missing. This also allows me to partially revert the changes to testTdf106953 from commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc (tdf#112211 RTF import: fix unwanted direct formatting for left indents, 2017-09-26). Change-Id: I9902f2f9ada4080cb4d873624ae9824342c6ee77 Reviewed-on: https://gerrit.libreoffice.org/53364 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-24tdf#106062 ooxmlimport: skip fake tab only on hanging indentJustin Luth3-17/+24
Export has changed, so that it only exports a tab when the footnote paragraph has a hanging indent. Adjusting the import code to match that change. Please test with MSO before flagging this patch as a regression. Certainly there will be some documents previously saved by LO which will now, in LO, show an extra tab character after the footnote. Any previously saved document without a hanging indent will display this extra tab. However, MSO has always seen that extra tab, so these patches are enhancing compatibility. This patch corrects several incorrect assumptions: -The paragraph style is not necessarily "Footnote". -The paragraph may have directly defined a hanging margin. -An aesthetic tab is needed on a hanging indent, not a defined margin. Change-Id: Ieaa76448ce202d92efdb8d1fc04ba2674ed120ba Reviewed-on: https://gerrit.libreoffice.org/52172 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-17loplugin:constparamsNoel Grandin2-3/+3
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b Reviewed-on: https://gerrit.libreoffice.org/52756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-14Fix typosAndrea Gelmini1-1/+1
Change-Id: I981cfdf97d132afdd4d3729ec76b6a3f4c62909a Reviewed-on: https://gerrit.libreoffice.org/52210 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-04-12tdf#116976 DOCX import: fix rel size of shape after bitmapMiklos Vajna1-2/+8
We have a queue of these odd relative sizes (which are not XML attributes but text inside the XML element), if the bitmap doesn't pop the queue, the following shape won't get its size. Change-Id: I1602208c9509d8889bf0be254f3b25fb25fafca2 Reviewed-on: https://gerrit.libreoffice.org/52791 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-11new loplugin:unusedvariablemoreNoel Grandin1-8/+2
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-09use more DBG_UNHANDLED_EXCEPTIONNoel Grandin5-18/+23
so we get nice logs of the exception dynamic type for UNO exceptions. Change-Id: Ic0b10dc14d354a2c9a0591b3a51d2f1640d54bdb Reviewed-on: https://gerrit.libreoffice.org/52465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann1-2/+2
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-07Add IWYU wrapper script to find unused includesMiklos Vajna1-0/+8
I've used this script in the recent past to fix warnings in mostly sw/inc/*.hxx. Hopefully sharing it creates interest for others to do similar fixes in other modules. Change-Id: I4c8b6a1e92b006d4fd56b403a25715f11964d639 Reviewed-on: https://gerrit.libreoffice.org/52289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-04-04Related: tdf#115719 DOCX import: fix ignore of increased anchored obj spacingMiklos Vajna1-2/+2
If there is only a single anchored object, then ignore only the current paragraph, not all paragraphs of the section. Change-Id: I5b44a3df05de325025ec90545667b349e875b31f Reviewed-on: https://gerrit.libreoffice.org/52398 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-04loplugin:unusedenumconstantsNoel Grandin2-4/+1
Change-Id: I6069ca8874329e7f15903aa8ef51000c9c280d47 Reviewed-on: https://gerrit.libreoffice.org/52200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-04tdf#116265 RTF import: ignore \fi in para if it repeats invalid \fi from listMiklos Vajna6-16/+70
The 2nd paragraph of the bugdoc has a \fi set, but it has to be ignored. The reason for this is that the \fi is a repeated property from the list definition, but there \levelnumbers has invalid contents, which means its \fi has to be ignored, including their repeated values in paragraph direct formatting. There was already code to insert implicit defaults as paragraph direct formatting based on list properties, this does the opposite: remove paragraph direct formatting based on the list state. This requires tracking the ignored values in a separate structure, since the normal list properties no longer contain the information we need to be able to remove paragraph formatting. (At the moment this tracks only \fi, but can be extended to other properties if it'll be necessary.) Change-Id: Iff542cb76c66b7fc7ae4e07ade84701e24a74f1a Reviewed-on: https://gerrit.libreoffice.org/52352 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-03long->sal_Int32 in tools/gen.hxxNoel Grandin1-2/+2
which triggered a lot of changes in sw/ Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6 Reviewed-on: https://gerrit.libreoffice.org/48806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29tdf#112886 ooxmlimport: skip useless footnote placeholderJustin Luth1-3/+0
Inserting the 0x02 placeholder as the first entry in the line interferes with the aesthetic tab code. lcl_text has code to ignore that placeholder, but lcl_utext doesn't. Ignoring at lcl_utext has the same affect as not processing it at all. Only .docx adds 0x02, so it should be fairly safe to avoid the 0x02 completely. Nothing was detected missing by skipping the placeholder. All of the code was inherited from OOo. Change-Id: Ie8840e5946fec89f270fef5523c88ee5051ca8ef Reviewed-on: https://gerrit.libreoffice.org/51912 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-27tdf#116410 DOCX import: restrict increased object spacing to multiple shapesMiklos Vajna1-0/+4
This anchored object handling is just there to be bug-compatible with Word, it's not needed for the case when there is a single shape in the paragraph. Change-Id: I5e3dc4ba9a4a6f459ec6217e8974ebc2d7303bcc Reviewed-on: https://gerrit.libreoffice.org/51922 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-23msfilter: extract copy&pasted RTF code from sw and writerfilterMiklos Vajna3-68/+7
Both the hexdump and the OLE1 reader can be shared. Change-Id: I97d72a8deeb9c79fc8e8c4a73c613213badfa744 Reviewed-on: https://gerrit.libreoffice.org/51783 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-23comment: Word does not use tabs in footnote implementationJustin Luth1-3/+3
Tabs are inserted when LO exports to MS formats in an attempt to emulate its "magical" spacing which uses the paragraph margin. By default, the Footnote paragraph style has a paragraph margin of 0.60cm. A hanging indent places the footnote character before the margin, and thus a tab advances to the margin. So the emulation works well. The previous comment was misleading because it suggests that this was a Microsoft convention, but actually this is an OOo innovation. Change-Id: Ie8708998457bcb3363bbc760086cf2b41d3eb104 Reviewed-on: https://gerrit.libreoffice.org/51753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-20tdf#116269 RTF import: implement reverse deduplication for listsMiklos Vajna5-2/+104
This is the same mechanism that was added in commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), except that here the reference is a list definition, not a paragraph style. Also, this commit only implements the part that inserts explicit defaults for not repeated properties, not the actual deduplication, as that already works at a dmapper level. (Saving the bugdoc as DOCX, it's visible in document.xml that DOCX marks these defaults explicitly: <w:ind w:left="0" w:right="-6" w:firstLine="0"/> but RTF does not, so the right place to fix this is in the tokenizer.) Change-Id: Iec88d9bf1032d1d89194bd272500d6780c3c2224 Reviewed-on: https://gerrit.libreoffice.org/51589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-19coverity#1430069 silence Uninitialized scalar fieldCaolán McNamara2-6/+2
Change-Id: I54b2140d965fc9c7dddfdcbddd9602ede800c3f7 Reviewed-on: https://gerrit.libreoffice.org/51566 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-19tdf#116472: import "auto" border color as blackMike Kaganski1-3/+4
Since commit fe6da2feb57c3d5e355a36f6b8ac09b48412ff39, "auto" color is supported in OOXML import. Since ODF doesn't support "auto" color as border color, just convert "auto" border color to black on import, like is done in GetLineIndex in ww8par6.cxx. Incidentally, this also fixes a problem in RTF import, where we used to import black borders ("\red0\green0\blue0;" entries in color table) as 0x000001 ("\red0\green0\blue1;") - see fixed tests in rtfexport2.cxx. Change-Id: I4f5e720d215b51c8a43dc7c58f338741bd608efc Reviewed-on: https://gerrit.libreoffice.org/51519 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-16tdf#113182: DOCX filter: new values of wrap property in text boxSerge Krot1-1/+6
Added support of "none" and "through" values of the w:wrap poroperty in the text box. Change-Id: I83f0c9e8162e93bf457f228d49d3b426050d4dc6 Reviewed-on: https://gerrit.libreoffice.org/51396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-16tdf#112118: DOC: properly import/export border distanceMike Kaganski1-30/+6
DOCX part was done in fb959e581c900b392efd0bb329b7cf30c8ed56a5. This commit fixes DOC part. Line width wasn't taken into account on import; and export was done only with "from text" distance, which gave poor interoperability with Word, where the borders were close to page edge. The common code is moved to editeng/source/items/frmitems.cxx and include/editeng/boxitem.hxx. Change-Id: I3d1d1312cb9dc9a9e00d9847ec11234cd787df60 Reviewed-on: https://gerrit.libreoffice.org/51366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-15Fix typosAndrea Gelmini1-1/+1
Change-Id: Icb2d5f8bb9eb781d6a59384e1aac75abf6145774 Reviewed-on: https://gerrit.libreoffice.org/51337 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-14tdf#112118: DOCX: properly import/export border distanceMike Kaganski4-45/+78
https://wiki.openoffice.org/wiki/Writer/MSInteroperability/PageBorder discusses implementation differences between ODF model and MS formats wrt dealing with page margins and distances to borders. This patch corrects import from DOCX, so that the border distance and width doesn't add to the margin size imported from file anymore. It takes care to preserve size from page edge to text (the most important size that affects document layout). When borders go outside of range valid for ODF, the margin is set to keep text area intact, and the border is placed as close to intended position as possible. Export code now also properly handles border width. Also, an improved heuristic implemented to better export cases unsupported by Word, so that the result would look closer to ODF original. We still write correct sizes to OOXML, so that when reopened by LO, the borders will be in correct places; but as Word cannot handle sizes more than 31 pt, it will show borders shifted. This prevents from adding border widths and distances to page margins at each opening of DOCX, saving back the changed value, increasing the margins each time. Change-Id: Ia978ab119dd661949d6c321aea91397f28d205b0 Reviewed-on: https://gerrit.libreoffice.org/51267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-14boost::intrusive_ptr->tools::SvRefMiklos Vajna2-16/+7
To avoid semi-manual refcount handling. Change-Id: I4a0bcd00ef2811a76f85313d2f821daa1731898c Reviewed-on: https://gerrit.libreoffice.org/51242 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-13tdf#116179 Support reading "auto" colour from docxLuke Deller11-12/+51
In docx a colour value is represented as a 6-digit hex RGB value, or alternatively the word "auto" to represent automatic colour. - Add support for reading the value "auto" as COL_AUTO. Previously this would be read as if it were a hex value, stopping at the letter 'u' which is not a valid hex digit, resulting in the colour 0x00000A - a very dark blue, which looks close enough to black that it went unnoticed for a long time :-) - Remove code which tried to handle this wrong 0x00000A value, including the constant OOXML_COLOR_AUTO, as it is no longer needed and will cause surprises for anyone who really wanted this exact shade of dark blue - Fix unit tests that were checking for 0x00000A Change-Id: I6000070341931147ff9341ad6281cd3b53c02b46 Reviewed-on: https://gerrit.libreoffice.org/50995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-13If handler sets contexts properties, it should do it properlyMike Kaganski2-1/+1
Change-Id: I0b58ab924214e1cbbc89af94c037e29d14d45856 Reviewed-on: https://gerrit.libreoffice.org/51195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-12forcepoint #21 pop on empty stackCaolán McNamara1-1/+4
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I25b1c6361fb0a3ae6b01f2be870c9e1b49bf5b84 Reviewed-on: https://gerrit.libreoffice.org/51114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-12forcepoint #24 back() on empty vectorCaolán McNamara2-0/+8
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: Idb6723b53a1ae8aaca80847bfe643bc4abaedd21 Reviewed-on: https://gerrit.libreoffice.org/51121 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-12forcepoint #23 Null dereferenceCaolán McNamara1-1/+1
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I2e68a6c3fe1846fbfaaa0305c02da135a930d863 Reviewed-on: https://gerrit.libreoffice.org/51120 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>