summaryrefslogtreecommitdiff
path: root/xmloff/source/core
AgeCommit message (Collapse)AuthorFilesLines
2016-10-24loplugin:expandablemethods in xmloffNoel Grandin1-8/+3
Change-Id: I995a4167ac4df5ca35d963dcf68ae802a997e1e1
2016-10-21loplugin:expandablemethodds in include/xmloffNoel Grandin1-1/+1
Change-Id: I6b1430220adaf240ef873ff908e3a767dfc278bf Reviewed-on: https://gerrit.libreoffice.org/30106 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-18loplugin:inlineablemethods in xmloffNoel Grandin3-19/+3
Change-Id: I22202f85c65a862ccdafe1d521e2945e3d99252a
2016-10-11loplugin:constantfunctionNoel Grandin1-4/+0
update the plugin similarly to commit 3ee3b36ae0c064fb5c81268d8d63444309d1b970 Author: Stephan Bergmann <sbergman@redhat.com> Date: Fri Oct 7 12:05:49 2016 +0200 loplugin:staticmethods: Don't be fooled by decls starting with macros Change-Id: I98ac3216d5acf89a49a26feb089ae2fd34e6e510 Reviewed-on: https://gerrit.libreoffice.org/29665 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-07loplugin:staticmethods: xmloffStephan Bergmann1-1/+1
Change-Id: Iad001ce011cd6aff4af9bb2e9129abee7fb935dc
2016-10-06xmloff: fix crash in ~XMLParaContext on fdo72541-1.fodtMichael Stahl1-0/+4
Change-Id: I3310699020bfea085eb62c50a7d5de25af51c1b1
2016-10-04this is used as a stack, so convert to std::stackCaolán McNamara1-18/+18
Change-Id: I248617ccbb985615f936ecd607ab7c8246ff8e71
2016-10-04we just care about empty vs nonempty hereCaolán McNamara1-17/+9
Change-Id: Ie7888f611f804ed1bd235e32e21560981f116c9a
2016-09-25tdf#101935 and tdf#102201:Mohammed Abdul Azeem1-2/+8
This fixes both the bugs. Change-Id: I7a64abc0cb12b5195a3b955549ce4f72f3530d57 Reviewed-on: https://gerrit.libreoffice.org/29263 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-16coverity#1372990 xmloff: use unique_ptr for RewindMapsMichael Stahl1-13/+13
Change-Id: I51e67607d94a465ce39e822f01a0c60efbf1a0f0
2016-09-13xmloff: invoke SvXMLImportContext destructor with proper namespace mapMichael Stahl1-11/+17
The recent pRewindMap fix revealed that the xContext object is destroyed too late so the destructors containing half the import code (because where else would you put complex logic that can fail?) are invoked with the namespace map of the parent element, which breaks RDFa import and JunitTest_sfx2_complex. (regression from 32ccb4ea863651c22bf33cc15012971d2a2d2810) Change-Id: I0c897ea0cae2db4d35f2ba19ba2f6e8026f1b3ec
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann6-10/+10
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13coverity#1372877 I'm guessing this is what might have been the intentCaolán McNamara1-6/+5
warning is 'Constant' variable guards dead code Change-Id: I06e65f576180d7ff62417828c26f969982788b55
2016-09-09use std::unique_ptrDavid Tardon1-9/+5
Change-Id: I8ba37267e8a7058ade54783ea0e117a8f8816c45
2016-09-09remove direct memory managementDavid Tardon1-28/+17
Change-Id: Ie5103347fc30095778d96d46ce702bf4f0da00a6
2016-09-09resolve the snafu with 2 separate refcounted basesDavid Tardon3-25/+40
Change-Id: Ia275596d54ea27436f03d01297fb78b6ca09e8a6
2016-09-07loplugin:constantparam in vcl..xmlscriptNoel Grandin2-5/+3
Change-Id: Icf66c08071b154259c9e551342d30331caf2b15a Reviewed-on: https://gerrit.libreoffice.org/28685 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-06use std::unique_ptrDavid Tardon1-36/+13
Change-Id: I0cc84cc6b18849118a2b7824a8e4b37ca063cd50
2016-09-06rewrite using a for loopDavid Tardon1-3/+1
Change-Id: Ia58651d011064e4d324e5e7851b681f4d13d41a7
2016-09-06drop unneeded dynamic allocationDavid Tardon1-38/+31
Change-Id: I9e19c33998137ee0065f92ccb980d1ff5a82115b
2016-09-05Fixes for migrating SvXMLImport to use FastParser:Mohammed Abdul Azeem2-31/+76
These are necessary for implementing fast interfaces for the contexts. Change-Id: I37655c85c76b42782a49eeea3140490213047341 Reviewed-on: https://gerrit.libreoffice.org/28641 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-09-02tdf101725 - fixed missing autotexts from StandardMohammed Abdul Azeem1-4/+4
Change-Id: I1f751888e5fc28b54f4e32344769d568433eb387 Reviewed-on: https://gerrit.libreoffice.org/28572 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-08-30fix copypastaDavid Tardon1-1/+1
Change-Id: I26a94dcc6339eceee685a2340cef5ff5ba595037
2016-08-29Make SvXMLTokenMap compatible with FastTokens:Mohammed Abdul Azeem1-51/+44
Added seperate map for fastToken and Token, to get token using only fastToken. Default values are derived for fastTokens from prefixKey and localName. Duplicate/ dummy tokens need to be overidden with different values. Change-Id: I17268754d8fd1bac29dd7bae05706ff20b8314ae Reviewed-on: https://gerrit.libreoffice.org/28415 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-26Make SvXMLTokenMap compatible with FastTokens:Daniel Sikeler1-8/+22
Added new methods for the fasttokens and a lot of entries must be updated in later commits. Change-Id: I37de9c8d4bdeb75f678902a422a5961670480562 Reviewed-on: https://gerrit.libreoffice.org/28355 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-25cid#1371771 Uncaught exceptionStephan Bergmann1-1/+1
Change-Id: I47105f30e702f9bc40cb711f862fb25796202d09
2016-08-23GSoC - First cut at migrating xmloff/ to use FastParser:Mohammed Abdul Azeem2-9/+266
This lays the foundation for using fast parser and contexts. Tokens are detokenized and made to emit events just like legacy parser interfaces. Change-Id: I11659be68026e112fdd06f8a847f3f2c876dae35 Reviewed-on: https://gerrit.libreoffice.org/28175 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-17loplugin:staticmethodsTor Lillqvist1-4/+4
Change-Id: I84fe6603010defcfae32250c86e75cf2237f64a1
2016-08-16tdf#100547 Save to ODF XY customized namesLaurent Balland-Poirier1-0/+2
Trendline equation: Following change 27069 https://gerrit.libreoffice.org/27069 Save customized names of X and Y variables in extended ODF Change-Id: Ie39487866f7671f4468a37f48847038fbd2cec2a Reviewed-on: https://gerrit.libreoffice.org/27233 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
2016-08-16GSoC - fix build of fasttokenhandlerMohammed Abdul Azeem1-3/+3
Change-Id: If561895da71e08bd9e58fce281c412d9f9206cad
2016-08-16GSoC - implement global tokenhandler for odf-tokensDaniel Sikeler1-0/+102
This generates perfect hash for odf-tokens and use them with the tokenhandler. With added test case to check to and fro mapping between tokens. This is taken from Daniel's work in feature/fastparser branch. Change-Id: I7cf77c1eb6c9dd68fd78108c6e0726507c7672e1 Reviewed-on: https://gerrit.libreoffice.org/28073 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-27tdf#100834 Extend ODF for integer/fraction delimiterLaurent Balland-Poirier1-0/+1
Any string can be used as delimiter between integer and fraction. It is now saved/loaded to/from ODF, as it was from XLS. Change-Id: Ie6364d1cdefc020ea615c18099118135c619f96b Reviewed-on: https://gerrit.libreoffice.org/27262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-27tdf#100755 Extend ODF to allow 0 in fractionLaurent Balland-Poirier1-0/+2
As '0' is now allowed in numerator/denominator this commit extend ODF to save/load this format Change-Id: I3bc897dcce5393453acd7a434a21ae305feeb919 Reviewed-on: https://gerrit.libreoffice.org/27263 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-13Remove __cplusplus-checks from apparently-C++-only filesStephan Bergmann1-4/+0
Change-Id: I87e9ce45cf945e75e8140a9d4608da8abcddada6 Reviewed-on: https://gerrit.libreoffice.org/27187 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-08Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendarEike Rathke1-6/+14
... implementing signed years with year 0 gap. Date(31,12,-1) last day BCE Date(1,1,1) first day CE New class Date member functions: * AddYears(sal_Int16) to be used instead of aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap. * convenience GetNextYear() to be used insted of GetYear()+1 * convenience GetPrevYear() to be used insted of GetYear()-1 * AddMonths(sal_Int32) * operator=(const css::util::Date&) New class DateTime member functions: * operator=(const css::util::DateTime&) Made some conversion ctors explicit, specifically Date(sal_Int32) Adapted hopefully all places that used a sal_uInt16 year to use sal_Int16 where appropriate. Eliminated some quirks in date handling found on the fly. Added era handling to i18npool icu calendar setting interface, which missing was responsible for 0001-01-01 entered in Calc being set as -0001-01-01, hence subtracting one day resulted in -0002-12-31. Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f Reviewed-on: https://gerrit.libreoffice.org/27049 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann1-2/+2
Change-Id: Ide1102f4dcc5f31de0f896b570fe453b8074454d
2016-06-27ODF import: add embedded pdf supportMiklos Vajna1-1/+5
The use-case is to have a .svm and .pdf alternative, need to pick .pdf from those. The test fails with any of the below commits reverted: - the xmloff part of this commit - fda68426374ed915783fd306c2f56463c757774a (ODT export: add embedded pdf support, 2016-06-27) - 878a860dff10bd91491d6c9f2f4e2308bfe4f0b2 (vcl: add initial PDF import-as-graphic filter, 2016-06-23) Change-Id: Id5b298d25a46af6ce7aa5f8c71a29c3914e1a7ce Reviewed-on: https://gerrit.libreoffice.org/26706 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-20GSoC Table Styles, Export Cell StylesJakub Trzebiatowski1-0/+8
Exporting cell-styles Exporting table-template To be able to map SwTableAutoFormat to table-template 1:1 extended table-template by the following elements: loext:first-row-even-column loext:last-row-even-column loext:first-row-end-column loext:first-row-start-column loext:last-row-end-column loext:last-row-start-column Added attributes describing box format to SwXTextCellStyle Change-Id: I2967ba461dfc6f030c1e5cdbba62e2673d3b232b Reviewed-on: https://gerrit.libreoffice.org/26185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-06-17convert DBG_ASSERT in xmloffNoel Grandin5-19/+19
Change-Id: I2f4bbbef451026fc34638e17fa29b6db2c14d850 Reviewed-on: https://gerrit.libreoffice.org/26191 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-14tdf#88206 Change use of cppu::WeakImplHelper*krishna keshav1-1/+2
Change-Id: I8562a69bf624902a54da004b0786cae2a98102e5 Reviewed-on: https://gerrit.libreoffice.org/26168 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-10o3tl::tryGet on a temporary is dangerousStephan Bergmann1-2/+2
...so rename to o3tl::tryAccess to make it more obvious that the returned proxy points into the internals of the given Any, and forbid calling o3tl::tryAccess on a temporary Change-Id: Ia412c6b2b06693811b9b7f0076a08bbf97142df9
2016-06-06remove some manual ref counting in svx and xmloffNoel Grandin1-11/+4
Change-Id: Ica0b6ff8ff7fa9e65cd758160d6e3ea7110ebb46 Reviewed-on: https://gerrit.libreoffice.org/25824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02New o3tl::try/doGet to obtain value from AnyStephan Bergmann1-6/+4
...in an attempt to reduce usage of type-unsafe void const * css::uno::Any::getValue() These new functions are often more convenient to use than the existing ">>=" and Any::get<T>. Note how they are careful to provide a pointer directly into the given Any, instead of creating temporaries. As an example, replaced most calls of getValue across xmloff: * Cases that first check for a specific type (via getValueType etc.) and then call getValue can instead call tryGet. (But beware that tryGet supports some conversions, which a check for a specific type may have missed---either intentionally or by accident. Also beware the somewhat common idiom of checking for TypeClass_ENUM and then using getValue to obtain a sal_Int32; this cannot be replaced with a call to tryGet.) * Cases that seem confident that the Any is of the correct type when calling getValue (but apparently are confident due to some higher-layer protocol, as the surrounding code does not do any checking via getValueType or similar) can instead call doGet. It throws an exception if it turns out the confidence wasn't warranted. (Many of the existing calls that directly dereferenced the return value of getValue as sal_Bool look suspicious, in that the author might have thought the given code would also cover a VOID Any---which technically it even would have happened to do. If any RuntimeExceptions thrown from these doGet calls start to crop up, these changes need to be revisited. Some may even be rewritten as uses of ">>=". But at least "make check" did not show any such problems. Also note that casting the value obtained from getValue to any css::uno::Reference<X> with X being anything but the base css::uno::XInterface was always prone to producing a bad pointer, in case the interface actually stored in the Any derived from X via multiple inheritance.) * Should there ever be cases where an Any is known to be of the requested type, some additional forceGet could be introduced (which would assert instead of throwing an exception). Change-Id: I2d8739e86314eff73abfcafe01d806f5bc5c34db
2016-05-30tdf#99661 Add max-denominator-value attribute to number:fractionLaurent Balland-Poirier1-0/+2
Add max-denominator-value attibute to <number:fraction> to comply with ODF 1.3 See https://issues.oasis-open.org/browse/OFFICE-3695 Specify loext or number according to ODF version This value is only used to stored the number of digits in numerator. No other values than 9, 99, 999,... are expected. Add loext:max-numerator-digits attributes to <number:fraction> to distinguish ??/?? and ##/## or any combination Not saved for ODF strict min-...-digits indicates the number of '?' max-...-digits indicates the total number of '?' and '#' This needs to be saved with both min-...-digits at least one because previous versions cannot have min-...-digits of 0. See tdf#38097 Change-Id: Ibd785579aa75edc315e3bd94935a146d82bbeeef Reviewed-on: https://gerrit.libreoffice.org/24903 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-05-30tdf#100134 xmloff: only update the progressbar twice for every percentMiklos Vajna1-3/+8
This restores the state before commit e1b78d36008d1fd188ca8dc154ad069d3476520c (#95181#; call the setValue method of the XStatusIndicator as often as possible to enable reschedule, 2001-11-26), which doesn't seem to be necessary anymore, perhaps due to the current scheduler that has priorities. Rather than a plain revert, still allow the progressbar to jump back, as that seems to be used relatively frequently. So just filter out the calls that would increment the value, but only with a small difference, compared to the shown value. Change-Id: I7136b20f1c64e267b0b4a35bbe2564e5163d9468 Reviewed-on: https://gerrit.libreoffice.org/25654 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-20clang-tidy misc-assign-operator-signatureNoel Grandin1-1/+2
Change-Id: I2953a88d9e2f5923732865ef17615d5928ac5f5f Reviewed-on: https://gerrit.libreoffice.org/25154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18clang-tidy modernize-make-sharedNoel Grandin1-2/+2
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a Reviewed-on: https://gerrit.libreoffice.org/25056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10Add SAL_FALLTHROUGH, where apparently appropriateStephan Bergmann1-0/+1
Change-Id: I646abf83b4dce8c92a3ba1c136d968bb9291dd83
2016-05-06xmloff: C++ is an imperative language, so let's write imperative loopsMichael Stahl2-39/+15
... instead of some over-engineered pseudo-functional boostified monstrosity. What the hell was the original author thinking? Change-Id: I64581b3f78792933373ed8f74ebbb38a8a27f1f8
2016-05-04use Any constructor instead of temporariesNoel Grandin4-31/+11
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a