summaryrefslogtreecommitdiff
path: root/sc/source/ui
AgeCommit message (Collapse)Author
2017-10-03tdf#112842: UI enable/disable leadingzeroeslabelXisco Fauli
Change-Id: I73c617c1416628d094b8ee5794f43e16b77681d3 Reviewed-on: https://gerrit.libreoffice.org/43058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2017-10-03convert TPB_DISPLAY_NAME constants to scoped enumNoel Grandin
Change-Id: I0e4f9ce3392e48fc82c232ba3e6581f3b0d9af9f Reviewed-on: https://gerrit.libreoffice.org/43083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-03convert WB_FORCECTRLBACKGROUND to bool field on EditNoel Grandin
Change-Id: I7a8731635bd22926df98cd70c8bb850408c1854c Reviewed-on: https://gerrit.libreoffice.org/43076 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-03new loplugin:blockblockNoel Grandin
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-02Remove undefined elements after std::uniqueJan-Marek Glogowski
Change-Id: Ifebd1124fa081d50797904175d90e6d26d50ab7f
2017-10-02lok - sc: row/column headers are updated fasterMarco Cecchetti
Now the computation of the row/column headers data exploits the cached row/col positions in HeightHelper/WidthHelper. That makes updating row/column headers at the bottom of the document as fast as at the top even for very big spreadsheets. Change-Id: I27381b520aaed68662e4d07c5879046d182c70e6 Reviewed-on: https://gerrit.libreoffice.org/40451 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02lok - sc: make computation of cell cursor position fasterMarco Cecchetti
Now the computation of the cell cursor position exploits the cached row/col positions in HeightHelper/WidthHelper. That makes navigating through arrow keys independent from the current cell cursor position: the cell cursor position is updated at the bottom of the document as fast as at the top even for very big spreadsheets. Change-Id: I2f23d4439f2157e702f09b56106bebdd0e0bbe86 Reviewed-on: https://gerrit.libreoffice.org/40450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02lok - sc: invalidation of cached row/col positions on several casesMarco Cecchetti
Cached row positions are invalidated when one of the following event occurs: - one or more rows are inserted - one or more rows are deleted - one or more hidden rows are made visible - one or more visible rows are made hidden - one row is resized - optimal row height is changed - the value of the PPTY parameter is updated - a undo/redo involving any of the above actions The same occurs for cached column positions. The solution takes care of row/column operations performed in another view and of the current tab each view is displaying Change-Id: I57895506b17986d36ab024eec9c79864ea95dad7 Reviewed-on: https://gerrit.libreoffice.org/40449 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02lok - sc: document size as sum of row heights/col widths in pixelMarco Cecchetti
Grid lines, cursor overlay, row/col headers are all computed by summing up row heights / col widths converted to pixels. On the contrary the document size was converted to pixel only at the end after having summed up heights/widths in twips. All that lead to have a document height/width greater than the position of the last row/col, with the scrolling in online going unplesantly far beyond the last row/column. This patch change the way the document size is computed, so that the spreadsheet height/width matches the position of the last row/column. Moreover it exploits the cache-like structure for row/col positions introduced in a previous commit. Change-Id: Ibb2cc6a7b592e359a0b1202dc9bea1dd4c421354 Reviewed-on: https://gerrit.libreoffice.org/40448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02lok - sc: a cache-like structure for row/col positions in the documentMarco Cecchetti
ScPositionHelper provides the ability to insert (and remove) row- position pairs where the position is in pixel and related to the spreadsheet top. In this way one can compute a new row position by starting from the nearest row presents in this cache-like data structure. It offers also the ability to invalidate the cache by removing all cached data below a given row or position. This data structure can be used for columns, too. Change-Id: Ifd66a003680ef9a3babf46ae952221c04451be9a Reviewed-on: https://gerrit.libreoffice.org/40447 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02lok: sc: overlays and edit view misplaced by other view actionsMarco Cecchetti
The edit view, the cell cursor and the cell selection overlays become misplaced when another user inserts, deletes or resizes a row. The same is true for columns. The solution takes care of the current tab each view is displaying and of undo/redo actions. Change-Id: I24c94f774f3b18028c9356a904e1b14b07c5c61a Reviewed-on: https://gerrit.libreoffice.org/40016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2017-10-02consistently apply std::unique_ptr to SvLBoxButtonDataCaolán McNamara
Change-Id: I307c9095aa562348ce1b9338203995d9d62eebb4 Reviewed-on: https://gerrit.libreoffice.org/43037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-01Replace list by vector in macromgr.cxx (sc)Julien Nabet
Change-Id: I5b57d4f4a1e0c68fdc56d84392f4b1472a67e82b Reviewed-on: https://gerrit.libreoffice.org/42992 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-09-30work around clang-cl ABI bug PR25641Stephan Bergmann
<https://bugs.llvm.org/show_bug.cgi?id=25641> "clang-cl: vtordisp thunks not emitted for functions with class template specializations in their signatures". Change-Id: I4f9a9777ba7486a026cb3b34340fa5b78f210f05 Reviewed-on: https://gerrit.libreoffice.org/42949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-29convert IsEqual/etc methods on ESelection to operatorsNoel Grandin
Change-Id: Ia8424e701b6f22d0536ee7f3bdb0ecaaed94a3b9 Reviewed-on: https://gerrit.libreoffice.org/42904 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-29loplugin:flatten check for throw in then clauseNoel Grandin
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-28Remove dead code behind Calc "Live Data Streams" dialog's "scriptdata" buttonStephan Bergmann
...that has been disabled and hidden ever since 4c90ed782a09e2e4b8738b82028032c42d1a203d "Actually hide these two radio buttons (since there is no choice now)." This removes the sole user of SvScriptStream. (Unfortunately, removing the no longer needed #include <osl/process.h> from include/tools/stream.hxx triggered an avalanche of missing includes elsewhere.) Change-Id: I7b0e683b14c0eaf7f4737f62adc9d691826380c0 Reviewed-on: https://gerrit.libreoffice.org/42916 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-09-27Resolves: tdf#112523 do not use anything Ascii in UI contextEike Rathke
Change-Id: I0854f7b1e6e0bf51d8b4c7d846fad9b0ff25e763
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-26loplugin:flatten in scNoel Grandin
Change-Id: I40653af2d90ef123cf77d7223c520cba0e5a3aca Reviewed-on: https://gerrit.libreoffice.org/42661 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-25Rename GetSelectEntryCount -> GetSelectedEntryCountSamuel Mehrbrodt
Change-Id: I405b347b404ed0acb3b6a0204e0b914a7698ce25 Reviewed-on: https://gerrit.libreoffice.org/42284 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-09-24tdf#112388 make aComboButton release its ScGridWindow outputdeviceCaolán McNamara
Change-Id: I938e36dda7fbc3b769b3fba8fd9a7d5d9b8e248c Reviewed-on: https://gerrit.libreoffice.org/42716 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-24tdf#106762 Base SvxColorToolBoxControl on svt::PopupWindowControllerMaxim Monastirsky
This allows us to support tearoff without breaking gtk3/wayland. SvxColorWindow no longer inherits from FloatingWindow, so several call sites need also to be changed to use DockingManager. Change-Id: I5d0bc611bbd2a8b9bfd4335212d0ae7e8fc10593
2017-09-22loplugin:flatten in pyuno..scNoel Grandin
Change-Id: I7ddc0b76532d26910f78642200750459508c2861 Reviewed-on: https://gerrit.libreoffice.org/42617 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-22Bin leftover SAL_DEBUGTor Lillqvist
Change-Id: I452909cc1f0529ecb24b1f705a86a0a8bc1a3c9f
2017-09-21Rename GetSelectEntryPos -> GetSelectedEntryPosSamuel Mehrbrodt
Change-Id: I0bd4cb463575af843c72d9c8aaf91742203532a4 Reviewed-on: https://gerrit.libreoffice.org/42283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-09-21Rename GetSelectEntry -> GetSelectedEntrySamuel Mehrbrodt
Change-Id: Ibb7d8c59c0e61b0e87455bd78f241d8691dd9dce Reviewed-on: https://gerrit.libreoffice.org/42282 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-09-20Resolves: tdf#99477 freeze first col/row always set a freezeEike Rathke
The previous implementation had the odd behavior that Freeze First Column and Freeze First Row removed any frozen state (column or row) if there was one, instead of freezing the actually selected choice. Changed to * Freeze First Column * always freezes the first column * removes another column freeze if there was one * keeps a row freeze if there is one * checks the Freeze Rows and Columns toggle box * Freeze First Row * always freezes the first row * removes another row freeze if there was one * keeps a column freeze if there is one * checks the Freeze Rows and Columns toggle box * Freeze Rows and Columns * freezes at the current cell cursor position if there was no freeze (toggle box was unchecked) * removes any freeze if there was one (toggle box was checked) Change-Id: I38c4b6f0486ef8e93da0bb3a69a99e5c7709a21e Reviewed-on: https://gerrit.libreoffice.org/41908 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-09-19ofz: disable more config related codeCaolán McNamara
Change-Id: I2458000c5d46a371cec0a17fb0bfd86a2444dc42 Reviewed-on: https://gerrit.libreoffice.org/42472 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-19ofz: survive missing configCaolán McNamara
Change-Id: Ie09544ffefcd1789aef7a7f6193aaaddd3ad1896 Reviewed-on: https://gerrit.libreoffice.org/42467 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-19ofz: survive missing configCaolán McNamara
Change-Id: I9d05602b6e3af2bb54e1c82668090d71153b3c9d Reviewed-on: https://gerrit.libreoffice.org/42463 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-18ofz#3412 SYLK import: check ;X;Y;C;R col/row validity earlyCaolán McNamara
Change-Id: I91fcd2571e528201e01467f3bcdbbff30cdfb50c Reviewed-on: https://gerrit.libreoffice.org/42423 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-18convert SvxDateFormat to scoped enumNoel Grandin
And simplify the code in sd/headerfooterdlg, no need for the complex encoding of date and time when we can just index into a static array. Change-Id: I677400bf1f956c81eba665b71dbda9183b63f55c Reviewed-on: https://gerrit.libreoffice.org/42346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-16convert SvxTimeFormat to scoped enumNoel Grandin
and make the numerators look more like our internal formatting codes Change-Id: I3b3d448cec913e72c7ffb6cc3e7754241af36d93 Reviewed-on: https://gerrit.libreoffice.org/42345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-16convert SvxTimeType to scoped enumNoel Grandin
Change-Id: Ic5ca8c50ccd74837cd0521a13e1f5eaa8e326ff3 Reviewed-on: https://gerrit.libreoffice.org/42344 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-16convert SvxURLFormat to scoped enumNoel Grandin
Change-Id: Ie2199cf0bcfb6d649f8aa33325ab645b18e7c000 Reviewed-on: https://gerrit.libreoffice.org/42343 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-15Fix loplugin:redundantcast's VisitCXXFunctionalCastExprStephan Bergmann
...when t1 is ElaboratedType sugar (which isn't only used when the type is written with an elaborated type keyword, but also when it is written with a qualified name). (I originally wrote testArithmeticTypedefs to track down a different issue, which turned out to be a non-issue, with this fix as fall-out. So that test doesn't quite match the theme of this commit, but is a worthwhile addition nonetheless.) Change-Id: Ic447da4399853d7d045e3e2e7ade8ddf52d89749
2017-09-15borderline: Extended decomposeArmin Le Grand
Decompose of BorderLinePrimitive2D extended to take care of non-perpendicular line endings for matching. Improved matching, one error in calc fixed Change-Id: I869a75385711b58e6725daba0f22be8a98158ad9
2017-09-15borderline: Adapt ViewContactOfTableObjArmin Le Grand
Adapted to usage of svx::frame::Style helpers for primitive creation, need much less SvxBorderLine classes and less overhead. Class SdrBorderlinePrimitive2D completely removed. Working on Array::DrawRange to get it using the Coodinate Systems which are available and include the rotation. Solved problems in BorderLinePrimitive creation in DrawRange and DrawArray by completely restucturing these. Also changed to now return a sequence of primitives to the caller instead of handing over a primitive renderer and using it for each single primitve. This is a preparation for later buffering these and not re-create for each paint. Have now a working version that uses the Cell used by the Style and creates all info on the fly, so that the correct coordinate systems will be used. Works in Calc and it's dialogs with one or multiple cells.
2017-09-15borderline: Abstraction of BorderLinePrimitiveArmin Le Grand
As preparation for more detailed definition of BorderLine primitives I have adapted the BorderLine definition to work with motre possibilities to define the LineStartEnd definitions in a BorderLineExtend class. That one is flexible to hold all kinds of definitions - from none to all four possible extends (Start/End, Left/Right of vector) Cleanup of DiagStyle and others: DiagStyle is not needed anymore due to no longer using angles calculated, but being based on vectors defining the geometry. Also cleaned up quite a bit of no longer needed calculation stuff for the control.
2017-09-15convert SvxFileType to scoped enumNoel Grandin
Change-Id: Iec1c67f7f0f9b2244b1d6ef52921ddd09f944fbb Reviewed-on: https://gerrit.libreoffice.org/42314 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-15convert SvxFileFormat to scoped enumNoel Grandin
Change-Id: Ia75c86a89c89bb22759e1d588ce603701cb7fad5 Reviewed-on: https://gerrit.libreoffice.org/42313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-15convert SvxCellVerJustify to scoped enumNoel Grandin
Change-Id: I9d1cdb4ddfee43b7a0990624d7d16e06679343c4 Reviewed-on: https://gerrit.libreoffice.org/42276 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14improve redundantcast lopluginNoel Grandin
to find c-style casts where the expression is a templated method Change-Id: Ifbd1e2cdc72d906fc95a7ec0f9408c3f6d2a836b Reviewed-on: https://gerrit.libreoffice.org/42275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14ofz#3362 SYLK import: check ;X;Y;C;R col/row validity earlyEike Rathke
Change-Id: I37d5ce67f975b6b89c4b8a9baefae2467da2eb84
2017-09-14convert SvxCellOrientation to scoped enumNoel Grandin
Change-Id: Ia4c75c6394b47805f24a7daca593e0074a8ddf0b Reviewed-on: https://gerrit.libreoffice.org/42268 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14simplify calls to IsStreamValid/SetStreamValidNoel Grandin
just add a short-circuit check inside SetStreamValid, and we can simplify all of the call sites Change-Id: Ib3d19455c60fe9569faf548b1fefbc274d03574c Reviewed-on: https://gerrit.libreoffice.org/42267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13no need to call GetNumerator() / GetDenominator() for FractionNoel Grandin
simplify the calculations - why have a Fraction and then just split it up for the calculation? Change-Id: I81af95e1ee1633f77e088c0990f308b1c169a6a2 Reviewed-on: https://gerrit.libreoffice.org/42242 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13Fraction: make conversion operators and constructor explicitNoel Grandin
and simplify some of the calculations that needed to be changed. Which resulted in one unit test needing to change by one pixel, let's hope not an indication of a real problem. Change-Id: Ie56434f35f4e58d21ee6f671392e93dc7542fca3 Reviewed-on: https://gerrit.libreoffice.org/42240 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13Enable -Wunreachable-codeStephan Bergmann
...motivated by <https://gerrit.libreoffice.org/#/c/41565/2> adding dead code at the end of a switch statement, after the last case's "break". -Wunreachable-code appears to work well on Clang, while it appears to have no effect on GCC. Most of the affected places are apparently temporary/TODO/FIXME cases of disabling code via "if (false)", which can be written with an extra set of parentheses as "if ((false))" to silence -Wunreachable-code on Clang (which thus needed loplugin:unnecessaryparen to be adapted accordingly). In some cases, the controlling expression was more complex than just "false" and needed to be rewritten by taking it out of the if statement to silence Clang. One noteworthy case where the nature of the disabled code wasn't immediately apparent: Sep 12 16:59:58 <sberg> quikee, is that "if (false)" in ScExponentialSmoothingDialog::ApplyOutput (sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx) some work-in- progress or dead code? Sep 12 17:02:03 <quikee> sberg: WIP, but you can remove it Sep 12 17:04:47 <sberg> quikee, I'll wrap the false in an extra set of parentheses for now, to silence -Wunreachable-code (I wouldn't want to remove it, as I have no idea whether I should then also remove the "Initial value" comment preceding it) Sep 12 17:07:29 <quikee> sberg: both are different ways to calculate the "intital value"... so no Another case where the nature of the dead code, following while (true) loops without breaks, is unclear is sd/source/ui/remotecontrol/BluetoothServer.cxx, where I added TODO markers to the workarounds that silence the warnings for now. basic/source/sbx/sbxvalue.cxx had a variable of type double, of automatic storage duration, and without an initalizer at the top of a switch statement. Clang warning about it is arguably a false positive. Apart from that, this didn't find any cases of genuinely dead code in the existing code base. Change-Id: Ib00b822c8efec94278c048783d5997b8ba86a94c Reviewed-on: https://gerrit.libreoffice.org/42217 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>