diff options
23 files changed, 370 insertions, 183 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 0aaccdea65cf..a693b142d6d0 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -498,7 +498,7 @@ DataBrowser::DataBrowser(const css::uno::Reference<css::awt::XWindow> &rParent, m_bIsReadOnly( false ), m_bDataValid( true ), m_aNumberEditField( VclPtr<FormattedField>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ), - m_aTextEditField( VclPtr<Edit>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ), + m_aTextEditField(VclPtr<EditControl>::Create(&EditBrowseBox::GetDataWindow())), m_pColumnsWin(pColumns), m_pColorsWin(pColors), m_rNumberEditController( new ::svt::FormattedFieldCellController( m_aNumberEditField.get() )), @@ -1128,8 +1128,9 @@ void DataBrowser::InitController( if( rController == m_rTextEditController ) { OUString aText( GetCellText( nRow, nCol ) ); - m_aTextEditField->SetText( aText ); - m_aTextEditField->SetSelection( ::Selection( 0, aText.getLength() )); + weld::Entry& rEntry = m_aTextEditField->get_widget(); + rEntry.set_text(aText); + rEntry.select_region(0, -1); } else if( rController == m_rNumberEditController ) { @@ -1210,7 +1211,8 @@ bool DataBrowser::SaveModified() break; case DataBrowserModel::TEXTORDATE: { - OUString aText( m_aTextEditField->GetText() ); + weld::Entry& rEntry = m_aTextEditField->get_widget(); + OUString aText(rEntry.get_text()); double fValue = 0.0; bChangeValid = false; if( isDateTimeString( aText, fValue ) ) @@ -1221,7 +1223,8 @@ bool DataBrowser::SaveModified() break; case DataBrowserModel::TEXT: { - OUString aText( m_aTextEditField->GetText()); + weld::Entry& rEntry = m_aTextEditField->get_widget(); + OUString aText(rEntry.get_text()); bChangeValid = m_apDataBrowserModel->setCellText( nCol, nRow, aText ); } break; @@ -1233,7 +1236,7 @@ bool DataBrowser::SaveModified() RowModified( GetCurRow(), GetCurColumnId()); ::svt::CellController* pCtrl = GetController( GetCurRow(), GetCurColumnId()); if( pCtrl ) - pCtrl->ClearModified(); + pCtrl->SaveValue(); } return bChangeValid; diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx index 8e6372b0b833..7f213382cf81 100644 --- a/chart2/source/controller/dialogs/DataBrowser.hxx +++ b/chart2/source/controller/dialogs/DataBrowser.hxx @@ -161,7 +161,7 @@ private: bool m_bDataValid; VclPtr<FormattedField> m_aNumberEditField; - VclPtr<Edit> m_aTextEditField; + VclPtr<svt::EditControl> m_aTextEditField; weld::Container* m_pColumnsWin; weld::Container* m_pColorsWin; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 4fb84775099a..c6a414af1f18 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1942,7 +1942,6 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property } if (ID_BROWSER_CUT == nId || ID_BROWSER_PASTE == nId) { - xCurrentController->SetModified(); rEdit.Modify(); } } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index b035a9eeb365..2089f5dc49a1 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1219,7 +1219,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) break; CellControllerRef xCurrentController = Controller(); - if (xCurrentController.is() && xCurrentController->IsModified() && ((nRow != GetCurRow()) || (nCol != GetCurColumnId()))) + if (xCurrentController.is() && xCurrentController->IsValueChangedFromSaved() && ((nRow != GetCurRow()) || (nCol != GetCurColumnId()))) // the current controller is modified and the user wants to drop in another cell -> no chance // (when leaving the modified cell an error may occur - this is deadly while dragging) break; @@ -1320,9 +1320,8 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) return DND_ACTION_NONE; rEdit.SetText( sDropped ); - xCurrentController->SetModified(); + // SetText itself doesn't call a Modify as it isn't a user interaction rEdit.Modify(); - // SetText itself doesn't call a Modify as it isn't a user interaction return DND_ACTION_COPY; } diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 373340afd776..729106eed4a3 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -136,9 +136,10 @@ void OTableGrantControl::Init() m_pCheckCell = VclPtr<CheckBoxControl>::Create( &GetDataWindow() ); m_pCheckCell->GetBox().EnableTriState(false); - m_pEdit = VclPtr<Edit>::Create( &GetDataWindow() ); - m_pEdit->SetReadOnly(); - m_pEdit->Enable(false); + m_pEdit = VclPtr<EditControl>::Create(&GetDataWindow()); + weld::Entry& rEntry = m_pEdit->get_widget(); + rEntry.set_editable(false); + rEntry.set_sensitive(false); } UpdateTables(); @@ -250,7 +251,7 @@ bool OTableGrantControl::SaveModified() ::dbtools::showError(::dbtools::SQLExceptionInfo(e),VCLUnoHelper::GetInterface(GetParent()),m_xContext); } if(bErg && Controller().is()) - Controller()->ClearModified(); + Controller()->SaveValue(); if(!bErg) UpdateTables(); @@ -275,7 +276,7 @@ void OTableGrantControl::InitController( CellControllerRef& /*rController*/, lon OUString sTablename = m_aTableNames[nRow]; // special case for tablename if(nColumnId == COL_TABLE_NAME) - m_pEdit->SetText(sTablename); + m_pEdit->get_widget().set_text(sTablename); else { // get the privileges from the user diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index 7f7062f52842..e15e08e902aa 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -51,8 +51,8 @@ class OTableGrantControl : public ::svt::EditBrowseBox mutable TTablePrivilegeMap m_aPrivMap; OUString m_sUserName; - VclPtr< ::svt::CheckBoxControl> m_pCheckCell; - VclPtr<Edit> m_pEdit; + VclPtr<::svt::CheckBoxControl> m_pCheckCell; + VclPtr<::svt::EditControl> m_pEdit; long m_nDataPos; ImplSVEvent * m_nDeactivateEvent; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index f0e221fe109d..ecdd09bd4fb4 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -119,7 +119,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) | BrowserMode::HLINES | BrowserMode::VLINES | BrowserMode::HEADERBAR_NEW ; - m_pTextCell = VclPtr<Edit>::Create(&GetDataWindow(), 0); + m_pTextCell = VclPtr<EditControl>::Create(&GetDataWindow()); m_pVisibleCell = VclPtr<CheckBoxControl>::Create(&GetDataWindow()); m_pTableCell = VclPtr<ListBoxControl>::Create(&GetDataWindow()); m_pFieldCell = VclPtr<ComboBoxControl>::Create(&GetDataWindow()); @@ -554,7 +554,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon setTextCellContext(pEntry,pEntry->GetCriteria( nIdx ),HID_QRYDGN_ROW_CRIT); } } - Controller()->ClearModified(); + Controller()->SaveValue(); } void OSelectionBrowseBox::notifyTableFieldChanged(const OUString& _sOldAlias, const OUString& _sAlias, bool& _bListAction, sal_uInt16 _nColumnId) @@ -904,7 +904,7 @@ bool OSelectionBrowseBox::SaveModified() bool bError = false; bool bListAction = false; - if (pEntry.is() && Controller().is() && Controller()->IsModified()) + if (pEntry.is() && Controller().is() && Controller()->IsValueChangedFromSaved()) { // for the Undo-action OUString strOldCellContents,sNewValue; @@ -1038,7 +1038,7 @@ bool OSelectionBrowseBox::SaveModified() case BROW_COLUMNALIAS_ROW: strOldCellContents = pEntry->GetFieldAlias(); - pEntry->SetFieldAlias(m_pTextCell->GetText()); + pEntry->SetFieldAlias(m_pTextCell->get_widget().get_text()); sNewValue = pEntry->GetFieldAlias(); break; case BROW_FUNCTION_ROW: @@ -1090,7 +1090,7 @@ bool OSelectionBrowseBox::SaveModified() break; sal_uInt16 nIdx = sal_uInt16(nRow - BROW_CRIT1_ROW); - OUString aText = comphelper::string::stripStart(m_pTextCell->GetText(), ' '); + OUString aText = comphelper::string::stripStart(m_pTextCell->get_widget().get_text(), ' '); OUString aCrit; if(!aText.isEmpty()) @@ -1176,7 +1176,7 @@ bool OSelectionBrowseBox::SaveModified() } } if( !bError && Controller().is() ) - Controller()->ClearModified(); + Controller()->SaveValue(); RowModified(GetCurRow(), GetCurColumnId()); @@ -2367,8 +2367,12 @@ bool OSelectionBrowseBox::isCutAllowed() const break; } default: - bCutAllowed = !m_pTextCell->GetSelected().isEmpty(); + { + weld::Entry& rEntry = m_pTextCell->get_widget(); + int nStartPos, nEndPos; + bCutAllowed = rEntry.get_selection_bounds(nStartPos, nEndPos); break; + } } return bCutAllowed; } @@ -2385,8 +2389,10 @@ void OSelectionBrowseBox::cut() break; } default: - m_pTextCell->Cut(); - m_pTextCell->SetModifyFlag(); + { + weld::Entry& rEntry = m_pTextCell->get_widget(); + rEntry.cut_clipboard(); + } } SaveModified(); RowModified(GetBrowseRow(nRow), GetCurColumnId()); @@ -2406,8 +2412,11 @@ void OSelectionBrowseBox::paste() break; } default: - m_pTextCell->Paste(); - m_pTextCell->SetModifyFlag(); + { + weld::Entry& rEntry = m_pTextCell->get_widget(); + rEntry.paste_clipboard(); + break; + } } RowModified(GetBrowseRow(nRow), GetCurColumnId()); invalidateUndoRedo(); @@ -2446,7 +2455,11 @@ void OSelectionBrowseBox::copy() break; } default: - m_pTextCell->Copy(); + { + weld::Entry& rEntry = m_pTextCell->get_widget(); + rEntry.copy_clipboard(); + break; + } } } @@ -2514,8 +2527,9 @@ void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const OUString& _sText,const OString& _sHelpId) { - m_pTextCell->SetText(_sText); - m_pTextCell->ClearModifyFlag(); + weld::Entry& rEntry = m_pTextCell->get_widget(); + rEntry.set_text(_sText); + rEntry.save_value(); if (!m_pTextCell->HasFocus()) m_pTextCell->GrabFocus(); diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 1668b4913edf..325554b6f0bc 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -55,7 +55,7 @@ namespace dbaui long m_nSeekRow; BrowserMode m_nMode; // remember the BrowseModes - VclPtr<Edit> m_pTextCell; + VclPtr< ::svt::EditControl> m_pTextCell; VclPtr< ::svt::CheckBoxControl> m_pVisibleCell; VclPtr< ::svt::ComboBoxControl> m_pFieldCell; VclPtr< ::svt::ListBoxControl> m_pFunctionCell; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 6f5128faa6e5..ee2cb2c1fdf2 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -211,11 +211,11 @@ void OTableEditorCtrl::InitCellController() pTypeCell = VclPtr<ListBoxControl>::Create( &GetDataWindow() ); // Cell description - pDescrCell = VclPtr<Edit>::Create( &GetDataWindow(), WB_LEFT ); - pDescrCell->SetMaxTextLen( MAX_DESCR_LEN ); + pDescrCell = VclPtr<EditControl>::Create(&GetDataWindow()); + pDescrCell->get_widget().set_max_length(MAX_DESCR_LEN); - pHelpTextCell = VclPtr<Edit>::Create( &GetDataWindow(), WB_LEFT ); - pHelpTextCell->SetMaxTextLen( MAX_DESCR_LEN ); + pHelpTextCell = VclPtr<EditControl>::Create(&GetDataWindow()); + pHelpTextCell->get_widget().set_max_length(MAX_DESCR_LEN); pNameCell->SetHelpId(HID_TABDESIGN_NAMECELL); pTypeCell->SetHelpId(HID_TABDESIGN_TYPECELL); @@ -238,8 +238,8 @@ void OTableEditorCtrl::InitCellController() void OTableEditorCtrl::ClearModified() { pNameCell->ClearModifyFlag(); - pDescrCell->ClearModifyFlag(); - pHelpTextCell->ClearModifyFlag(); + pDescrCell->get_widget().save_value(); + pHelpTextCell->get_widget().save_value(); pTypeCell->get_widget().save_value(); } @@ -379,18 +379,23 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16 break; case HELP_TEXT: + { if( pActFieldDescr ) aInitString = pActFieldDescr->GetHelpText(); - pHelpTextCell->SetText( aInitString ); - pHelpTextCell->SaveValue(); + weld::Entry& rEntry = pHelpTextCell->get_widget(); + rEntry.set_text(aInitString); + rEntry.save_value(); break; + } case COLUMN_DESCRIPTION: + { if( pActFieldDescr ) aInitString = pActFieldDescr->GetDescription(); - pDescrCell->SetText( aInitString ); - pDescrCell->SaveValue(); + weld::Entry& rEntry = pDescrCell->get_widget(); + rEntry.set_text(aInitString); + rEntry.save_value(); break; - + } } } @@ -526,25 +531,27 @@ void OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) case HELP_TEXT: { // if the current field description is NULL, set Default + weld::Entry& rEntry = pHelpTextCell->get_widget(); if( !pActFieldDescr ) { - pHelpTextCell->SetText(OUString()); - pHelpTextCell->ClearModifyFlag(); + rEntry.set_text(OUString()); + rEntry.save_value(); } else - pActFieldDescr->SetHelpText( pHelpTextCell->GetText() ); + pActFieldDescr->SetHelpText(rEntry.get_text()); break; } case COLUMN_DESCRIPTION: { // Set the default if the field description is null + weld::Entry& rEntry = pDescrCell->get_widget(); if( !pActFieldDescr ) { - pDescrCell->SetText(OUString()); - pDescrCell->ClearModifyFlag(); + rEntry.set_text(OUString()); + rEntry.save_value(); } else - pActFieldDescr->SetDescription( pDescrCell->GetText() ); + pActFieldDescr->SetDescription(rEntry.get_text()); break; } case FIELD_PROPERTY_DEFAULT: @@ -670,9 +677,6 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) // SaveData could create an undo action as well GetUndoManager().LeaveListAction(); RowModified(nRow); - CellControllerRef xController(Controller()); - if(xController.is()) - xController->SetModified(); // Set the Modify flag GetView()->getController().setModified( true ); @@ -1075,16 +1079,23 @@ bool OTableEditorCtrl::IsCutAllowed() bool bIsCutAllowed = (GetView()->getController().isAddAllowed() && GetView()->getController().isDropAllowed()) || GetView()->getController().isAlterAllowed(); - if(bIsCutAllowed) + if (bIsCutAllowed) { + int nStartPos, nEndPos; switch(m_eChildFocus) { case DESCRIPTION: - bIsCutAllowed = !pDescrCell->GetSelected().isEmpty(); + { + weld::Entry& rEntry = pDescrCell->get_widget(); + bIsCutAllowed = rEntry.get_selection_bounds(nStartPos, nEndPos); break; + } case HELPTEXT: - bIsCutAllowed = !pHelpTextCell->GetSelected().isEmpty(); + { + weld::Entry& rEntry = pHelpTextCell->get_widget(); + bIsCutAllowed = rEntry.get_selection_bounds(nStartPos, nEndPos); break; + } case NAME: bIsCutAllowed = !pNameCell->GetSelected().isEmpty(); break; @@ -1103,10 +1114,17 @@ bool OTableEditorCtrl::IsCutAllowed() bool OTableEditorCtrl::IsCopyAllowed() { bool bIsCopyAllowed = false; - if(m_eChildFocus == DESCRIPTION ) - bIsCopyAllowed = !pDescrCell->GetSelected().isEmpty(); + int nStartPos, nEndPos; + if (m_eChildFocus == DESCRIPTION ) + { + weld::Entry& rEntry = pDescrCell->get_widget(); + bIsCopyAllowed = rEntry.get_selection_bounds(nStartPos, nEndPos); + } else if(HELPTEXT == m_eChildFocus ) - bIsCopyAllowed = !pHelpTextCell->GetSelected().isEmpty(); + { + weld::Entry& rEntry = pHelpTextCell->get_widget(); + bIsCopyAllowed = rEntry.get_selection_bounds(nStartPos, nEndPos); + } else if(m_eChildFocus == NAME) bIsCopyAllowed = !pNameCell->GetSelected().isEmpty(); else if(m_eChildFocus == ROW) @@ -1165,7 +1183,7 @@ void OTableEditorCtrl::cut() if(GetView()->getController().isAlterAllowed()) { SaveData(-1,COLUMN_DESCRIPTION); - pDescrCell->Cut(); + pDescrCell->get_widget().cut_clipboard(); CellModified(-1,COLUMN_DESCRIPTION); } } @@ -1174,7 +1192,7 @@ void OTableEditorCtrl::cut() if(GetView()->getController().isAlterAllowed()) { SaveData(-1,HELP_TEXT); - pHelpTextCell->Cut(); + pHelpTextCell->get_widget().cut_clipboard(); CellModified(-1,HELP_TEXT); } } @@ -1193,9 +1211,15 @@ void OTableEditorCtrl::copy() else if(m_eChildFocus == NAME) pNameCell->Copy(); else if(HELPTEXT == m_eChildFocus ) - pHelpTextCell->Copy(); + { + weld::Entry& rEntry = pHelpTextCell->get_widget(); + rEntry.copy_clipboard(); + } else if(m_eChildFocus == DESCRIPTION ) - pDescrCell->Copy(); + { + weld::Entry& rEntry = pDescrCell->get_widget(); + rEntry.copy_clipboard(); + } } void OTableEditorCtrl::paste() @@ -1219,7 +1243,7 @@ void OTableEditorCtrl::paste() { if(GetView()->getController().isAlterAllowed()) { - pHelpTextCell->Paste(); + pHelpTextCell->get_widget().paste_clipboard(); CellModified(); } } @@ -1227,7 +1251,7 @@ void OTableEditorCtrl::paste() { if(GetView()->getController().isAlterAllowed()) { - pDescrCell->Paste(); + pDescrCell->get_widget().paste_clipboard(); CellModified(); } } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index 44469bf29d1e..69039f3d92f4 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -45,9 +45,9 @@ namespace dbaui std::vector< std::shared_ptr<OTableRow> >* m_pRowList; VclPtr<OSQLNameEdit> pNameCell; - VclPtr< ::svt::ListBoxControl> pTypeCell; - VclPtr<Edit> pHelpTextCell; - VclPtr<Edit> pDescrCell; + VclPtr<::svt::ListBoxControl> pTypeCell; + VclPtr<::svt::EditControl> pHelpTextCell; + VclPtr<::svt::EditControl> pDescrCell; VclPtr<OTableFieldDescWin> pDescrWin; // properties of one column std::shared_ptr<OTableRow> pActRow; diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx index 3824880de551..6cb71bc9502c 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.cxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx @@ -89,7 +89,7 @@ void OTableDesignCellUndoAct::Undo() { CellControllerRef xController = m_pTabDgnCtrl->Controller(); if ( xController.is() ) - xController->ClearModified(); + xController->SaveValue(); m_pTabDgnCtrl->GetView()->getController().setModified(false); } diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index ac84f078b6b1..73f12c5c50d7 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -29,6 +29,7 @@ #include <svtools/brwbox.hxx> #include <svtools/brwhead.hxx> +#include <tools/lineend.hxx> #include <vcl/InterimItemWindow.hxx> #include <vcl/vclmedit.hxx> #include <o3tl/typed_flags_set.hxx> @@ -93,9 +94,8 @@ namespace svt Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; } - virtual void SetModified(); - virtual void ClearModified() = 0; - virtual bool IsModified() const = 0; + virtual void SaveValue() = 0; + virtual bool IsValueChangedFromSaved() const = 0; // commit any current changes. Especially, do any reformatting you need (from input formatting // to output formatting) here @@ -140,9 +140,8 @@ namespace svt virtual void ReplaceSelected( const OUString& _rStr ) = 0; virtual OUString GetSelected( LineEnd aSeparator ) const = 0; - virtual void SetModified() = 0; - virtual bool IsModified() const = 0; - virtual void ClearModified() = 0; + virtual bool IsValueChangedFromSaved() const = 0; + virtual void SaveValue() = 0; virtual void SetModifyHdl( const Link<LinkParamNone*,void>& _rLink ) = 0; }; @@ -177,12 +176,127 @@ namespace svt virtual void ReplaceSelected( const OUString& _rStr ) override; virtual OUString GetSelected( LineEnd aSeparator ) const override; - virtual void SetModified() override; - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; virtual void SetModifyHdl( const Link<LinkParamNone*,void>& _rLink ) override; }; + class SVT_DLLPUBLIC EditControl final : public InterimItemWindow + { + public: + EditControl(vcl::Window* pParent); + + virtual void dispose() override; + + virtual void GetFocus() override + { + if (m_xWidget) + m_xWidget->grab_focus(); + InterimItemWindow::GetFocus(); + } + + weld::Entry& get_widget() { return *m_xWidget; } + + private: + std::unique_ptr<weld::Entry> m_xWidget; + + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + }; + + class SVT_DLLPUBLIC EntryImplementation : public IEditImplementation + { + EditControl& m_rEdit; + int m_nMaxTextLen; + Link<LinkParamNone*,void> m_aModifyHdl; + + DECL_LINK(ModifyHdl, weld::Entry&, void); + public: + EntryImplementation(EditControl& rEdit) + : m_rEdit(rEdit) + , m_nMaxTextLen(EDIT_NOLIMIT) + { + m_rEdit.get_widget().connect_changed(LINK(this, EntryImplementation, ModifyHdl)); + } + + virtual Control& GetControl() override + { + return m_rEdit; + } + + virtual OUString GetText( LineEnd /*aSeparator*/ ) const override + { + // ignore the line end - this base implementation does not support it + return m_rEdit.get_widget().get_text(); + } + + virtual void SetText( const OUString& _rStr ) override + { + return m_rEdit.get_widget().set_text(_rStr); + } + + virtual bool IsReadOnly() const override + { + return !m_rEdit.get_widget().get_editable(); + } + + virtual void SetReadOnly( bool bReadOnly ) override + { + m_rEdit.get_widget().set_editable(!bReadOnly); + } + + virtual sal_Int32 GetMaxTextLen() const override + { + return m_nMaxTextLen; + } + + virtual void SetMaxTextLen( sal_Int32 nMaxLen ) override + { + m_nMaxTextLen = nMaxLen; + m_rEdit.get_widget().set_max_length(nMaxLen == EDIT_NOLIMIT ? 0 : nMaxLen); + } + + virtual Selection GetSelection() const override + { + int nStartPos, nEndPos; + m_rEdit.get_widget().get_selection_bounds(nStartPos, nEndPos); + return Selection(nStartPos, nEndPos); + } + + virtual void SetSelection( const Selection& rSelection ) override + { + m_rEdit.get_widget().select_region(rSelection.Min(), rSelection.Max()); + } + + virtual void ReplaceSelected( const OUString& rStr ) override + { + m_rEdit.get_widget().replace_selection(rStr); + } + + virtual OUString GetSelected( LineEnd /*aSeparator*/ ) const override + // ignore the line end - this base implementation does not support it + { + int nStartPos, nEndPos; + weld::Entry& rEntry = m_rEdit.get_widget(); + rEntry.get_selection_bounds(nStartPos, nEndPos); + return rEntry.get_text().copy(nStartPos, nEndPos - nStartPos); + } + + virtual bool IsValueChangedFromSaved() const override + { + return m_rEdit.get_widget().get_value_changed_from_saved(); + } + + virtual void SaveValue() override + { + m_rEdit.get_widget().save_value(); + } + + virtual void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ) override + { + m_aModifyHdl = rLink; + } + }; + #include <svtools/editimplementation.hxx> @@ -244,15 +358,15 @@ namespace svt public: EditCellController( Edit* _pEdit ); + EditCellController( EditControl* _pEdit ); EditCellController( IEditImplementation* _pImplementation ); virtual ~EditCellController( ) override; const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; } IEditImplementation* GetEditImplementation( ) { return m_pEditImplementation; } - virtual void SetModified() override; - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; @@ -270,9 +384,8 @@ namespace svt const SpinField& GetSpinWindow() const; SpinField& GetSpinWindow(); - virtual void SetModified() override; - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; private: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; @@ -319,8 +432,8 @@ namespace svt CheckBoxCellController(CheckBoxControl* pWin); CheckBox& GetCheckBox() const; - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; private: virtual bool WantMouseEvent() const override; @@ -335,6 +448,13 @@ namespace svt public: ComboBoxControl(vcl::Window* pParent); + virtual void GetFocus() override + { + if (m_xWidget) + m_xWidget->grab_focus(); + InterimItemWindow::GetFocus(); + } + weld::ComboBox& get_widget() { return *m_xWidget; } virtual void dispose() override; @@ -351,8 +471,8 @@ namespace svt ComboBoxCellController(ComboBoxControl* pParent); weld::ComboBox& GetComboBox() const { return static_cast<ComboBoxControl&>(GetWindow()).get_widget(); } - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; @@ -368,6 +488,13 @@ namespace svt public: ListBoxControl(vcl::Window* pParent); + virtual void GetFocus() override + { + if (m_xWidget) + m_xWidget->grab_focus(); + InterimItemWindow::GetFocus(); + } + weld::ComboBox& get_widget() { return *m_xWidget; } virtual void dispose() override; @@ -383,8 +510,8 @@ namespace svt ListBoxCellController(ListBoxControl* pParent); weld::ComboBox& GetListBox() const { return static_cast<ListBoxControl&>(GetWindow()).get_widget(); } - virtual bool IsModified() const override; - virtual void ClearModified() override; + virtual bool IsValueChangedFromSaved() const override; + virtual void SaveValue() override; protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; @@ -403,7 +530,6 @@ namespace svt //= EditBrowserHeader - class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader { public: @@ -416,7 +542,6 @@ namespace svt //= EditBrowseBox - class EditBrowseBoxImpl; class SVT_DLLPUBLIC EditBrowseBox: public BrowseBox { @@ -552,7 +677,7 @@ namespace svt // return sal_False prevents leaving the cell virtual bool SaveRow(); // commit the current row - virtual bool IsModified() const {return aController.is() && aController->IsModified();} + virtual bool IsModified() const {return aController.is() && aController->IsValueChangedFromSaved();} virtual CellController* GetController(long nRow, sal_uInt16 nCol); virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol); diff --git a/include/svtools/editimplementation.hxx b/include/svtools/editimplementation.hxx index ceddf0a81fbc..9797009b2369 100644 --- a/include/svtools/editimplementation.hxx +++ b/include/svtools/editimplementation.hxx @@ -84,49 +84,36 @@ void GenericEditImplementation< EDIT >::ReplaceSelected( const OUString& _rStr ) m_rEdit.ReplaceSelected( _rStr ); } - template <class EDIT> OUString GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const { return m_rEdit.GetSelected( ); } - template <class EDIT> void GenericEditImplementation< EDIT >::SetMaxTextLen( sal_Int32 _nMaxLen ) { m_rEdit.SetMaxTextLen( _nMaxLen ); } - template <class EDIT> sal_Int32 GenericEditImplementation< EDIT >::GetMaxTextLen() const { return m_rEdit.GetMaxTextLen( ); } - template <class EDIT> -void GenericEditImplementation< EDIT >::SetModified() +bool GenericEditImplementation< EDIT >::IsValueChangedFromSaved() const { - m_rEdit.SetModifyFlag(); + return m_rEdit.IsValueChangedFromSaved(); } - template <class EDIT> -bool GenericEditImplementation< EDIT >::IsModified() const +void GenericEditImplementation< EDIT >::SaveValue() { - return m_rEdit.IsModified(); + m_rEdit.SaveValue(); } - -template <class EDIT> -void GenericEditImplementation< EDIT >::ClearModified() -{ - m_rEdit.ClearModifyFlag(); -} - - template <class EDIT> void GenericEditImplementation< EDIT >::SetModifyHdl( const Link<LinkParamNone*,void>& _rLink ) { diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 8cb3a65347f1..1159fdd51cd0 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -463,8 +463,8 @@ bool OFieldExpressionControl::SaveModified() m_pParent->m_pController->getUndoManager().LeaveListAction(); } - if ( Controller().is() ) - Controller()->ClearModified(); + if (Controller().is()) + Controller()->SaveValue(); if ( GetRowCount() == m_pParent->getGroups()->getCount() ) { RowInserted( GetRowCount()-1); diff --git a/solenv/sanitizers/ui/svt.suppr b/solenv/sanitizers/ui/svt.suppr index 13660186f664..e15630b0015c 100644 --- a/solenv/sanitizers/ui/svt.suppr +++ b/solenv/sanitizers/ui/svt.suppr @@ -27,3 +27,4 @@ svtools/uiconfig/ui/restartdialog.ui://GtkLabel[@id='reason_opengl'] orphan-labe svtools/uiconfig/ui/restartdialog.ui://GtkLabel[@id='reason_skia'] orphan-label svtools/uiconfig/ui/restartdialog.ui://GtkLabel[@id='label'] orphan-label svtools/uiconfig/ui/spinfieldcontrol.ui://GtkSpinButton[@id='spinbutton'] no-labelled-by +svtools/uiconfig/ui/thineditcontrol.ui://GtkEntry[@id='entry'] no-labelled-by diff --git a/svtools/UIConfig_svt.mk b/svtools/UIConfig_svt.mk index 4c2a7cfd0703..23a9e7df778c 100644 --- a/svtools/UIConfig_svt.mk +++ b/svtools/UIConfig_svt.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svt,\ svtools/uiconfig/ui/querydeletedialog \ svtools/uiconfig/ui/restartdialog \ svtools/uiconfig/ui/spinfieldcontrol \ + svtools/uiconfig/ui/thineditcontrol \ )) # vim: set noet sw=4 ts=4: diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index df5eb4d4b2d8..c2534dc9efd4 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -93,12 +93,12 @@ namespace svt } } - bool ComboBoxCellController::IsModified() const + bool ComboBoxCellController::IsValueChangedFromSaved() const { return GetComboBox().get_value_changed_from_saved(); } - void ComboBoxCellController::ClearModified() + void ComboBoxCellController::SaveValue() { GetComboBox().save_value(); } @@ -149,12 +149,12 @@ namespace svt } } - bool ListBoxCellController::IsModified() const + bool ListBoxCellController::IsValueChangedFromSaved() const { return GetListBox().get_value_changed_from_saved(); } - void ListBoxCellController::ClearModified() + void ListBoxCellController::SaveValue() { GetListBox().save_value(); } @@ -285,19 +285,16 @@ namespace svt return static_cast<CheckBoxControl &>(GetWindow()).GetBox(); } - - bool CheckBoxCellController::IsModified() const + bool CheckBoxCellController::IsValueChangedFromSaved() const { return GetCheckBox().IsValueChangedFromSaved(); } - - void CheckBoxCellController::ClearModified() + void CheckBoxCellController::SaveValue() { GetCheckBox().SaveValue(); } - IMPL_LINK_NOARG(CheckBoxCellController, ModifyHdl, LinkParamNone*, void) { callModifyHdl(); @@ -328,8 +325,6 @@ namespace svt } //= EditCellController - - EditCellController::EditCellController( Edit* _pEdit ) :CellController( _pEdit ) ,m_pEditImplementation( new EditImplementation( *_pEdit ) ) @@ -338,7 +333,6 @@ namespace svt m_pEditImplementation->SetModifyHdl( LINK(this, EditCellController, ModifyHdl) ); } - EditCellController::EditCellController( IEditImplementation* _pImplementation ) :CellController( &_pImplementation->GetControl() ) ,m_pEditImplementation( _pImplementation ) @@ -347,25 +341,48 @@ namespace svt m_pEditImplementation->SetModifyHdl( LINK(this, EditCellController, ModifyHdl) ); } + IMPL_LINK_NOARG(EntryImplementation, ModifyHdl, weld::Entry&, void) + { + m_aModifyHdl.Call(nullptr); + } - EditCellController::~EditCellController( ) + EditControl::EditControl(vcl::Window* pParent) + : InterimItemWindow(pParent, "svt/ui/thineditcontrol.ui", "EditControl") // *thin*editcontrol has no frame/border + , m_xWidget(m_xBuilder->weld_entry("entry")) { - if ( m_bOwnImplementation ) - DELETEZ( m_pEditImplementation ); + m_xWidget->set_width_chars(1); // so a smaller than default width can be used + m_xWidget->connect_key_press(LINK(this, EditControl, KeyInputHdl)); } + IMPL_LINK(EditControl, KeyInputHdl, const KeyEvent&, rKEvt, bool) + { + return ChildKeyInput(rKEvt); + } - void EditCellController::SetModified() + void EditControl::dispose() { - m_pEditImplementation->SetModified(); + m_xWidget.reset(); + InterimItemWindow::dispose(); } + EditCellController::EditCellController(EditControl* pEdit) + : CellController(pEdit) + , m_pEditImplementation(new EntryImplementation(*pEdit)) + , m_bOwnImplementation(true) + { + m_pEditImplementation->SetModifyHdl( LINK(this, EditCellController, ModifyHdl) ); + } - void EditCellController::ClearModified() + EditCellController::~EditCellController( ) { - m_pEditImplementation->ClearModified(); + if ( m_bOwnImplementation ) + DELETEZ( m_pEditImplementation ); } + void EditCellController::SaveValue() + { + m_pEditImplementation->SaveValue(); + } bool EditCellController::MoveAllowed(const KeyEvent& rEvt) const { @@ -390,13 +407,11 @@ namespace svt return bResult; } - - bool EditCellController::IsModified() const + bool EditCellController::IsValueChangedFromSaved() const { - return m_pEditImplementation->IsModified(); + return m_pEditImplementation->IsValueChangedFromSaved(); } - IMPL_LINK_NOARG(EditCellController, ModifyHdl, LinkParamNone*, void) { callModifyHdl(); @@ -421,18 +436,11 @@ namespace svt return static_cast<SpinField &>(GetWindow()); } - void SpinCellController::SetModified() - { - GetSpinWindow().SetModifyFlag(); - } - - - void SpinCellController::ClearModified() + void SpinCellController::SaveValue() { - GetSpinWindow().ClearModifyFlag(); + GetSpinWindow().SaveValue(); } - bool SpinCellController::MoveAllowed(const KeyEvent& rEvt) const { bool bResult; @@ -456,10 +464,9 @@ namespace svt return bResult; } - - bool SpinCellController::IsModified() const + bool SpinCellController::IsValueChangedFromSaved() const { - return GetSpinWindow().IsModified(); + return GetSpinWindow().IsValueChangedFromSaved(); } IMPL_LINK_NOARG(SpinCellController, ModifyHdl, Edit&, void) diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 9b56e56c0afa..1db43ea8c40f 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -434,7 +434,7 @@ namespace svt if (rEvt.GetColumnId() == HandleColumnId) { // it was the handle column. save the current cell content if necessary // (clicking on the handle column results in selecting the current row) - if (IsEditing() && aController->IsModified()) + if (IsEditing() && aController->IsValueChangedFromSaved()) SaveModified(); } @@ -578,7 +578,7 @@ namespace svt case KEY_RETURN: // save the cell content (if necessary) - if (IsEditing() && aController->IsModified() && !SaveModified()) + if (IsEditing() && aController->IsValueChangedFromSaved() && !SaveModified()) { // maybe we're not visible ... EnableAndShow(); @@ -639,7 +639,7 @@ namespace svt if (nId == BROWSER_SELECT || BROWSER_SELECTCOLUMN == nId ) { // save the cell content (if necessary) - if (IsEditing() && aController->IsModified() && !SaveModified()) + if (IsEditing() && aController->IsValueChangedFromSaved() && !SaveModified()) { // maybe we're not visible ... EnableAndShow(); @@ -813,7 +813,7 @@ namespace svt return true; // save the cell content - if (IsEditing() && aController->IsModified() && !const_cast<EditBrowseBox *>(this)->SaveModified()) + if (IsEditing() && aController->IsValueChangedFromSaved() && !const_cast<EditBrowseBox *>(this)->SaveModified()) { // maybe we're not visible ... EnableAndShow(); @@ -958,7 +958,7 @@ namespace svt InitController(aController, nEditRow, nEditCol); - aController->ClearModified(); + aController->SaveValue(); aController->SetModifyHdl(LINK(this,EditBrowseBox,ModifyHdl)); EnableAndShow(); @@ -1278,7 +1278,6 @@ namespace svt } } - void CellController::resume( ) { DBG_ASSERT( bSuspended == !GetWindow().IsVisible(), "CellController::resume: inconsistence!" ); @@ -1290,24 +1289,16 @@ namespace svt } } - void CellController::CommitModifications() { // nothing to do in this base class } - bool CellController::WantMouseEvent() const { return false; } - - void CellController::SetModified() - { - } - - bool CellController::MoveAllowed(const KeyEvent&) const { return true; diff --git a/svtools/uiconfig/ui/thineditcontrol.ui b/svtools/uiconfig/ui/thineditcontrol.ui new file mode 100644 index 000000000000..a30e8db01435 --- /dev/null +++ b/svtools/uiconfig/ui/thineditcontrol.ui @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.2 --> +<interface domain="svt"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkBox" id="EditControl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkEntry" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="has_frame">False</property> + <property name="activates_default">True</property> + <property name="width_chars">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> +</interface> diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 68b4b3c53259..050824efd915 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1402,7 +1402,7 @@ bool FmGridControl::commit() // css::form::component::GridControl if (!IsUpdating()) { - if (Controller().is() && Controller()->IsModified()) + if (Controller().is() && Controller()->IsValueChangedFromSaved()) { if (!SaveModified()) return false; diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 81d3e410dd25..06ac175b99e5 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1054,14 +1054,12 @@ DbTextField::DbTextField(DbGridColumn& _rColumn) { } - DbTextField::~DbTextField( ) { m_pPainterImplementation.reset(); m_pEdit.reset(); } - void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor) { sal_Int16 nAlignment = m_rColumn.SetAlignmentFromModel(-1); @@ -1106,11 +1104,26 @@ void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCurso } else { - m_pWindow = VclPtr<Edit>::Create( &rParent, nStyle ); - m_pEdit.reset(new EditImplementation( *static_cast< Edit* >( m_pWindow.get() ) )); + auto xEditControl = VclPtr<EditControl>::Create(&rParent); + auto xEditPainter = VclPtr<EditControl>::Create(&rParent); + + switch (nAlignment) + { + case awt::TextAlign::RIGHT: + xEditControl->get_widget().set_alignment(TxtAlign::Right); + xEditPainter->get_widget().set_alignment(TxtAlign::Right); + break; + case awt::TextAlign::CENTER: + xEditControl->get_widget().set_alignment(TxtAlign::Center); + xEditPainter->get_widget().set_alignment(TxtAlign::Center); + break; + } + + m_pWindow = xEditControl; + m_pEdit.reset(new EntryImplementation(*xEditControl)); - m_pPainter = VclPtr<Edit>::Create( &rParent, nStyle ); - m_pPainterImplementation.reset(new EditImplementation( *static_cast< Edit* >( m_pPainter.get() ) )); + m_pPainter = xEditPainter; + m_pPainterImplementation.reset(new EntryImplementation(*xEditPainter)); } if ( WB_LEFT == nStyle ) diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index a37ce469905f..d8e20b7be894 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -3049,7 +3049,7 @@ void DbGridControl::RowModified( long nRow ) if (nRow == m_nCurrentPos && IsEditing()) { CellControllerRef aTmpRef = Controller(); - aTmpRef->ClearModified(); + aTmpRef->SaveValue(); InitController(aTmpRef, m_nCurrentPos, GetCurColumnId()); } EditBrowseBox::RowModified(nRow); @@ -3097,7 +3097,7 @@ bool DbGridControl::SaveModified() if (bOK) { - Controller()->ClearModified(); + Controller()->SaveValue(); if ( IsValid(m_xCurrentRow) ) { @@ -3110,11 +3110,6 @@ bool DbGridControl::SaveModified() SAL_INFO("svx.fmcomp", "no SetState, new state: " << ROWSTATUS(m_xCurrentRow)); } } - else - { - // reset the modified flag... - Controller()->SetModified(); - } return bOK; } @@ -3126,7 +3121,7 @@ bool DbGridControl::SaveRow() if (!IsValid(m_xCurrentRow) || !IsModified()) return true; // value of the controller was not saved, yet - else if (Controller().is() && Controller()->IsModified()) + else if (Controller().is() && Controller()->IsValueChangedFromSaved()) { if (!SaveModified()) return false; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 1531ad09e987..90f604612982 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -132,8 +132,8 @@ namespace { class SwEntryBrowseBox : public SwEntryBrowseBox_Base { - VclPtr<Edit> m_aCellEdit; - VclPtr< ::svt::CheckBoxControl> m_aCellCheckBox; + VclPtr<svt::EditControl> m_aCellEdit; + VclPtr<svt::CheckBoxControl> m_aCellCheckBox; OUString m_sYes; OUString m_sNo; @@ -3550,8 +3550,8 @@ SwEntryBrowseBox::SwEntryBrowseBox(const css::uno::Reference<css::awt::XWindow> BrowserMode::VLINES | BrowserMode::AUTO_VSCROLL| BrowserMode::HIDECURSOR ) - , m_aCellEdit(VclPtr<Edit>::Create(&GetDataWindow(), 0)) - , m_aCellCheckBox(VclPtr< ::svt::CheckBoxControl>::Create(&GetDataWindow())) + , m_aCellEdit(VclPtr<svt::EditControl>::Create(&GetDataWindow())) + , m_aCellCheckBox(VclPtr<svt::CheckBoxControl>::Create(&GetDataWindow())) , m_nCurrentRow(0) , m_bModified(false) { @@ -3738,7 +3738,7 @@ bool SwEntryBrowseBox::SaveModified() RowInserted(nRow, 1, true, true); if(nCol < ITEM_WORDONLY) { - pController->ClearModified(); + pController->SaveValue(); GoToRow( nRow ); } } @@ -3824,7 +3824,7 @@ void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr) pController = m_xController.get(); else pController = m_xCheckController.get(); - if(pController ->IsModified()) + if (pController->IsValueChangedFromSaved()) GoToColumnId(nCol + (nCol < ITEM_CASE ? 1 : -1 )); rtl_TextEncoding eTEnc = osl_getThreadTextEncoding(); @@ -3860,7 +3860,7 @@ bool SwEntryBrowseBox::IsModified()const pController = m_xController.get(); else pController = m_xCheckController.get(); - return pController->IsModified(); + return pController->IsValueChangedFromSaved(); } SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(weld::Window* pParent, const OUString& rAutoMarkURL, |