summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2017-11-21Introduce and use ScCellShell::HasClipboardFormat(), tdf#50746 follow-upEike Rathke
Intead of gathering all possible formats just to check one.. Change-Id: I80f3a2c957492c9f72084c69b867aaccfbdd0530
2017-11-21tdf#113571, tdf#32213, tdf#50746: Make "paste unformatted text"Serge Krot
Added check for availability of the SotClipboardFormatId::STRING_TSVC that could be used instead of SotClipboardFormatId::STRING. Change-Id: I03de4500affb71270b501b12c14287037cea7c3c Reviewed-on: https://gerrit.libreoffice.org/44975 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-11-21Adapt documentation to realityEike Rathke
Change-Id: Ia773da1fb1c0af0855321ce88c488a5b86c7cf92
2017-11-21Keep number format on string cell content Undo, tdf#103234 follow-upEike Rathke
Change-Id: I18c281211e6eeb4816da13972c360df85d577491
2017-11-21Invert logic of ScSetStringParam::* enum value checks, tdf#103234 follow-upEike Rathke
In preparation for adding a new enum value to keep existing formatting in any case. Change-Id: Ic15a900adba0281d1267d95f821e1e898f80f566
2017-11-21WaE: C4334: '<<': result of 32-bit shift implicitly converted to 64 bitsTor Lillqvist
Change-Id: I6e30bd1b77f0f7df01571c9f497cbde1380e73be
2017-11-21Move token-cache for doubles to ScInterpreterContext...Dennis Francis
...from ScInterpreter and in the s/w interpreter, create a ScInterpreterContext for each thread for passing into per thread ScInterpreter constructor. Change-Id: I4e0abce043c7e1e70859efb2e5001fc284f416a9
2017-11-21Type check the tokens before reuseDennis Francis
If the exisiting token is of wrong type, create and use a fresh new token instead. Change-Id: I348b0972306497dfe7eae0655c9b93d5830cb740
2017-11-21cache FormulaToken for doublesDennis Francis
Change-Id: Ic0b4dff6f03ef3f88bd150e798fa2d83dfb0f486
2017-11-21halve thread count if HT active for group interpreter tooDennis Francis
Change-Id: Iacc93122191152183127500a4172358a14e96c8b
2017-11-21halve the number of threads if HT is activeDennis Francis
added hasHyperThreading() function to tools::cpuid to detect hyperthreading. Change-Id: I13fab4b6c649e681c329b7e3f4c9f36bda879d84
2017-11-21Avoid ScTokenArray thrashDennis Francis
Allocate ScTokenArray object only once per worker thread, fill it for the first row/cell and reuse them for subsequent rows/cells if possible. Change-Id: If8f20da618938d0e189224f189b4763815702e10
2017-11-21Thread the software interpreterDennis Francis
Also introduce new state ScFormulaVectorState::FormulaVectorEnabledForThreading to indicate that using the “traditional” vectoring is disabled, but threading should be tried. Change-Id: I552d9e29e1ab9e5721534e07f4a45fdd5a23f399
2017-11-21Add OFFSET to blacklist for threaded calculationTor Lillqvist
Change-Id: Ia1aaf40aa4e8e6f41ca190272365528bf37bf130
2017-11-21Add INDIRECT to blacklist for threaded calculationTor Lillqvist
Change-Id: I9a2066c396802551c3eda2c8db32b6d1a4171dfd
2017-11-21Check whether ScTokenArray::CheckToken() has disabled threading of the groupTor Lillqvist
Otherwise the aThreadedCalcBlackList check in CheckToken() has no effect, we would still attempt the threaded code path. Change-Id: I08dc2dd174459615ab8a11dbb819e39fc5437d10
2017-11-21Avoid unused private field warning in the NDEBUG caseTor Lillqvist
Change-Id: I5e37b9a8325af35a15c01409f9eaa2f92459cc28
2017-11-21Move ScDocument::GetNonThreadedContext() inlineTor Lillqvist
Did not have any impact on performance, though. Change-Id: I7e769b4a74e0ff9e0aabfb7e291fc4b987441954
2017-11-21Make threaded calculation the default (when OpenCL is not used)Tor Lillqvist
Introduce a configuration setting to turn it off. For now, can also be turned off with the environment variable SC_NO_THREADED_CALCULATION, but that is probably not something we want to keep or guarantee staility of. (LO looks at way too many environment variables already.) Change-Id: I469cde259eda72cc2d630814a25f707f1210b0ab
2017-11-21Need more ScInterpreterContextsTor Lillqvist
Change-Id: I1dd679156661bb5cb025ca6cb46d19783524d5a4
2017-11-21-Werror,-Wunused-parameterTor Lillqvist
Change-Id: If10c6a58f5b6f196f3644f6c592dd6d1dc0d860c
2017-11-21-Werror,-Wsign-compareTor Lillqvist
Change-Id: Ide03e0ae1fe97e1a09a767908a981a1e803a3474
2017-11-21Introduce ScInterpreterContextTor Lillqvist
Possibly later things that need to be thread-local can be handled through the ScInterpreterContext. Why handle some thread-local things through the ScDocument::maNonThreaded and ScDocument::maThreadSpecific mechanism, and others through this ScInterpreterContext? Good question. Share SvNumberFormatter across worker threads and use mutex to protect SvNumberFormatter::IsNumberFormat() Change-Id: I372e5fbd9a19785f55f0faf4a4bedc5fc1ef3e03
2017-11-21Disable formula group threading for macros and table opsTor Lillqvist
Those are likely highly problematic to do in parallel. Change-Id: I50cc32eb72f6b7951d247ecd787b2942cd7d9163
2017-11-21Move nInterpreterTableOpLevel back to ScDocumentTor Lillqvist
Change-Id: I4de0051d9fa5de9147954c6021d47076145a3e59
2017-11-21Move nMacroInterpretLevel back to ScDocumentTor Lillqvist
Change-Id: I48748434c845af963af160f8bbd75e4ab7ce95bd
2017-11-21Move nInterpretLevel back to ScDocumentTor Lillqvist
Move the calls to increment and decrement it out of InterpretTail(), to those call sites that aren't reached during parallelized calculations. Use unique_ptr for pInt in StackCleaner Change-Id: Ie1bd03dd62aea5f6c71c383df21afff29391dade
2017-11-21Re-work how the thread-specific data in ScDocument worksTor Lillqvist
We can use normal thread_local data for it as a thread can only be acting on one ScDocument in parallelized formula group calculation anyway. Use separate data instance for the non-threaded data, and when a thread starts, copy that to the thread-specific data. Change-Id: I3e58320a728d1c5639a8a078748b3d4d7a451b25
2017-11-21Move some of the fields in ScDocument into a thread-local structTor Lillqvist
This is part of the work to enable having several ScInterpreters working on the same object in parallel. Perhaps a more thorugh re-factoring would be better, maybe these fields should not be part of ScDocument at all, but part of ScInterpreter? Without this change the parallelism unit test occasionally fails. Change-Id: I70500b4d2b513e134d22b4b98c84a3ec00dad291
2017-11-21Guard pFormatExchangeList from mutation during threaded calculationTor Lillqvist
Change-Id: I645630fae8a5fcd09d8af4c4ec9aac94edbd2f25
2017-11-21Guard pValidationList from mutationTor Lillqvist
Change-Id: I9bd889523b5e5374776d94534ae2171e7a5a635d
2017-11-21Guard pColorList from mutationTor Lillqvist
Change-Id: I53a13bebf018c15a1d94c15adbfa7b68632c77b0
2017-11-21Use explicit flag to indicate threaded formula group calculation being activeTor Lillqvist
Don't just check whether we are in the "main" thread, as that is not true in the tiled rendering unit test, for instance. Change-Id: I4f3ca1a1b1cb3c92856104fffe8100f18cd7b66c
2017-11-21Assert that we don't call MaybeInterpret() in a threaded calculationTor Lillqvist
Change-Id: Ied03498333ee531e6e31e05fa2734056673364f2
2017-11-21Guard mpDrawLayer from mutationTor Lillqvist
Change-Id: I8b9a4680691d47732be2dd159ffc5d56d12a7a95
2017-11-21Guard mpShell from mutationTor Lillqvist
Change-Id: I7c12301f5a435dfca733b5f87b4b083f98a5292a
2017-11-21Guard mpNoteEngine from mutationTor Lillqvist
Change-Id: I174bca167379b96083476a394d8ff5d7f00a8021
2017-11-21Set fill-column in Emacs mode lineTor Lillqvist
Change-Id: I102b02e93ff06f3e53b9a1194277f5a6fae9f1ed
2017-11-21More work on the ScDependantsCalculatorTor Lillqvist
Might now actually do what it should. Change-Id: Ibf38560a37910924c4fade79cbbf4553d6dbd077
2017-11-21Use a static const bool when checking an env var for existenceTor Lillqvist
2017-11-21Make formula group weight take number of cells referenced into accountTor Lillqvist
And not just the number of rows in the group. This means that even relatively short formula groups that calculate over large ranges of cells will be eligible for parallelized calculation. The weight of a formula group is the number of rows in the group times the weight of the formula. The weight of a formula is for now the number of cells referenced by all cell ranges in the formula, divided by 10. For instance, the weight of SUM(A1:B100) would be 20. If no cell ranges are used, the formula's weight is one. Change-Id: Ib77e403961d8f487d580eea6b901fa4f5e4102b0
2017-11-21Check whether it is the multi-threaded case explicitlyTor Lillqvist
Change-Id: I96bed3ebd90af9a8ab2c17b678384cf340ba2802
2017-11-21Bin some YAGNI codeTor Lillqvist
We don't do anything at the moment to check whether a formula group calculation thread "failed", I don't even know what it actually would mean. So just bin that code for now. Change-Id: Ie4b15a3c20169d08d338e255a71a139913528a16
2017-11-21Move formula tree manipulation out of multi-threaded parts of codeTor Lillqvist
Change-Id: I2f7e6fb747b6a74172a81f9db9bc210ef6a27342
2017-11-21Always create the DocumentLinkManager, avoids a mutation assertion failureTor Lillqvist
Change-Id: If968792c4b98afbe0cc956e9cab0bcfde47bf1c1
2017-11-21Add "mutation guard" API for ScDocumentTor Lillqvist
USe by adding a ScMutationGuard object to a section of code that shouldn't be run during threaded calculation of a formula group in any of the calculation threads. There are currently several "classes" of mutation as bits of ScMutationGuardFlags, althouh I am not sure whether that will be useful, so far I use just the one same (CORE) in all cases. Currently implemented using mutexes. Possibly a simple bool field in ScDocument would be enough, the multiple flags and mutexes might be over-complicating it? Maybe I misunderstood what I want. Add such mutation guards for some fields of ScDocument. Change-Id: If2a8223c49d36143f2984e0449798271f2b6440d
2017-11-21First steps for Calc parallelismTor Lillqvist
For now, formula group calculations are done in parallel threads when 1) OpenCL is not used, and 2) the environment variable CPU_THREADED_CALCULATION is set. This commit is a surely broken first step and does not actually work that well at all. Change-Id: Ia7e5019703ba89bff0695faef0f7504765061149
2017-11-21tdf#103234 undo replacing text with formulaCaolán McNamara
if this isn't what we want, then presumably ScSetStringParam shouldn't exist here at all Change-Id: I17318c38948bc19b7148276935830f83356c7ed2 Reviewed-on: https://gerrit.libreoffice.org/45008 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-21clang-format fixesMiklos Vajna
Hopefully the last such commit, now that the in-gerrit verification is in place and also a warning is printed locally for those who push directly. Change-Id: Ib80cbca0b29dc7f71cbb182a38ad6839a659ff41 Reviewed-on: https://gerrit.libreoffice.org/45002 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-21TypedWhichId for SDRATTR* constants (2)Noel Grandin
Change-Id: I9926d55568f8b5bbc67f448bbf7fb660e74505fd Reviewed-on: https://gerrit.libreoffice.org/44964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>