Commit Graph

2738 Commits

Author SHA1 Message Date
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
3d0988b8ca coverity#982478 Dereference after null check
maybe sort of can be considered a regression from
commit 733b831970204059b9d89eff203551d6d3bf4bbe
Date:   Tue Jan 5 16:37:41 2010 +0100
    swunolocking1: swtypes.hxx: rename frame anchor types
     enum RndStdIds: rename frame anchor types (FLY_*) to be more intuitive.

where

if (0 == (pAnchorPos = pAnch->GetCntntAnchor()))
    bCallMake = sal_False;

turned to

if (pAnchorPos)
    bCallMake = sal_False;

but there would always be a following de-ref of a potential NULL pAnchorPos
which wasn't FLY_AT_PAGE

Change-Id: I808b4f178887ab6149e38bab6e36eb68d7a1eb29
2014-10-15 13:49:09 +01:00
af5ebbf783 create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution.  (Unfortunately MSVC 2012
does not support explicit conversion operators.  Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)

Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13 17:45:57 +02:00
1119e4a98c coverity#735334 Unchecked return value
Change-Id: I8023e8c11e76def505568125703f30531161dfa7
2014-10-12 16:39:54 +01:00
7ec1643c9f coverity#1226478 Unchecked return value
Change-Id: Idcd3f35d1b5f097e61963083f11712e4ab87bdaa
2014-10-12 16:39:53 +01:00
4c12951a03 Typo: compatability->compatibility
Change-Id: If0b98a30452a9d1fcc340173deb6856755926471
2014-10-12 13:00:46 +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
d3a04fdebf copy document defaults/properties for separate mailmerge result files
Also remove code duplication (that I'm not even sure why it's there).

Change-Id: I9a20fe0de9b34adbd03155712869bb19f5969f9b
2014-10-09 17:15:25 +02: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
0be1c2e87a typo: formual -> formula
Change-Id: I39b4c2fc4edd7d609b15fc289dd1b053c749f435
2014-10-09 13:02:50 +02:00
04a810cee4 back out more wrong and confusing tools::Time comment changes
Apparently fc04f76336fdf8c96e35382cdeb497e2f939705c used some sed script
to change all ...

Change-Id: Ie609bd02a2c5d70109fc6185cf4440480f29d8f5
2014-10-08 14:24:21 +02:00
9835a5823e sw textboxes: reimplement ODF import/export
Turns out that for normal TextFrames and rectangular drawinglayer
shapes, the engine is written in ODF implicitly. Use the same trick to
describe if the shape content should be rendered by SW or editeng.

This reverts 9d310ecfce3c2fc481b125e1493a534e2107a68e (sw textboxes:
implement ODF import/export, 2014-06-02).

Change-Id: Id8afa6368bedcd293e578244abb58e18949bec8d
2014-10-04 20:18:01 +02:00
f4825097a9 copy default drawinglayer attributes when doing mailmerge
Change-Id: I4c6fc31ae72d179975c65aec0b560741474d433e
2014-10-03 18:28:11 +02:00
5402438343 SfxItemSet ranges are inclusive
This used to skip the last item in the range.

Change-Id: Icf27a041f1388c8bd01568356d1009a08e5b7a7a
2014-10-03 18:28:10 +02:00
8eae6dc82e fdo#75757: remove inheritance to std::vector
from SwGrfFmtColls.

Change-Id: I4dd83917584406704d1a52f85b8973f2714e9d0b
Reviewed-on: https://gerrit.libreoffice.org/11731
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-10-01 19:56:11 +00:00
25a76ef791 sw: std::auto_ptr -> std::unique_ptr
Change-Id: I60ac3706b9be335c31039ed0997cb8215808ddaa
2014-10-01 17:35:11 +02: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
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
8dbde0845a fdo#82577: Handle Region
Put the VCL Region class in the vcl namespace. Avoids clash with the X11
Region typedef.

Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
2014-09-30 09:58:23 +02:00
0597f3bb6b Set relative heights for all default heading styles
The relative height "100%" (used only by Heading 3 now) is converted
silently to absolute height (btw, also in the dialogs and in OOo, too).
Using 101% instead of 100% fixes this problem, so setting a new height
in the parent style "Heading" (for example, by Tools->Options->
LibreOffice Writer->Basic fonts (western)->Heading->Size) can change
the heights of all default headings, including Heading 3.

Change-Id: Ia44ac9d24041b75f0aedd7b56340dd41caf0020e
2014-09-29 17:37:03 +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
8f684e21de remove unnecessary static_cast's
left over from our conversion of the SvStream output operators
to more specific methods
e Please enter the commit message for your changes. Lines starting

Change-Id: Ibfe7635451ef7b8813d7a59c78c5223092a17ad5
2014-09-26 15:25:40 +02:00
9fd7ca788b fdo#78611 Don't create automatic rules on reset
As we reset all styles, there shouldn't be any unknown automatic
SwNumRules, because all should have been created by the style
copying! And in this case we also have to overwrite the existing
automatic SwNumRules to get a consistent copy.

In case of unknown automatic SwNumRules we just warn and ignore
any inconsistence.

Change-Id: I26e25bccc9a8c7be74f3dceb2e1f91894eac1d0a
Reviewed-on: https://gerrit.libreoffice.org/10988
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-24 16:13:22 +00:00
cde554a731 fdo#81782 MM: copy most document properties
Mail merge wasn't copying the document properties into the target
document. It also has to copy most document properties into the
working copy, as ConvertFieldsToText is called just there.

Change-Id: I7e07fec712c225f667d960a94f4eb3fd0b83f041
Reviewed-on: https://gerrit.libreoffice.org/10987
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-24 16:11:07 +00: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
354ad43c5c SwCursor::SelectWordWT: include comment anchor character of a commented word
In case the user double-clicks on a word and exactly that word is
commented, then we used to select only the word, but not its comment
anchor character. So when the user deleted the selection, the comment
left there.

It is still possible to manually select only the word, but on
double-click let's just select the comment anchor as well, so a simple
double-click on the commented word will remove the comment as well.

Change-Id: I7322af61c31e8aba108eef5596849d17d55fc7eb
2014-09-19 12:14:26 +02: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
cc6c01632d Fix Windows build - the same thing in Writer.
Change-Id: Iba40d99dd6c162f20ca35e5a937b7c5ee3d2e126
2014-09-17 12:47:27 +02:00
10fee3d3bc SFX_ITEM_SET to SfxItemState::SET
Change-Id: I95dc8872d702cbe63d5fdab10a9ddd0e86d49e06
2014-09-17 10:19:59 +02:00
d5109b2fcf Make it easier to add new color attributes to GetDocColors
Change-Id: I2098892fc44c7a8bde1eb30f6db1709e58925577
2014-09-17 10:19:51 +02:00
4ef268d262 Get more color attributes for document colors in Writer
Change-Id: I2005b434f20a56417105c7b26ce09155a7023023
2014-09-17 10:19:30 +02:00
5f27596bed Add writer document font colors to color palettes
Change-Id: If3fedc45586eee068c40e92da87d5d550a456a64
2014-09-17 10:19:29 +02:00
4851cde7b9 fdo#70346 MM: add mail merge data to condition dict
Currently section hide conditions are just evaluated based on
document field data.

This adds the current mail merge dataset to the condition
dictionary, so this can be used in the condition evaluation.

The dataset values are named from their columns and added initially,
therefore DB fields with identical names will overwrite the values
in the dictionary!

Change-Id: I82a5f9f6962628a76c836e8e2a7c9e264fdc16e0
Reviewed-on: https://gerrit.libreoffice.org/10978
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-16 08:35:13 +00:00
3b11057b75 sw: rename SwDoc::Append to something unique
Change-Id: Ibb9db5ecdea6439df20fc1ee609267dcdd864405
2014-09-12 21:51:08 +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
9099e21b89 Fix single node CopyRange
Previously there was a restriction for the range to contain at
least two nodes.

Change-Id: Iadf21d3928303c2ab8df0d93dabd969ed1ff7e09
Reviewed-on: https://gerrit.libreoffice.org/10972
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-10 19:54:58 +00:00
f3d791f754 sw: [loplugin:externandnotdefined]
It turns out that document compare / merge and master document
insert file are all the callers of SwFindDocShell() so move the fix-up
there...

Change-Id: I912a464c3acab8d0adb7b5b659d62f629a15cb70
2014-09-10 18:45:23 +02:00
628a0f27de WaE: implicit conversion of literal of type 'int' to 'bool'
Change-Id: Ie21c61d718d720ec6bac741cd17e807123f47129
2014-09-10 18:57:17 +03:00
d92602c5b1 more fixes for SfxItemState
In commit 88a874fc "convert SfxItemState constants to a proper enum"
I made some mistakes in converting bitwise logic to boolean logic.

I fixed one of those places in commit 7ad83656 "fix bitwise->logic
conversion in SfxItemState commit"

This commit fixes the other places where I converted bitwise to normal
boolean logic. I also validated that none of the existing code tries to
uses combinations of these enum values.

This commit also introduces an exception-throwing check in the one place
where the enum is explicitly cast to make sure that no combinations
sneak in.

Change-Id: I545f7d17b76c4fd999078867caec314e83ffe165
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-10 17:54:35 +02:00
b56558717d fdo#83655: sw: RSID-only hint assertion when inserting in master document
For the temporary document there is no layout so SwTxtNode::MakeFrm()
isn't called.

(regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291)

Change-Id: I711d32a81519edd6840cc29f5cd9dbc57ef21982
2014-09-10 16:14:56 +02:00
3b9361a930 Add debug messages for sw.{createcopy,docappend}
This adds a lot of SAL_INFO messages to SwDoc::CreateCopy and
SwDoc::Append.

Change-Id: Ie924e20698bec84482fcc5496175a9e29245729e
Reviewed-on: https://gerrit.libreoffice.org/10969
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-10 11:06:43 +00:00
c808802e94 MM: introduce SwDoc::Append helper function
This drops all the specialized, workaround code from MM, introduced
to use the SwFEShell::Paste function and additionally merges
and renames SwDoc::Paste into SwDoc::Append.

There is still a little common codepath, therefore this adds
comments to always update both functions.

Change-Id: I704b3ef3257dd977dac95e16e25049ff8ade97ed
Reviewed-on: https://gerrit.libreoffice.org/10967
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-10 11:06:01 +00:00
ddffb79790 Replace the whole content for copied documents
If the document is initialized in CreateCopy, it already contains
the initial empty paragraph. So we have to delete the content from
initial document, as we're going to replace the whole content with
the pasted document.

Change-Id: Ie6a64dcb070f7d611dfde97f2c1a721834b4167b
Reviewed-on: https://gerrit.libreoffice.org/10963
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-09-09 15:22:04 +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
4d8701537f SwSortedObjs: Count() to size() and use size_t consistently
Change-Id: I80fa39e9790a0dfff9d4afb534be119eb593b60d
2014-09-06 12:12:25 +02:00
da44e4cce8 Use size_t consistently, constify, reduce scope
Change-Id: Ie5de70645becc5ac584f1b3ffe6048969d2a19a9
2014-09-06 12:08:13 +02:00
2248aaf58a std::set::find() is faster than plain std::find()
Change-Id: I11ca9474e4b6b751f0348b78b53abaa81682eaa6
2014-09-05 15:26:18 +02:00
9991b50ccc Make opengl chart window always active
Fortunately there is a special ole object group with
the MS_EMBED_ACTIVATEWHENVISIBLE flag which define this
behaviour.
Problem is that both Aspect and EmbedMisc are MS specific
enums so we can't use them directly for non-MS objects. But we
can handle opengl charts the same as this ole object group.

Change-Id: I49abeffce319cbb775709a72ba198a1f76b65374
2014-08-29 17:40:27 +02:00
bd9a4e1922 ChartHelper::IsChart is useless
EmbeddedObjectRef has an own IsChart method with the same
behavior.

Change-Id: Ib06699186466bf3da2bd67d7c631a5216463fb14
2014-08-29 17:40:27 +02:00