diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-10 18:22:31 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-12 12:55:40 +0200 |
commit | 68e1be4ccbb90ee9a788962219a88312c4ffbea2 (patch) | |
tree | 22a46bc974e012859846180ac8a7f00c61fb7527 /sw/inc | |
parent | 77eb3a7ff88c30d6145a3aa6d454d08ed93206df (diff) |
MSForms: Rework text-based date form field's representation
* Better to represent it similar to text form field with two
marking characters selecting a text range
* So the text between the two marks can be anything (not only
a well formatted date) and also have any character formatting.
* With this we handle the case when the user needs a placeholder
text in the date field or when the user needs time values (hour,
minute, sec) next to the date.
Change-Id: Id60a50a2028058f8a6a080e265c0730d88b98543
Reviewed-on: https://gerrit.libreoffice.org/75459
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/IDocumentMarkAccess.hxx | 2 | ||||
-rw-r--r-- | sw/inc/IMark.hxx | 19 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 4 |
3 files changed, 22 insertions, 3 deletions
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 9670e811f044..cba649ea077e 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -322,7 +322,7 @@ class IDocumentMarkAccess virtual std::vector< ::sw::mark::IFieldmark* > getDropDownsFor(const SwPaM &rPaM) const=0; virtual void deleteFieldmarkAt(const SwPosition& rPos) = 0; - virtual ::sw::mark::IFieldmark* changeNonTextFieldmarkType(::sw::mark::IFieldmark* pFieldmark, const OUString& rNewType) = 0; + virtual ::sw::mark::IFieldmark* changeFormFieldmarkType(::sw::mark::IFieldmark* pFieldmark, const OUString& rNewType) = 0; virtual void NotifyCursorUpdate(const SwCursorShell& rCursorShell) = 0; virtual void ClearFieldActivation() = 0; diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index e7275d9f5d56..b8ee6a4a2098 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -121,6 +121,25 @@ namespace sw { namespace mark ICheckboxFieldmark &operator =(ICheckboxFieldmark const&) = delete; }; + class SW_DLLPUBLIC IDateFieldmark + : virtual public IFieldmark + { + protected: + IDateFieldmark() = default; + + public: + virtual OUString GetContent() const = 0; + virtual void ReplaceContent(const OUString& sNewContent) = 0; + + virtual std::pair<bool, double> GetCurrentDate() const = 0; + virtual void SetCurrentDate(double fDate) = 0; + virtual OUString GetDateInStandardDateFormat(double fDate) const = 0; + + private: + IDateFieldmark(ICheckboxFieldmark const &) = delete; + IDateFieldmark &operator =(ICheckboxFieldmark const&) = delete; + }; + OUString ExpandFieldmark(IFieldmark* pBM); }} diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index c793069b8a41..d696d9388472 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -78,7 +78,7 @@ namespace com{namespace sun{namespace star{ }}} -namespace sw { namespace mark { class IFieldmark; } } +namespace sw { namespace mark { class IFieldmark; class IDateFieldmark; } } typedef void (*SwLabDlgMethod) (css::uno::Reference< css::frame::XModel> const & xModel, const SwLabItem& rItem); @@ -392,7 +392,7 @@ public: SwField* pField, bool bPrevButton, bool bNextButton) = 0; virtual VclPtr<VclAbstractDialog> CreateDropDownFormFieldDialog(weld::Widget* pParent, sw::mark::IFieldmark* pDropDownField) = 0; - virtual VclPtr<VclAbstractDialog> CreateDateFormFieldDialog(weld::Widget* pParent, sw::mark::IFieldmark* pDateField, SwDoc* pDoc) = 0; + virtual VclPtr<VclAbstractDialog> CreateDateFormFieldDialog(weld::Widget* pParent, sw::mark::IDateFieldmark* pDateField, SwDoc* pDoc) = 0; virtual VclPtr<SfxAbstractTabDialog> CreateSwEnvDlg(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, bool bInsert) = 0; |