Commit graph

160 commits

Author SHA1 Message Date
Jonathan Clark
7e4f4a0ccd tdf#163913 Implement font-relative margins
This change adds loext:margin-left and loext:margin-right, which
implement margins that support font-relative units.

See tdf#36709 for additional details.

Change-Id: I31b0dd2b6f98cb5b02fd4dca3608db6fdee4054c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177473
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-11-28 22:10:05 +01:00
Regina Henschel
7cec59402d tdf#131862 No table:cell-range-address in ODF 1.4
ODF 1.4 has removed the attribute table:cell-range-address from the
chart:plot-area element. So we may write it only in versions < 1.4.
The attribute was used to distinguish whether a chart has internal data.
The same information is given by the href attribute of the chart:chart
element.
The actual used cell-range-address values are already given in the
chart:axis and chart:series child elements and evaluated from there.
A global setting is not needed.

The attributes chart:data-source-has-labels, chart:column-mapping and
chart:row-mapping are related to the table:cell-range-address attribute.
These three attributes are deprecated already in ODF 1.2. Thus we will
not write them in ODF 1.4. Their information is given in the chart:axis
and chart:series child elements. The order of series is given by the
order of the chart:series child elements.

Change-Id: I08886723b1c8eb27489a7f44b5f8321572defdff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177323
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-11-27 17:10:40 +01:00
Kurt Nordback
b10d331c1c tdf#161800 - I/O of '# of values in second plot' parameter not supported
Add support for input and output of 'split position' parameter (number of entries
in second plot) for of-pie charts. In OOXML this uses the supported split-pos
tag. For ODF I added an extension in loext namespace for this parameter.
This commit also includes simple tests for the I/O functionality in OOXML and
ODF.

Change-Id: I00ff59db721867fa836eb99b6677350040d005dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170666
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-26 01:34:07 +01:00
Balazs Varga
8391024604 tdf#160404 tdf#160535 tdf#160536 - sc improve sheet protection
tdf#160404: Fix FILEOPEN XLSX Pivot table is not imported if sheet
protection has Pivot table editing enabled
- Import correctly the pivot tables, even if the tab protection is not
allowing to use them.

tdf#160535: Support sheet protection option: Use AutoFilter
- Add new option for tab protection to enable/disable to use autofilter
on the sheet. Import/export correctly to odf/ooxml.
Add new ext-odf attribute: XML_USE_AUTOFILTER

tdf#160536: Support sheet protection option: Use PivotTable&PivotChart
- Add new option for tab protection to enable/disable to use Pivot table
on the sheet. Import/export correctly to odf/ooxml.
Add new ext-odf attribute: XML_USE_PIVOT

Change-Id: I5d34e3608aed1a3d004ec553f6125b6428e9c05e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176274
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-11-14 23:53:24 +01:00
Xisco Fauli
3dcd0f4a4c tdf#162691: ODF 1.4 Add support for xy and polar handle new attributes
Co-author: Regina Henschel
This implements the new draw:handle attributes of ODF 1.4. For reasons
for new attributes see https://issues.oasis-open.org/browse/OFFICE-4110
The old attributes are deprecated but may still be written. So we keep
them to be backward compatible.

Change-Id: I0b3443d000b2b163363f9070e5e276af2b018cbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174966
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-11-12 14:05:10 +01:00
Regina Henschel
1b7bdc2955 tdf#162686 tdf#162687 ODF 1.4 extrusion-metal-type
and extrusion-specularity.

In ODF strict always value 'draw:MetalODF' was written. Changed the
logic to write 'loext:MetalMSCompatible' too, depending on eMetalType.
Using a QName as value requires a namespace declaration for the prefix
'loext'. That is now written directly at the element, not as global
declaration, to restrict its scope to the element. A global declaration
would hide when attributes or elements are accidentially written in
'loext' namespace.

The pattern for nonNegativePercent had missed the percent sign.
The export is adapted to write the percent sign.

Validation is skipped for save to ODF 1.3, because currently the
implicit validation uses always latest ODF version, see tdf#163806.

Tests are extended to cover ODF 1.4 and value draw:MetalODF.

Change-Id: I836d11b9cd327b9772e800d9797e04e1613ab2f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176246
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-11-10 18:50:37 +01:00
Balazs Varga
dcf3a85e6e Related tdf#162262 - sc: odf import/export of "Summary below data"
Add new LO_EXT "summary-below" attribute for table:subtotal-rules.

Follow up commit: 26c08356d1
(tdf#162262 sc add "Summary below data" option for Subtotal dialog)

Change-Id: Ie7f43d3c76479cd9468552b5939de5dbb2082a02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176058
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-11-06 23:26:28 +01:00
Jonathan Clark
43cd683230 tdf#36709 Add loext:text-indent supporting font-relative units
This change adds an ODF font-relative first-line indent paragraph style
attribute as a LibreOffice extension. The corresponding ODF standard
change is tracked by OFFICE-4165.

This change only implements what is minimally necessary to serialize,
deserialize, and check for ODF files containing this attribute. Further
changes are necessary.

* Added cssLength to schema, which is equivalent to length but also
  allows ic and em as units.
* Added loext:text-indent to schema as a paragraph style attribute. This
  attribute is equivalent to fo:text-indent, but accepts cssLength
  instead of length.
* Added XML_TYPE_UNIT_MEASURE to the ODF parser, which currently accepts
  only the font-relative measures and forces fallback in other cases.
* Added loext:text-indent to the ODF parser. This attribute accepts
  font-relative metrics, and will behave as an import-only alias for
  fo:text-indent in other cases.
* Updated SvxFirstLineIndentItem to handle unit-denominated measures.
* Added proof-of-concept indentation handler to Writer. This
  implementation is incomplete and temporary, and will be revised in
  future changes.

Change-Id: I7eb5c7382093cb18a9b0afbf93dacb34ba1d35ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175941
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-11-02 01:09:52 +01:00
Xisco Fauli
146dac7d30 tdf#162690, tdf#162687: Adapt to ODF 1.4
After this, the workaround introduced to
OpenDocument-v1.4+libreoffice-schema.rng in
afa4965e4d "schema: update to ODF 1.4 OS"
can be removed

Change-Id: Iecf31cec0bf187155a97e5b6ccf8173b6aba82fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173940
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-09-25 19:31:28 +02:00
Xisco Fauli
a36e806c21 ODF 1.4: Add ODFVER_014 and ODFSVER_014
Change-Id: I0aa1b6a1f9eec3932b76f5ad0649c462884ffa68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172767
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-09-24 14:49:55 +02:00
Xisco Fauli
746c35baf6 ODF 1.4: schema: rename to OpenDocument-v1.3*
Change-Id: I83ac72accf2bbddd3ca74790654327bb9e86dba4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172765
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-09-24 14:21:15 +02:00
Xisco Fauli
afa4965e4d schema: update to ODF 1.4 OS
* The change in schema/odf1.4/OpenDocument-v1.4-schema.rng
is the same as 56d8007a19
"tdf#134734 tdf#141059 tdf#122508 cui,sw,xmloff: BackgroundFullSize"

Change-Id: I79bdebbee4d250af9c5822bf2f205ef386f1b97d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172392
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-09-24 10:50:07 +02:00
Xisco Fauli
7244f5eaf7 ODF 1.4: Add schema
Source: https://github.com/oasis-tcs/odf-tc/tree/master/docs/odf1.4/schemas
Change-Id: I8b00d6c3c6c3df9c7fc40bcda9379199ff74a7b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172253
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-09-24 10:49:37 +02:00
Regina Henschel
35c5d49664 tdf#162963 export property TotalsRow to ODF
DatabaseRange has got the property TotalsRow with UI and UNO. But this
property was not written to ODF. The patch adds this as attribute
calcext:contains-footer to <table:database-range> element.
Related is issue OFFICE-4169 at OASIS.

Change-Id: I99a51198585b9b7dfb840217bdf1312f2462c9bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173612
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-09-19 08:54:44 +02:00
Balazs Varga
5bb5a7ea60 Related: tdf#161826 - Add uniform Glow effect for texts in shapes
Using text-properties for the glow-text attributes in odf import/export
instead of graphic-properties.

Change-Id: I94f5a76f33a03891fa0bfed988e7e3cd0e842cc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172741
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-09-03 22:52:53 +02:00
Balazs Varga
3eac847927 tdf#161826 - Add uniform Glow effect for texts in shapes
- Add new text Glow effect properties for shapes

- Using TextGlowPrimitive for rendering uniform text glow in shapes

- Add/allow new UI Glow Effect for texts in shapes on sidebar
  (Only for Impress/Draw and Calc)

- Import/Export ooxml files with Glow effect on texts in shapes
  (Only PPTX/XLSX)

- Import/Export odf files with Glow effect on texts in shapes

- Add unit test for glow text attributes in ODF

- Add uni tests for OOXML import/export

Note: Also this patch effects on
tdf#144061 - Effects: Allow GLOW to apply to Text (as we have for shapes)

Change-Id: I16586c01654f197f532129e4e06aa2ef9f214395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172216
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-08-29 19:59:24 +02:00
László Németh
c8a99cb8dc tdf#132599 sw schema xmloff: add hyphenation-keep-type='always'
Add new hyphenation option to limit hyphenation
of the last full line of the hyphenated paragraph.

Move also loext:hyphenation-keep-type to paragraph-properties,
following the associated hyphenation-keep.

Note: value "always" is defined by CSS 4 hyphenate-limit-last,
see https://www.w3.org/TR/css-text-4/#hyphenate-line-limits.

Follow-up to commit 6e8819f29b
"tdf#132599 cui offapi sw xmloff: add hyphenation-keep-type".

Change-Id: I2121269205fc89fb5367dccdca00195aac68f3e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167232
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
2024-05-07 13:58:28 +02:00
László Németh
6e8819f29b tdf#132599 cui offapi sw xmloff: add hyphenation-keep-type
Support XSL attribute "column" and CSS 4 attribute "spread",
stored in loext:hyphenation-keep-type, to give better control
over hyphenation-keep. E.g. spread: both parts of a hyphenated
word shall lie within a single spread, i.e. when the next page
is not visible at the same time (e.g. the next page is not a
right page of a book).

– css::style::ParaHyphenationKeep is a boolean property now,
  importing hyphenation-keep = "page" as true.

– type of ParaHyphenationKeep, including the new non-ODF types
  is stored in the new ParagraphProperties::ParaHyphenationKeepType.

– default value of ParaHyphenationKeepType is COLUMN for
  interoperability.

– Add checkboxes to Text Flow -> Hyphenation Across in
  paragraph dialog:

  * Column (previously: Hyphenate across column and page)
  * Page
  * Spread

  – enabling/disabling them follows XSL/CSS 4/loext, i.e.
    possible combinations:

  * No Hyphenation across
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "column")

  * Hyphenation across [x] Column
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "page")

  * Hyphenation across [x] Column [x] Page
    (hyphenation-keep = "page" and loext:hyphenation-keep-type = "spread")

  * Hyphenation across [x] Column [x] Page [x] Spread
    (hyphenation-keep = "auto")

– Add ODF import/export

– Update DOCX import

– Add ODF unit tests

Note: recent implementation depends on widow settings: disabling widow
handling allows hyphenation across columns and pages not only in table
cells.

Note: RTF import-only, but not used bPageEnd has been renamed to bKeep.
Depending on the RTF test results, likely it will need to disable
the layout change, e.g. GetKeepType()=ParagraphHyphenationKeepType::AUTO,
if PageEnd uses obsolete hyphenation rule, i.e. shifting only the
hyphenated word to the next page, not the full line.

More information:

– COLUMN (standard XSL value, defined in
  https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep)

– SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last,
  equivalent of hyphenation-keep, defined in
  https://www.w3.org/TR/css-text-4/#hyphenate-line-limits).

Follow-up to commit 9574a62add
"tdf#132599 cui offapi sw xmloff: implement hyphenate-keep" and
commit c8ee0e8f58
"tdf160518 DOCX: import hyphenation-keep to fix layout".

Change-Id: I3ac6d9e86d0ed1646f105de8607c0e8ebc534eaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165954
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2024-04-11 10:20:41 +02:00
Rafael Lima
350c590620 tdf#160356 Add support for hidden named expressions in Calc
Since bug 154449 was fixed, Calc now supports hidden named ranges. However, named expressions were not considered in the original patch and it would be useful to support hidden named expressions as well.

This patch adds suppport for hidden named expressions (import and export).

Change-Id: I2580416dcd5db0fcb2aa9061085cdc9975fb03c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165239
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-04-01 05:56:10 +02:00
László Németh
3a332d9f1c tdf#158885 cui offapi sw xmloff: fix hyphenation at stem boundary
Add new hyphenation option "Compound characters at line end",
equivalent of libhyphen's COMPOUNDLEFTHYPHENMIN, to limit bad
pattern based hyphenation of compound words using morphological
analysis of Hunspell.

* Add checkbox to Text Flow in paragraph formatting dialog window
* Store property in paragraph model:
  css::style::ParagraphProperties::ParaHyphenationCompoundMinLeadingChars
* Add ODF import/export (loext:hyphenation-compound-remain-char-count)
* Add ODF unit tests

Note: slower Hunspell based hyphenation is used only if
ParaHyphenationCompoundMinLeadingChars >= 3 (we assume that
libhyphen hyphenation patterns cover the smaller distances
correctly). Hunpell based hyphenation doesn't introduce
new hyphenation breaks, only detects the stem boundaries
from the libhyphen based hyphenation breaks.

Follow-up to commit c899d3608d
"tdf#158885 sw: don't hyphenate right after a stem boundary",
replacing hyphenation zone dependence with the new "Compound
characters at line end".

Note: preset COMPOUNDLEFTHYPHENMIN values aren't loaded yet
from hyphenation dictionaries.

Note: the suffix of the last stem of the compound is always
hyphenated, i.e. the distance limits only hyphenation
inside the stem, not inside its suffix or at the end of the
stem before the suffix.

Change-Id: I46a0288929a66f7453e3ff97fbc5a0c6a01f038f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164983
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-20 13:04:09 +01:00
Kurt Nordback
9ae8e74fb3 tdf#50934: Add a pie-with-remainder-as-another-pie chart type
Implement ODF import/export for bar-of-pie and pie-of-pie types,
and add simple tests for this capability. The associated ODF tags
are implemented in the loext namespace. This also required changing
the schema.

Change-Id: Ib55ae1c5818ad810f7b962d807a9163a3d02ba17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-18 07:07:24 +01:00
Michael Stahl
4d6e9d5e15 tdf#105844 add test for ODF wholesome encryption with macro signature
... plus manifest schema extension.

Change-Id: I73721db8620e97bd58556f9a71afcb0a33f6c7e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161898
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-11 10:50:51 +01:00
Miklos Vajna
7f58b57b47 sw floattable, per-frame wrap-on-all-pages mode: add ODT filter
See <https://issues.oasis-open.org/browse/OFFICE-4150>, map
SwFormatWrapTextAtFlyStart to

	<style:graphic-properties loext:wrap-text-at-frame-start="...">

on export, and the opposite on import.

Change-Id: I43ee4c014fbcef8e883ff08ea061cfd395399a98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160010
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2023-11-28 09:53:13 +01:00
Miklos Vajna
bda066a77f sw floattable: link ODF proposal
Change-Id: Ie0b94b8830f9d2f196effc4a9f7d9fa5839f0d97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159421
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-14 20:10:28 +01:00
Laurent Balland
443027cd71 tdf#156449 Preserve '0' or '?' in exponent
Exponent in scientific number may use '?' as blank like in format "0.00E+?0"
This change:
- adds interpreatation of '0' and '?' in exponent
- adds "blank-exponent-digits" attribute to scientific number for import
  and export to ODF
- prevents using exponent with only '?'. There must be at least one '0'
  in exponent
- adds QA test of such format and test import/export/import to ODF and OOXML
- corrects one basic test

Change-Id: If52edc632a161f842270bb2fd77af535e2b978d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154986
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
2023-11-01 11:43:54 +01:00
Laurent Balland
cc721291cc tdf#153993 Extend ODF: lowercase for exponent char
In scientific format, user may want to have clearer format such as:
0.000" "000" "e+" "0

This change
- adds "exponent-lowercase" boolean attribute to scientific-number format to preserve "e" or "E" char
- includes all positions up to exponent for embedded text of scientific number

Add QA test

Change-Id: Ie263f4ecf30a1a8dcd8046e1e048767020e54dc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153824
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
2023-11-01 09:10:19 +01:00
Skyler Grey
6412a74b35 Enable STYLEREF flag export/import with ODF
This commit enables exporting the following STYLEREF flags with ODF
- Search from bottom to top
- Hide non numerical

After this commit, the following steps have been implemented
- The document model (I7d8f455ffe90cface4f3b1acf6b9bef6a045ed19)
- The layout (I7d8f455ffe90cface4f3b1acf6b9bef6a045ed19)
- The UI (I7d8f455ffe90cface4f3b1acf6b9bef6a045ed19)
- UNO (Ib664fec059aa1f7f130acc76c253d5d298fa59f7)
- DOCX/ODF filters (here and Ib664fec059aa1f7f130acc76c253d5d298fa59f7)

Change-Id: Iad8e8001807f5ceeaedc9665838672695174a936
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158351
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-30 20:07:01 +01:00
Attila Szűcs
e4fb4937b3 tdf#157663 SW: Tracked change improve move
Made accept/reject handle move redlines other pair, (moveto-movefrom)
and handle the whole move redline, even if it is split into small pieces
that separated from each other.

Added unique ID to every move redline to help find their other parts.
This move ID is generated in case of:
move recognition
moveing a paragraph. (directly create move redline with unique id without
calling the recognition it is faster and more stable)

(there are other cases that could be improved to not use recognition,
but generate ID directly, like moveing selected partial text with mouse)

Implemented the odt export/import of this move ID.
it is a tag like this: "<loext:move-id>4</loext:move-id>"
next to creator/date

Improved the docx import to generate this move ID, so move redlines can
find their other parts
(Not changed Docx export... it works a bit, but far from perfect)

Improved move reckognition:
It can find them even if they are split into multiple parts differently.
(like "ab"+"cd" == "a"+"bcd")
Disabled this because of probably performance issue.

made a complex unit test for it.

Note: Left the move recognition on every place, to avoid as much
regressions as possible.. but in the future, we may can disable it
in some cases.
Note2: We will have to keep move recognitnion, because there are documents
from past, saved without any move informations in the file, and users
expect to see move redlines there. (generated by the recognition.)

Change-Id: If968d4235b676c5e538cfaf4187a4482a86eae9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157740
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158611
Tested-by: Jenkins
2023-10-29 19:30:43 +01:00
Skyler Grey
32c588dd11 tdf#86790: Add support for a word-style styleref
STYLEREF is a field type in Word which changes its content based on
nearby paragraphs. For example, upon creating a styleref referencing
"Heading 1" you will see the text of the nearest "Heading 1"-styled
paragraph that is above the field.

This patch implements STYLEREF in Writer as a cross-reference. By using
"insert>cross-reference>styles" you'll be presented with a list of
styles. Selecting one and clicking "insert" will create a field which
has text from the "most relevant" instance of the style. To find the
most relevant instance we first search up for paragraphs with the style,
and if there are any we take the closest. If there weren't any, we
search down for paragraphs with the style.

This patch also updates our use of STYLEREF for chapters exported to
docx by using it for all chapters not only those in headers and footers.
This allows us to approximate more chapter field functionality even when
moving between Writer and Word.

Finally, this patch adds some tests for STYLEREF:
- testTdf86790 tests that the "sample file with STYLEREF" document from
  tdf#86790 has the correct fields
- testStyleRefSearchUp tests that the STYLEREF searches up when there
  are bits of text both above and below it
- testStyleRefSearchDown tests that the STYLEREF searches down when
  there are bits of text below it only
- testMarginalStyleRef tests that the STYLEREF searches from the page
  top when it is placed in a footer
- testFootnotetyleRef tests that the STYLEREF searches from the
  reference mark when it is placed in a footnote

Still TODO:
- [  ] Update documentation
- [  ] Implement reverse-searching (\l) and nondelimiter
       suppression (\t)
       - Probably these 2 will be in a followup patch

Change-Id: I25dd7a6940abee5651a784b9059fe23b32547d6c
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157456
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-10-20 08:53:34 +02:00
Rafael Lima
8938bc7039 tdf#154449 Add support for hidden named ranges
This patch adds the possibility of having "hidden" named ranges in Calc, in a way similar to what MS Excel has (i.e. they're not visible in the UI and can only be hidden/shown via scripting).

This is done by creating a new HIDDEN flag in com.sun.star.sheet.NamedRangeFlag.

Hence thia patch makes it so that named ranges can be made hidden/visible via scripting. For instance, consider a Calc document with a named range "NamedRange1". The following scripts hides "NamedRange1" from the UI (i.e. it's no longer visible in the Manage Names dialog):

Sub SetHidden
  Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag
  aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1")
  nType = aNamedRange.getType() Or eFlags.HIDDEN
  aNamedRange.setType(nType)
End Sub

To make the named range visible again:

Sub RemoveHidden
  Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag
  aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1")
  nType = aNamedRange.getType()
  nType = nType - (aNamedRange.getType() And eFlags.HIDDEN)
  aNamedRange.setType(nType)
End Sub

This patch also implements ODS and OOX import/export, as well as QA tests.

Change-Id: I10efe46938fe772b87dc17fc597cb83648b5efb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155599
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-01 13:01:32 +02:00
Gökay Şatır
62cc221721 Added parent / child relationship to comments.
Adding parent name of a comment into odf file when there is a parent.

Also includes:

    Added test case to comment property test.

    Change-Id: I033f6574b4875fcb76b16c8b5b9d9f7d55b52cbe

Also includes:

    Add parent / child relations to replied comments.

    Change-Id: Ia7d95c4e6020b501798a89cbdcae64dc5691437c

Change-Id: I08b5ab6eb11adcafcbf3559896d79d41b449b26a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156824
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-09-12 17:09:18 +02:00
Laurent Balland
74d9da037c tdf#152724 Extend ODF for blank width "_x"
Number format code "_x" is currently saved as a text string containing a
number of spaces corresponding to the width of character "x". It may be
confusing for user if its format code is modified.
This change introduces a new XML tag XML_BLANK_WIDTH_CHAR to replace the
previous text string if ODF version is extended

<number:text> and <number:embedded-text>:
the attribute is composed of a string containing the used character and its
position in the text string (if position is 0, it is omitted).
Several blank code characters are separated by '_'.
Replacement blanks in the text string are preserved to enable compatibility.

Example: format code
"foo"_M_I_N"!"???,???.000_.000"!"_)
is saved as:
  <number:number-style style:name="N173">
   <number:text loext:blank-width-char="M3_I6_N7">foo       !</number:text>
   <number:number number:decimal-places="6" number:min-decimal-places="6" number:min-integer-digits="6" loext:max-blank-integer-digits="6" number:grouping="true">
    <number:embedded-text number:position="-4" loext:blank-width-char="."> </number:embedded-text>
   </number:number>
   <number:text loext:blank-width-char=")1">! </number:text>
  </number:number-style>

Add QA test

Change-Id: I785e1a14ecccc900e9fd5af88dd7b743fefcc48c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146582
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2023-08-25 17:49:17 +02:00
Tomaž Vajngerl
9d1140cb74 xmloff: support stroke/line complex color import/export + test
Change-Id: I4ed901fd5b23e58aafa781e2b07f460f034fbba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155685
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25 08:04:29 +02:00
Tomaž Vajngerl
c8d8bf4282 sc: theme color support for sparklines + ODF & OOXML import/export
This changes Sparkline colors to use complex colors instead and
adds Sparkline theme color import and export support for ODF and
OOXML.

Change-Id: I58edd525d50f95199bd4fe7825afb51aaa7fc091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155113
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-02 21:22:43 +02:00
Tomaž Vajngerl
5e34a25aa7 sc: Add import/export ODF support for border complex colors
ODF Import and export support for border {left,right,top,bottom}
complex colors. In addition round-trip test was extended with the
border use case.

Change-Id: I1d14690272c06e8ffcfcd483eb7f688ca5bb1e5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155014
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-01 08:15:24 +02:00
Tomaž Vajngerl
dceeb9550d sc: ODF import/export of background cell complex color
Change-Id: Idf526aea21ccfeda9b03d1fb69588f120b6e161d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154571
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-18 15:11:11 +02:00
Mike Kaganski
fd64b426bc tdf#150408: Implement "Legal" numbering (all levels using Arabic numbers)
Enabling this feature on a list level makes all numbered sublevels, that
constitute the number of this level, to use Arabic numerals. This doesn't
change the labels of other levels: e.g., if level 1 uses A,B,C; level 2
uses i,ii,iii; level 3 uses a,b,c, and is "Legal"; and level 4 uses 1,2,3;
then a list may look like

  A. Something
    A.i. Some subitem
    A.ii. Another subitem
      1.2.1. This is a "Legal" sub-subitem
        A.ii.a.1. And its child

This improves interoperability with Word.

This change introduces document model, ODF and OOXML import and export.
In ODF, a new boolean attribute of 'text:outline-level-style' element,
'loext:is-legal', is introduced; its default value is "false".

Change-Id: I5ae9f970864854c7e84c4b2f7ce46634b3ef104e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154288
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-07-11 14:02:19 +02:00
Michael Stahl
1e7cab690d xmloff: ODF export: stop producing decorative on draw:frame etc.
The attribute was moved to the style graphic-properties in commit
2721520ca3, which is in 7.5.2 so users
likely have upgraded from 7.5.0/7.5.1 and this can be removed now.

Change-Id: I69ef3e2e501af21f04df440bf176e46f651d671b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154074
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-06 09:29:16 +02:00
Laurent Balland
8ef4d3a416 related tdf#153993 Embedded text in scientific numbers
Embedded text was limited to number:number. But scientific notation may
require embedded text like
0.000" "000E+00
This change extend ODF format to support embedded text in
number:scientific-number also

Change-Id: I4e3220b06efbd9228d722bf518e137d7707ccf4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150804
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2023-06-27 17:26:22 +02:00
Tomaž Vajngerl
38e0e78998 xmloff: add color-type attribute to complex color
We need to identify what the color type of the complex color is.
For now we mostly use "theme", but in the future we can also have
other types like "rgb",... when the infrastructure for that is
built.

Change-Id: I38c91d294a191ca3124be4e99050977c9815d23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152253
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-27 06:00:31 +02:00
Tomaž Vajngerl
9747d9a6ea xmloff: rename theme color names and color-table to theme-colors
For ODF it's not needed to abbreviate names and we prefer to use
full names. The theme color names in OOXML are abbreviated and the
same names were used also for ODF - this was changed now.

"color-table" used in "theme" element has reused the already
existing "color-table" element name in ODF, but they don't relate
to each other. The name was changed to "theme-colors", which makes
more sense anyway.

Change-Id: I61ec91895d301ad4343f2b977d5cbcf38e360b99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152252
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-25 10:05:21 +02:00
Tomaž Vajngerl
68c4d1ca20 xmloff: rename *-color-theme-reference to *-complex-color
Change-Id: I63dd83522da7699162eb06a019a679d4b8750d10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152053
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-25 03:58:44 +02:00
Regina Henschel
1d2830b936 tdf#155271 add drawooo:display to libreoffice-schema
Commit 33ef17ed had introduced attribute drawooo:display at 2010-03-02.
The entry in libreoffice-schema.rng was missing and therefore
validation in unit tests fails, when this attribute occures.

The attribute is written in case an object in Calc is hidden by hiding
the cell to which it is anchored, for example. The attribute belongs to
properties 'Visibile' and 'Printable' in 'Shape Service' in API.

Change-Id: Id3d2e7984aed146fca9e2819eb183d7d7bfaf701
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152119
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2023-05-22 19:40:45 +02:00
Mike Kaganski
1a88efa8e0 tdf#155238: Reimplement how ListAutoFormat is stored to ODF
This reimplements commits 6249858a89
(sw: ODT import/export of DOCX's paragraph marker formatting,
2022-12-19) and 209dce614c (sw: fix
ODT import of paragraph marker formatting, 2022-12-20).

Instead of using an empty trailing span for the ListAutoFormat data,
introduce a new loext:marker-style-name attribute for text:p element,
referencing a text autostyle.

The problems with the previous implementation were that (1) it was
impossible (or very difficult) to disambiguate several empty trailing
spans, in case it was needed; and (2) this was incompatible change,
with other ODF implementations treating the trailing span normally.

I couldn't manage to incorporate the attribute to paragraph autostyle,
because of problems referencing different autostyles one from another,
so put it directly to the paragraph attributes.

Change-Id: I33473147f1f774c24cbbc57bf0c4f3a1d83ce5bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151645
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-11 18:06:02 +02:00
László Németh
ffd8d20d36 tdf#150673 sw xmloff: import/export tracked table column
to OpenDocument format using

<style:table-cell-properties loext:text-changes-only="false"/>

Follow-up to commit 05366b8e66
"tdf#60382 sw offapi: add change tracking of table/row deletion"
and commit 48898a7206
"tdf#60382 sw xmloff: import/export tracked table/row deletion".

Change-Id: I6fb37322056a42a6746db0e4144b0848b0754b0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151606
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2023-05-11 13:52:16 +02:00
Vojtěch Doležal
d543eb2d8e Reworked bibliography mark link target to have user-selectable type
Without this change, havign no link is not possible, if the bibliography entry has URL.
This commit adds a select box for user to choose between target types (Entry URL, specific Target URL, None, bibliography table row)
The main features are that it also makes it more obvious to the user and makes it possible to easily extend target types in the future.

As for compatibility, files from before 7b99871635 are fully compatible without any hurdles, as missing property maps to the old behaviour.
Bibliography marks saved after 7b99871635 will also revert to the old behaviour, however no actual data (such as target URLs) will be lost.

Change-Id: Iad61dd8b4df337fa202f45d117313ee47ec20c05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150708
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-05-05 08:32:09 +02:00
Regina Henschel
f2eac63dcc WIP ODF import and export for MCGR
Current state uses:
Element loext:gradient-stop with the attributes svg:offset,
loext:color-type with value 'rgb', and loext:color-value with
values of kind #rrggbb.
Element loext:opacity-stop with the attributes svg:offset and
svg:stop-opacity, both with datatype double.

With MCGR enabled testColorGradientWithTransparencyDOCX in
CppunitTest_chart_export3 has the value 90000 instead of
90196. That is same value as in original file. Thus I have
adapted the test.

Change-Id: I976934f9b8fb79be4f74adb180b3285486dce31f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150060
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-04 11:57:51 +02:00
Dennis Francis
2f8d10b0b9 sc: pivot table compact layout
This implements compact layout for pivot tables. In ooxml each row field
can have a compact layout setting. Support for any such "mixed" layout
of tabular/outline/compact per field is also implemented. This also
implements expand/collpse toggle buttons to field labels to make pivot
tables with compact layout more usable. Such buttons are also available
if other layouts are used.

Conflicts:
	sc/qa/unit/pivottable_filters_test.cxx
	sc/source/ui/cctrl/checklistmenu.cxx
	sc/source/ui/inc/checklistmenu.hxx

Change-Id: Ieaa1f3bd282ebdec804d0b45a0af7b3d95a2027f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151057
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
2023-04-27 08:35:59 +02:00
Sarper Akdemir
fa5c01e677 related tdf#102261: xmloff: ODF import/export for ParaTabStopDefaultDistance
Introduces ODF import/export for ParaTabStopDefaultDistance
(loext:tab-stop-distance).

Also adds a unit test that covers import & export of the
property.

Change-Id: I8a69a9e2b73e8f1172f92dc35fada901f4b887f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148540
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-03-24 07:18:54 +00:00
Vojtěch Doležal
61d55b67b0 Moved target-url and use-target-url into loext namespace
Change-Id: I4307a20f34543d4a187b5e59f117b43371f6f6fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148559
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-03-10 08:54:49 +00:00