Commit Graph

1680 Commits

Author SHA1 Message Date
2e363d1135 Remove ScToken from the formula::FormulaToken hierarchy
...to keep UBSan from complaining about illegal downcasts from FormulaToken to
ScToken (which were practically harmless, given that ScToken did not add any
data members).

Change-Id: I8fdc026eec363442cc4b720b71d65c972b4a4446
2014-10-23 09:30:10 +02:00
19d2f42119 Make ScToken::GetSingleRef etc. return * instead of &
...so that default implementations can return nullptr without further ado

Change-Id: Idc8778fe868efa00b1de597a54aa07a2e6fa3bc0
2014-10-23 09:30:09 +02:00
9ecac3874d Replace DISABLE_SCRIPTING with HAVE_FEATURE_SCRIPTING
Feature test macros that govern conditional compilation should be
defined in config_*.h include files, not on the compilation command
line.

Change-Id: I40575a4762fd2564f10927b6f38a112dd9f9a3d7
2014-10-22 09:30:23 +03:00
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
8044acf2db convert SFX_CALLMODE constants to SfxCallMode enum class
and fix a couple of bugs in SC and SW where the call mode was
being passed to the hints parameter by accident

Change-Id: Ief805410b3f7035e012e229e77f92d5832430f58
Reviewed-on: https://gerrit.libreoffice.org/11916
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-11 15:14:52 +00:00
7168096fdf Add DeleteCell to ScDocFunc, which is a variant of DeleteContents ...
for a single cell case.  This is equivalent of ScViewFunc::DeleteConents
with bSimple = true.

Change-Id: I5eccce21843f4cb21b29f96b0360617a180aebee
2014-10-10 20:36:29 -04:00
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
fcf953b8ec make streamtimeout a config variable instead of an env. var.
Change-Id: I6c82142265a0a149206d15fbc267ad61e6b9cf3b
2014-10-09 09:54:30 +01:00
9aa36a1ad3 Move this one to a common place too.
Change-Id: I7f4e007cfc861dc323b42be353c6ba11091e8fa1
2014-10-08 23:25:37 -04:00
7adef94b82 Share undo doc creation code.
Change-Id: I55f27b61637ba0284479c63c2fa48b0bd8938c0f
2014-10-08 23:24:58 -04:00
ed0e3fdcc1 Start sharing common code between DeleteContents of ScViewFunc/ScDocFunc.
The goal is to have ScViewFunc::DeleteContents() simply call
ScDocFunc::DeleteContents() while doing the view only stuff in the ScViewFunc
variant.  This is just a step toward that goal.

Change-Id: I2e574f9eb2b2be5340dbfb6f10739dfc2406faae
2014-10-08 23:24:52 -04:00
a8e2f3e845 coverity#1231670 Unchecked return value
Change-Id: I29a751b2d44e86ccf115015b0ede8bae2e702eea
2014-10-05 13:26:09 -05:00
dd617c0bbe New feature to allow converting formula cells to static values.
You used to have to convert formula cells to static values by copying
them and pasting them as values onto the original place.  Why not just
allow converting them in place?

This is something I've always wanted to implement.
2014-10-02 21:32:24 -04:00
fc04f76336 fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.

Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-01 07:34:23 +00:00
89c72084b2 sc: std::auto_ptr -> std::unique_ptr
Change-Id: I25468d578de597ff9aeba3ffc850c630fa532767
2014-09-30 17:51:30 +02:00
4e26b91568 remove unnecessary casts in misc calls to SvStream.Write*
left over from our conversion of the SvStream output operators
to more specific methods

Change-Id: Ib80032e8626f5476a89b958f590441994594f4e4
2014-09-26 15:27:18 +02:00
5501c8d222 remove unnecessary casts in calls to SvStream.WriteUInt16
left over from our conversion of the SvStream output operators
to more specific methods

Change-Id: I482ca7abb84613971e7e8f839f7aa67a65cd71ff
2014-09-26 15:26:48 +02:00
bec72dd34f remove unnecessary casts in calls to SvStream.WriteUChar
left over from our conversion of the SvStream output operators
to more specific methods

Change-Id: I2ea4c7d97e745b3e6a3834f41ac7bfefa4883c7a
2014-09-26 15:26:19 +02:00
d46b16e1e4 remove unnecessary casts's
left over from our conversion of the SvStream output operators
to more specific methods

Change-Id: I63f18be8e940098c2acbbc73ee49ede3a949fcb2
2014-09-26 15:25:40 +02:00
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
5fd4679e7b fdo#84009: Be sure to update the sheet index when moving the sort range.
Change-Id: Ic9ad51b33f6dfb6f90e76439c27eeff25ec4c7da
2014-09-19 09:13:26 -04:00
60e78fbb80 fdo#82577: Handle Font
Put the VCL Font class in the vcl namespace. Avoids clash with the X11
Font typedef.

Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-18 08:54:37 +02:00
9b37819adb Add loading document colors to Calc
Change-Id: I06783b04dbbad2aa690820af1ca2cf05a1004f20
2014-09-17 10:19:31 +02:00
ea733ab5b6 Turn SfxItemState into a C++11 scoped enumeration
...to gain further confidence in the claim "that none of the existing
code tries to uses combinations of these enum values"
(d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState")

Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13
Reviewed-on: https://gerrit.libreoffice.org/11384
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-12 06:08:32 +00:00
5bce329040 SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.

Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:47:44 -05:00
8e4dc1d760 create type-safe bitfield for sc insert/delete flags
The most important part of the change is in sc/inc/global.hxx

It creates a type-safe struct that prevents the accidental interaction
between regular integer types and the flags struct.
It also provides utility methods that make combining and testing the
flags type-safe.

Change-Id: Ibc5b20058b1655df913490682b679afd1297b36d
Reviewed-on: https://gerrit.libreoffice.org/11071
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2014-09-04 09:05:34 -05:00
8c18ffbf9b fdo#81633: Add a new configuration option to toggle ref update on sort.
The new option is in Calc -> General and is labeled

"Update references when sorting range of cells"

Change-Id: I5ac686e96742df40f7d8ba5ffec23806db2988a6
2014-09-03 21:10:10 +02:00
aebcabd54c out-of-bounds string access, this comparison never matched
aName == aLinkTabName.copy(nIndex, nLinkTabNameLength)
is not a replacement for
String(aName).Equals(String(aLinkTabName), nIndex, nLinkTabNameLength)
instead use
aName.match( aLinkTabName, nIndex)
because here nLinkTabNameLength actually is aLinkTabName.getLength()

Change-Id: I884f56541f819db5672e9d096a26a3673e82d83b
2014-08-27 00:34:43 +02:00
10b6bda51c init formula options once, fdo#82183
Change-Id: I1db4816f4693e35024c6dc6c70585d7b72e68c32
2014-08-22 04:31:32 +02:00
9344af955b nitpick on comment form
Change-Id: I023f79187aaf6eb943a50516dace2aa229c5a87b
2014-08-22 02:59:57 +02:00
c0aba5007b fdo#82183 do not reset globals while loading a document
Destroying the function list while an instance of the Formula Wizard is
still open is a bad idea. Workaround not doing this when loading a
document due to a DDE function or external reference being entered in
the wizard.

Change-Id: I6fa00fb4f442bf7c9410679e446ff460289e4b16
2014-08-22 01:12:18 +02:00
794d5ac4ac vcl: use enum for complex text layout constants
Since these constants are bitfield flags, we define some methods to make
working with them reasonably type safe.

Move the definitions to outdevstate.hxx, since we need the values there,
and that appears to be the "root most" header file.

Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing
as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write
weird code thinking that it's a real flag.

Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343
Reviewed-on: https://gerrit.libreoffice.org/10676
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-20 09:01:26 -05:00
a107bdfdfc ErrorBox->MessageDialog
Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b
2014-08-18 10:57:21 +01:00
176e99a965 -Werror,-Wundefined-bool-conversion
Change-Id: I6ff5f855becc44d195ea8043e3c7c1a4873617c4
2014-08-12 12:19:42 +02:00
856bf05a1d Related fdo#69006: Reintroduce some height calculation back.
When importing CSV with multiple lines in a cell, it looks as if some content
was lost.  It is not, it is in the spreadsheet, but looks very confusing, and
only way to get around that was to let the heights be recalculated.

It seems that the large CSV still opens in reasonable time even with this
change in.

Change-Id: I701110fcd8a92daa5f374d80f5af696666a7aa6a
Reviewed-on: https://gerrit.libreoffice.org/10499
Tested-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
2014-08-06 12:14:07 +00:00
c5bbfb3935 fdo#78555: Oopsy.
Change-Id: I969973b2d8165d7ff7a46e6b7e60ad07e58bfdee
2014-07-31 09:08:10 -04:00
27182231ac fdo#78555: Retain formula results when moving a range of cells.
* No need to re-compile RPN token array on reference change alone.  We do that
  when the formula contains one or more names that have been updated.

* Adjust undo code to get it to work without relying on ref undo document,
  which would cause the token arrays to be unnecessarily recompiled.

* Whatever else need to be changed in order to pass all unit tests.

Change-Id: I99e86d23320aca8900fef011da23a9d34e42751e
2014-07-31 09:05:18 -04:00
7b13c6d964 Bring this logic from ScViewFaunc::DeleteContents to ScDocFunc's.
To make the bug reported in fdo#80846 reproducible.

Change-Id: Iec400f26c6c6af9ae3bd0afd4fce75939ab1e23d
2014-07-29 17:21:32 -04:00
300845922e fdo#79578: Properly update formulas upon change in db collection.
Update it to handle formula groups correctly.

Change-Id: I009a7fcf3d3fb17ef6951c50534ca6bc1fffc259
2014-07-28 22:08:22 -04:00
ab409bf7fb Move this fucntion to ScDBDocFunc.
so that it could be usable from unit test.

Change-Id: Iea10cb473bc17d7e030c018fd2c84fbeccce3e47
2014-07-28 22:08:22 -04:00
678ad50a5e fix coding style
Change-Id: I4841929ac8f1a50892d72f7b2a32ba2f55b62a85
2014-07-24 23:18:50 +02:00
dc0b5fa230 avoid static variables
Change-Id: Ib73464cbd9ddc644b008ab7fdcab5ca70dcaa2f1
2014-07-24 23:18:50 +02:00
5c6ee09126 fdo#81309: Adjust references during sort.
Change-Id: I2b98610f6b774400ecfaffe2905201c27fcab33f
2014-07-13 18:07:14 -04:00
5902dcf099 fdo#80462: Don't always increment the start row position.
Sometimes someone might attempt to sort only a single row.

Change-Id: Ie29d4cf7ec0bd3a5c945997083368b6ef6074268
2014-07-12 22:11:12 -04:00
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
972c92c84e CID#982304 logically dead code
Change-Id: I8ffc8249a4d1b7530ee208cf84b48af832758a4d
2014-07-11 12:28:56 +02:00
d92aa2f445 remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b
2014-06-27 17:08:04 +02:00
37e6631cc5 remove whitespace
Change-Id: Ib15413e73409cc33de01fa92a47b9d1237cfc4b2
2014-06-25 05:41:10 +02:00
e2080e70fe new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
   class A {
     struct X x;
     public X* getX() { return &x; }
   }
which can be:
     public X& getX() { return x; }

Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-24 11:34:21 +02:00
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00