diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-07-20 14:42:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-07-20 23:01:11 +0200 |
commit | da8e95ebe0dce032cfbe37602ebb013869dc1e6d (patch) | |
tree | e661e426a7773103b7ced7a3b56ceb90c35b6a5c /sw/inc/formatcontentcontrol.hxx | |
parent | 4205fb723144e825ae75e977034a6df1a99f4881 (diff) |
sw content controls, plain text: add doc model & UNO API
OOXML's <w:sdt> with <w:text> describes a plain text content control. We
are currently mapping this to fields, and then on export it's possible
to map this to FORMTEXT fields. The trouble is that our doc model could
not differentiate between content controls and fields for non-formatted
form text, so the exporter can't do the opposite of import.
This has the benefit that input fields do a reasonable job of providing
the feature set of plain text content controls, but it has the downside
that we map two OOXML features to a single Writer concept, loosing
formatting.
Fix this by introducing a dedicated "plain text" content control type,
which can be used for OOXML's <w:sdt> with <w:text>, and keep using the
input field only for OOXML fields.
This commit just adds the document model & UNO API, follow-up commits
will add the remaining functionality.
Change-Id: I0a0317adbd5f58c6ab880dccf6170292462d2671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137263
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/inc/formatcontentcontrol.hxx')
-rw-r--r-- | sw/inc/formatcontentcontrol.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx index 5d60ba40ecf1..975972573c30 100644 --- a/sw/inc/formatcontentcontrol.hxx +++ b/sw/inc/formatcontentcontrol.hxx @@ -45,6 +45,7 @@ enum class SwContentControlType DROP_DOWN_LIST, PICTURE, DATE, + PLAIN_TEXT, }; /// SfxPoolItem subclass that wraps an SwContentControl. @@ -143,6 +144,9 @@ class SW_DLLPUBLIC SwContentControl : public sw::BroadcastingModify /// Date in YYYY-MM-DDT00:00:00Z format. OUString m_aCurrentDate; + /// Plain text, i.e. not rich text. + bool m_bPlainText = false; + /// The placeholder's doc part: just remembered. OUString m_aPlaceholderDocPart; @@ -258,6 +262,10 @@ public: /// Formats m_oSelectedDate, taking m_aDateFormat and m_aDateLanguage into account. OUString GetDateString() const; + void SetPlainText(bool bPlainText) { m_bPlainText = bPlainText; } + + bool GetPlainText() const { return m_bPlainText; } + void SetPlaceholderDocPart(const OUString& rPlaceholderDocPart) { m_aPlaceholderDocPart = rPlaceholderDocPart; |