path: root/oox
AgeCommit message (Collapse)AuthorFilesLines
2014-11-22All image cleanup related change in one commit for perf testZolnai Tamás1-16/+0
Change-Id: I5baac12f97ea7fa36293844331ca548b7bc2cdfd Always call ImplAfterDataChange() when data is changed Call it inside ImplAssignGraphicData() which assign GraphicObject members using Graphic's data. With that ImplAfterDataChange() method also called in constructors. It's important to call ImplAfterDataChange(), because this will trigger the auto swaping mechanism. Change-Id: I45af91f8df2fb5b0143fcc5eb05e82e4d408d0bc Avoid using null pointer as a special indicator When ImpGraphic::ImplSwapOut() is called with null pointer it was assumed that it is becase the graphic is a link and so we don't need to swap out it actually (we can load it anytime using the link), only clear the graphic's internal data. The problem with that it can happen that ImplSwapOut() is called with null pointer accidentally on a non-link graphic object which leads to that we loose the graphic. Seems more robust to use an explicit indicator (GRFMGR_AUTOSWAPSTREAM_LINK) for links swapout. indicator Change-Id: Icf31524a192c7866278ba6a13eb85648aa69f554 Remove manual SwapOut() call in ODF export We have a good auto swapout mechanism which will prevent excessive memory use. Change-Id: I362f51c724ac31704561abe8b961910f5d490f04 MS export: don't need to manually swapout images after swapin them We have some good auto mechanisms for that. Change-Id: I487dbf4a5fc69c7563dfbc5c21f9ebdb05ba6b9e DOC import: avoid manual swapout call. No reason to swapout the image directly after the import because it will be used for rendering just a second later. Change-Id: I78c8ef9225c55f306182dc5efd7bcaf0e88521c0 Make SetSwapState() an internal method So we can be sure it is always called when user data changed. Change-Id: If107907afffb85a7a57817f5807847a5c028416c Swap in graphic by SwGrfNode and not manually It's a Writer specific problem, that images lost during export because of not swapped in graphic data. Other components (Impress, Calc...) use SdrGrafObj to get the graphic and SdrGrafObj calls swap in before retrun with the graphic. Change-Id: I7398d8e3f6535199b10de048acd58543bdb42531 Avoid an image loss situation of auto swapping Before an image data is used GraphicObject should be swapped in. When a GraphicObject is swapped in auto swapping mechanism is triggered which can swap out some of the images. We should avoid to swap out the same image on which the swap in method was called before because the caller code assumes that the image data is there. Change-Id: Ia4addc370742aea5fbf185cf87e3c062a5ebf5be Assign graphic data also during auto swap in Change-Id: I09b8d11027f4a1e8470b81677388d4a573b372a6 Ignore the swapped in graphic, but use its size Change-Id: I75f17ab5e55119965fcede2b220979cefc1e26ab Remove these useless static bool variables. Change-Id: I7a8ad7814231f129d5d1146ceb36eb2c22b2aff1 More useless static bool variables. Change-Id: If09aa23768f73bbf659966e4e5aac82dca83d1b6 Paint background images always via drawinglayer Painting via GraphicObject is obsolete. See fdo#68927 where the problem was the quality of svg graphics, it seems a good idea to extend this improvement to all graphic type. Change-Id: I57a26d4fcfea8e4f666504a90281365e8a9a7e1d Remove unused IsInSwap() method Change-Id: Ib295bd71b5cf16fd75d04818dfd415ff24cb2655 Printing: remove an other manual swap out call Change-Id: I2b6d6eaa072d9948eb5734e978d68d3bc37701b2 SvxGraphicObject: remove more manual swap out calls Tested with importing large *.rtf and *.docx test documents with lots of images -> auto swapp out works. Change-Id: Ib040edaa89c9bcb966c58b75f0392e6d9f7a165e SdrUndoDelObj: one more manual swap out call This thing seems a good optimization to me, but it would be good to hide all of this swapping thing inside GraphicObject class, to make our code more robust (e.g. no image loss because of missing manual swap in / swap out call). Auto swapping mechanism will take care of that, anyway. Change-Id: I933dafd95597ffff038dc6aeb0a64fcaa3941bd8 Remove duplicated swapping methods Change-Id: I0e61aeb0705ed13872d252ee1594f9ab4aab4f8a ForceSwap{In,Out}Objects methods are unused now They are called only by themselves recuirsively, but not from outside. Change-Id: I1cde392c95bbc60ac7937d0bf3cd4b0fd062568b More unused swapping related methods / member of SdrPage Change-Id: I4a979dd09418df4526409d9026d6abb98c6bf954 Make GetTwipSize() call SwapIn() by itself in case of invalid size Change-Id: I5bc6cf097e61d65007dde531af4a213b19e8ca5b More replacements of manual swapping with SwGrfNode::GetGrf()/GetGrfObj() Change-Id: Ie56584c03af8a6d3ea8f8d4294f5492a841933b7 Be explicit here when to swap out as a link Change-Id: I70dd00d5f82c5f4f622805e1d6ee1dfc30900b31 Remove unused Graphic member of SwOLENode Change-Id: Iaff7e86a8e11e9befc6feacdafd3a78a1971bbcd Swapping Graphic is a privilage of GraphicObject. This means more things: * Graphic won't swap out itself, so those classes which uses Graphic without GraphicObject won't need to deal with swapping. * When a Graphic is queried from GraphicObject the caller won't need to deal with swapping, because GraphicObject swaps it in before return. * GraphicObject will swap in the Graphic always when a swapping dependent data is queried (e.g. whole graphic, transformed graphic or AnimationNotifyHdl) Change-Id: I2bf6e37291ec94146f10aac4a35084682437ed16 Why to have this compromise, do that what we say the users we do. Change-Id: Ia599644ff1f7591ac84bdca988883eaf5860297e Make SwGrfNode swapping methods private Change the filter test accordingly. Conflicts: sw/ sw/qa/extras/globalfilter/globalfilter.cxx Change-Id: Ide3043f2f245c097a7b4c07ba2e0713510296b3e Remove some useless swapping call inside SwGrfNode Change-Id: I4cd2677197c7a6cff71e2966c2b2dd2285032c07 Make SdrGrafObj swapping methods private. Plus remove some useless call of them. Change the tests accordingly. Conflicts: sc/qa/unit/data/ods/document_with_two_images.ods sc/qa/unit/subsequent_export-test.cxx sd/qa/unit/export-tests.cxx Change-Id: I47a50b5734d799ac02ee7221c95f82415afb9497 Optimize ImplCheckSizeOfSwappedInGraphics() a bit Store used size as a member so we don't need to recalculate it all the time and no need to use a size map. Change-Id: I1f929c5d3a56f545cef123bda087ecaf8ca0be4a Avoid DelStreamName because it can lead to image loss. See also: f811e628411bda29a76ebb1f72eb107ce67d27f0 The problem is that more images can have the same stream name so we can't decide here when to remove one stream name. Better to leak in the storage as to loose images (actually we already leak here, so) Change-Id: I2c2afe87e024c2521fe22d62126b567931604101 Set back these lines, later it can be useful Removed in: 9dc3b49c891fb9fe45c24de4b7e1e88fe400afe0 Change-Id: Id8cee4e17d214ca0eaa5cd11dc25849e5f68851e Logically dead code related to embedded stream name in SwGrfNode\SdrGrafObj See also: 286e2f5c6ec829bc0987b1be7016699f7ef03e5e Since embedded URL exists until the first swap in these lines are not needed anymore. Change-Id: Ie6bf8efe7808cf42f20f7b4b3f8cb927555c0ea8 Remove now useless setTextEmbeddedGraphicURL() Since this commit: 286e2f5c6ec829bc0987b1be7016699f7ef03e5e it's not necessary to update the package URL. Change-Id: I25c829e9bc0c666838baf19cd60f19938ebb430c
2014-11-05fdo#85813 drawingML export: fix handling of impress tablesMiklos Vajna1-2/+5
Change-Id: Ia17b14c4b27e808ceab388aa33602875e67433a5
2014-11-05oox: document PPTX export entry pointMiklos Vajna1-1/+4
Change-Id: I8102f31d46257c96837b6c9497e9c49f92ac29b1
2014-11-05fdo#38835 strip out OUString globalsNoel Grandin4-11/+7
they are largely unnecessary these days, since our OUString infrastructure gained optimised handling for static char constants. Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-04Actually we shouldn't always set Overlap flag on for all xlsx charts...Kohei Yoshida1-1/+1
The correct fix unfortunately would require making the axis label layout smarter, to avoid overlapping of angled text label objects. Change-Id: I92198dbb90fd4a206ee226307992343d064f733a
2014-11-03typo: geomtery -> geometryAndras Timar1-1/+1
Change-Id: I20263c836dd55e663cdad9fc8283fe8fbf02b1f1
2014-11-02unused includes in RTF filter and related filesMiklos Vajna2-11/+0
Change-Id: Id13e10f2ceed3985c78ccc542e6677eccc0cb1c7
2014-11-01oox: introduce W_TOKEN() macroMiklos Vajna5-82/+83
It was inconsistent that when parsing <a:foo> elements, A_TOKEN(foo) was available, but for <w:foo> elements there was no W_TOKEN() macro. Also, there were two manual variants (NMSP_doc|XML_foo or via OOX_TOKEN(doc, foo)), replace both of them with W_TOKEN() for easier searching. Change-Id: Ic5cd027f07518535b92671ffe3c486016a3f9f0a
2014-10-31Removed duplicated includesAndrea Gelmini2-2/+0
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6 Reviewed-on: Tested-by: LibreOffice gerrit bot <> Reviewed-by: Michael Stahl <>
2014-10-29constStephan Bergmann1-1/+1
Change-Id: Ia76df719b2f76a993e65e0bf6d55723b1a2f5b93
2014-10-29constStephan Bergmann1-1/+1
Change-Id: I0d89cc99a1d8f7b3c17986b45653dce5e4b436d7
2014-10-28coverity#735309 Unchecked return valueCaolán McNamara1-2/+2
Change-Id: I15cbfb15054962998a058da1381a84bb667944ef
2014-10-24-Werror,-Wunused-private-fieldStephan Bergmann1-1/+0
Change-Id: I2cc9884b23b49eb3e2afd27e5610bf96998a3c7f
2014-10-24coverity#736028 Invalid iterator comparisonCaolán McNamara1-2/+3
Change-Id: I3ecb621d124c873556387e3bc5cfd5b9aadd8fc1
2014-10-24coverity#736027 Invalid iterator comparisonCaolán McNamara1-2/+3
Change-Id: I099c0562bc52f0625ceac202b34b01025a7fd35d
2014-10-24coverity#736026 Invalid iterator comparisonCaolán McNamara1-2/+3
Change-Id: I04bc103120256614fa76310d3ba0a51c560d9393
2014-10-23inline TokenMap::getUtf8TokenNameMatúš Kukan1-7/+0
Change-Id: Icd9c6ebc9feb3e7aba28b01729b582a8f49c832a
2014-10-23Remove few pointless OUString::number() and one methodMatúš Kukan1-4/+3
Change-Id: I3e9a302a7513eebfeff07402f71fc3dde22e4cc2
2014-10-23maTokenNames.size() is constant: use it and be a bit fasterMatúš Kukan1-1/+1
Change-Id: I39a6e2badf0c159e87763e2782bc89f0ee6068ec
2014-10-23loplugin: cstylecastNoel Grandin1-2/+2
Change-Id: I9134aff4f2e6bff43ebb78c605e0ff521eac6ffc
2014-10-22fix oox build on big endianDavid Tardon1-1/+1
Change-Id: I580266d908e30ef076de0517f41a600f4c9372c1
2014-10-17coverity#1247632 Uncaught exceptionCaolán McNamara1-1/+1
Change-Id: I8d6df8c6853f0bd2f0b099d14bf0ac246170e7f1
2014-10-15More -Werror,-Wunused-private-fieldStephan Bergmann1-2/+0
...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. <> "-Wunused-private-field distracted by side effects"). Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15I think this is what was meant, see cf7832d6Adolfo Jayme Barrientos1-2/+2
Change-Id: I626e3a36426958d7ba1fd320cf8e1a3bf2f3595f Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2014-10-13oox: refactor embedded media importMichael Stahl4-18/+29
Currently the oox import creates a temp file and leaks it, and there is no way to clean it up afterwards. Unfortunately it turns out that SdrModel has no way to access the imported OOXML storage, so add a really ugly hack to get the embedded media into the SdrMediaObj by setting both MediaURL and PrivateStream properties (currently oox really wants to set the properties in alphabetical order too...) Change-Id: I5a235fbeb08e7bc17faf066de52b94867e9a79a2
2014-10-11fdo#84647 : Fixed default value for TickLableSkip value.sushil_shinde1-1/+1
1. 'TextCanOverlap' property was stored as false if TickLableSkip is not equal to one. 2. For OOXML charts TickLableSkip can be between 1 to 999999999. 3. We can not apply zero or less than zero value to TickLableSkip. ( As per specification) 4. In axis model default value for TickLableSkip was zero which is incorrect. 5. Added unit test to check 'TextCanOverlap' property for chart. Change-Id: Ib3104b1d932f6e9376c149eabb201c8e9ad23da9 Reviewed-on: Reviewed-by: Kohei Yoshida <> Tested-by: Kohei Yoshida <>
2014-10-11fdo#75757: remove inheritance to std::mapTakeshi Abe2-8/+9
from oox::core::Relations. Change-Id: If2e0109a2ad6598436177b7638cb6d568fb2d3d6 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2014-10-10fdo#54361: Chart background in XLSX is transparent instead of white.Muthu Subramanian1-7/+10
Change-Id: I116e7e8c9046009cfcadc04b5367a6fe25f88d96
2014-10-09drawingML export: fix <a:srcRect> if graphic's map mode is pixelsMiklos Vajna1-1/+7
Change-Id: Idbe399648c60e39c61e2be09a77b0648f57d3347
2014-10-08fdo#75757: remove inheritance to std::mapTakeshi Abe2-4/+4
from ItemFormatMap. Change-Id: I956b5797e677d22eb71fe801b650db7c982d6d51 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2014-10-08back out more wrong and confusing tools::Time comment changesEike Rathke1-4/+4
Apparently fc04f76336fdf8c96e35382cdeb497e2f939705c used some sed script to change all ... Change-Id: Ie609bd02a2c5d70109fc6185cf4440480f29d8f5
2014-10-07oox: fix spurious rebuilds of namespacemap.cxxMichael Stahl1-0/+1
There is a missing dependency on one of the generated header files. Change-Id: Id3fa2ccf2c2a31527b795861afdf557882f56972
2014-10-07-Werror,-WuninitializedStephan Bergmann1-1/+1
Change-Id: I91333f5290c84c6317b85572824be065da9cf64b
2014-10-06use comphelper::rng::uniform_*_distribution everywhereCaolán McNamara1-2/+2
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-03Remove OSL_ASSERT which could fail for allowed XLS_TOKEN(tint)Matúš Kukan1-1/+0
Change-Id: I6e0cc345f6903128ffebe5fb56f6e198ee32da9a
2014-10-02coverity#1242917 Result is not floating-pointCaolán McNamara1-1/+1
Change-Id: I284562585c10a3d68b8545df7b6cb3022001660c
2014-10-01DOCX drawingML import: handle char color from theme for shape textMiklos Vajna2-1/+24
When we import table styles, we apply that as direct formatting, in case there is no real direct formatting, see lcl_ApplyCellProperties() in the sw UNO implementation. We can do the same here: in case there is no other formatting, then apply the char color from the WPS theme, that will give us the expected result. Change-Id: Ic8e6afc09167f7924a11ab0b445351075f16738e
2014-10-01fdo#82577: Handle TimeNoel Grandin2-12/+12
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11 Time typedef. Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866 Reviewed-on: Reviewed-by: Noel Grandin <> Tested-by: Noel Grandin <>
2014-09-30Resolves: fdo#79129 Crash in oox::drawingml::LayoutNode::setupShapeCaolán McNamara1-1/+9
Change-Id: I0bafd2c43d29806eea0ff0cb165e67aece53488f
2014-09-30bnc#584721: invisible text because of wrong color (white)Zolnai Tamás1-10/+20
Color::getColor() method uses some caching mechanism which works wrong when the result depend on one of the input parameters. So avoid caching in these cases. Change-Id: Ifa9221e21e685715454de86d5cec09ff6c266307
2014-09-30fdo#82577: Handle PolyPolygonNoel Grandin2-3/+3
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows PolyPolygon typedef. Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-29proper reading of mso-position-(horizontal|vertical)(-relative)Luboš Luňák2-1/+27
Change-Id: I50f537c697f6e73c1fd150f3f03fc65b85ccbeaf
2014-09-29drawingML export: fix remaining rotation / flip combinationsMiklos Vajna1-13/+4
With this, each rotation = 0 / 90 / 180 / 270 and flip = none / horizontal / vertical / horizontal+vertical combination (16 cases) are exported perfectly. Also, this matches what the (binary) [MS-ODRAW] export does, see ImplEESdrWriter::ImplWriteShape(). Change-Id: I04030c8c6819c35c06ce97400eb7e2f1f7389a5f
2014-09-27Use oox::drawingml::EMU_PER_HMMMiklos Vajna1-3/+3
Change-Id: I2034f862b5e15ffaa2ba370ae0249628677c587d
2014-09-26DOCX drawingML import: fix remaining rotation / flip combinationsMiklos Vajna2-3/+14
With this, each rotation = 0 / 90 / 180 / 270 and flip = none / horizontal / vertical / horizontal+vertical combination (16 cases) are imported perfectly. Also adjust a few testcases -- now that in many cases we only set the position in oox, some rounding errors went away. Change-Id: I5567a7d6964775f2caf10a0e539f3eb84d10461e
2014-09-26cleanup GUID/ClsId/CLSID typesNoel Grandin1-13/+5
- rename GUID to SvGUID so we don't need an #ifdef WIN32 - drop ClsId struct, since it is used interchangeably with GUID and has the same structure Change-Id: Idf5c14c82a6861ef585fb57896a9b12cfe40374c
2014-09-26Resolves: fdo#84261 unexpected exception -> clang builds terminateCaolán McNamara1-1/+1
Change-Id: I545ed112b54fb3d81e67b0f42230811cd48de626
2014-09-26bnc#897769: OOXML import: Import border lines using reference too.Matúš Kukan1-22/+33
Do not ignore 'lnRef' element. Also fix typo to apply 'seCell' properties to the right cell (southeast). Change-Id: Ia45f7016f358b70e6db06a232c569335ce9d7051
2014-09-25Fix validation problems pointed out by CppunitTest_sd_export_testsMiklos Vajna1-0/+4
Regression from e8bdd38882522591723097c028ca7a6927ee70c4 (fdo#83751-FILESAVE:Custom Properties dropped while exporting to .pptx, 2014-09-11), there were two problems here: 1) Using the wrong filter when the output is expected to be suitable for validation. 2) Writing empty custom property values, which is not valid. Change-Id: Ic18c789c53bd40cc8aa07385cb5fd0d5c7ada6ab
2014-09-24Remove TokenMap::getUnicodeTokenName()Matúš Kukan5-22/+15
Change-Id: I778dc43085b6afbb6456cbf53fe8c95b624b75b3