summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/cfwl_combobox.h4
-rw-r--r--xfa/fwl/cfwl_edit.cpp14
-rw-r--r--xfa/fwl/cfwl_edit.h4
3 files changed, 10 insertions, 12 deletions
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h
index 923e2d8b9a..a9dc635373 100644
--- a/xfa/fwl/cfwl_combobox.h
+++ b/xfa/fwl/cfwl_combobox.h
@@ -83,8 +83,8 @@ class CFWL_ComboBox : public CFWL_Widget {
return EditCanCopy();
}
bool EditCanSelectAll() const { return m_pEdit->GetTextLength() > 0; }
- bool EditCopy(WideString& wsCopy) const { return m_pEdit->Copy(wsCopy); }
- bool EditCut(WideString& wsCut) { return m_pEdit->Cut(wsCut); }
+ Optional<WideString> EditCopy() const { return m_pEdit->Copy(); }
+ Optional<WideString> EditCut() { return m_pEdit->Cut(); }
bool EditPaste(const WideString& wsPaste) { return m_pEdit->Paste(wsPaste); }
void EditSelectAll() { m_pEdit->SelectAll(); }
void EditDelete() { m_pEdit->ClearText(); }
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index cdbca2cf54..960ec9967a 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -322,20 +322,18 @@ void CFWL_Edit::SetAliasChar(wchar_t wAlias) {
m_EdtEngine.SetAliasChar(wAlias);
}
-bool CFWL_Edit::Copy(WideString& wsCopy) {
+Optional<WideString> CFWL_Edit::Copy() {
if (!m_EdtEngine.HasSelection())
- return false;
+ return {};
- wsCopy = m_EdtEngine.GetSelectedText();
- return true;
+ return {m_EdtEngine.GetSelectedText()};
}
-bool CFWL_Edit::Cut(WideString& wsCut) {
+Optional<WideString> CFWL_Edit::Cut() {
if (!m_EdtEngine.HasSelection())
- return false;
+ return {};
- wsCut = m_EdtEngine.DeleteSelectedText();
- return true;
+ return {m_EdtEngine.DeleteSelectedText()};
}
bool CFWL_Edit::Paste(const WideString& wsPaste) {
diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h
index 6aedca8dec..9c667f5e14 100644
--- a/xfa/fwl/cfwl_edit.h
+++ b/xfa/fwl/cfwl_edit.h
@@ -80,8 +80,8 @@ class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate {
int32_t GetLimit() const;
void SetLimit(int32_t nLimit);
void SetAliasChar(wchar_t wAlias);
- bool Copy(WideString& wsCopy);
- bool Cut(WideString& wsCut);
+ Optional<WideString> Copy();
+ Optional<WideString> Cut();
bool Paste(const WideString& wsPaste);
bool Undo();
bool Redo();