summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-03-12forcepoint #22 pop on empty stackCaolán McNamara1-1/+1
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I964c79af0087075df0142cd251fd304a68bc497b Reviewed-on: https://gerrit.libreoffice.org/51119 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-11Move (and rename) graphic stuff from svtools to vclTomaž Vajngerl2-1/+4
This is preparing to change how GraphicManager works where it won't base itself around GraphicObject anymore but Graphic. No functional or cosmetic change was made to the classes, only changes that were needed because of the move and rename. The only thing that wasn't moved is the GraphicRenderer as it is not needed in vcl for now (but makes sense to move it in the future to keep graphic stuff together). grfmgr was renamed to GraphicObject as the GraphicManager will be changed a lot and most likely moved out, so the name grfmgr won't make any sense anymore. All the UNO implementations were renamed with a prefix Uno and used the same name as the class name. This is made to be more specific which are the Uno objects (for example graphic.cxx contained the implementation of XGraphic, which is similar to graph.cxx contains Graphic). Change-Id: I54a2fa6c7e997469aaa7770db05244adb9f64137 Reviewed-on: https://gerrit.libreoffice.org/51068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-09forcepoint #21 pop on empty stackCaolán McNamara1-1/+2
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I0aac834a60224b33e5d33d08abd7fb056ef9d52a Reviewed-on: https://gerrit.libreoffice.org/50973 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-09forcepoint #20 pop on empty stackCaolán McNamara1-1/+2
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: I3098c5d32d8f97dff4c620e054acde1ba1b6adf3 Reviewed-on: https://gerrit.libreoffice.org/50972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-09svx: removing GraphicURL and OWN_ATTR_GRAFURL, fix writerfilterTomaž Vajngerl2-22/+20
Change-Id: I5b84788a324cc68e3c4561e9a7376fcb1cfeeb67 Reviewed-on: https://gerrit.libreoffice.org/50933 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-08change RTFDocumentImpl to use Graphic instead of GraphicURLTomaž Vajngerl1-29/+16
Change-Id: I4d2f7dd540651a54e4da3dedf315a61a4f8a75cc Reviewed-on: https://gerrit.libreoffice.org/50924 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-07Move BackGraphicURL property & friends to BackGraphic + fixesTomaž Vajngerl4-15/+14
This moves BackGraphicURL, HeaderGraphicURL, FooterGraphicURL and ParaBackGraphicURL properties to BackGraphic, HeaderBackGraphic, FooterBackGraphic and ParaBackGraphic. With this the property type changes from String to XGraphic. This change also fixes a bunch of test failures, changes the tests to use the new properties and the correct type, changes the import and export filters like xmloff and oox, to make the tests happy. Change-Id: Ie66097514203c6dc36ab27420faf265322e9279e Reviewed-on: https://gerrit.libreoffice.org/50760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-06tdf#115861 DOCX import: avoid last-paragraph removal when discarding footerMiklos Vajna2-1/+19
Discarding header/footer is necessary when the document or section settings request to ignore first or even headers/footers. In the bugdoc case settings.xml didn't opt-in for different even/odd footers, but there was an even footer to be ignored. Handle this state at two more places, so we don't end up in a situation where we ignore the footer but not its "remove last (empty) paragraph at the end of the footer" action. Also make the debug dumper for text ranges more robust to have a working token dump when we try to get the string for a table. Change-Id: I6395f37aa40c42304e2c918d87dadecb21e9d378 Reviewed-on: https://gerrit.libreoffice.org/50786 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-04ofz#6720 Divide-by-zeroCaolán McNamara1-3/+7
Change-Id: I81d89a41437456535949e1cd214ec4e514c26494 Reviewed-on: https://gerrit.libreoffice.org/50733 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-02forcepoint #12 top empty stackCaolán McNamara1-1/+4
Change-Id: I51f02be13b3cf69e9aaef644a6c4837f1c47ff62 Reviewed-on: https://gerrit.libreoffice.org/50602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-02delete colordata.hxxNoel Grandin2-2/+0
move what we still need into color.hxx Change-Id: Ied7e31eb16468aa334c666b1499a6262f16a6350 Reviewed-on: https://gerrit.libreoffice.org/50561 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-28convert COL_ constants to be of type ColorNoel Grandin3-6/+6
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27tdf#115715 RTF import: ignore zero para indents in styles without parentsMiklos Vajna2-5/+29
The only reason the DOCX equivalent of the bugdoc was imported correctly is that these default zero margins are simply missing from the DOCX markup, suggesting Word ignores them. We now do the same, this way the stripped down document's 3 paragraphs all have different margins as expected. (Also rework the testTdf112211_2 testcase to test the original problem better: I verified that the layout is unchanged before/after this patch.) Change-Id: I88d56c27c19e070e983c3392f99bca96597cd56e Reviewed-on: https://gerrit.libreoffice.org/50391 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-26forcepoint #10 pop empty stackCaolán McNamara2-1/+7
Change-Id: I96452a86187a6b03251614625445d1b18a5ee218 Reviewed-on: https://gerrit.libreoffice.org/50357 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-23tdf#115883 DOCX import: catch RuntimeException from SwXFrameMiklos Vajna1-1/+8
getPropertyValue("Surround") for a non-inserted frame can throw, but hasPropertyValue("Surround") still returns true. So fix the regression by just catching the exception, assuming that in that case no increased spacing is needed. Change-Id: I49a78ce8d41b4e1cc7d23721d5dc70f7550c94af Reviewed-on: https://gerrit.libreoffice.org/50175 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-20create uno::Any overrides for ColorNoel Grandin3-12/+14
And use less ColorData in writerfilter and xmloff. part of removing ColorData. Change-Id: Ia1c57bf837ae814e7642cf1c7de2eb7ada7a1500 Reviewed-on: https://gerrit.libreoffice.org/50028 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-20tdf#112694 DOCX import: handle <w:titlePg> when turning on follow style headerMiklos Vajna2-11/+10
Commit 17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (DOCX import: first page header should always set default headers as well, 2014-11-21) turned on header/footer of follow page styles of first page styles when the first page style had the header/footer turned on, but failed to consider if <w:titlePg> is present or not. When it's not present, the first page header/footer should be ignored. An additional problem is that by the time DomainMapper_Impl::PushPageHeaderFooter() is called, <w:titlePg> is not parsed yet, so we can't act accordingly. Fix the problem by moving the check to SectionPropertyMap::PrepareHeaderFooterProperties(), which runs at the end of the section properties, where all required info is available, there we can just check for m_bTitlePage. This allows reverting the two changes to existing testcases in CppunitTest_sw_ooxmlexport6 from the original commit as a side-effect. Change-Id: Ic628adab99a4b148fcfd66ca39d0cf81eb7dd9f1 Reviewed-on: https://gerrit.libreoffice.org/50014 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-14tdf#115719 DOCX import: increase paragraph spacing for anchored objectsMiklos Vajna7-29/+135
... like Word 2013 does, when the version string indicates that the new layout is wanted. An alternative to this change would be to add a new sw layout compatibility flag and handle this at a layout level (somewhere in SwAnchoredObject::GetObjRectWithSpaces()). The downside of that approach is that once a layout flag is added, it's not preferred to tweak its behavior, while doing the same at import time is not a problem. Also it's better to have a flag for something which has clear behavior in some spec / implementer notes, which is not the case for this problem. (I've mailed dochelp@microsoft, no answer so far.) Change-Id: Ibad28d27e4bcbe1991a3be1c686064e18e9ffa4d Reviewed-on: https://gerrit.libreoffice.org/49733 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-14oox: cosmetic cleanupAshod Nakashian1-34/+26
Change-Id: Ifafd7338ddfec8b707b5ddf4acb39512faf186da Reviewed-on: https://gerrit.libreoffice.org/49325 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-14oox: move putPropertiesToDocumentGrabBag to XmlFilterBaseAshod Nakashian1-34/+2
Change-Id: Ic3cbabc420c7856682b889528043563622997c14 Reviewed-on: https://gerrit.libreoffice.org/49235 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-13tdf#113258 DOCX import: fix beforeAutospacing for shape first paragraphMiklos Vajna3-0/+32
Commit c761df1e42fd11acc5fc05b0baacd803c3788ca6 (tdf#84678 DOCX import: fix handling of textbox margins, 2016-10-25) uncovered a previously harder to notice problem that single-paragraph shapes have an incorrect upper paragraph margin for the first paragraph. Now that the shape margins are correct this problematic paragraph margin causes crop of the shape text. Fix the problem by adapting the DOCX import to the WW8 import's SwWW8ImplReader::AppendTextNode() (the "If this is the first paragraph in the document" part), where it seems the first paragraph is not only the literally first paragraph in the document, but also the first paragraph of shapes as well. Change-Id: I9d99b9cfabae2c9a7c33eefefb5a9f008669e93d Reviewed-on: https://gerrit.libreoffice.org/49617 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-12cppcheck useInitializationListJochen Nitschke1-2/+2
unique_ptr don't need explicit nullptr initialization, same goes for VclPtr in ImpEditEngine. Change-Id: Id8f3163c2719bee6ee2724cae98449d564be5535 Reviewed-on: https://gerrit.libreoffice.org/49559 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-10writerfilter / ww8filter: enhancement to support new ruby position.Mark Hung4-0/+9
1. Allow ooxml / rtf import the ruby aligned on the right side ( rightVertical or jc=5 ) as css::text::RubyPosition::INTER_CHARACTER. 2. Allow rtf / ww8 export of css::text::RubyPosition::INTER_CHARACTER as jc=5. Though rtf filter can save and load the new ruby position, character format seems lost. The reset of the MSO formats have other issues that they can't make roundtrip yet. Change-Id: Idb77423842f43abc375a1282a52b0bc6f20049e4 Reviewed-on: https://gerrit.libreoffice.org/49177 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-02-07rtf: null-derefCaolán McNamara1-21/+30
Change-Id: I9c4510cb91e2572a3ab2b62497dc4dd9fd1119c8 Reviewed-on: https://gerrit.libreoffice.org/49319 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-07tdf#114217: Consider relative width when importing floating tableMike Kaganski3-3/+12
Unit test included Change-Id: I8e3338d7df431bd016caa4e06e684fbd189127c4 Reviewed-on: https://gerrit.libreoffice.org/49324 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-06Fix typosAndrea Gelmini1-1/+1
Change-Id: Ifb3aa4f79b9accc34b2010b762e596fadae9fd09 Reviewed-on: https://gerrit.libreoffice.org/49297 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-06tdf#115242 RTF import: order numPr before other paragraph propertiesMiklos Vajna7-11/+48
So that paragraph properties inherited from numbering properties can be properly overwritten with direct formatting, even when we have to take style deduplication into account. The OOXML tokenizer already did this, writerfilter::dmapper::DomainMapper::sprmWithProps()'s NS_ooxml::LN_CT_NumPr_numId depends on this, so adapt the RTF tokenizer accordingly. Change-Id: Iec6026d146f08a9d06266763d01ed626a2d1f3d1 Reviewed-on: https://gerrit.libreoffice.org/49247 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-03RTF filter: handle horizontal flip of picture framesMiklos Vajna1-0/+7
Only shapes were handled previously. Change-Id: Ie03947d7ae065729ef85addddb1ede32637622f2 Reviewed-on: https://gerrit.libreoffice.org/49178 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-02Replace some front/pop_front by for-range loops+clearJulien Nabet1-5/+4
Change-Id: I8a9239667b0d80ee2fa6ebbc8a19ba4c0076c2fb Reviewed-on: https://gerrit.libreoffice.org/49107 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-02DOCX import: don't try to set grab-gag props as UNO propsMiklos Vajna1-9/+0
This fixes loads of warnings like this one: warn:legacy.osl:22335:22335:writerfilter/source/dmapper/StyleSheetTable.cxx:1611: Exception in StyleSheetTable::getOrCreateCharStyle - Style::setPropertyValue during import. They are harmless as we catch the exception, but they are just noise. It seems the code that transforms grab-bag pseudo-props into real props was added in commit 4c3ba3a413be7339115ea5e6edc825a8434cd345 (fdo#75757: Remove inheritance from std::map., 2014-07-26), which is supposed to be a pure refactoring, so just remove this problematic transformation. Change-Id: Ibf45bfedc661f9e065405c47623516c4026148a4 Reviewed-on: https://gerrit.libreoffice.org/49105 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-31tdf#72942 Do not overwrite styles from the inserted docSerge Krot1-0/+15
During inserting of the text from the external document we should not change original default styles in currently opened document. Added unit test. Change-Id: Ida754a0da5efaaa043464cd807c0b52cfb0d5670 Reviewed-on: https://gerrit.libreoffice.org/48826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-30tdf#115155 RTF import: fix left indent handling inside list definitionMiklos Vajna2-2/+12
This used to work in the past only because the left indent was also imported as a direct paragraph formatting, but that is not the case since left margin of lists is deduplicated during import after commit c9dee880d88305312094b311abdae155e452bf14 (tdf#104016 RTF import: deduplicate before text indent from numbering, 2017-12-05). Change-Id: I1c9be30700c51ef97fb274e8781d6008db3121d8 Reviewed-on: https://gerrit.libreoffice.org/48855 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-29DOCX import: handle horizontal flip of bitmapsMiklos Vajna1-0/+11
Horizontal mirror on the UNO API level, mirror on the vertical axis internally. Change-Id: If142274a8f81a6875059a2651af6d8470870a36a Reviewed-on: https://gerrit.libreoffice.org/48843 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-29Fix typosAndrea Gelmini1-2/+2
Change-Id: Iedd82d035454c940d76a94c7e910c81827c1389c Reviewed-on: https://gerrit.libreoffice.org/48828 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-28tdf#115278: an empty entry in color table is auto colorMike Kaganski3-13/+27
A unit test will come in a separate commit Change-Id: I89dd9cae6e099509d21398e29ccf6412791accc2 Reviewed-on: https://gerrit.libreoffice.org/48781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-28tdf#115276: multiply quarter-points by 5 (not divide) to convert to twipsMike Kaganski1-1/+2
Unit test will come in separate commit Change-Id: I4cd6983d708868883c766b239cb57752106a59bf Reviewed-on: https://gerrit.libreoffice.org/48780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-27writerfilter: FindStyleSheetBy... remove StyleName optionJustin Luth3-17/+1
It is confusing having three undocumented Find functions. Reduce by one - either search on the imported WW8 (ISTD) name or on the internal (converted) name. The one remaining use of ByStyleName was testing against an already set property, so by definition it was set using convertedStyleName. (Plus, that was my code anyway...) Change-Id: If5a352bedb7d297698f449fbb629a1350e27c51c Reviewed-on: https://gerrit.libreoffice.org/48037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-01-26tdf#95377 ooxmlimport: treat default style like named stylesJustin Luth2-75/+77
The default style was missing out on all of the fixes made by LN_CT_PPrBase_pStyle. That included right margins, and numbering styles. Essentially, this change is just copy and paste from one function to another. I tried to make all of the logic changes separately in previous commits. So the adjustments here are simply to accommodate different variable/function names. So if this causes any regressions, it ought to just be related to either applying later on (at finishparagraph instead of LN_CT_PPrBase_pStyle or because it includes the default style. One important note regards the preparatory commit 254c80037a3939c110d5c66fef6c28caf47625e5. If this commit is reverted, make sure to check that commit to add a conditional wrappers around GetCurrentNumberingRules(). Change-Id: I9827b2cd1a74a13cf18ada9baa221c5c567a7391 Reviewed-on: https://gerrit.libreoffice.org/48458 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>