diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-29 10:21:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-01 20:51:12 +0100 |
commit | 19d17a739cc61341ca74cfa485e919c6012fe28c (patch) | |
tree | be3823e68681d796275149d08059872dde680534 /svx | |
parent | b1f9e704cb9148b6e211005dab0cd153957a1b2b (diff) |
weld FmFieldWin
needs drag source support
fixes a leak of ColumnInfo data as well
Change-Id: I671834726aed3fd4de096b56baaa592f51a9e73e
Reviewed-on: https://gerrit.libreoffice.org/84147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 29 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 220 | ||||
-rw-r--r-- | svx/source/inc/tabwin.hxx | 63 | ||||
-rw-r--r-- | svx/uiconfig/ui/formfielddialog.ui | 99 |
5 files changed, 197 insertions, 215 deletions
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 9f6a55c266e3..f4a7e0abddb4 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -49,6 +49,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/fontworkgallerydialog \ svx/uiconfig/ui/fontworkspacingdialog \ svx/uiconfig/ui/formdatamenu \ + svx/uiconfig/ui/formfielddialog \ svx/uiconfig/ui/formlinkwarndialog \ svx/uiconfig/ui/formnavimenu \ svx/uiconfig/ui/functionmenu \ diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index 0e6df6cfb871..698a7e6e6055 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -42,18 +42,22 @@ namespace svx using namespace ::com::sun::star::container; using namespace ::com::sun::star::datatransfer; - OColumnTransferable::OColumnTransferable(const ODataAccessDescriptor& _rDescriptor, ColumnTransferFormatFlags _nFormats ) - :m_nFormatFlags(_nFormats) + OColumnTransferable::OColumnTransferable(ColumnTransferFormatFlags nFormats) + : m_nFormatFlags(nFormats) + { + } + + void OColumnTransferable::setDescriptor(const ODataAccessDescriptor& rDescriptor) { OUString sDataSource, sDatabaseLocation, sConnectionResource, sCommand, sFieldName; - if ( _rDescriptor.has( DataAccessDescriptorProperty::DataSource ) ) _rDescriptor[ DataAccessDescriptorProperty::DataSource ] >>= sDataSource; - if ( _rDescriptor.has( DataAccessDescriptorProperty::DatabaseLocation ) ) _rDescriptor[ DataAccessDescriptorProperty::DatabaseLocation ] >>= sDatabaseLocation; - if ( _rDescriptor.has( DataAccessDescriptorProperty::ConnectionResource ) ) _rDescriptor[ DataAccessDescriptorProperty::ConnectionResource ] >>= sConnectionResource; - if ( _rDescriptor.has( DataAccessDescriptorProperty::Command ) ) _rDescriptor[ DataAccessDescriptorProperty::Command ] >>= sCommand; - if ( _rDescriptor.has( DataAccessDescriptorProperty::ColumnName ) ) _rDescriptor[ DataAccessDescriptorProperty::ColumnName ] >>= sFieldName; + if ( rDescriptor.has( DataAccessDescriptorProperty::DataSource ) ) rDescriptor[ DataAccessDescriptorProperty::DataSource ] >>= sDataSource; + if ( rDescriptor.has( DataAccessDescriptorProperty::DatabaseLocation ) ) rDescriptor[ DataAccessDescriptorProperty::DatabaseLocation ] >>= sDatabaseLocation; + if ( rDescriptor.has( DataAccessDescriptorProperty::ConnectionResource ) ) rDescriptor[ DataAccessDescriptorProperty::ConnectionResource ] >>= sConnectionResource; + if ( rDescriptor.has( DataAccessDescriptorProperty::Command ) ) rDescriptor[ DataAccessDescriptorProperty::Command ] >>= sCommand; + if ( rDescriptor.has( DataAccessDescriptorProperty::ColumnName ) ) rDescriptor[ DataAccessDescriptorProperty::ColumnName ] >>= sFieldName; sal_Int32 nCommandType = CommandType::TABLE; - OSL_VERIFY( _rDescriptor[ DataAccessDescriptorProperty::CommandType ] >>= nCommandType ); + OSL_VERIFY( rDescriptor[ DataAccessDescriptorProperty::CommandType ] >>= nCommandType ); implConstruct( @@ -62,14 +66,13 @@ namespace svx if ( m_nFormatFlags & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR ) { - if ( _rDescriptor.has( DataAccessDescriptorProperty::Connection ) ) - m_aDescriptor[ DataAccessDescriptorProperty::Connection ] = _rDescriptor[ DataAccessDescriptorProperty::Connection ]; - if ( _rDescriptor.has( DataAccessDescriptorProperty::ColumnObject ) ) - m_aDescriptor[ DataAccessDescriptorProperty::ColumnObject ] = _rDescriptor[ DataAccessDescriptorProperty::ColumnObject ]; + if ( rDescriptor.has( DataAccessDescriptorProperty::Connection ) ) + m_aDescriptor[ DataAccessDescriptorProperty::Connection ] = rDescriptor[ DataAccessDescriptorProperty::Connection ]; + if ( rDescriptor.has( DataAccessDescriptorProperty::ColumnObject ) ) + m_aDescriptor[ DataAccessDescriptorProperty::ColumnObject ] = rDescriptor[ DataAccessDescriptorProperty::ColumnObject ]; } } - OColumnTransferable::OColumnTransferable(const Reference< XPropertySet >& _rxForm, const OUString& _rFieldName, const Reference< XPropertySet >& _rxColumn, const Reference< XConnection >& _rxConnection, ColumnTransferFormatFlags _nFormats) diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 8e91d42804d4..09ab384fdcdc 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -24,7 +24,6 @@ #include <svx/strings.hrc> #include <svx/svxids.hrc> -#include <svx/dbaexchange.hxx> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> @@ -59,8 +58,6 @@ const long STD_WIN_SIZE_X = 120; const long STD_WIN_SIZE_Y = 150; -const long LISTBOX_BORDER = 2; - using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::uno; @@ -74,8 +71,6 @@ using namespace ::svxform; using namespace ::svx; using namespace ::dbtools; -namespace { - struct ColumnInfo { OUString const sColumnName; @@ -85,9 +80,7 @@ struct ColumnInfo } }; -} - -static void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns ) +void FmFieldWin::addToList(const uno::Reference< container::XNameAccess>& i_xColumns ) { const uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); for ( const OUString& rEntry : aEntries ) @@ -96,124 +89,77 @@ static void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< conta OUString sLabel; if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) ) xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel; + m_aListBoxData.emplace_back(new ColumnInfo(rEntry)); + OUString sId(OUString::number(reinterpret_cast<sal_Int64>(m_aListBoxData.back().get()))); if ( !sLabel.isEmpty() ) - _rListBox.InsertEntry( sLabel, nullptr, false, TREELIST_APPEND, new ColumnInfo(rEntry) ); + m_xListBox->append(sId, sLabel); else - _rListBox.InsertEntry( rEntry, nullptr, false, TREELIST_APPEND, new ColumnInfo(rEntry) ); + m_xListBox->append(sId, rEntry); } } -FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent ) - :SvTreeListBox( pParent, WB_HASBUTTONS|WB_BORDER ) - ,pTabWin( pParent ) -{ - SetHelpId( HID_FIELD_SEL ); - - SetHighlightRange( ); -} - -FmFieldWinListBox::~FmFieldWinListBox() -{ - disposeOnce(); -} - -void FmFieldWinListBox::dispose() -{ - pTabWin.clear(); - SvTreeListBox::dispose(); -} - - -sal_Int8 FmFieldWinListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ ) -{ - return DND_ACTION_NONE; -} - - -sal_Int8 FmFieldWinListBox::ExecuteDrop( const ExecuteDropEvent& /*rEvt*/ ) +IMPL_LINK_NOARG(FmFieldWin, DragBeginHdl, weld::TreeView&, bool) { - return DND_ACTION_NONE; -} - - -bool FmFieldWinListBox::DoubleClickHdl() -{ - if ( pTabWin->createSelectionControls() ) - return true; - - return SvTreeListBox::DoubleClickHdl(); -} - - -void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ ) -{ - SvTreeListEntry* pSelected = FirstSelected(); + ColumnInfo* pSelected = reinterpret_cast<ColumnInfo*>(m_xListBox->get_selected_id().toInt64()); if (!pSelected) + { // no drag without a field - return; + return true; + } svx::ODataAccessDescriptor aDescriptor; - aDescriptor[ DataAccessDescriptorProperty::DataSource ] <<= pTabWin->GetDatabaseName(); - aDescriptor[ DataAccessDescriptorProperty::Connection ] <<= pTabWin->GetConnection().getTyped(); - aDescriptor[ DataAccessDescriptorProperty::Command ] <<= pTabWin->GetObjectName(); - aDescriptor[ DataAccessDescriptorProperty::CommandType ]<<= pTabWin->GetObjectType(); - ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData()); - aDescriptor[ DataAccessDescriptorProperty::ColumnName ] <<= pInfo->sColumnName; - - rtl::Reference<OColumnTransferable> pTransferColumn = new OColumnTransferable( - aDescriptor, ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::CONTROL_EXCHANGE | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR - ); - EndSelection(); - pTransferColumn->StartDrag( this, DND_ACTION_COPY ); + aDescriptor[ DataAccessDescriptorProperty::DataSource ] <<= GetDatabaseName(); + aDescriptor[ DataAccessDescriptorProperty::Connection ] <<= GetConnection().getTyped(); + aDescriptor[ DataAccessDescriptorProperty::Command ] <<= GetObjectName(); + aDescriptor[ DataAccessDescriptorProperty::CommandType ]<<= GetObjectType(); + aDescriptor[ DataAccessDescriptorProperty::ColumnName ] <<= pSelected->sColumnName; + + m_xHelper->setDescriptor(aDescriptor); + + return false; } -FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent) - :SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE)) - ,SfxControllerItem(SID_FM_FIELDS_CONTROL, *_pBindings) - ,::comphelper::OPropertyChangeListener(m_aMutex) - ,m_nObjectType(0) +FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, weld::Window* _pParent) + : SfxModelessDialogController(_pBindings, _pMgr, _pParent, "svx/ui/formfielddialog.ui", "FormFieldDialog") + , SfxControllerItem(SID_FM_FIELDS_CONTROL, *_pBindings) + , comphelper::OPropertyChangeListener(m_aMutex) + , m_xListBox(m_xBuilder->weld_tree_view("treeview")) + , m_nObjectType(0) { - SetHelpId( HID_FIELD_SEL_WIN ); + m_xDialog->set_help_id(HID_FIELD_SEL_WIN); + m_xListBox->set_help_id(HID_FIELD_SEL); + + m_xListBox->connect_row_activated(LINK(this, FmFieldWin, RowActivatedHdl)); + m_xHelper.set(new OColumnTransferable( + ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::CONTROL_EXCHANGE | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR + )); + rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get()); + m_xListBox->enable_drag_source(xHelper, DND_ACTION_COPY); + m_xListBox->connect_drag_begin(LINK(this, FmFieldWin, DragBeginHdl)); - SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); - pListBox = VclPtr<FmFieldWinListBox>::Create( this ); - pListBox->Show(); UpdateContent(nullptr); - SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); + m_xDialog->set_size_request(STD_WIN_SIZE_X, STD_WIN_SIZE_Y); } - FmFieldWin::~FmFieldWin() { - disposeOnce(); -} - -void FmFieldWin::dispose() -{ - if (m_pChangeListener.is()) + if (m_xChangeListener.is()) { - m_pChangeListener->dispose(); - m_pChangeListener.clear(); + m_xChangeListener->dispose(); + m_xChangeListener.clear(); } - pListBox.disposeAndClear(); ::SfxControllerItem::dispose(); - SfxFloatingWindow::dispose(); } - -void FmFieldWin::GetFocus() +IMPL_LINK_NOARG(FmFieldWin, RowActivatedHdl, weld::TreeView&, bool) { - if ( pListBox ) - pListBox->GrabFocus(); - else - SfxFloatingWindow::GetFocus(); + return createSelectionControls(); } - -bool FmFieldWin::createSelectionControls( ) +bool FmFieldWin::createSelectionControls() { - SvTreeListEntry* pSelected = pListBox->FirstSelected(); - if ( pSelected ) + ColumnInfo* pSelected = reinterpret_cast<ColumnInfo*>(m_xListBox->get_selected_id().toInt64()); + if (pSelected) { // build a descriptor for the currently selected field ODataAccessDescriptor aDescr; @@ -223,8 +169,7 @@ bool FmFieldWin::createSelectionControls( ) aDescr[ DataAccessDescriptorProperty::Command ] <<= GetObjectName(); aDescr[ DataAccessDescriptorProperty::CommandType ] <<= GetObjectType(); - ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData()); - aDescr[ DataAccessDescriptorProperty::ColumnName ] <<= pInfo->sColumnName;//OUString( pListBox->GetEntryText( pSelected) ); + aDescr[ DataAccessDescriptorProperty::ColumnName ] <<= pSelected->sColumnName; // transfer this to the SFX world SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) ); @@ -240,30 +185,12 @@ bool FmFieldWin::createSelectionControls( ) return nullptr != pSelected; } - -bool FmFieldWin::PreNotify( NotifyEvent& _rNEvt ) -{ - if ( MouseNotifyEvent::KEYINPUT == _rNEvt.GetType() ) - { - const vcl::KeyCode& rKeyCode = _rNEvt.GetKeyEvent()->GetKeyCode(); - if ( ( 0 == rKeyCode.GetModifier() ) && ( KEY_RETURN == rKeyCode.GetCode() ) ) - { - if ( createSelectionControls() ) - return true; - } - } - - return SfxFloatingWindow::PreNotify( _rNEvt ); -} - - void FmFieldWin::_propertyChanged(const css::beans::PropertyChangeEvent& evt) { css::uno::Reference< css::form::XForm > xForm(evt.Source, css::uno::UNO_QUERY); UpdateContent(xForm); } - void FmFieldWin::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) { if (!pState || SID_FM_FIELDS_CONTROL != nSID) @@ -278,12 +205,12 @@ void FmFieldWin::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoo UpdateContent(nullptr); } - void FmFieldWin::UpdateContent(FmFormShell const * pShell) { - pListBox->Clear(); + m_xListBox->clear(); + m_aListBoxData.clear(); OUString aTitle(SvxResId(RID_STR_FIELDSELECTION)); - SetText( aTitle ); + m_xDialog->set_title(aTitle); if (!pShell || !pShell->GetImpl()) return; @@ -293,15 +220,15 @@ void FmFieldWin::UpdateContent(FmFormShell const * pShell) UpdateContent( xForm ); } - void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & xForm) { try { // delete ListBox - pListBox->Clear(); + m_xListBox->clear(); + m_aListBoxData.clear(); OUString aTitle(SvxResId(RID_STR_FIELDSELECTION)); - SetText(aTitle); + m_xDialog->set_title(aTitle); if (!xForm.is()) return; @@ -328,7 +255,7 @@ void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & x Reference< XComponent > xKeepFieldsAlive; Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive ); if ( xColumns.is() ) - lcl_addToList(*pListBox,xColumns); + addToList(xColumns); } // set prefix @@ -348,19 +275,19 @@ void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & x } // listen for changes at ControlSource in PropertySet - if (m_pChangeListener.is()) + if (m_xChangeListener.is()) { - m_pChangeListener->dispose(); - m_pChangeListener.clear(); + m_xChangeListener->dispose(); + m_xChangeListener.clear(); } - m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer(this, xSet); - m_pChangeListener->addProperty(FM_PROP_DATASOURCE); - m_pChangeListener->addProperty(FM_PROP_COMMAND); - m_pChangeListener->addProperty(FM_PROP_COMMANDTYPE); + m_xChangeListener = new ::comphelper::OPropertyChangeMultiplexer(this, xSet); + m_xChangeListener->addProperty(FM_PROP_DATASOURCE); + m_xChangeListener->addProperty(FM_PROP_COMMAND); + m_xChangeListener->addProperty(FM_PROP_COMMANDTYPE); // set title aTitle += " " + aPrefix + " " + m_aObjectName; - SetText( aTitle ); + m_xDialog->set_title(aTitle); } catch( const Exception& ) { @@ -368,41 +295,20 @@ void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & x } } - -void FmFieldWin::Resize() -{ - SfxFloatingWindow::Resize(); - - Size aOutputSize( GetOutputSizePixel() ); - - - // adapt size of css::form::ListBox - Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER ); - Size aLBSize( aOutputSize ); - aLBSize.AdjustWidth( -(2*LISTBOX_BORDER) ); - aLBSize.AdjustHeight( -(2*LISTBOX_BORDER) ); - - pListBox->SetPosSizePixel( aLBPos, aLBSize ); -} - - void FmFieldWin::FillInfo( SfxChildWinInfo& rInfo ) const { rInfo.bVisible = false; } - -SFX_IMPL_FLOATINGWINDOW(FmFieldWinMgr, SID_FM_ADD_FIELD) - +SFX_IMPL_MODELESSDIALOGCONTOLLER(FmFieldWinMgr, SID_FM_ADD_FIELD) FmFieldWinMgr::FmFieldWinMgr(vcl::Window* _pParent, sal_uInt16 _nId, SfxBindings* _pBindings, SfxChildWinInfo const * _pInfo) :SfxChildWindow(_pParent, _nId) { - SetWindow( VclPtr<FmFieldWin>::Create(_pBindings, this, _pParent) ); + SetController(std::make_shared<FmFieldWin>(_pBindings, this, _pParent->GetFrameWeld())); SetHideNotDelete(true); - static_cast<SfxFloatingWindow*>(GetWindow())->Initialize( _pInfo ); + static_cast<FmFieldWin*>(GetController().get())->Initialize(_pInfo); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx index 9645ff5a1343..17bdbe6da534 100644 --- a/svx/source/inc/tabwin.hxx +++ b/svx/source/inc/tabwin.hxx @@ -23,6 +23,7 @@ #include <sfx2/basedlgs.hxx> #include <sfx2/childwin.hxx> #include <sfx2/ctrlitem.hxx> +#include <svx/dbaexchange.hxx> #include <com/sun/star/form/XForm.hpp> #include <comphelper/propmultiplex.hxx> @@ -30,61 +31,34 @@ #include <connectivity/dbtools.hxx> -class FmFieldWin; -class FmFieldWinListBox - :public SvTreeListBox -{ - VclPtr<FmFieldWin> pTabWin; - -protected: -// virtual void Command( const CommandEvent& rEvt ); - -public: - FmFieldWinListBox( FmFieldWin* pParent ); - virtual ~FmFieldWinListBox() override; - virtual void dispose() override; - - sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; - sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; - -protected: - // DragSourceHelper - virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; - - // SvTreeListBox - virtual bool DoubleClickHdl() override; - - using SvTreeListBox::ExecuteDrop; -}; - - class FmFormShell; +struct ColumnInfo; - -class FmFieldWin :public SfxFloatingWindow - ,public SfxControllerItem - ,public ::comphelper::OPropertyChangeListener +class FmFieldWin : public SfxModelessDialogController + , public SfxControllerItem + , public ::comphelper::OPropertyChangeListener { ::osl::Mutex m_aMutex; - VclPtr<FmFieldWinListBox> pListBox; + std::unique_ptr<weld::TreeView> m_xListBox; + std::vector<std::unique_ptr<ColumnInfo>> m_aListBoxData; ::dbtools::SharedConnection m_aConnection; OUString m_aDatabaseName, m_aObjectName; sal_Int32 m_nObjectType; - rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_pChangeListener; + rtl::Reference<comphelper::OPropertyChangeMultiplexer> m_xChangeListener; + rtl::Reference<svx::OColumnTransferable> m_xHelper; + void addToList(const css::uno::Reference<css::container::XNameAccess>& i_xColumns); + + DECL_LINK(RowActivatedHdl, weld::TreeView&, bool); + DECL_LINK(DragBeginHdl, weld::TreeView&, bool); public: - FmFieldWin(SfxBindings *pBindings, - SfxChildWindow *pMgr, vcl::Window* pParent); + FmFieldWin(SfxBindings *pBindings, SfxChildWindow *pMgr, weld::Window* pParent); virtual ~FmFieldWin() override; - virtual void dispose() override; - virtual void Resize() override; - using SfxFloatingWindow::Close; - virtual void GetFocus() override; - virtual bool PreNotify( NotifyEvent& _rNEvt ) override; + virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) override; @@ -92,10 +66,10 @@ public: void UpdateContent(const css::uno::Reference< css::form::XForm > &); void FillInfo( SfxChildWinInfo& rInfo ) const override; - const OUString& GetDatabaseName() const { return m_aDatabaseName; } + const OUString& GetDatabaseName() const { return m_aDatabaseName; } const ::dbtools::SharedConnection& GetConnection() const { return m_aConnection; } - const OUString& GetObjectName() const { return m_aObjectName; } - sal_Int32 GetObjectType() const { return m_nObjectType; } + const OUString& GetObjectName() const { return m_aObjectName; } + sal_Int32 GetObjectType() const { return m_nObjectType; } bool createSelectionControls( ); @@ -105,7 +79,6 @@ protected: protected: using SfxControllerItem::GetBindings; - using SfxFloatingWindow::StateChanged; }; diff --git a/svx/uiconfig/ui/formfielddialog.ui b/svx/uiconfig/ui/formfielddialog.ui new file mode 100644 index 000000000000..3a3d56441852 --- /dev/null +++ b/svx/uiconfig/ui/formfielddialog.ui @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> +<interface domain="svx"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkTreeStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> + <object class="GtkDialog" id="FormFieldDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="default_width">0</property> + <property name="default_height">0</property> + <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="layout_style">end</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="container"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="treeview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore1</property> + <property name="headers_visible">False</property> + <property name="reorderable">True</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="Macro Library List-selection2"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn3"> + <property name="resizable">True</property> + <child> + <object class="GtkCellRendererText" id="cellrenderer1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> +</interface> |