summaryrefslogtreecommitdiff
path: root/sw/qa/extras
AgeCommit message (Collapse)AuthorFilesLines
2018-05-24tdf#106390 Intersect the table borders with upper frames.Mark Hung2-0/+20
Also removes dead code because SwTabFramePainter::Insert() is always called with a cell frame and IsTabFrame() always returns false. Change-Id: I2505d876d20e44ded1faf760bc3b7b1d34b0fd8d Reviewed-on: https://gerrit.libreoffice.org/54684 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 Luth1-4/+9
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-23tdf#117505 RTF export: fix incorrect header distance for first/follow pagesMiklos Vajna2-0/+11
In case the first and the follow page format has different header distances, the DOC and DOCX import work with the distance from the first page format when they take the last item from the MSWordSections container at the end of the export. RTF writes section info before the document content, and in case there are separate first and follow page formats, then we work with the follow format since commit 20a53cb9e9c7b797c091fe6ac6a34dfb28c61304 (INTEGRATION: CWS limerickfilterteam08 (1.16.32); FILE MERGED, 2003-09-01) as a fix for i#13107. There is no perfect solution here, the sw doc model can store different header distances for first and follow pages, while Word works with a single distance. But RTF/DOCX/DOC import puts the relevant header distance to the first page format and DOCX/DOC export reads the distance from there, so be consistent and do the same in the RTF export as well. This means the DOCX import -> RTF export -> RTF import sequence from the bugreport will result in a correct header distance. Change-Id: I3f1fe3080360702c41d680b8785cc3602e74685e Reviewed-on: https://gerrit.libreoffice.org/54680 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-22db04be037b611e296ef9f2542322c52ed82d7a2b follow-up: no new log areaMike Kaganski1-15/+16
Change-Id: Ib0dc0240db4840d3e93f1816d4288644d9e308f0 Reviewed-on: https://gerrit.libreoffice.org/54660 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-05-22tdf#117171 unit test for localized page number numbering stylesLászló Németh2-2/+2
Change-Id: Iad92cbe0b0376725c3078d26a4f3201d072c3c16 Reviewed-on: https://gerrit.libreoffice.org/54554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-05-22Fix svg to base64 conversionSamuel Mehrbrodt1-1/+1
This reverts part of ab14a9708d2937bc767c14542610ce91b56dda1e which had a questionable fix by unconditionally removing the first 8 bytes of the svg which led to svgs starting with rsion="1.0" encoding="utf-8"?> instead of <?xml version="1.0" encoding="utf-8"?> Change-Id: I8c4d78db1794473d20ddd77019ae81b88be0bb03 Reviewed-on: https://gerrit.libreoffice.org/54550 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-20[API-CHANGE] change to GraphicBitmap prop. for NumberingLevelTomaž Vajngerl2-8/+9
To make it consistent, change "Graphic" property (added during image handling rework) to "GraphicBitmap" in style::NumberingLevel, which is already used in text::NumberingLevel. Both of them are accessors for the graphic of bitmap bullets. Change-Id: I70f7bccd80fa9949778c49e23de583c6fb32a796 Reviewed-on: https://gerrit.libreoffice.org/54492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-20tdf#35798: Hide empty Database fields' paragraphs (+ compat option)Mike Kaganski6-0/+215
With this change, Database fields that expand to empty values behave as if they are "Hidden Paragraph" fields. A compatibility option to enable this behaviour is added. The option is enabled by default, and for any non-native documents (for compatibility with other office suites). For existing (F)ODT documents, the option is disabled for those documents that don't have this setting set, to keep the layout of legacy documents. Change-Id: Ic5e8cb15a3a7d1a765a984eef4b0d97666df7dfd Reviewed-on: https://gerrit.libreoffice.org/54552 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-20tdf#117502 fix graphical bullets for OOXML and RTFTomaž Vajngerl5-24/+151
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-16tdf#117504 ooxmlimport: check paragraph props for actual styleJustin Luth2-0/+6
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-16sw: cleanup globalfilter testTomaž Vajngerl1-57/+61
- use OUString for filter names - use modern iteration through filter names - no change to the tests Change-Id: Idab4183efe2b489b91b4f3c96e7cb1d639628766 Reviewed-on: https://gerrit.libreoffice.org/54374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-16sw: improvements of globalfilter testTomaž Vajngerl1-41/+35
- check if linked graphic is registered in LinkManager - remove setting of graphic cache size as it doesn't have any effect anymore - improve asserts for Graphic / XGraphic objects Change-Id: I97e2772e2a8209ff61975c273ec27401c3e7a976 Reviewed-on: https://gerrit.libreoffice.org/54373 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-15tdf#117225 sfx2: fix leftover temp file when saving doc with embedded objectsMiklos Vajna2-1/+42
Regression from 27938e1bbd5f3405c47b9933be7489eeb03920f3 (sfx2 store: create temp files next to local files (storage case), 2018-01-17), the optimization to store temp files during save next to the destination document (so that it can be renamed and not copied after writing the data successfully) causes problems when we have embedded objects. Avoid the problem by disabling this new optimization when the document has embedded objects. How to fix the actual root cause is not clear to me, I see that: - the SfxMedium::GetOutputStorage() call in SfxObjectShell::SaveTo_Impl() create a temp file - the SfxMedium::Commit() call in SfxObjectShell::SaveTo_Impl() tries to remove the file, which fails on Windows as there is an open file handle to that file - SfxObjectShell::SwitchChildrenPersistance() would close the storage, owning that open file handle, but it's too late So just go back to the previous behavior for now. Change-Id: I37259100d1ddf963c1f2d3b7bd9f460bc995815c Reviewed-on: https://gerrit.libreoffice.org/54340 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-14remove page count check in a test (irrelevant and fragile)Luboš Luňák1-3/+0
If I load this document in LO, either my build or distro build, it has only one page, so the test fails for me only because of the 2-page check. The commit causing this, b904d639a8, has been in for quite a while, so it's apparently something special about my setup, but a) the test doesn't actually require 2 pages for anything, b) the commit mentions that the test is fragile, c) if I manually inspect the .rtf, there's an extra page that I do not see even in Word2013, so the document is possibly a bit broken. One way or another, the page check seems pointless. Change-Id: I18bdf25f71e8eb9225acd667e60f426fca008ee4 Reviewed-on: https://gerrit.libreoffice.org/53380 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-05-12Revert "Enable CppunitTest_sw_odfexport for MACOSX"Christian Lohmaier1-3/+4
This reverts commit fe192a7b7485379625a4d91ad6e3a9e6280add2c. The mac-mini jenkins buildslaves get stuck on the sw_odfexporttest and ultimately get killed by the build-timeout. Revert to not tempt people into bypassing jenkins alltogether. Change-Id: I6c08657a1957455161882443b88b5d581c888bcf Reviewed-on: https://gerrit.libreoffice.org/54155 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-05-11tdf#117245 sw layout: extend TabOverMargin compat modeMiklos Vajna2-0/+14
This layout compatibility flag is supposed to mimic Word behavior, but in both cases we failed to lay out the text as Word does. Change-Id: Ic6fb2eb16ce3670d23aeb9f17bd7043f55164883 Reviewed-on: https://gerrit.libreoffice.org/54087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-10tdf#79315 Fix wp:effectExtent issue when exporting inline picture to DOCX.Victor Mireyev2-0/+14
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-09Fix some IWYU warningsMiklos Vajna1-2/+14
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-08OFFICE-3776 xmloff: adapt ODF import to renamed text:sender-initialsMichael Stahl2-0/+91
ODF TC decided to rename the element to meta:creator-initials, so adapt the import so it can read this in addition to the 2 element names produced by current and past LO versions. Also add a test. Unfortunately it turned out that the ODF validator had a bug in checking character data in foreign elements, which is triggered by the test document, see https://issues.apache.org/jira/browse/ODFTOOLKIT-475 ... so update the validator jar as well. Change-Id: I1de1e8772b41f8937f043d9a0d150e169f25ffd4 Reviewed-on: https://gerrit.libreoffice.org/53979 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-05-08sw: check layout in testTdf102466.Mark Hung1-0/+7
Examine the document in testTdf102466 and sees that the table in the first page is clipped instead of first page missing as mentioned in the comment 1 of tdf#102466. Adding more precise test to make the test the feature more purposely. Change-Id: Icb6dfb17f033c96dde21b5561d7b15170cf96e27 Reviewed-on: https://gerrit.libreoffice.org/53904 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-08Enable CppunitTest_sw_odfexport for MACOSXStephan Bergmann1-4/+3
The whole boy of sw/qa/extras/odfexport/odfexport.cxx had been disabled for MACOSX and WNT with effeb7b039bbed5e4eb0c4af1f600b61ffbb4546 "sw/qa: 1 individual unit test per filter (import/export) test", for no clear reason, then enabled again for WNT (but left disabled for MACOSX) with 960db7d4a875897addb8a28257da38138babb264 "CppunitTest_sw_odfexport: enable on Windows". What fails for me on macOS is > /Users/stephan/Software/lo/core/test/source/xmltesttools.cxx:71: Assertion > Test name: testEmbeddedFontProps::Import_Export_Import > equality assertion failed > - Expected: 1 > - Actual : 0 > - In <file:///Users/stephan/Software/lo/TMPDIR/libtest_sw_odfexport.dylibf8drfk.tmp>, XPath '//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]' number of nodes is incorrect > > /Users/stephan/Software/lo/core/sw/qa/extras/odfexport/odfexport.cxx:1948: Assertion > Test name: testBulletAsImage::Import > equality assertion failed > - Expected: 15 > - Actual : 17 > > /Users/stephan/Software/lo/core/sw/qa/extras/odfexport/odfexport.cxx:1948: Assertion > Test name: testBulletAsImage::Import_Export_Import > equality assertion failed > - Expected: 15 > - Actual : 17 > > Failures !!! > Run: 99 Failure total: 3 Failures: 3 Errors: 0 of which the first was already disabled individually for WNT (so disabled it for MACOSX, too), and the latter two are covered by a new TODO disabling just the relevant CPPUNIT_ASSERT_EQUAL for MACOSX for now. Change-Id: I233f71dc9566b1e21d34f4ef65cbddb364bb6f03 Reviewed-on: https://gerrit.libreoffice.org/53961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-08tdf#117403 RTF import: fix lost cell border of merged cellMiklos Vajna2-0/+29
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-07sw HTML export: ensure <li> is not closed before list item contentMiklos Vajna2-0/+17
Seems to be a regression from commit c30cf5a3d7902018b0a752fa2060b8f2a2caafc2 (sw html: use HtmlWriter in htmlatr in some places, 2014-03-16). Change-Id: If03b77a43cb2f7d1c9c9c62da7eef9ee9c2b5e91 Reviewed-on: https://gerrit.libreoffice.org/53937 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-05-05sw: move tests in ooxmlimport to ooxmlimport2.Mark Hung2-160/+201
To avoid using -bigobj on Windows. Change-Id: I3115fc01a0802c4b40219bb6f7ea934df81706ed Reviewed-on: https://gerrit.libreoffice.org/53769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-05-04Removed executable permission on data filesAndrea Gelmini12-0/+0
chmod -x for doc, xlsx, png, hxx, cxx, xls, ppt, hpp Change-Id: I52aed261e318cfd765e9adb3ed8edd226c8a59d8 Reviewed-on: https://gerrit.libreoffice.org/52569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-05-03tdf#117268: treat erroneous \itap0 the same way as Word doesMike Kaganski2-0/+71
... 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#117171 support localized number name numbering stylesLászló Németh2-0/+26
in page number, chapter and outline numbering in ~30 languages by integrating libnumbertext library. - offapi: add linguistic2::NumberText New NumberingType constants: - ordinal indicators (1st, 2nd, 3rd...) - cardinal number names (One, Two, Three...) - ordinal number names (First, Second, Third...) Note: these numberings are parts of OOXML, too. Plain text files of Libnumbertext's language data are installed in share/numbertext (similar to share/fingerprint), allowing further customization. Change-Id: I4034da0a40a8c926f14a3f591749a89a8d807d5a Reviewed-on: https://gerrit.libreoffice.org/53313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-05-03tdf#116801 DOCX import: char styles have no IsAutoUpdate propertyMiklos Vajna2-0/+12
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-05-02extend test, so it checks the retireved graphic is as expectedTomaž Vajngerl1-0/+3
Change-Id: I49f852681a5d3541da23d1d590cac14b6e4f8e6a Reviewed-on: https://gerrit.libreoffice.org/53491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-02extend test with checking the bullet bitmap sizeTomaž Vajngerl1-0/+6
Change-Id: Ib79ab49110d0e04b2f38eb7cc6d1db191857cb87 Reviewed-on: https://gerrit.libreoffice.org/53459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-28tdf#106062 ww8import: skip fake tab only on hanging indentJustin Luth2-0/+9
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. Change-Id: Id074ca0f3246eaee9807b907757cbeb6f1bbe7b4 Reviewed-on: https://gerrit.libreoffice.org/52173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-04-26tdf#117246 RTF import: don't loose page breaks inside nested groupsMiklos Vajna2-0/+17
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-26convert tabopts to scoped enumNoel Grandin1-7/+7
Change-Id: I6c9290e3319d2afd1bd71847091c7ab77b8ea6e6 Reviewed-on: https://gerrit.libreoffice.org/53497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-26SwEditShell functions that really want to return boolNoel Grandin1-2/+2
but just couldn't, because they were too shy, so they went to ToastMasters, and now they are all grown up and can bool all the day long Change-Id: Id06e0791ec3c930be8a165cc7b05ce4f0c8f7499 Reviewed-on: https://gerrit.libreoffice.org/53462 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-24tdf#116841 RTF import: fix default value of left para margin from numberingMiklos Vajna3-1/+26
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 Luth2-0/+9
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-23sw HTML import: lazy-read inline imagesMiklos Vajna2-0/+19
Also prefer Graphic::GetPrefSize() over Graphic::GetSizePixel(), since the previous does not swap in the image. Change-Id: I100da14716448e72b687ce8ad1800326f0b3735e Reviewed-on: https://gerrit.libreoffice.org/53322 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-20DOC import: lazy-read imagesMiklos Vajna2-0/+8
At least JPEG files are now only loaded when the user scrolls to the relevant page. Also fix the root cause of the EMF lazy-read problem and remove the previous workarounds. Change-Id: I9699927282b99bcb71a0d271a20bbfd56a361ee8 Reviewed-on: https://gerrit.libreoffice.org/53219 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-20DOCX import: lazy-read images without external headersMiklos Vajna2-0/+8
So that similar to ODT, images are not loaded on file open, only when the user scrolls there. Notes: 1) GraphicDescriptor::ImpDetectJPG() would try to calculate the logic size before the pixel size is available, so the logic size would be 0x0. Also, ImpGraphic::ImplSetPrepared() would always work with a pixel map mode. Any of these two would result in a failure of testDMLShapeFillBitmapCrop in CppunitTest_sw_ooxmlexport6. 2) Lazy-loading seems to (at the moment) not recognize EMF files, so don't lazy-load in case an external header is provided. This probably has to be revisited, since the ODF import doesn't go via GraphicProvider::queryGraphic(). Change-Id: I44754e659effebca8339715df114dbaadb9b5e9f Reviewed-on: https://gerrit.libreoffice.org/53215 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-20loplugin:constantparamNoel Grandin1-3/+3
Change-Id: Ia58d8950b3b9e48bbe9f075b9fe1eed62d9abf0d Reviewed-on: https://gerrit.libreoffice.org/53188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-20Function to load graphic swapped out (loaded on demand)Tomaž Vajngerl1-2/+3
When a document is loaded it takes a lot of time and memory to load the graphic that are in the documet, so avoid that and just store the compressed graphic into a temporary file (handeled by GfxLink) and load when we really need to show the graphic. GraphicObject cached some attributes from Graphic, but this attributes now aren't available immediately so this attributes are removed form GraphicObject and now delegate to the Graphic itself. GetSizeBytes attribute however was removed as it is only used in some tests. GfxLink initial values were moved to the constructor and are not set in the header file anymore (as it is the recommended way to do it). The SdImportTest::testDocumentLayout failed as it looks like the dump sometimes didn't include the width and height of the null bitmap (which is set to 32x32) of the FillBitmap in some situations, but then in other situations it did include this attributes. With this change the width and height are always included for the FillBitmap which looks like it is more correct. Change-Id: Ia1218f93b1735402b7828404f65660e2d4acf32f Reviewed-on: https://gerrit.libreoffice.org/53016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-04-18sw XHTML export: close <col> for tablesMiklos Vajna2-3/+18
By switching to HtmlWriter instead of manually constructing HTML elements / attributes. Also fix a validity problem for ReqIF (transitional XHTML still allows that, so not depending on mbXHTML here). Change-Id: I4f3fef781fdbb4c72824701ad6d380cece8e6f81 Reviewed-on: https://gerrit.libreoffice.org/53120 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-18sw HTML import: use GraphicDescriptor to determine default sizeMiklos Vajna3-0/+38
Rather than the hardcoded HTML_DFLT_IMG_WIDTH / HTML_DFLT_IMG_HEIGHT defines. Change-Id: I4ed2207ce3fdcd247054941d91eb67a679fb370c Reviewed-on: https://gerrit.libreoffice.org/53081 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-18tdf#116195 swap a compatibility valuePatrick Jaap2-0/+8
There was a minor bug in the compat flag, leading to a regression from commit 8d62b79f168180c6992eb483ec864d473050635f Change-Id: I1e468e665a583ef15b6e474c3adb32f1dcf98f46 Reviewed-on: https://gerrit.libreoffice.org/52674 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-17tdf#116848 sw, sections in tables: no split in headers or footersMiklos Vajna2-0/+9
The motivation for split section-in-tables was multiple pages, so disabling it for headers/footers is not a problem, and fixes the layout loop. Change-Id: I3e13690f6e6b50c35417f8a4f7886fd0befe7962 Reviewed-on: https://gerrit.libreoffice.org/53006 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-16tdf#117028 sw: conditionally consider fill of shape for in-textbox auto colorMiklos Vajna2-0/+24
Commit f966767e1ccfa432da33e1a0fd6de69e17a36bc3 (tdf#116925 sw: consider fill styles of shape for in-textbox auto color, 2018-04-10) did this unconditionally, but there are two cases: 1) Shape (with textbox) has a fill, in that case auto text color of textbox should consider the shape fill. 2) Shape has no fill, in that case the shape fill should not be considered when counting the background of a transparent fly frame. Fix 2) without breaking 1) by making the change to SwFrame::GetBackgroundBrush() opt-in, and only use it for auto font color, not in other cases. Change-Id: I761a1b7d6ecf47586edbe5641ec012f22f6a53d7 Reviewed-on: https://gerrit.libreoffice.org/52941 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-16tdf#116486 Consider upper margin in paragraph positioning with flysPatrick Jaap2-0/+6
The problem was the following: There is a paragraph with an upper margin defined. Also, there is a flyframe intersecting this upper margin. The desired behavior is to reposition the parapgraph, such that it (including it's upper margin) is located below the flyframe. This patch increases the bounding rectangle of the paragraph by the upper margin. For compatibility, there is a compat-flag query. I re-used a related one. Change-Id: I9dbc75e07e2ba0658fdbbfa9989be24a68660713 Reviewed-on: https://gerrit.libreoffice.org/52685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-16sw: prefix members of WriterMiklos Vajna2-3/+3
Change-Id: Iee39219eb9de089ded9658eb75fcf258c3bd951d Reviewed-on: https://gerrit.libreoffice.org/52931 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-15remove some unused comphelper includesJochen Nitschke4-4/+0
and fix the fallout Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359 Reviewed-on: https://gerrit.libreoffice.org/52894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-14Fix typosAndrea Gelmini1-1/+1
Change-Id: I9ea95f5b7b6cd056cc1aad146c8841877d187d55 Reviewed-on: https://gerrit.libreoffice.org/52742 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>