Age | Commit message (Collapse) | Author |
|
Change the xmloff filter to use XThemeColor and the associated
proprties (CharColorThemeReference and FillColorThemeReference).
Change the ODF format for referencing a theme color - make it an
element instead a series of attributes on the *-properties style
element.
Change-Id: I0fa7d8ebffecc02897b7fe9824d6f1776ef36380
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144923
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Follow-up to 100c914d44ae8f362924fe567d7d41d0033ae8ad
which added the initial id preservation for DOCX.
adding DOCX block SDT grabbaging, ODF import/export
[content controls can't exist in DOC format]
The ID field is CRITICAL to preserve for VBA purposes.
This patch adjusts BlockSDT to also round-trip the id
instead of just creating a random one.
m_nRunSdtPrToken <never equals> FSNS(XML_w, XML_id) since 2021
with 5f3af56b2c0ef6c628a7cfe5ce6e86f8e1765f5f,
so I removed that part of the clause.
I had thought about changing the ID to use a string instead of an int,
but then the integer version was adopted to fix a regression
in the commit mentioned earlier.
I think it is AWFUL to have a number as the identifier
when it will be used in StarBASIC. The VBA guys have to deal
with it, but it would be nice to do something reasonable
for LO native access to content controls.
However, the concern would be if we allow VBA macro content created in LO
to be exported to DOCX format - that would cause problems converting
from a string ID to a number ID. VBA editing already is happening to
some extent, and mmeeks seems interested in enabling it.
So over-all it seems best to just stick with an integer ID.
I used the commits for <w:alias> and <w:tag> to compose this patch.
XML_ID already existed in include/xmloff/xmltoken.hxx
and "id" already exists in xmloff/source/token/tokens.txt
The ID can be used in VBA to select a specific control.
The id (which is a positive or negative integer in DOCX)
specifies a unique control - either by passing the number as a string
(of the UNSIGNED value) or by passing as a float (specified with #).
For example:
msgbox ActiveDocument.ContentControls(2587720202#).ID
msgbox ActiveDocument.ContentControls("2587720202").ID
but not as an integer since that is used for index access.
dim index as integer
index = 1
msgbox ActiveDocument.ContentControls(index).ID
make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText
make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport
make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf151912
make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport
Change-Id: I5c4022dc932d941fad9da6d75ce899ee1ff66ff5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142818
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
This has to be vital to keyboard navigation.
Certainly it is good to have it imported
before we start to consider tab-movements
for form controls.
All tabIndex 1's are processed (in placement order)
and then the 2's etc. 0's are to be done last.
XML_TAB_INDEX already existed in include/xmloff/xmltoken.hxx
and "tab-index" already exists in xmloff/source/token/tokens.txt
make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText
make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport
make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport
No existing unit test found containing blockSDT with tabIndex.
Change-Id: I8a958844e6192b079a2b22a62dedfd8739021f4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143603
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
DOCX SdtControls can be locked in two ways:
-Content Control cannot be deleted (sdtLocked)
-Contents cannot be edited (contentLocked)
or both (sdtContentLocked)
make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText
make CppunitTest_sw_ooxmlexport4 CPPUNIT_TEST_NAME=testSimpleSdts
make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport
make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport
make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport
Change-Id: I5a82d9f6b5103a4902f59af66cd8a99addd4e690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143542
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
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>
|
|
- Replace SwContentControl::HasListItems(), which assumed that the type
is dropdown if we have list items. This is not valid, it's OK to have
a dropdown with no list items. Add a GetDropDown() instead to check
for the type, explicitly.
- UNO API sets the dropdown bit when list items are set and the type is
not expilcitly combo box or drop down, to keep backwards
compatibility with existing documents.
- No change to the edit shell, SwDropDownContentControlButton already
checked if items are empty and used STR_DROP_DOWN_EMPTY_LIST in that
case, but that was dead code previously.
- ODT & DOCX filters are now updated, ODF has a new
<loext:content-control loext:dropdown="..."> attribute to specify that
the type is a dropdown, explicitly.
Change-Id: Id577ba9639151549a8f953aab31685a73a898504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142491
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
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>
|
|
Change-Id: I13da5ca9d07131a340dcf95ca0b980d75ca6e9d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142229
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I767f464ec666330a2e8e832b6d6f5736a6bef54d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142228
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
parseExportStream is already in MacrosTest
Change-Id: Ibde88b176db1521966b6877bda90e06c278c397d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142218
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I0f04fae8b4ff922f5e14ae413cd63cc92a66077e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141797
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: Ia6e083df4dfb6a6354f3bbe2f5eabaca559281b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141771
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: If0f956336581438927ab3e01a50374c15b43bcd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141763
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: Ic876ff8d67a7da22e381510bebf3ddb80139a81b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141760
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Map the Alias/Tag UNO properties to:
<loext:content-control loext:alias="..." loext:tag="...">
on export, and do the opposite on import.
Change-Id: Icecbe9037ede0bf8d72d52f2db44328a8db1d83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141492
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
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>
|
|
Map the ComboBox UNO property to:
<loext:content-control loext:combbobox="...">
on export, and do the opposite on import.
Change-Id: I33c162ace15025c8031eb678ba5a43ac085c4b6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140364
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
The bugdoc has a broken image where both axis are set to a relative size
of 255%, which means "keep aspect", and the expectation is that only one
axis uses this to match the size of the other axis.
The problem was that commit b578fa08a25a83abccad2386e12b707586fffb26
(ODT export: fix fallback svg:width/height for text frames with relative
sizes, 2022-03-16) assumed that only one axis uses "scale", so we always
get a non-zero layout size.
Fix the problem by only using the layout size when exactly one axis uses
the "scale" percentage, which is the expected the case.
This way we just keep the aspect ratio of broken documents, then the UI
will in practice ignore the scale request of the width.
Change-Id: I2dbd6bb92f912f6185422fd301b99b284a66ef74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140218
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
And also import/export the video preview as well. The naming follows the
style used for table shape previews.
The preview is important, since the cropping is relative to the bitmap's
preferred logic size.
Change-Id: I6115284c1f4cf342b3296cd0ac3beb70a809fd1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138959
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
The 'bt-lr' attribute value of 'writing-mode' attribute and the
'page-content-bottom' and 'page-content-top' values of 'vertical-rel'
attribute are not part of ODF 1.3. Therefore they need to be saved in
'loext' extended namespace.
Error was, that this was done too, if the current ODF version is
strict. That results in an invalid file in a productive build and a
failed assert in SvXMLNamespaceMap::GetQNameByKey() in a debug build.
Change-Id: Ie9ba99fdd02de21a2467b236409daa951933f011
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138595
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
|
|
XMLTextParagraphExport::ExportContentControl() disables the export of
the <loext:list-item> XML element in autostyle mode, then it should also
disable the export of the matching attributes.
Change-Id: Ia65fc8bd3398df0ab1b71973695c9bc8d10deaa4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137452
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Map the PlainText UNO property to:
<loext:content-control loext:plain-text="...">
on export, and do the opposite on import.
Change-Id: Icec0c35b2b9fca53104e6526c98083db52df5d42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137340
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
The attributes 'vert' and 'vert270' set property TextPreRotateAngle on
import from OOXML. The property TextRotateAngle can be set by macro.
Both were written to file as 'draw:text-rotate-angle' attribute. So we
got a file format error 'duplicate attribute'.
The values are now added and the sum is written. That gives the same
rendering as after applying a macro. Using the sum is a workaround. We
have currently no way to save the direction specified by 'vert' and
'vert270' as style:writing-mode to ODF.
Change-Id: I93fd8ca42b82c1ed7f1bf6e33d932e5510615b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135901
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
|
|
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>
|
|
While working on the DOCX import for dates, it turns out there is a need
to store the selected date in machine-readable format as well. This is
useful, because once the timestamp is formatted, the user is allowed to
hand-edit the result, so otherwise the selected date would be lost.
This commit adds:
- doc model & UNO API
- click handler (store the selected date, default to the current date in
the date picker if possible)
- ODT filter
- DOCX export
And tests for all these.
Change-Id: I00f4e87ebfe0e8a19486367c32d472ccd2ff16a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135035
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Map the Date, DateFormat and DateLanguage UNO properties to:
<loext:content-control loext:date="..." loext:date-format="..." loext:date-rfc-language-tag="...">
And do the opposite on import.
Change-Id: I16d3f755d77ed20380d877ba65dfe6d063f2bec2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134977
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
(*) use o3tl::span for the array param, which means we don't need a null
entry to terminate the array
(*) use std::unordered_map to speed things up
(*) mark the array as static at a few more call sites
Change-Id: I05b6cae7552f44459e183ec05cb94e60edb3bfe0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134832
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Map Picture UNO property on content controls to:
<loext:content-control loext:picture="...">
And do the opposite on import.
Change-Id: I47c3d04c505ba94da958d5d6b6b2c883236afc3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134595
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
Map each list item to a dedicated XML element:
<loext:list-item loext:display-text="..." loext:value="...">
And do the opposite on import.
Change-Id: I59a536a8317a3bb24919107b4449f858d5f6de96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134034
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Map a themed color with effects to:
<style:graphic-properties draw:fill-color="..." loext:fill-theme-color="..." loext:fill-color-lum-mod="..." loext:fill-color-lum-off="...">
Change-Id: I18d8ddf8d6050ef468a8d67a9e797a576f682e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133843
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
The CurvedArrow shapes had an error in their enhanced-path. The error
was fixed in the geometry definition with commit 4cfe4699. But the
wrong path was written to file markup. This patch repairs the path in
shapes in documents written before the fix of the geometry definition.
Change-Id: I6d7bc3b4ec4a61f16ce5dea3d352575525850b80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133740
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
|
|
Change-Id: Ibefb18e5b798ccf1f9d7a5ba1524c9fb1e9bee32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133700
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Textbox z-order synchronization was missing in case
of Undo, resulting broken text boxes.
Regression from 504d78acb866495fd954fcd6db22ea68f174a5ab
"tdf#143574 sw: textboxes in group shapes - part 1".
Change-Id: I2632b7fb40e327f083e680e10b19c8f405df1875
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130875
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Attila Bakos <bakos.attilakaroly@nisz.hu>
Reviewed-by: László Németh <nemeth@numbertext.org>
|
|
Map the 4 new UNO properties to XML attributes:
- Checkbox <-> loext:checkbox="..."
- Checked <-> loext:checked="..."
- CheckedState <-> loext:checked-state="..."
- UncheckedState <-> loext:unchecked-state="..."
Change-Id: Ia4623004ee39c77f5f242c2d720bc188e4dd9433
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133467
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Map
<loext:content-control loext:showing-place-holder="...">
to com.sun.star.text.ContentControl and set its ShowingPlaceHolder
property based on the XML attribute.
This requires moving XMLImpSpanContext_Impl to txtparai.hxx, otherwise
XMLContentControlContext would have to be in txtparai.cxx, which is
already large.
Change-Id: I9a915868160ebcc0e98ded61bfab72f32864bd76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132804
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Wrap the text portions inside the content control in a
<loext:content-control> XML element. Also map the (so far) single UNO
property of it to <loext:content-control
loext:showing-place-holder="...">.
This is just initial export for inline text content controls, more
properties are to be added in follow-up commits.
Change-Id: I5d928255b925ed7e08fb635ba39f546e9a4879de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132717
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Refer to the 12 pre-defined colors by name + don't write the attribute
for the case when there is no theme.
Change-Id: I37c984b3371ec878a0d733977f5c937dce27c440
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131717
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
In case <draw:frame> has style:rel-width="..." and style:rel-height="...", then the ODF spec says that:
> To support consumers that do not support relative width, producers
> should also provide the width in a svg:width 19.575 attribute.
If the motivation is to support simple consumers, then it's better if we
write the up to date layout size as the fallback value, not what was the
layout size at insert time.
(But don't ignore this at import time: 80% width and "scale" for height
is a valid combination, and then height/width is needed to know the
ratio.)
Change-Id: Iefeb43cdb141b01a732086c37186201a3fef0952
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131662
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Map
<text:line-break loext:clear="..."/>
to com.sun.star.text.LineBreak and set its Clear property based on the
XML attribute.
Change-Id: I76d375de23146592c2327df16aa5066ee2a6598d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131645
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Write the clearing break as:
<text:line-break loext:clear="..."/>
Change-Id: Ieb517b825f2ee162bb70a453a3756ec870fa8aac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131346
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
This attribute is needed when a numbering is built using multiple,
independent <text:list> elements. In that case the markup to connect
these are either:
<text:list text:style-name="L1">
</text:list>
...
<text:list text:continue-numbering="true" text:style-name="L1">
</text:list>
In case there is no other list in-between, or:
<text:list xml:id="..." text:style-name="L1">
</text:list>
...
<text:list text:continue-list="..." text:style-name="L1">
</text:list>
In case there are other lists in-between.
This means that at least in case all the text nodes of the numbering are
after each other, then the random value in xml:id="..." is never
referenced, so it can be omitted.
This helps deterministic ODF output when the input is HTML, where there
are never text:continue-list="..." attributes that would refer to these
xml:id="..." attributes.
Change-Id: Ice69422a12d4229879f89f3a4a24ed926c6d43af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131322
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
in case of it has to follow the text flow.
Change-Id: Ic4f195c2efcc465276faa9a95362933dafa65bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130077
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
|
|
which resulted lost (invisible) text content before
implementing its support now.
Cleanup to SwTextBoxHelper by removing its unneeded functions.
testFDO78590 was commented out temporarily because it has a
pure VML groupshape inside and it's converted to WPG during
the test run resulting crash on reopening, because lack of
its support in DocumentContentOperationsManager, trying to
convert the content to a text frame inside a text frame.
Regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834
"tdf#143574 OOXML export/import of textboxes in group shapes".
Change-Id: Ic6ce3549d390ae763044f54e991f390677704396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129627
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
|
|
The ODF spec says that text:continue-numbering="true" should only
continue the numbering in case the styles of the previous and the
current list match.
In contrast, Word continues the numbering even in case there is e.g.
numbering, then bullets, then numbering again, in case the list styles of
the two numberings are the same.
Work this around at import time when the generator confirms that the
document is coming from Word. At least Office 2019 and the latest
renderer at office.com is affected.
(I've mailed dochelp@microsoft, no answer yet.)
Change-Id: Ib63e14322e5501a6220f798abd9365d7913dab4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130503
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
The fix for tdf#145700 has changed the internal handling so, that
values larger than 100% from MS binary import are now kept und correctly
used. But ODF 1.2 and 1.3 have the range restricted to
zeroToHundredPercent.
The patch writes values larger than 100% in extended namespace for our
'ODF 1.3 extended'. It writes draw:extrusion-specularity in any case, so
that older versions get a meaninful value, but clamps it to [0,100] if
necessary to get valid files.
Change-Id: I98298d5c3e3367ffe4a45cdc051be23679308119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130306
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
|
|
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>
|
|
This builds on top of commit 28d67b792724a23015dec32fb0278b729f676736
(tdf#107776 sw ODF shape import: make is-textbox check more strict,
2019-08-26). Before that commit, any non-empty parent style name on a
shape resulted in an sw textbox. After that commit, we filtered out Writer
images by checking for the Frame parent style name.
The problem with this approach is that in case two documents are to be
merged together, then it's reasonable to rename the Frame style, but
then the complex content inside the shape gets lost.
Fix the problem by going with a middle ground: require Frame as a
prefix, but allow other names as well. This gets e.g. FrameX to work
without breaking the "reject Graphics" use-case.
Change-Id: Id59ed28a64a9398f2f1620f69b5f148d65e6c95a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126828
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Thanks for catching this Regina.
Change-Id: Iaf6a0c9161378934818e392126a4437e55f5ddf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126743
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Handle luminance modulation and offset (i.e. lighter and darker colors).
Change-Id: I536bbca1ed994e991c7ceac153d6a47cb6ef35f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126722
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Refer to the 12 pre-defined colors by name + don't write the attribute
for the case when there is no theme.
Change-Id: Ib6ab5b7b34d896a36e04309bf0cb410998acce01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126566
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|