summaryrefslogtreecommitdiff
path: root/svx/qa
AgeCommit message (Collapse)Author
2023-03-05svx: add test for RotatePointTomaž Vajngerl
Change-Id: I62182fa02843d428d1b745c55ab695450ec4940a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148235 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-05svx: SdrRectObj move, rotate testsTomaž Vajngerl
Change-Id: I448f82d87be34c58d0abf4f6a0c1e6192567b807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148234 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-02-17SfxViewFrame* arg of SfxRequest ctor always dereferencedCaolán McNamara
change it to take a reference Change-Id: Ib9349f4c2660d297d93ee81256e7fa9873728ba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147163 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-16SfxViewShell::GetViewFrame never returns null, change to a referenceCaolán McNamara
various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-27move Theme class to own file inside docmodelTomaž Vajngerl
Also move Theme from svx to model namespace so it is consistent with other classes in docmodel. Theme header also includes ThemeSupplementalFont, ThemeFont, FontScheme classes that are used by the Theme and were also moved to docmodel. These may be moved to its own file in the future when they are used in more places. Change-Id: Ic409bea8e5298adc2b039b529c4f7b01cf64f03e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146221 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-24tdf#141908 Replace usage of sal_Int32 with Colorektagoel12
Change-Id: Id2849140ba1302d59918eb30458984aef2b5c6ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145964 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-01-20tdf#148000 impress: Handle linebreaks on fontwork.Attila Szűcs
Split text lines in a paragraph, right before polygons are created for rendering, so eol will brake line in fontwork just like eop. Change-Id: Ie9e6764f9f91c2e19afd43dc9a212bd18c41c99d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145425 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-14Removed executable bits on source fileAndrea Gelmini
Change-Id: I0becfd79fe71557e7b538e7d4122374c2164fcda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145518 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-14tdf#153000 Unittest file types MSO_SPT=25 to 31Regina Henschel
Unit test for commit 11319f419988443af85cf3c60dbed12d67fc183f Change-Id: Idac7205a98599b765fdfc25a6fd29460f0ee430d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145508 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2023-01-13introduce {Char,Fill}ColorThemeReference which uses XThemeColorTomaž Vajngerl
Adds a unified UNO property for theme colors *ColorTheme (CharColorTheme and FillColorTheme) which uses XThemeColor, that replaces the properties *Theme, *TintOrShade, *LumOff, *LumMod. The properties are still present for backwards compatibility and to keep ODF support working in tests as that needs a bigger change. Reactor the code and tests to accomodate for this change. Change-Id: If7983decb4ba528b49fe7b5968aa9efc696a9efc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144783 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-01oox: add support for importing font scheme into a svx::ThemeTomaž Vajngerl
Change-Id: I862256a17ce84c85174678f3fd03c8ef6661f2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143995 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-12-21qa: hint about tolerance in namesXisco Fauli
As suggested by Mike in https://gerrit.libreoffice.org/c/core/+/144171 Change-Id: I653118985b781ebb1eed71587ae19efe45e1c800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144691 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-15UnoApiTest: introduce CPPUNIT_ASSERT_RECTANGLE_EQUALXisco Fauli
and get rid of duplicated code Change-Id: Iccbd3147fab71b43b1725af308df8ed37c807b7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144173 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-24Remove some unused includesMiklos Vajna
Mostly com/sun/star/frame/Desktop.hpp is unused after inheriting from UnoApiTest. Change-Id: Ifba307353a11a14e033a230a291314bee86b51c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143190 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-23svx/qa: add checks for PDFiumDocument pointerTarcísio Ladeia de Oliveira
When compiled without PDFium, two tests in svx were causing segmentation faults, as they were trying to access null pointers. Add a check for the pointer returned and end test if it is a nullptr (based on how it is done in other tests). Change-Id: Iab3c341a20f002adc92fac22ef76ed022aa49422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143081 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-09UnoApiTest: factor out common codeXisco Fauli
Change-Id: I1d84d8c1e371016a4f4f068af1e9c76635f28cf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142490 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-08UnoApiTest: simplify code by using tempfile memberXisco Fauli
SwModelTestBase does the same. this will help to make SwModelTestBase inherit from UnoApiTest Change-Id: If1c824cf92f0e8b70253e4d5fdeddcaa521d4632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142287 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-03UnoApiXmlTest: add new wrapper for XmlTestTools testsXisco Fauli
Change-Id: I767f464ec666330a2e8e832b6d6f5736a6bef54d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142228 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-01CppunitTest_svx_styles: inherit from UnoApiTestXisco Fauli
Change-Id: I3edd6e41e12efb4876f632edc66ae198d26ac944 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142095 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-01CppunitTest_svx_core: inherit from UnoApiTestXisco Fauli
Change-Id: I4e7cdd1507232d48eba7c4afc599adf8da7a3df7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142094 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-01CppunitTest_svx_unit: inherit from UnoApiTestXisco Fauli
Change-Id: I12e6032c178039eb7b87a1ef063a69c63a0f814b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142093 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-10-11tdf#151060 sw PDF export: don't paint off-page part of drawing objectMiklos Vajna
Reported to be a regression from c12358166a9bd88fe10feabca45a6ad3f65dff8e (DOCX import: fix lost objects anchored to an empty linked header, 2020-01-10), the 3rd page of the PDF export result contains an unexpected line shape. This was "working" before as all objects anchored to the empty header were lost. Fix the problem by clipping the rendering to the page frame when handling shapes, similar to what 689cead9e0837dc932e3a4cd765f7d319b529018 (tdf#91260 svx, sw: don't paint off-page part of drawing object, 2016-12-06) did to fix the normal rendering of the document. The testcase document just has 2 pages, so there the unexpected shape was on the 2nd page. Change-Id: Ica24cd15717a1ee97dff448d385a10536671103e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141167 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-29ref-count SdrObjectNoel Grandin
Which means we can get rid of the majestic hack of ScCaptionPtr Previously, SdrObject was manually managed, and the ownership passed around in very complicated fashion. Notes: (*) SvxShape has a strong reference to SdrObject, where previously it had a weak reference. It is now strong since otherwise the SdrObject will go away very eagerly. (*) SdrObject still has a weak reference to SvxShape (*) In the existing places that an SdrObject is being deleted, we now just clear the reference (*) instead of SwVirtFlyDrawObj removing itself from the page that contains inside it's destructor, make the call site do the removing from the page. (*) Needed to take the SolarMutex in UndoManagerHelper_Impl::impl_clear because this can be called from UNO (e.g. sfx2_complex JUnit test) and the SdrObjects need the SolarMutex when destructing. (*) handle a tricky situation with SwDrawVirtObj in the SwDrawModel destructor because the existing code wants mpDrawObj in SwAnchoredObject to be sometimes owning, sometimes not, which results in a cycle with the new code. Change-Id: I4d79df1660e386388e5d51030653755bca02a163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-26tdf#149971 avmedia: implement video crop support in the gsteamer backendMiklos Vajna
If a media shape had cropping defined, we already took that into account when presenting a preview for it, but not during video playback. The reason for this is that the preview may be set by a file importer (e.g. PPTX) explicitly, in which case the preview is a bitmap we get without any video processing. As a start, implement video crop for the gstreamer backend (used on Linux), and also pass in the media item (containing crop and other properties) both during the edit view (MediaWindowImpl) and presenting (ViewMediaShape). We pass in the whole media item, so in case later other filters (e.g. black-and-white) are wanted, we have all that info in the backends already. Other backends (avmediaMacAVF and avmediawin) are untouched so far. svx/qa/unit/data/video-snapshot.pptx is modified to have a yellow border when cropping is unimplemented, which is now not visible with the gtreamer backend, matching PowerPoint behavior. PPTX export was working out of the box already. Change-Id: If26b7a4391bcffe9cbddd9933e1bab69be52924e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138867 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-25Related: tdf#149971 avmedia: add doc model and render for crop of media objectsMiklos Vajna
It is possible to provide an explicit preview of media objects since commit 8fa1d453c94cdbb03dac646fb8db2ebd1a0e84bd (Related: tdf#149971 svx: support explicitly provided snapshots for media shapes, 2022-08-24), however they can't be cropped. This means that media shapes from PPTX with cropping show unexpected content and can also have a buggy aspect ratio. Extend avmedia::MediaItem to store cropping and take it into account when returning the preview bitmap in SdrMediaObj::getSnapshot(). PPTX import works out of the box, as oox/ already tried to set a cropping property on the media shape. This is just the preview, the cropping of the video itself is not yet implemented. Change-Id: I8db3e0dcf252613d56eb0e6139adf097e53b15cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138808 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-24Related: tdf#149971 svx: support explicitly provided snapshots for media shapesMiklos Vajna
Snapshots / previews for media objects are used when the shape's video is not playing. This is generated by seeking to the 3rd second in the video, probably to avoid initial black frames. The trouble is that PowerPoint takes the initial frame (at least in case of the bugdoc), so our snapshot doesn't match the reference. We already import a bitmap snapshot from PPTX files since commit e2d46da076f43a7c0d56fc486b9f15339243f7c9 (avmedia: add doc model for bitmap fill of slide narrations, 2021-01-21), fix the problem by changing the snapshot generation to prefer this bitmap over generating one from the video. The crop properties of this bitmap / the video are still not yet handled from PPTX. Change-Id: Id985eaaaad5e4222d9a98203d054e08a0f97a0f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138763 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-11some --disable-pdfium fixesCaolán McNamara
Change-Id: I33867397cd5783adb90e9dc2c62b037ced131e26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138081 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-21tdf#123983 fix loading graphic that is in root folder + testTomaž Vajngerl
We need to detect that the storage name is empty, so in that case the root storage needs to be set as the current storage. Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20tdf#127236 vcl: fix missing encryption of PDF images during exportMiklos Vajna
Regression from commit 78e25558e86188314b9b72048b8ddca18697cb86 (tdf#106059 PDF export: create a reference XObject for JPG images with PDF data, 2017-02-23), once a PDF image was inserted to a document, an encrypted PDF export lost those images. The reason for this is that we started to preserve PDF images as vector data with the above commit, but this means we copied over PDF objects from PDF images to the export result as-is, so encryption was not performed for them. Fix this by separating the write of the PDF object headers, stream content and object footer and then calling checkAndEnableStreamEncryption() / disableStreamEncryption() for each object, even if it's not something our PDF export created but comes from a PDF image. Note that when existing PDF files are signed, PDF objects are also copied into a vcl::filter::PDFDocument, but such PDF images are never encrypted, so it's fine to have stub implementations in vcl::filter::PDFDocument. Change-Id: I2f74b9f51cd35b4319221532ca890e197bab9cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137242 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-06-24tdf#148522 svx: fix undo of cell border changes text alignment in other cellsMiklos Vajna
The Impress table properties dialog has multiple purposes: normally it only affects the properties of the currently active cell, but shadow is applied on the whole shape. Regression from commit fdeb04f7c59cf8032fe17072ed779e70505cc6ab (tdf#129961 svx: finish UI for table shadow as direct format, 2020-12-15), we started to apply properties to the current cell, and then to the whole shape as well, unconditionally. This affects undo/redo, as there is a separate undo manager while the text edit of a table cell is active and when the text edit is ended. Fix the problem by only applying properties on the shape when there we actually have some properties: this way the text edit is typically not ended, bringing back the old undo/redo behavior. Note that we still need to end the text edit if the user explicitly sets some shadow properties, that part is unchanged with this commit. Change-Id: I78e28bd326a2c12c3775b33957adca4cd95ac582 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136357 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-06-18-Werror=maybe-uninitializedStephan Bergmann
Change-Id: Ife1958a39a7cf673b745a7724ee963e868b21432 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136064 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-14Remove some unused includesMiklos Vajna
See tdf#42949 for motivation. Change-Id: I157b331195cc8262e6bd1dcc536cb653587fc45f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135775 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-05tdf#148707 implicit moveTo on all not only on firstRegina Henschel
The current solution checks implicit moveTo only on the first arc in a sequence of arcs. The patch moves it into the loop, so that the implicit moveTo is done for each command in a sequence. Change-Id: I400fa8fc96d7377ede55296c71e7a82ce891cc24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133896 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-05-03Just use Any ctor instead of makeAny in svxStephan Bergmann
Change-Id: I59b1b3f817a9028f132456ea5094f38f88674d00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133768 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29tdf#148714 connect first and second arc with arcToRegina Henschel
The curved*Arrows start with two arcs, which should be connected by a line. The used commands are double V and double B respectively. Both have an implicit moveTo, so that there should be no line between. Other applications show the shapes correctly without line. But because of bug 148714 LO shows a connecting line so that the error was not earlier detected. The patch changes the segment definition so that for the second command the variant with implicit lineTo is used. This does not change rendering in LO but makes other applications rendering the shapes like LO. Change-Id: I4f799f89497e52b1a7e00d8e5345a66ce21c00a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133586 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-04-28sd theme: add PPTX import for shape fill color effectsMiklos Vajna
This is always direct formatting, so FillProperties::pushToPropMap() always has the needed info at hand. Change-Id: I3317b618e0e8bb7688d0f0fbfe4546e2e8b4e947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-22sd theme: add rendering for shape fill color effectsMiklos Vajna
Only the no-effects variant was working previously. Change-Id: I50811a4c49d19dc801f0d1c841cbbdb2fae1ad60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-21tdf#55058 tdf#143875 EMF+ Fix display of dashed lines and line jointsBartosz Kosiorek
With previous implementation, empty spaces between dashes were too long. Additionally line joints were not working correctly, after EMF+ reworking: tdf#111486 This commit fixes all these issues and additionally it is covering it with tests. Change-Id: I9404e566d2d7d3405ab817268ad9b1f538c200eb Change-Id: I523f92a928ab592ff175d0d01c1ad1a3bc22e324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133207 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-04-20tdf#148501 color shades only for filled PolyPolygonsRegina Henschel
For shading parts of a shape not of Type 'ooxml-*', ColorData is used, introduced about 2005. For 'mso_spt*' shapes they are set directly, for others they are encoded as 'col-********' into the Type value. During OOo time two changes were made, resulting in the bugs, that colors are assigned to wrong segments and that shadings are too dark. More details are in the bug report. With this patch the colors are assigned to the correct segments again. The too dark colors are visible in our preset shapes 'Octagon Bevel'. The shape 'Diamond Bevel' with corrected color assignment is also affected. Both need new ColorData. Since it is important for Libreoffice to have good compatibility with OOXML, I have decided to use only the four shading values available in OOXML. In the long run, these shapes should be replaced by ones that contain the shading information inside the <enhanced-path> element. Change-Id: I4b8323c45bf702fc371d6e6c82dd9102d0fd9929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133132 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-13sd theme: add UNO API for shape fill color effectsMiklos Vajna
XColorItem::maThemeColor already provided the document model for this. Change-Id: Iefbd0aeaa37a813bb4c86386801e0116e8fae40d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132933 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-10sd theme: add PPTX import for shape fill colorMiklos Vajna
The theme index is typically not a direct property, but comes from style -> fillref -> theme index, so support that. Change-Id: I00733db44bb5321019bbc7337d10feb0a34661a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131268 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-03Recheck modules sv* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I25779cbfb1aa93c31d6e12ac95e136b3bdbbc058 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130403 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-03sd theme: add rendering for shape fill colorMiklos Vajna
I.e. update the shape fill color when the theme of the master page changes if the color is a theme color. Change-Id: Ia1ed566230a8547334aa4a7d69627882aa690546 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130894 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-01Fix typosAndrea Gelmini
Change-Id: I13e7f1dc5d93f352e79139acb64b46dee298c9fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130186 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-24sd theme: add UNO API for shape fill colorMiklos Vajna
In preparation of adding import/export for this. Change-Id: I195be9e9ccdbb25fa41878a2858c22ee11d189a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130467 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-17tdf#147409 tdf#146866 use SetPropertyValue for toggleRegina Henschel
The toggles (Textpath,SameLetterHeights) and (Extrusion,Extrusion) change a value by directly writing the value into the property. That is lines (*pAny) <<= bOn;, for example. But that does not trigger InvalidateHash() of the SdrCustomShapeGeometryItem. So the item has still aHashState 'Valid'. On the other hand because of the change the hash itself has changed. Therefore the == comparison between the original item and its clone returns 'false' in customshapeitem.cxx#238. And as a result, the assert in itempool.cxx#679 fails. My solution replaces the direct writing with setting the value via SetPropertyValue(), which includes the needed InvalidateHash(). The method InvalidateHash() is private and so cannot be directly used in fontwork.cxx and extrusionbar.cxx. Change-Id: Ib6021defb61478de9cbefa8f26466a2fe21352a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130117 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-02-17tdf#145700 Improve lighting in extruded custom shapesRegina Henschel
The fix tries to make rendering similar to MS Office. The ODF standard follows closely the extrusion in RTF and MS binary format. Rendering uses the 3D scene engine. The main problem was, that the z-component of the direction was interpreted with opposite sign. As result the maximum of a light was at false position. Especially a direction from the observer to the object has produced a light behind the shape and so looks as if light was off. The wrong z-direction has produced lighting, which was less intensive than in MS Office. To compensate that, a third light source was added as workaround. That part is removed. Second problem was wrong use of 3D-scene D3DMaterialSpecularIntensity and D3DMaterialSpecular (= UI Specular color). That was not only wrong in OOo but in my previous patch too. D3DMaterialSpecularIntensity corresponds to MS property 'c3DShininess'. Relationship is Intensity = 2^c3DShininess. D3DMaterialSpecular is calculated from MS property c3DSpecularAmt and and c3DKeyIntensity. The light source was missing, but needs to be included, because c3DSpecularAmt is 'the ratio of incident to specular light that is reflected on a shape'. The old unit tests are adapted to this change. MS gives no information how it softens a light in case of harsh=false. ODF specifies it as 'implementation-defined'. The patch uses four additional lights, which have directions in 60° angle to the original light. The light intensity is distributed. That comes near to rendering in MS Office. Changing our 3D engine to provide 'soft' lights was not doable for me. The way MS Office renders a 'metal' surface is different from ODF specification. To distinguish the kinds, I have introduced a new property MetalType. I have discussed it with the ODF TC (see minutes from 2022-02-07) and got the advise to use namespaced values. Therefore the datatype is not boolean. The 'Surface' drop-down in the extrusion bar is changed to make the two kinds of rendering 'Metal' available to the user. If a user sets surface 'Metal' in the UI of MS Office, it sets not only fc3DMetallic but reduces the value of c3DDiffuseAmt in addition. Our 3D-scene engine has the corresponding ODF attribute dr3d:diffuse-color not implemented. To get a similar rendering I change the material color of the 3D-objects as workaround. Change-Id: Ia986b9c318b4c79688e0c0e2d858215b9d612fdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128449 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-02-11PNG export: allow setting filter data keys from the cmdlineMiklos Vajna
For example, to set a custom pixel size: soffice --convert-to 'png:draw_png_Export:{"PixelHeight":{"type":"long","value":"192"},"PixelWidth":{"type":"long","value":"192"}}' test.odg Change-Id: I628717ba36b6ad1ac03911eec06855c1745ef258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129801 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-05WaE: angle[1|2] may be used uninitialized [-Wmaybe-uninitialized]Caolán McNamara
Change-Id: If8771e4c73656d6f6d236d2d530d0ec92c1f5a7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129533 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>