diff options
author | Skyler Grey <skyler.grey@collabora.com> | 2023-10-20 13:07:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-30 20:04:01 +0100 |
commit | e195c22533de44cd4f6afab7836c7eb6a613d202 (patch) | |
tree | e59ed742c91328d3b7f6abc18667646d9c5b6dd3 /writerfilter | |
parent | 186398e2661c8be9c4d8447d2c8fada443b26ad4 (diff) |
Enable STYLEREF flag export/import with OOXML
This commit enables exporting the following STYLEREF flags with OOXML
- 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
- DOCX filter
Change-Id: Ib664fec059aa1f7f130acc76c253d5d298fa59f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158350
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 18 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ae121ea2b2d3..ae69b3ba5b89 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -126,6 +126,9 @@ #include <unicode/errorcode.h> #include <unicode/regex.h> +#define REFFLDFLAG_STYLE_FROM_BOTTOM 0xc100 +#define REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL 0xc200 + using namespace ::com::sun::star; using namespace oox; namespace writerfilter::dmapper{ @@ -7600,6 +7603,21 @@ void DomainMapper_Impl::CloseFieldCommand() xFieldProperties->setPropertyValue( getPropertyName(PROP_SOURCE_NAME), aStyleDisplayName); + + sal_uInt16 nFlags = 0; + OUString sValue; + if( lcl_FindInCommand( pContext->GetCommand(), 'l', sValue )) + { + //search-below-first + nFlags |= REFFLDFLAG_STYLE_FROM_BOTTOM; + } + if( lcl_FindInCommand( pContext->GetCommand(), 't', sValue )) + { + //suppress-nondelimiter + nFlags |= REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL; + } + xFieldProperties->setPropertyValue( + getPropertyName( PROP_REFERENCE_FIELD_FLAGS ), uno::Any(nFlags) ); } else { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 554f7490c991..be8dd75fc8cf 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -259,6 +259,7 @@ namespace { PROP_TABS_RELATIVE_TO_INDENT, u"TabsRelativeToIndent"}, { PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES, u"CreateFromLevelParagraphStyles"}, { PROP_DROP_CAP_FORMAT, u"DropCapFormat"}, + { PROP_REFERENCE_FIELD_FLAGS, u"ReferenceFieldFlags"}, { PROP_REFERENCE_FIELD_PART, u"ReferenceFieldPart"}, { PROP_SOURCE_NAME, u"SourceName"}, { PROP_REFERENCE_FIELD_SOURCE, u"ReferenceFieldSource"}, diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 581378af895a..40395cd04d8a 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -267,6 +267,7 @@ enum PropertyIds ,PROP_REDLINE_DATE_TIME ,PROP_REDLINE_TYPE ,PROP_REDLINE_REVERT_PROPERTIES + ,PROP_REFERENCE_FIELD_FLAGS ,PROP_REFERENCE_FIELD_PART ,PROP_REFERENCE_FIELD_SOURCE ,PROP_RESTART_AT_EACH_PAGE |