summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2016-09-06remove outdated comment, getter not neededJochen Nitschke
DBG_CHKTHIS call was removed from Which() in commit d205ff49be10159d1766c2d06182c02255497def Change-Id: I4d5b806f0b0733ae3dc84c672ad9d6915d211f68 Reviewed-on: https://gerrit.libreoffice.org/28682 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-06use range based loops in SfxItemPoolJochen Nitschke
access arrays with [] try to clear up Delete() Change-Id: Ifcb741f56d263cf79c751aa6e32b410e6c22e6ef Reviewed-on: https://gerrit.libreoffice.org/28673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-04get index only when neededJochen Nitschke
GetIndex_Impl can't be USHRT_MAX for nWhich > SFX_MAX_WHICH bSID is true and GetIndex_Impl returns nWhich - pImpl->mnStart Change-Id: I392e544d65196b7af143ee1864f9065e92b717d1 Reviewed-on: https://gerrit.libreoffice.org/28665 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-09-02convert ppPoolDefaults to std::vectorJochen Nitschke
Change-Id: I13ba5b66f3ea70bae28181f580579c73a4353f68 Reviewed-on: https://gerrit.libreoffice.org/28599 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-09-01coverity#1372396 Uncaught exceptionCaolán McNamara
Change-Id: Idd2be5ba18d68ab9b5f7da12b69727480ad9ff50
2016-09-01coverity#1372381 Uncaught exceptionCaolán McNamara
Change-Id: I37fb1503737f81edb92a0571cc6222a69ba465c2
2016-09-01tdf#79398 Insert LCID in the correct sub-formatLaurent Balland-Poirier
During XL export, LCID is insert in format if necessary. If there are several sub-formats ([>0];[<0];[0]) this commit insert LCID in the correct one. Change-Id: I016c38a3338634113bfc0aa7e20e028e2e01e201 Reviewed-on: https://gerrit.libreoffice.org/28427 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-09-01use SfxItemPool::IsWhich instead of custom implementationJochen Nitschke
Change-Id: I56cbdc1ede491486643f73a98117c5cd4ce77c1d Reviewed-on: https://gerrit.libreoffice.org/28564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-01use IsStaticDefaultItem from poolitem.hxx instead of custom checksJochen Nitschke
Change-Id: Ic49a940d83e5b8944bd724203bb2045bb1eb22b9 Reviewed-on: https://gerrit.libreoffice.org/28567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-01use SfxItemPool::IsSlot instead of custom implementationJochen Nitschke
Change-Id: I435fb78f10f361120ee1865465dab93aa4661806 Reviewed-on: https://gerrit.libreoffice.org/28565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-01avoid warning in PoolItemTestJochen Nitschke
> warn:legacy.tools:19758:1:svl/source/inc/poolio.hxx:139: > Start-Which-Id must be greater 0 adapt ID range in the test and leave usage comment in SfxItemPool ctor params Change-Id: I93150be8d3d1e330c6574b9f8d05b3b1ef2ffa43 Reviewed-on: https://gerrit.libreoffice.org/28570 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-30loplugin:stringconstant: adapt to improved OUStringLiteral1 (svl)Stephan Bergmann
Change-Id: I5b9c503fd28209b893688e81ddd00eb843b44e37
2016-08-30tdf#96248 delete SfxPoolItems with Which Id >= 4000Jochen Nitschke
Which Ids > 4999 (SFX_WHICH_MAX) are Slot Ids and handled above. Which Ids >= 4000 and <= 4999 are used by EditEngineItemPool, defined in eeitem.hxx (values 3994 to 4048). the former hack prevented that some of PoolItems got deleted when RefCount dropped to 0. when trying to Remove the PoolItem again, an earlier assert hits. hack and comment are in source since initial commit, other referenced comment is nowhere to be found. Change-Id: I299b2ae4aed088d4ee438397d0bb91ca8d055cef Reviewed-on: https://gerrit.libreoffice.org/28429 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-08-30Let OUStringLiteral1 take its arg as ctor arg, not template argStephan Bergmann
...which makes it more flexible, can now also be used on non-const arguments. The drawback of the argument no longer being a compile-time constant is remedied by making the ctor constexpr. Change-Id: Ia4903a2cc86791fece92eac0cb8406b6659dd19d
2016-08-29Adapt loplugin:stringconstant to improved OUStringLiteral1Stephan Bergmann
Change-Id: Ibc5128df8bcf8cb5f2f09551c0de6dfdb46bdee0 Reviewed-on: https://gerrit.libreoffice.org/28447 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-08-29cid#1371226 Missing move assignment operatorNoel Grandin
Change-Id: I915b24d8f546f156b85ad18ad0418903fa3ce1ba
2016-08-27put StreamMode masks in scope of enum classJochen Nitschke
Change-Id: I77682f7e289a59b986bb84edf014029a20266470 Reviewed-on: https://gerrit.libreoffice.org/28420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-25tdf#100726 - Improve readability of OUString concatanationsGökhan Gurbetoğlu
Improved readability of OUString concatanations. Also removed unused OUStrings "sColor" and "sEntry" from the code. Change-Id: Ie9792f499cd880be72229f8a8c71f05ff8e258b6 Reviewed-on: https://gerrit.libreoffice.org/28375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-08-23rename rNum to aNatNumEike Rathke
... since it is a copied instance now. Change-Id: Ied3845cde42cb39ecabafa660d3ba7f6b1ca8b48
2016-08-23tdf#79398 Add LCID with DBNum during export to XLLaurent Balland-Poirier
Change-Id: I64a01ef5eb7ada9bc5edbeb873e09fd348d8f6d4 Reviewed-on: https://gerrit.libreoffice.org/28256 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-22tdf#101636 Test index before reading OUStringLaurent Balland-Poirier
Change-Id: I0a4c02b172fc6d3273f6aa2cca855c27705b4d68 Reviewed-on: https://gerrit.libreoffice.org/28282 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-19Resolves: coverity#705366 Mixing enum typesCaolán McNamara
and coverity#705367 Mixing enum types coverity#705371 Mixing enum types coverity#982694 Mixing enum types coverity#1027717 Mixing enum types coverity#1371228 Mixing enum types coverity#1371242 Mixing enum types coverity#1371280 Mixing enum types coverity#1371310 Mixing enum types MapUnit and SfxMapUnit share the same values and are freely cast from one to the other. Now that commit d30a4298bdb5ba53cd1fe659f2b742f218a2e527 Date: Thu Aug 11 15:02:19 2016 +0200 loplugin:unusedenumconstants in package..svtools removed the SfxMapUnit entries that were directly unused, they don't match anymore and casting from one to the other is dangerous. Why there was two of these anyway escapes me, get rid of SfxMapUnit and just use MapUnit universally Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e Reviewed-on: https://gerrit.libreoffice.org/28234 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-18loplugin:stringconstantTor Lillqvist
Change-Id: I6dd872afb8d96da2ceb09ee553795ae98d5c0d09
2016-08-18tdf#79399 tdf#101462 Add qa unit testLaurent Balland-Poirier
Test Native Number formats NatNum and DBNum Change-Id: I6e62586d9bfcc27162017291ee110cb70f85d425 Reviewed-on: https://gerrit.libreoffice.org/28098 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-18svl: no need to iterate in reverse order in GetRedoActionsInfo()Miklos Vajna
We have random access to the array after all, so the non-reverse order is OK as well, and it's more readable. Change-Id: I966a56ae2e161d95f56927be1b2a9f9162d0f7bb Reviewed-on: https://gerrit.libreoffice.org/28204 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-16Fraction Number Format: add UI/Sidebar optionsLaurent Balland-Poirier
Enable modification of fraction number format through dialog UI: - negative in red - "Decimal places" is replaced with "Denominator places" - leading zeros for integer part - thousand separator for integer part Update: options in Sidebar Thousand separator works, also for ' ' as thousand separator Change-Id: I0ed2952ed9cd8afb5444b44997526e5019a5858d Reviewed-on: https://gerrit.libreoffice.org/27268 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
2016-08-16loplugin:stringstaticStephan Bergmann
Change-Id: Icb05f681aa549a975ae4a1dee749e20ad4a215f0
2016-08-15properly move bLCIDInserted=true into the conditionEike Rathke
Change-Id: Iaad1b3cb2ee4e7dd293af00eb738cfd66c8b94d6
2016-08-15use SvNumberNatNum::IsComplete() instead of IsSet(), tdf#79398 follow-upEike Rathke
IsComplete() takes into account if the language was also set, output is transliterated only if complete. Change-Id: I1b7c2c8dbd308604c7af9aa5d1aa3ff0c1b436ca
2016-08-15tdf#79398 Export to XL DBNum codesLaurent Balland-Poirier
Change-Id: Ibe24b68b89909eecdf73fe4f7db19de26396194d Update: only if corresponding code exists Reviewed-on: https://gerrit.libreoffice.org/28090 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2016-08-15tdf#101462 tdf#79399 lcl_matchKeywordAndGetNumber returns integerLaurent Balland-Poirier
This prevent [DBNumX] format codes to be recognized Fix in the same time tdf#79399 (import of [DBNumX] from XL) Do NOT fix yet tdf#79398 (export of [DBNumX] to XL) Change-Id: I08817818bf0ff30b4704bb69b2ac9aa3890c7aa6 Reviewed-on: https://gerrit.libreoffice.org/28071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2016-08-12loplugin:unusedenumconstants in package..svtoolsNoel Grandin
Change-Id: I8136b93b9303ebecafd791159e813c335b1bc172 Reviewed-on: https://gerrit.libreoffice.org/28052 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-11Fix comments to match new reality: these are no longer optional parametersTor Lillqvist
Change-Id: Idf054aa4ef095ce37f05a01adf59cb450a6906c6
2016-08-11loplugin:countusersofdefaultparams in svl..unodevtoolsNoel Grandin
Change-Id: Ie3d2cf29e99b8a51b80246aafa23a92e6c3404b2 Reviewed-on: https://gerrit.libreoffice.org/28017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-09tdf#101096 tdf#101147 Add qa tests for minute/month detectionLaurent Balland-Poirier
Test number formats of bug reports Test odd date formats which do not follow Excel detection Change-Id: Iaa6d25a0103cae5e3ddd76075a324240aa255c35 Reviewed-on: https://gerrit.libreoffice.org/27494 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-09remove the duplicated system locale checkEike Rathke
... which is handled by LanguageTag::convertToLanguageType() anyway. Change-Id: I26656d64fdccf9c06d24c53e1e473e355732e00f
2016-08-09do not resolve system locale when queried, rhbz#1364406 relatedEike Rathke
When loading older documents that calculated a number format on the fly an inherited but default format of a type could had been applied using the fixed resolved locale instead of the default system locale, which then was stored upon save and remained sticky. This because a format the formula depends on already was applied using the resolved system locale. http://bugs.documentfoundation.org/attachment.cgi?id=78559 of tdf#63267 exhibits the behavior on the hidden sheet 'Festwerte' when unprotected and inspecting number formats in column A under Datum. Change-Id: If23908f259458e988c5164cc5e268bfc9a6a6bcd
2016-08-06another fraction format unit testEike Rathke
Change-Id: Ic33edb9ca34235d2e24e8b0b0d6455efd0f3076c
2016-08-05force integer display if numerator and denominator are equalEike Rathke
So with {# ?/?} format 1.96 is displayed as "2" insted of "1 1/1" Change-Id: I756deeb884d41726c7d476a236d3c68b89fe9cba
2016-08-05gtktiledviewer: expose undo/redo info in a repair document dialogMiklos Vajna
This shows the full undo and redo stack, with all the metadata available via the LOK API. Also fix SfxUndoManager::GetRedoActionsInfo(), so it's easy to show the undo/redo stack in linear time; and fix a use-after-free in lokdocview. Change-Id: I66625ed453efa61b5738d99d7d1ad8f468908240 Reviewed-on: https://gerrit.libreoffice.org/27913 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-05desktop: add undo/redo support to lok::Document::getCommandValues()Miklos Vajna
Expose the undo/redo stack and the metadata of each item. Change-Id: I66b81e855a945c97be3d491ed709959f310d4b73 Reviewed-on: https://gerrit.libreoffice.org/27905 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-05tdf#101147 New approach to fix minute/month detectionLaurent Balland-Poirier
Other formats may be differently interpreted HH YY/MM => Month expected HH DD/MM => Month expected Change-Id: Iabb17911bf2907c02b6b898052b6933692f8074a Reviewed-on: https://gerrit.libreoffice.org/27823 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-04svl: track creation time of SfxUndoAction instancesMiklos Vajna
It's not yet clear how to expose this on the UI, though. Change-Id: Iee6737922d36e896653b4fae557442747dda1b8b Reviewed-on: https://gerrit.libreoffice.org/27878 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-04svl: expose redo actions in SfxUndoManager::dumpAsXml()Miklos Vajna
To see if an undo action is actually deleted or just moved to the redo stack. Change-Id: I40632ea29353e50b643b8b1831d5ffdf443ca75a Reviewed-on: https://gerrit.libreoffice.org/27871 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-03svl: handle nullptr pWriter in SfxUndoManager::dumpAsXml()Miklos Vajna
This is useful when it's called from gdb for Calc. Change-Id: I22b3e5bbfc5627bff27899a288f7c25179f750ec Reviewed-on: https://gerrit.libreoffice.org/27836 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-02break the Excel rule for YMD and DMY, tdf#101147 follow-upEike Rathke
Clearly in {HH YYYY-MM-DD} the MM should not be minute. Also not in {HH DD.MM.YY}. Don't follow every bullshit. Period. It is debatable how to treat MDY, {HH:MM DD/YY} should be different from {HH MM/DD/YY}, Excel ironically takes both as minute, even in an en-US locale. Change-Id: I13d39a36294e3c40cc0e9bf72026804b299bb264
2016-08-01svl: implement SfxUndoAction::GetViewShellId() interface in SfxListUndoActionMiklos Vajna
Client code in sw, sd, sc and svx is adapted, the rest is just a placeholder for now. With this, e.g. the undo item for Writer's insert comment properly tracks which window was used for the insertion. Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab Reviewed-on: https://gerrit.libreoffice.org/27781 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-01tdf#101147 Improve (again) minute/month detectionLaurent Balland-Poirier
For format like HH:MM:SS MM/DD second MM is detected as minute: see tdf#95339 New rules: - first M following each H is minute - first M following first S is minute Detection Month/minute now fully compatible with Excel even with unwanted detection: SS:MM:HH DD/MM/YY second MM is minute even if user would expect month Change-Id: Ia789fbc2dbd6d2dcbe9b9c34d3f288674966dd10 Reviewed-on: https://gerrit.libreoffice.org/27560 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-29svl: add SfxUndoAction::GetViewShellId()Miklos Vajna
In preparation of a Writer version that overrides this and remembers which view shell introduced which action. Change-Id: I4970f8ce9c56f1b57ab1ae92f3ea8be804ca27bf Reviewed-on: https://gerrit.libreoffice.org/27682 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-29loplugin:countusersofdefaultparams in store..svtoolsNoel Grandin
Change-Id: I15b4400bddc5a4d0e3de5dfffe18b7e493f97df6 Reviewed-on: https://gerrit.libreoffice.org/27580 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>