Commit Graph

6931 Commits

Author SHA1 Message Date
68c9515daf pParagraphMarkerProperties can easily be a reference
Change-Id: Ida4309aeb69bde43f70415211490db657c7c7567
2014-10-17 21:26:51 +02:00
4bb872b192 DOCX export: fix handling of paragraph mark on empty paragraphs
The problem was that in case a paragraph is empty, and it has both a
character style and direct formatting, then the doc model created by the
ODT and DOCX import is like this:

<text>
  <attrset>
    <item whichId="8" which="character font size" value="nHeight: 240, nProp: 100"/>
  </attrset>
  <hints>
    <hint end="0" whichId="52" which="character format" value="name: hello"/>
  </hints>
</text>

I.e. the direct formatting is stored in the attribute set of the text
node directly, while the character style is stored as a hint.

MSWordExportBase::OutputTextNode() tried to read the hints and if there
were not any, then tried to read the attribute set, while in this
situation we need both.

Change-Id: I71fd10f6d00246348e77fee5431cb4e2a7c9b349
2014-10-17 18:27:16 +02:00
be31503ef8 coverity#1242778 Untrusted value as argument
Change-Id: I34d5a5e7c5f0eef51d941c65ab73d5421d5a36cb
2014-10-17 15:19:55 +01:00
c45fa7f54d coverity#1247648 Uninitialized pointer read
Change-Id: Id9faf897cedd976491520178aad8015398f7d018
2014-10-17 15:19:39 +01: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
d2ed493a4c WaE: Unreferenced function definition
Change-Id: Ibc28879d303fc768014df89df8022e1fd13634dd
2014-10-16 08:59:22 +03:00
40e043ca9e sw: remove more dead code from SwIoSystem::GetFileFilter()
Change-Id: I53cadf01246faf3c4b54ee360db19bde2dcb98cc
2014-10-15 23:44:55 +02:00
3ec25899e0 sw: fix temp file leak in SwIoSystem::GetFileFilter()
Change-Id: Id483d58a9de27a247880aedfe6bb3fe1d410129c
2014-10-15 23:44:55 +02:00
53d4966421 sw: WW8 import: delete leaked SdrGrafObj (and temp file)
The SdrObject returned from SvxMSDffManager::GetShape() is owned by the
caller; since it's not inserted anywhere it has to be deleted.

Change-Id: Iaac6467592ec4151173a586a6dc71f9bc44b44f0
2014-10-15 18:03:17 +02:00
569bf818cb fix indent
Change-Id: If9f7154b204a1f5c0a0c6475988cf965fb5aadfe
2014-10-15 16:56:59 +01:00
169433f294 coverity#1242817 Untrusted loop bound
Change-Id: I974a80644f70c024f93d081a87204df8cadfa012
2014-10-15 16:56:59 +01:00
1c118a9536 coverity#1242879 Untrusted value as argument
Change-Id: Iedcd30fc27e9984407c6752577a3ecb35d7dc075
2014-10-15 16:56:58 +01:00
159ea0e04e coverity#1242719 Untrusted value as argument
Change-Id: I444233dcf0a1e5e3792089be605b340b24882c89
2014-10-15 16:56:58 +01:00
e178c45a47 coverity#1242692 Untrusted value as argument
Change-Id: If0019caa34168b758f23e88363b94e91f8bd4c8a
2014-10-15 16:56:58 +01:00
0fc5d67a84 fix up indent
Change-Id: Icaa9b84aa0c3617248d8e52fcccfca928accaea1
2014-10-15 16:56:57 +01:00
ad9498f8b8 More -Werror,-Wunused-private-field
...detected with a modified trunk Clang with

> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp	(revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp	(working copy)
> @@ -1917,9 +1917,10 @@
>    const Type *T = FD.getType()->getBaseElementTypeUnsafe();
>    // FIXME: Destruction of ObjC lifetime types has side-effects.
>    if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> -    return !RD->isCompleteDefinition() ||
> -           !RD->hasTrivialDefaultConstructor() ||
> -           !RD->hasTrivialDestructor();
> +    return !RD->hasAttr<WarnUnusedAttr>() &&
> +           (!RD->isCompleteDefinition() ||
> +            !RD->hasTrivialDefaultConstructor() ||
> +            !RD->hasTrivialDestructor());
>    return false;
>  }
>
> @@ -3517,9 +3518,11 @@
>    bool addFieldInitializer(CXXCtorInitializer *Init) {
>      AllToInit.push_back(Init);
>
> +#if 0
>      // Check whether this initializer makes the field "used".
>      if (Init->getInit()->HasSideEffects(S.Context))
>        S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
>      return false;
>    }

to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html>
"-Wunused-private-field distracted by side effects").

Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
ecc5cbc69e fdo#82860 RTF export: if shape has textbox, export its contents as shape text
See 8c677716c4707ccd86b152ae504841affb393cc0 (DOCX drawingML export: if
shape has textbox, export its contents as shape text, 2014-06-06).

Change-Id: I5b1afae4d1b80c9b225096677f7d7ae77ff90f5b
2014-10-15 13:19:08 +02:00
f57ed7edd4 fdo#82860 RTF export: don't export textboxes of shapes twice
See 96965fb39d6d376e91030a01c11f16f9428ddf2e (DOCX drawingML export:
don't export textboxes of shapes twice, 2014-06-06).

Change-Id: I89c039debeca5f88f172479b9f8ecbaec2dc7bc4
2014-10-15 13:19:08 +02:00
dd6d9fd5db ww8: warning C4701: potentially uninitialized local variable
Apparently xmloff supports at least one value that has no equivalent in
OOXML; just use "none" for now.

Change-Id: I76d2802c7c91ea756125e66c229ec5fdb2e7ec3b
2014-10-15 00:04:31 +02:00
dea7cb8a4f Remove confusing TableReference::operator=()
Confusing, because the class has 4 members, and only 2 was set in that
method.

Change-Id: I797872be8c60fa564cece66d8dd20e33248d4a0f
2014-10-14 09:16:30 +02:00
3ded687bef SwBasicEscherEx::WritePictures: improve comment
Change-Id: I6763d18efb2b61462b0a92f847495884716f18bb
2014-10-13 21:53:48 +02:00
8ef09a9219 coverity#704061 Unchecked return value
Change-Id: I460f258cb3b44949176561d397837184cd08bfbd
2014-10-13 16:54:25 +01:00
b1efc0e9ef coverity#1078466 Unchecked return value
Change-Id: Ia78578303cadda713b3c015cd0e30446cd6f8f25
2014-10-13 16:54:24 +01:00
38d87edeeb coverity#1078451 Unchecked return value
Change-Id: I7652c609228e90fa0c71a6d20852da111be77d3d
2014-10-13 16:54:23 +01:00
be4c913293 coverity#1078450 Unchecked return value
Change-Id: I1dce4448ccc1a3af143dc4435a00aa434b4114ae
2014-10-13 16:54:23 +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
06210e5ded coverity#1078484 Unchecked return value
Change-Id: Ia9ce3d94aa5b825e0b7ba28240f00733332e606c
2014-10-12 16:39:52 +01:00
f99ebf4681 RTF filter: fix \acc* handling
The exporter didn't write circle and underdot at all.

Change-Id: Ia8f45f2b03fb14e9a0027ec24ee7f36adc8c018d
2014-10-12 16:26:01 +02:00
997ce52eb7 DOCX filter: fix <w:em> handling
The real news here is that "comma" and "dot" was swapped on export, the
rest is just a fixup of recent breakage.

Change-Id: I54045f5837652dc38a30361e21ced25aeaf58257
2014-10-12 16:26:01 +02:00
4c12951a03 Typo: compatability->compatibility
Change-Id: If0b98a30452a9d1fcc340173deb6856755926471
2014-10-12 13:00:46 +02:00
510c358646 indentation fixes
Change-Id: I56664b455383f69137399e4c5fb28521ef813287
2014-10-10 20:15:21 +02:00
dd1490db9a DOCX export: improve <wp:effectExtent> handling
Change-Id: If8838529817c72f6e6a3730135a00312fe5c2ad3
2014-10-10 14:15:59 +02:00
f453dc0327 convert SWHTML_OPTTYPE #defines to enum
Change-Id: I847c7c116984817c7d66d44431db0601f0a27209
2014-10-10 09:31:43 +02:00
f62a0ed0bf DOCX export: handle name of Writer pictures
Change-Id: I1863da23fc25bd271494d48863ff4bf0554d0439
2014-10-09 20:36:51 +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
ab52bb712c DOCX export: fix handling of shapes containing and also anchored inside tables
Change-Id: I6f23bd0e0553b8f6435537b542fc82ee55a64c03
2014-10-08 18:14:55 +02:00
ad8c2f7090 fdo#75757: remove inheritance to std::vector
from SvxMSDffShapeOrders.

Change-Id: Idf551f1fbde907759d6a296141e2837264dbbb10
Reviewed-on: https://gerrit.libreoffice.org/11840
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-10-08 15:18:32 +00:00
f0859c4eae Resolves: fdo#84588 loop in TableInfo::getNextNode
Change-Id: I5bb44dc94041c3b3cd9d80ba125594a48c9c921f
2014-10-06 16:19:13 +01:00
8f436d3de7 use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use

coverity#1242393 Don't call rand
coverity#1242404 Don't call rand
coverity#1242410 Don't call rand and additionally allow 0xFF as a value
coverity#1242409 Don't call rand
coverity#1242399 Don't call rand
coverity#1242372 Don't call rand
coverity#1242377 Don't call rand
coverity#1242378 Don't call rand
coverity#1242379 Don't call rand
coverity#1242382 Don't call rand
coverity#1242383 Don't call rand
coverity#1242402 Don't call rand
coverity#1242397 Don't call rand
coverity#1242390 Don't call rand
coverity#1242389 Don't call rand
coverity#1242388 Don't call rand
coverity#1242386 Don't call rand
coverity#1242384 Don't call rand
coverity#1242394 Don't call rand

Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
2014-10-06 14:13:27 +01:00
a3b154ab02 DOCX export: fix missing table border when original doc has table style
Scenario is that the original document has a table style, which sets
borders around the table, so A1 cell gets top and left borders (and none
for right/bottom). Then on export, if we write A1 as table default, then
this overwrites the table style, so the real right / bottom borders from
the table style are lost, as on export we think that they are available
from the table style already, so we don't write them.

Regression from commit ae61569eea0719a882010cfbb260a1a0d690d974 (oox: Do
not overwrite table style properties, 2014-04-03).

Change-Id: I54c10ffc2ade65260693b769274b1311efc086f9
2014-10-03 18:22:57 +02:00
b2922c99f5 html export: Fix export of checked checkbox and radiobutton.
Change-Id: Ia77f9840df7508d96292aac63e65714a7892342f
2014-10-03 17:06:23 +02:00
5e0b8b7980 coverity#704994 Dereference after null check
Change-Id: I19f98152b5bd8c9b2cdfacb560d13fc0c1f8c4be
2014-10-03 09:07:55 +01:00
b0e3e11c26 coverity#1242532 Arguments in wrong order
I don't think this actually matters

Change-Id: Ia7190f436eeb47888b1aace1391cf0b5aef9f9f0
2014-10-03 09:07:53 +01:00
c625525ddc rename SvRef::AddRef to AddFirstRef
to make it's intended purpose clearly distinguishable from AddNextRef

Change-Id: I5da780b48b19fd873667b648031bc394113f953b
Reviewed-on: https://gerrit.libreoffice.org/11763
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-03 05:25:41 +00:00
31c407e35b coverity#735532 'Constant' variable guards dead code
Change-Id: Ia0b8ad6af83907a51678e37e41c445fa4a7b5a58
2014-10-02 14:49:08 +01:00
8dd1367a7a coverity#1242740 Unused value
Change-Id: I627c50f6315b2212e3e1f4790b7fc8e08c6e0ee8
2014-10-01 20:29:02 +01:00
25a76ef791 sw: std::auto_ptr -> std::unique_ptr
Change-Id: I60ac3706b9be335c31039ed0997cb8215808ddaa
2014-10-01 17:35:11 +02:00
d691156db9 DocxAttributeOutput::CharEscapement: avoid writing <w:sz> twice
As comments-nested.odt shows, that would lead to invalid output.

Change-Id: I5c8f7ae0df60f80b0e58f7007c2f7f5e2a1cee87
2014-10-01 16:15:37 +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