# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # $(eval $(call gb_Library_Library,shlxtmsi)) $(eval $(call gb_Library_use_external,shlxtmsi,boost_headers)) $(eval $(call gb_Library_add_defs,shlxtmsi,\ -U_DLL \ -D_WIN32_WINNT=0x0502 \ )) $(eval $(call gb_Library_add_cxxflags,shlxtmsi,\ $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,shlxtmsi,\ /DEF:$(SRCDIR)/setup_native/source/win32/customactions/shellextensions/shlxtmsi.def \ /NODEFAULTLIB \ )) $(eval $(call gb_Library_add_exception_objects,shlxtmsi,\ setup_native/source/win32/customactions/shellextensions/startmenuicon \ setup_native/source/win32/customactions/shellextensions/upgrade \ setup_native/source/win32/customactions/shellextensions/migrateinstallpath \ setup_native/source/win32/customactions/shellextensions/completeinstallpath \ setup_native/source/win32/customactions/shellextensions/checkdirectory \ setup_native/source/win32/customactions/shellextensions/layerlinks \ setup_native/source/win32/customactions/shellextensions/vistaspecial \ setup_native/source/win32/customactions/shellextensions/checkpatches \ )) $(eval $(call gb_Library_use_static_libraries,shlxtmsi,\ seterror \ )) $(eval $(call gb_Library_use_system_win32_libs,shlxtmsi,\ libcmt \ libcpmt \ msi \ kernel32 \ advapi32 \ shell32 \ psapi \ )) # vim: set noet sw=4 ts=4: ffice-6-2'>distro/cib/libreoffice-6-2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml
AgeCommit message (Collapse)Author
2020-04-03DOCX import: declare w14 as a supported featureMiklos Vajna
This is needed (but not enough) to support markup like this: <mc:AlternateContent> <mc:Choice Requires="w14"> <w:numFmt w:val="custom" w:format="001, 002, 003, ..."/> </mc:Choice> <mc:Fallback> <w:numFmt w:val="decimal"/> </mc:Fallback> </mc:AlternateContent> Change-Id: I598b0452b5d29624ed0a6795682c29a09fd0dcfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90564 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit b0887393ceb0bf283841fe212baf5be3571782b9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91635 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-04-03DOCX import: tokenize <w:numFmt w:val="custom" w:format="...">Miklos Vajna
Which means CT_NumFmt has to be a property resource, not a single value, and also ST_NumberFormat needs to recognize "custom" as a valid value. Adapt the RTF tokenizer to emit the new token format. This is needed (but not enough) to support markup like this: <w:numFmt w:val="custom" w:format="001, 002, 003, ..."/> (cherry picked from commit 496197fe4dff2cd94ceeb42fc04d0263ac8d8971) Conflicts: writerfilter/source/rtftok/rtfdispatchflag.cxx writerfilter/source/rtftok/rtfdispatchvalue.cxx Change-Id: I767e4b92fc41f9425f446d6eaad1d875e2233964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91634 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-08-05pretty up logging of exceptionsNoel Grandin
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15tdf#124670: xml:space attribute may be specified for w:document root elementMike Kaganski
Treat xml:space specially in OOXMLFastContextHandler::startFastElement, to allow this attribute to be handled for any element. Change-Id: I81bd1e0642940ffdfc03d6c65d0ce9f421206c5e Reviewed-on: https://gerrit.libreoffice.org/70723 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/70725 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-11-16loplugin:staticmethods improvementNoel Grandin
Change-Id: I8889ce8a7d2309b54454cfe4c6421282e1c6e755 Reviewed-on: https://gerrit.libreoffice.org/63434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08loplugin:collapseif in tools..xmloffNoel Grandin
Change-Id: Iea1227a9f13a0a618d9bb6b0bbedaa5ce8d1a4f5 Reviewed-on: https://gerrit.libreoffice.org/62732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-02fix signatures of deleted copy/assign operatorsNoel Grandin
Change-Id: Id1a0749b78a7021be3564487fb974d7084705129 Reviewed-on: https://gerrit.libreoffice.org/62718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-16clang-tidy readability-simplify-subscript-exprNoel Grandin
error: accessing an element of the container does not require a call to 'data()'; did you mean to use 'operator[]'? Change-Id: I022745aa84b80124f342ce6c596d51b4d904f012 Reviewed-on: https://gerrit.libreoffice.org/61820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15clang-tidy bugprone-copy-constructor-initNoel Grandin
message is "calling a base constructor other than the copy constructor" these constructors are not in use, so just remove them Change-Id: Ic8cede1eb153a6ae97fd1ca9c96ca8c1f43e3399 Reviewed-on: https://gerrit.libreoffice.org/61784 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-04related tdf#76683 writerfilter: hanging implemented as SignedJustin Luth
despite the documentation that states it must be a positive value, the actual implmentation honors a negative number (as opposed to treating it as a zero, or an absolute). Change-Id: Ie38369ecdf5353b73572dd3533c2efe41adda290 Reviewed-on: https://gerrit.libreoffice.org/59401 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-03tdf#76683 writerfilter: TwipMeasure must be positiveJustin Luth
...and the column width must not be negative. The previous column logic ensured that the total width was larger than the reference by adding a fake buffer and then subtracted the difference from the final column. In the case of a zero-width final column, it could become negative. The current logic ensures that the total width is less than the reference width, and then adds the difference (which should be a smaller difference now) to the final column. Regression potential - early columns that need every single twip of bonus space might not fit anymore. On the other hand, ending columns might be fixed... Change-Id: Ie75d455e8ed62dbec5a1b9c901417df8d842ace8 Reviewed-on: https://gerrit.libreoffice.org/59400 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-02Silence new Clang trunk -Wdefaulted-function-deletedStephan Bergmann
This mostly affects explicitly defaulted functions that had recently been user- declared to silence new GCC trunk -Wdeprecated-copy. It is not entirely clear to me what the best approach is overall, see my mail <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20181001/245321.html> "Re: r343285 - [cxx2a] P0641R2: (Some) type mismatches on defaulted functions only", but lets just explicitly delete those functions for now. Change-Id: If8c72f612f67a8feb8b03c2fb988c807e704ef03 Reviewed-on: https://gerrit.libreoffice.org/61259 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-29Simplify containers iterations in w*Arkadiy Illarionov
Use range-based loop or replace with STL functions. Change-Id: Ie1e169f9d2d44e188180164bd1f93af43740425d Reviewed-on: https://gerrit.libreoffice.org/61141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27loplugin:methodcycles more graph theory for the winNoel Grandin
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18tdf#118691 DOCX import: fix table loss caused by <w:cr>László Németh
According to the OOXML standard, <w:cr> (carriage return – Unicode character 000D) is equivalent to a break with null type and clear attributes, so we handle it as a <w:br/>, instead of endOfParagraph, fixing losing table paragraphs and tables containing <w:cr/>. Note: It seems, MSO cannot handle carriage return characters in table cells correctly. It shows squares (unknown characters) without line break there. Copying this text to a non-table paragraph in MSO, we get the correct layout with line breaks. Copying this text with carriage return characters back to a table cell, we get squares again. With this LO fix, it will be possible to fix the bad tables edited by MS Word by using LO, because LibreOffice import/export converts all <w:cr>s to <w:br>s (as before, but now without destroying the structure of the tables). Change-Id: Iee42f71e9a00531353582e7127c2c212ea0890d0 Reviewed-on: https://gerrit.libreoffice.org/60585 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-13loplugin:constfields in writerfilterNoel Grandin
Change-Id: Ibe380e1fb35d9defc478d459a988f9f6df13bf35 Reviewed-on: https://gerrit.libreoffice.org/60427 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13loplugin:simplifyconstruct in writerfilter..xmlsecurityNoel Grandin
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0 Reviewed-on: https://gerrit.libreoffice.org/60398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-27tdf#119143: introduce tentative directional embedding import supportMike Kaganski
ECMA-376-1:2016 states that w:dir is functionally equivalent to LRE/RLE+PDF pair around the enclosed runs. So this patch does just that. Change-Id: Ibf9775338cc38a3bbc38a42a33fc64ae787b478f Reviewed-on: https://gerrit.libreoffice.org/59643 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-27writerfilter: build-time test for unexpected data typesMiklos Vajna
So next time I write <data type="ST_Foo"> instead of <ref name="ST_FOO">, I get an error quickly. Change-Id: Ida91b8ebe68915e22c62addffafe418ab29b1158 Reviewed-on: https://gerrit.libreoffice.org/59661 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-25ofz#10056 Null derefCaolán McNamara
Change-Id: I9ea0f272d0a8b13fb51fec55ac57adca47cafc77 Reviewed-on: https://gerrit.libreoffice.org/59596 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21tdf#57589 writerfilter: support hash-encoded colorsJustin Luth
Previously, a hash-encoded value would simply fail to zero and thus the color would be dark black. The unit test covers two conditions. Paragraph 1 has a valid encoding, and pararaph 2 has an invalid coding (which is ignored and fails to COL_AUTO). Change-Id: I68940f5c4b0975a87feb6cab8fb3572b7546a077 Reviewed-on: https://gerrit.libreoffice.org/59295 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-13ofz#9870 check sequence length before useCaolán McNamara
Change-Id: I137a9de49c5a73eb5f277dc1519e5e036abba31c Reviewed-on: https://gerrit.libreoffice.org/58945 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-27writerfilter python: 2 blank lines after class/function definitionMiklos Vajna
To be in sync with PEP8. Change-Id: If712dc4eac675abb011543f2ea54a2de085e6ad8 Reviewed-on: https://gerrit.libreoffice.org/58163 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-07-26writerfilter: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
...by explicitly defaulting the copy/move functions (and, where needed in turn, also a default ctor) for classes that have a user-declared dtor that does nothing other than an implicitly-defined one would do, but needs to be user- declared because it is virtual and potentially serves as a key function to emit the vtable, or is non-public, etc.; and by removing explicitly user- provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non- deleted in the future. (Even if such a user-provided function was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already include, so why bother with non-inline functions.) Change-Id: I08632dcf7ccac1ab7efa0d5e8f4985d74cd31eac Reviewed-on: https://gerrit.libreoffice.org/58077 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26OOXMLFastContextHandler has a deleted copy assignment opStephan Bergmann
...for whatever reason, ever since the file's introduction with 359fd901c7c8a1c37e1d2ccee2b5a2cf6c3c93d1 "INTEGRATION: CWS xmlfilter02". Make the copy ctor expliticly defaulted to avoid -Werror=deprecated-copy with GCC trunk towards GCC 9. Change-Id: I7785dfb073767ba963ceec682cfbdfe192eed69b Reviewed-on: https://gerrit.libreoffice.org/58040 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-17tdf#79878 perf loading docx file, disable SAX threading for writerNoel Grandin
since it seems to cost us 20% performance Change-Id: Ic4796ee3756c8c722feb4851dc48a99e882ba0fe Reviewed-on: https://gerrit.libreoffice.org/57545 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-15cppcheck: useInitializationList in writerfilterJochen Nitschke
Change-Id: I4bbd2b4d3a4bba23936bd25a02cff011448e66f9 Reviewed-on: https://gerrit.libreoffice.org/57453 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-07-12Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories w* x* Change-Id: I27bff44da3d34d24262031c7489e755311599bc5 Reviewed-on: https://gerrit.libreoffice.org/57307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-10tdf#79877 perf loading docx file, writerfilter/ improvementsNoel Grandin
this improves load time by 20%. We switch from shared_ptr to tools::SvRef to manage the objects I noticed some double inheritance like this: DomainMapper LoggedProperties Properties SvRefBase LoggedTable Table SvRefBase so to be safe I made all the ref-count-base-class inheritance virtual. Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd Reviewed-on: https://gerrit.libreoffice.org/57022 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-08tdf#79878 perf loading docx file, sax improvementsNoel Grandin
these are the smaller improvements, they make about 5% worth of difference - use std::vector instead of std::deque - use std::move on pendingCharacters instead of copying - in FastAttributeList::add, when reallocate the buffer, allocate twice the existing size, instead of increasing to only what we need - in FastAttributeList, create getAttributeIndex and friends, so we can avoid iterating the attribute list more often than necessary Change-Id: I3e3380ea50b77c6845b66e83404e245778ec06eb Reviewed-on: https://gerrit.libreoffice.org/57021 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29Improved loplugin:redundantcast (const-qualified typedefs): writerfilterStephan Bergmann
Change-Id: I389287456feba683c6af650546931325e4a6f3ba Reviewed-on: https://gerrit.libreoffice.org/56707 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-29loplugin:unusedfields-in-constructor in variousNoel Grandin
Change-Id: Ie0fb647938e3cf730976fb2e435b92bfd67ef645 Reviewed-on: https://gerrit.libreoffice.org/54998 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25Improve re-throwing of UNO exceptionsNoel Grandin
(*) if we are already throwing a Wrapped*Exception, get the exception using cppu::getCaughtexception. (*) when catching and then immediately throwing UNO exceptions, use cppu::getCaughtException to prevent exception slicing (*) if we are going to catch an exception and then immediately throw a RuntimeException, rather throw a WrappedTargetRuntimeException and preserve the original exception information. Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558 Reviewed-on: https://gerrit.libreoffice.org/54692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29tdf#112886 ooxmlimport: skip useless footnote placeholderJustin Luth
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-19coverity#1430069 silence Uninitialized scalar fieldCaolán McNamara
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-13tdf#116179 Support reading "auto" colour from docxLuke Deller
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>