From e195c22533de44cd4f6afab7836c7eb6a613d202 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Fri, 20 Oct 2023 13:07:12 +0000 Subject: Enable STYLEREF flag export/import with OOXML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 18 ++++++++++++++++++ writerfilter/source/dmapper/PropertyIds.cxx | 1 + writerfilter/source/dmapper/PropertyIds.hxx | 1 + 3 files changed, 20 insertions(+) (limited to 'writerfilter') 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 #include +#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 -- cgit