diff options
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 306 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 29 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 13 | ||||
-rw-r--r-- | cui/source/inc/insdlg.hxx | 92 | ||||
-rw-r--r-- | cui/uiconfig/ui/insertfloatingframe.ui | 137 | ||||
-rw-r--r-- | cui/uiconfig/ui/insertoleobject.ui | 57 | ||||
-rw-r--r-- | include/sfx2/filedlghelper.hxx | 13 | ||||
-rw-r--r-- | include/sfx2/sfxdlg.hxx | 4 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 76 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlgimpl.hxx | 14 | ||||
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 6 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/autoformattable.ui | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 111 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 21 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 14 |
22 files changed, 563 insertions, 353 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 9db02b3b467f..a20a282ae513 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -78,24 +78,23 @@ uno::Reference< io::XInputStream > InsertObjectDialog_Impl::GetIconIfIconified( return uno::Reference< io::XInputStream >(); } -InsertObjectDialog_Impl::InsertObjectDialog_Impl(vcl::Window * pParent, const OUString& rID, - const OUString& rUIXMLDescription, +InsertObjectDialog_Impl::InsertObjectDialog_Impl(weld::Window* pParent, + const OUString& rUIXMLDescription, const OString& rID, const css::uno::Reference < css::embed::XStorage >& xStorage) - : ModalDialog(pParent, rID, rUIXMLDescription) + : GenericDialogController(pParent, rUIXMLDescription, rID) , m_xStorage( xStorage ) , aCnt( m_xStorage ) { } - -IMPL_LINK_NOARG(SvInsertOleDlg, DoubleClickHdl, ListBox&, void) +IMPL_LINK_NOARG(SvInsertOleDlg, DoubleClickHdl, weld::TreeView&, void) { - EndDialog( RET_OK ); + m_xDialog->response(RET_OK); } -IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl, Button*, void) +IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl, weld::Button&, void) { - sfx2::FileDialogHelper aHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, this); + sfx2::FileDialogHelper aHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, m_xDialog.get()); Reference< XFilePicker3 > xFilePicker = aHelper.GetFilePicker(); // add filter @@ -115,73 +114,49 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl, Button*, void) { Sequence< OUString > aPathSeq( xFilePicker->getSelectedFiles() ); INetURLObject aObj( aPathSeq[0] ); - m_pEdFilepath->SetText( aObj.PathToFileName() ); + m_xEdFilepath->set_text(aObj.PathToFileName()); } } - -IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl, Button*, void) +IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl, weld::Button&, void) { - if ( m_pRbNewObject->IsChecked() ) + if (m_xRbNewObject->get_active()) { - m_pObjectTypeFrame->Show(); - m_pFileFrame->Hide(); + m_xObjectTypeFrame->show(); + m_xFileFrame->hide(); } else { - m_pFileFrame->Show(); - m_pObjectTypeFrame->Hide(); + m_xFileFrame->show(); + m_xObjectTypeFrame->hide(); } } - -SvInsertOleDlg::SvInsertOleDlg -( - vcl::Window* pParent, - const Reference < embed::XStorage >& xStorage, - const SvObjectServerList* pServers -) - : InsertObjectDialog_Impl( pParent, "InsertOLEObjectDialog", "cui/ui/insertoleobject.ui", xStorage ), - m_pServers( pServers ) -{ - get(m_pRbNewObject, "createnew"); - get(m_pRbObjectFromfile, "createfromfile"); - get(m_pObjectTypeFrame, "objecttypeframe"); - get(m_pLbObjecttype, "types"); - get(m_pFileFrame, "fileframe"); - get(m_pEdFilepath, "urled"); - get(m_pBtnFilepath, "urlbtn"); - get(m_pCbFilelink, "linktofile"); - get(m_pCbAsIcon, "asicon"); - m_pLbObjecttype->SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) ); - m_pBtnFilepath->SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) ); - Link<Button*,void> aLink( LINK( this, SvInsertOleDlg, RadioHdl ) ); - m_pRbNewObject->SetClickHdl( aLink ); - m_pRbObjectFromfile->SetClickHdl( aLink ); - m_pRbNewObject->Check(); - RadioHdl( nullptr ); -} - -SvInsertOleDlg::~SvInsertOleDlg() -{ - disposeOnce(); -} - -void SvInsertOleDlg::dispose() +SvInsertOleDlg::SvInsertOleDlg(weld::Window* pParent, const Reference<embed::XStorage>& xStorage, + const SvObjectServerList* pServers) + : InsertObjectDialog_Impl( pParent, "cui/ui/insertoleobject.ui", "InsertOLEObjectDialog", xStorage) + , m_pServers( pServers ) + , m_xRbNewObject(m_xBuilder->weld_radio_button("createnew")) + , m_xRbObjectFromfile(m_xBuilder->weld_radio_button("createfromfile")) + , m_xObjectTypeFrame(m_xBuilder->weld_frame("objecttypeframe")) + , m_xLbObjecttype(m_xBuilder->weld_tree_view("types")) + , m_xFileFrame(m_xBuilder->weld_frame("fileframe")) + , m_xEdFilepath(m_xBuilder->weld_entry("urled")) + , m_xBtnFilepath(m_xBuilder->weld_button("urlbtn")) + , m_xCbFilelink(m_xBuilder->weld_check_button("linktofile")) + , m_xCbAsIcon(m_xBuilder->weld_check_button("asicon")) { - m_pRbNewObject.clear(); - m_pRbObjectFromfile.clear(); - m_pObjectTypeFrame.clear(); - m_pLbObjecttype.clear(); - m_pFileFrame.clear(); - m_pEdFilepath.clear(); - m_pBtnFilepath.clear(); - m_pCbFilelink.clear(); - m_pCbAsIcon.clear(); - InsertObjectDialog_Impl::dispose(); + m_xLbObjecttype->set_size_request(m_xLbObjecttype->get_approximate_digit_width() * 32, + m_xLbObjecttype->get_height_rows(6)); + m_xLbObjecttype->connect_row_activated(LINK(this, SvInsertOleDlg, DoubleClickHdl)); + m_xBtnFilepath->connect_clicked(LINK( this, SvInsertOleDlg, BrowseHdl)); + Link<weld::Button&,void> aLink( LINK( this, SvInsertOleDlg, RadioHdl ) ); + m_xRbNewObject->connect_clicked( aLink ); + m_xRbObjectFromfile->connect_clicked( aLink ); + m_xRbNewObject->set_active(true); } -short SvInsertOleDlg::Execute() +short SvInsertOleDlg::execute() { short nRet = RET_OK; SvObjectServerList aObjS; @@ -193,22 +168,22 @@ short SvInsertOleDlg::Execute() } // fill listbox and select default - m_pLbObjecttype->SetUpdateMode( false ); + m_xLbObjecttype->freeze(); for ( sal_uLong i = 0; i < m_pServers->Count(); i++ ) - m_pLbObjecttype->InsertEntry( (*m_pServers)[i].GetHumanName() ); - m_pLbObjecttype->SetUpdateMode( true ); - m_pLbObjecttype->SelectEntryPos(0); + m_xLbObjecttype->append_text((*m_pServers)[i].GetHumanName()); + m_xLbObjecttype->thaw(); + m_xLbObjecttype->select(0); OUString aName; DBG_ASSERT( m_xStorage.is(), "No storage!"); - if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK ) + if ( m_xStorage.is() && ( nRet = run() ) == RET_OK ) { OUString aFileName; bool bCreateNew = IsCreateNew(); if ( bCreateNew ) { // create and insert new embedded object - OUString aServerName = m_pLbObjecttype->GetSelectedEntry(); + OUString aServerName = m_xLbObjecttype->get_selected(); const SvObjectServer* pS = m_pServers->Get( aServerName ); if ( pS ) { @@ -268,7 +243,7 @@ short SvInsertOleDlg::Execute() OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE)); aErr = aErr.replaceFirst( "%", aFileName ); - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, aErr)); xBox->run(); } @@ -279,7 +254,7 @@ short SvInsertOleDlg::Execute() OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE)); aErr = aErr.replaceFirst( "%", aServerName ); - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, aErr)); xBox->run(); } @@ -288,12 +263,12 @@ short SvInsertOleDlg::Execute() } else { - aFileName = m_pEdFilepath->GetText(); + aFileName = m_xEdFilepath->get_text(); INetURLObject aURL; aURL.SetSmartProtocol( INetProtocol::File ); aURL.SetSmartURL( aFileName ); aFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); - bool bLink = m_pCbFilelink->IsChecked(); + bool bLink = m_xCbFilelink->get_active(); if ( !aFileName.isEmpty() ) { @@ -323,13 +298,13 @@ short SvInsertOleDlg::Execute() OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE)); aErr = aErr.replaceFirst( "%", aFileName ); - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, aErr)); xBox->run(); } else { - if (m_pCbAsIcon->IsChecked()) + if (m_xCbAsIcon->get_active()) { //something nice here I guess would be to write the filename into //the image with this icon above it @@ -361,78 +336,54 @@ uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( OUString* } -SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( vcl::Window *pParent, - const css::uno::Reference < css::embed::XStorage >& xStorage ) - : InsertObjectDialog_Impl( pParent, "InsertFloatingFrameDialog", "cui/ui/insertfloatingframe.ui", - xStorage ) +SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog(weld::Window *pParent, + const css::uno::Reference < css::embed::XStorage >& xStorage) + : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog", + xStorage) { Init(); } -SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( vcl::Window *pParent, - const uno::Reference < embed::XEmbeddedObject >& xObj ) - : InsertObjectDialog_Impl( pParent, "InsertFloatingFrameDialog", "cui/ui/insertfloatingframe.ui", - uno::Reference < embed::XStorage >() ) +SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog(weld::Window *pParent, + const uno::Reference < embed::XEmbeddedObject >& xObj) + : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog", + uno::Reference<embed::XStorage>()) { m_xObj = xObj; Init(); } -SfxInsertFloatingFrameDialog::~SfxInsertFloatingFrameDialog() -{ - disposeOnce(); -} - -void SfxInsertFloatingFrameDialog::dispose() -{ - m_pEDName.clear(); - m_pEDURL.clear(); - m_pBTOpen.clear(); - m_pRBScrollingOn.clear(); - m_pRBScrollingOff.clear(); - m_pRBScrollingAuto.clear(); - m_pRBFrameBorderOn.clear(); - m_pRBFrameBorderOff.clear(); - m_pFTMarginWidth.clear(); - m_pNMMarginWidth.clear(); - m_pCBMarginWidthDefault.clear(); - m_pFTMarginHeight.clear(); - m_pNMMarginHeight.clear(); - m_pCBMarginHeightDefault.clear(); - InsertObjectDialog_Impl::dispose(); -} - void SfxInsertFloatingFrameDialog::Init() { - get(m_pEDName, "edname"); - get(m_pEDURL, "edurl"); - get(m_pBTOpen, "buttonbrowse"); - get(m_pRBScrollingOn, "scrollbaron"); - get(m_pRBScrollingOff, "scrollbaroff"); - get(m_pRBScrollingAuto, "scrollbarauto"); - get(m_pRBFrameBorderOn, "borderon"); - get(m_pRBFrameBorderOff, "borderoff"); - get(m_pFTMarginWidth, "widthlabel"); - get(m_pNMMarginWidth, "width"); - get(m_pCBMarginWidthDefault, "defaultwidth"); - get(m_pFTMarginHeight, "heightlabel"); - get(m_pNMMarginHeight, "height"); - get(m_pCBMarginHeightDefault, "defaultheight"); - - Link<Button*, void> aLink( LINK( this, SfxInsertFloatingFrameDialog, CheckHdl ) ); - m_pCBMarginWidthDefault->SetClickHdl( aLink ); - m_pCBMarginHeightDefault->SetClickHdl( aLink ); - - m_pCBMarginWidthDefault->Check(); - m_pCBMarginHeightDefault->Check(); - m_pRBScrollingAuto->Check(); - m_pRBFrameBorderOn->Check(); - - m_pBTOpen->SetClickHdl( LINK( this, SfxInsertFloatingFrameDialog, OpenHdl ) ); + m_xEDName.reset(m_xBuilder->weld_entry("edname")); + m_xEDURL.reset(m_xBuilder->weld_entry("edurl")); + m_xBTOpen.reset(m_xBuilder->weld_button("buttonbrowse")); + m_xRBScrollingOn.reset(m_xBuilder->weld_radio_button("scrollbaron")); + m_xRBScrollingOff.reset(m_xBuilder->weld_radio_button("scrollbaroff")); + m_xRBScrollingAuto.reset(m_xBuilder->weld_radio_button("scrollbarauto")); + m_xRBFrameBorderOn.reset(m_xBuilder->weld_radio_button("borderon")); + m_xRBFrameBorderOff.reset(m_xBuilder->weld_radio_button("borderoff")); + m_xFTMarginWidth.reset(m_xBuilder->weld_label("widthlabel")); + m_xNMMarginWidth.reset(m_xBuilder->weld_spin_button("width")); + m_xCBMarginWidthDefault.reset(m_xBuilder->weld_check_button("defaultwidth")); + m_xFTMarginHeight.reset(m_xBuilder->weld_label("heightlabel")); + m_xNMMarginHeight.reset(m_xBuilder->weld_spin_button("height")); + m_xCBMarginHeightDefault.reset(m_xBuilder->weld_check_button("defaultheight")); + + Link<weld::Button&, void> aLink(LINK(this, SfxInsertFloatingFrameDialog, CheckHdl)); + m_xCBMarginWidthDefault->connect_clicked(aLink); + m_xCBMarginHeightDefault->connect_clicked(aLink); + + m_xCBMarginWidthDefault->set_active(true); + m_xCBMarginHeightDefault->set_active(true); + m_xRBScrollingAuto->set_active(true); + m_xRBFrameBorderOn->set_active(true); + + m_xBTOpen->connect_clicked(LINK(this, SfxInsertFloatingFrameDialog, OpenHdl)); } -short SfxInsertFloatingFrameDialog::Execute() +short SfxInsertFloatingFrameDialog::execute() { short nRet = RET_OK; bool bOK = false; @@ -447,10 +398,10 @@ short SfxInsertFloatingFrameDialog::Execute() OUString aStr; uno::Any aAny = xSet->getPropertyValue( "FrameURL" ); if ( aAny >>= aStr ) - m_pEDURL->SetText( aStr ); + m_xEDURL->set_text( aStr ); aAny = xSet->getPropertyValue( "FrameName" ); if ( aAny >>= aStr ) - m_pEDName->SetText( aStr ); + m_xEDName->set_text(aStr); sal_Int32 nSize = SIZE_NOT_SET; aAny = xSet->getPropertyValue( "FrameMarginWidth" ); @@ -458,26 +409,26 @@ short SfxInsertFloatingFrameDialog::Execute() if ( nSize == SIZE_NOT_SET ) { - m_pCBMarginWidthDefault->Check(); - m_pNMMarginWidth->SetText( OUString::number(DEFAULT_MARGIN_WIDTH) ); - m_pFTMarginWidth->Enable( false ); - m_pNMMarginWidth->Enable( false ); + m_xCBMarginWidthDefault->set_active(true); + m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH)); + m_xFTMarginWidth->set_sensitive(false); + m_xNMMarginWidth->set_sensitive(false); } else - m_pNMMarginWidth->SetText( OUString::number( nSize ) ); + m_xNMMarginWidth->set_text(OUString::number(nSize)); aAny = xSet->getPropertyValue( "FrameMarginHeight" ); aAny >>= nSize; if ( nSize == SIZE_NOT_SET ) { - m_pCBMarginHeightDefault->Check(); - m_pNMMarginHeight->SetText( OUString::number(DEFAULT_MARGIN_HEIGHT) ); - m_pFTMarginHeight->Enable( false ); - m_pNMMarginHeight->Enable( false ); + m_xCBMarginHeightDefault->set_active(true); + m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT)); + m_xFTMarginHeight->set_sensitive(false); + m_xNMMarginHeight->set_sensitive(false); } else - m_pNMMarginHeight->SetText( OUString::number( nSize ) ); + m_xNMMarginHeight->set_text(OUString::number(nSize)); bool bScrollOn = false; bool bScrollOff = false; @@ -496,9 +447,9 @@ short SfxInsertFloatingFrameDialog::Execute() else bScrollAuto = true; - m_pRBScrollingOn->Check( bScrollOn ); - m_pRBScrollingOff->Check( bScrollOff ); - m_pRBScrollingAuto->Check( bScrollAuto ); + m_xRBScrollingOn->set_sensitive(bScrollOn); + m_xRBScrollingOff->set_sensitive(bScrollOff); + m_xRBScrollingAuto->set_sensitive(bScrollAuto); bSet = false; aAny = xSet->getPropertyValue( "FrameIsAutoBorder" ); @@ -507,11 +458,11 @@ short SfxInsertFloatingFrameDialog::Execute() { aAny = xSet->getPropertyValue( "FrameIsBorder" ); aAny >>= bSet; - m_pRBFrameBorderOn->Check( bSet ); - m_pRBFrameBorderOff->Check( !bSet ); + m_xRBFrameBorderOn->set_active(bSet); + m_xRBFrameBorderOff->set_active(!bSet); } - SetUpdateMode( true ); +//TODO SetUpdateMode( true ); bOK = true; } catch ( uno::Exception& ) @@ -525,15 +476,15 @@ short SfxInsertFloatingFrameDialog::Execute() bOK = m_xStorage.is(); } - if ( bOK && ( nRet = Dialog::Execute() ) == RET_OK ) + if ( bOK && ( nRet = run() ) == RET_OK ) { OUString aURL; - if ( !m_pEDURL->GetText().isEmpty() ) + if (!m_xEDURL->get_text().isEmpty()) { // URL can be a valid and absolute URL or a system file name INetURLObject aObj; aObj.SetSmartProtocol( INetProtocol::File ); - if ( aObj.SetSmartURL( m_pEDURL->GetText() ) ) + if ( aObj.SetSmartURL( m_xEDURL->get_text() ) ) aURL = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } @@ -556,26 +507,26 @@ short SfxInsertFloatingFrameDialog::Execute() if ( bIPActive ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - OUString aName = m_pEDName->GetText(); + OUString aName = m_xEDName->get_text(); ScrollingMode eScroll = ScrollingMode::No; - if ( m_pRBScrollingOn->IsChecked() ) + if (m_xRBScrollingOn->get_active()) eScroll = ScrollingMode::Yes; - if ( m_pRBScrollingOff->IsChecked() ) + if (m_xRBScrollingOff->get_active()) eScroll = ScrollingMode::No; - if ( m_pRBScrollingAuto->IsChecked() ) + if (m_xRBScrollingAuto->get_active()) eScroll = ScrollingMode::Auto; - bool bHasBorder = m_pRBFrameBorderOn->IsChecked(); + bool bHasBorder = m_xRBFrameBorderOn->get_active(); long lMarginWidth; - if ( !m_pCBMarginWidthDefault->IsChecked() ) - lMarginWidth = static_cast<long>(m_pNMMarginWidth->GetText().toInt32()); + if (!m_xCBMarginWidthDefault->get_active()) + lMarginWidth = static_cast<long>(m_xNMMarginWidth->get_text().toInt32()); else lMarginWidth = SIZE_NOT_SET; long lMarginHeight; - if ( !m_pCBMarginHeightDefault->IsChecked() ) - lMarginHeight = static_cast<long>(m_pNMMarginHeight->GetText().toInt32()); + if (!m_xCBMarginHeightDefault->get_active()) + lMarginHeight = static_cast<long>(m_xNMMarginHeight->get_text().toInt32()); else lMarginHeight = SIZE_NOT_SET; @@ -604,42 +555,39 @@ short SfxInsertFloatingFrameDialog::Execute() return nRet; } - -IMPL_LINK( SfxInsertFloatingFrameDialog, CheckHdl, Button*, pButton, void ) +IMPL_LINK(SfxInsertFloatingFrameDialog, CheckHdl, weld::Button&, rButton, void) { - CheckBox* pCB = static_cast<CheckBox*>(pButton); - if ( pCB == m_pCBMarginWidthDefault ) + weld::CheckButton& rCB = dynamic_cast<weld::CheckButton&>(rButton); + if (&rCB == m_xCBMarginWidthDefault.get()) { - if ( pCB->IsChecked() ) - m_pNMMarginWidth->SetText( OUString::number(DEFAULT_MARGIN_WIDTH) ); - m_pFTMarginWidth->Enable( !pCB->IsChecked() ); - m_pNMMarginWidth->Enable( !pCB->IsChecked() ); + if (rCB.get_active()) + m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH)); + m_xFTMarginWidth->set_sensitive(!rCB.get_active()); + m_xNMMarginWidth->set_sensitive(!rCB.get_active()); } - if ( pCB == m_pCBMarginHeightDefault ) + if (&rCB == m_xCBMarginHeightDefault.get()) { - if ( pCB->IsChecked() ) - m_pNMMarginHeight->SetText( OUString::number(DEFAULT_MARGIN_HEIGHT) ); - m_pFTMarginHeight->Enable( !pCB->IsChecked() ); - m_pNMMarginHeight->Enable( !pCB->IsChecked() ); + if (rCB.get_active()) + m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT)); + m_xFTMarginHeight->set_sensitive(!rCB.get_active()); + m_xNMMarginHeight->set_sensitive(!rCB.get_active()); } } - -IMPL_LINK_NOARG( SfxInsertFloatingFrameDialog, OpenHdl, Button*, void) +IMPL_LINK_NOARG( SfxInsertFloatingFrameDialog, OpenHdl, weld::Button&, void) { // create the file dialog sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, OUString(), - SfxFilterFlags::NONE, SfxFilterFlags::NONE, this); + SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get()); // set the title aFileDlg.SetTitle(CuiResId(RID_SVXSTR_SELECT_FILE_IFRAME)); // show the dialog if ( aFileDlg.Execute() == ERRCODE_NONE ) - m_pEDURL->SetText( - INetURLObject( aFileDlg.GetPath() ).GetMainURL( INetURLObject::DecodeMechanism::WithCharset ) ); + m_xEDURL->set_text(INetURLObject(aFileDlg.GetPath()).GetMainURL(INetURLObject::DecodeMechanism::WithCharset)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 644326aa7c5a..8a8647b088af 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -158,7 +158,11 @@ short AbstractPasteDialog_Impl::Execute() return m_xDlg->run(); } -IMPL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl); +short AbstractInsertObjectDialog_Impl::Execute() +{ + return m_xDlg->execute(); +} + IMPL_ABSTDLG_BASE(AbstractLinksDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSpellDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSvxPostItDialog_Impl); @@ -390,17 +394,17 @@ vcl::Window* AbstractHyphenWordDialog_Impl::GetWindow() Reference < css::embed::XEmbeddedObject > AbstractInsertObjectDialog_Impl::GetObject() { - return pDlg->GetObject(); + return m_xDlg->GetObject(); } bool AbstractInsertObjectDialog_Impl::IsCreateNew() { - return pDlg->IsCreateNew(); + return m_xDlg->IsCreateNew(); } ::Reference< css::io::XInputStream > AbstractInsertObjectDialog_Impl::GetIconIfIconified( OUString* pGraphicMediaType ) { - return pDlg->GetIconIfIconified( pGraphicMediaType ); + return m_xDlg->GetIconIfIconified( pGraphicMediaType ); } void AbstractPasteDialog_Impl::Insert(SotClipboardFormatId nFormat, const OUString& rFormatName) @@ -1478,15 +1482,14 @@ GetTabPageRanges AbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16 nI return nullptr; } -VclPtr<SfxAbstractInsertObjectDialog> AbstractDialogFactory_Impl::CreateInsertObjectDialog( vcl::Window* pParent, const OUString& rCommand, - const Reference < css::embed::XStorage >& xStor, - const SvObjectServerList* pList ) +VclPtr<SfxAbstractInsertObjectDialog> AbstractDialogFactory_Impl::CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand, + const Reference <css::embed::XStorage>& xStor, const SvObjectServerList* pList) { InsertObjectDialog_Impl* pDlg=nullptr; if ( rCommand == ".uno:InsertObject" ) - pDlg = VclPtr<SvInsertOleDlg>::Create( pParent, xStor, pList ); + pDlg = new SvInsertOleDlg(pParent, xStor, pList); else if ( rCommand == ".uno:InsertObjectFloatingFrame" ) - pDlg = VclPtr<SfxInsertFloatingFrameDialog>::Create( pParent, xStor ); + pDlg = new SfxInsertFloatingFrameDialog(pParent, xStor); if ( pDlg ) { @@ -1496,14 +1499,14 @@ VclPtr<SfxAbstractInsertObjectDialog> AbstractDialogFactory_Impl::CreateInsertOb return nullptr; } -VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateEditObjectDialog( const OUString& rCommand, - const Reference < css::embed::XEmbeddedObject >& xObj ) +VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommand, + const Reference<css::embed::XEmbeddedObject>& xObj) { if ( rCommand == ".uno:InsertObjectFloatingFrame" ) { - VclPtrInstance<SfxInsertFloatingFrameDialog> pDlg( nullptr, xObj ); + SfxInsertFloatingFrameDialog* pDlg = new SfxInsertFloatingFrameDialog(pParent, xObj); pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) ); - return VclPtr<CuiVclAbstractDialog_Impl>::Create( pDlg ); + return VclPtr<AbstractInsertObjectDialog_Impl>::Create( pDlg ); } return nullptr; } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 771f6eafd611..ae87ab25bb72 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -432,7 +432,14 @@ class AbstractSvxAreaTabDialog_Impl :public AbstractSvxAreaTabDialog class AbstractInsertObjectDialog_Impl : public SfxAbstractInsertObjectDialog { - DECL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl, InsertObjectDialog_Impl) +protected: + std::unique_ptr<InsertObjectDialog_Impl> m_xDlg; +public: + explicit AbstractInsertObjectDialog_Impl(InsertObjectDialog_Impl* p) + : m_xDlg(p) + { + } + virtual short Execute() override; virtual css::uno::Reference < css::embed::XEmbeddedObject > GetObject() override; virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ) override; virtual bool IsCreateNew() override; @@ -555,10 +562,10 @@ public: virtual VclPtr<AbstractSvxDistributeDialog> CreateSvxDistributeDialog(const SfxItemSet& rAttr) override; virtual VclPtr<SfxAbstractInsertObjectDialog> - CreateInsertObjectDialog( vcl::Window* pParent, const OUString& rCommmand, + CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommmand, const css::uno::Reference < css::embed::XStorage >& xStor, const SvObjectServerList* pList ) override; - virtual VclPtr<VclAbstractDialog> CreateEditObjectDialog( const OUString& rCommmand, + virtual VclPtr<VclAbstractDialog> CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommmand, const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ) override; virtual VclPtr<SfxAbstractPasteDialog> CreatePasteDialog(weld::Window* pParent) override; virtual VclPtr<SfxAbstractLinksDialog> CreateLinksDialog( vcl::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML = false, sfx2::SvBaseLink* p=nullptr ) override; diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx index 102eb19d421f..fadddf94d570 100644 --- a/cui/source/inc/insdlg.hxx +++ b/cui/source/inc/insdlg.hxx @@ -30,6 +30,7 @@ #include <vcl/field.hxx> #include <vcl/edit.hxx> #include <vcl/lstbox.hxx> +#include <vcl/weld.hxx> #include <svtools/svmedit.hxx> #include <comphelper/embeddedobjectcontainer.hxx> @@ -37,52 +38,51 @@ class VclFrame; class INetURLObject; -class InsertObjectDialog_Impl : public ModalDialog +class InsertObjectDialog_Impl : public weld::GenericDialogController { protected: css::uno::Reference < css::embed::XEmbeddedObject > m_xObj; const css::uno::Reference < css::embed::XStorage > m_xStorage; comphelper::EmbeddedObjectContainer aCnt; - InsertObjectDialog_Impl(vcl::Window * pParent, const OUString& rID, - const OUString& rUIXMLDescription, + InsertObjectDialog_Impl(weld::Window * pParent, + const OUString& rUIXMLDescription, const OString& rID, const css::uno::Reference < css::embed::XStorage >& xStorage); public: - const css::uno::Reference < css::embed::XEmbeddedObject >& GetObject() - { return m_xObj; } - virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ); + const css::uno::Reference<css::embed::XEmbeddedObject>& GetObject() { return m_xObj; } + virtual css::uno::Reference<css::io::XInputStream> GetIconIfIconified(OUString* pGraphicMediaType); + void SetHelpId(const OString& rHelpId) { m_xDialog->set_help_id(rHelpId); } virtual bool IsCreateNew() const; + virtual short execute() = 0; }; class SvInsertOleDlg : public InsertObjectDialog_Impl { - VclPtr<RadioButton> m_pRbNewObject; - VclPtr<RadioButton> m_pRbObjectFromfile; - VclPtr<VclFrame> m_pObjectTypeFrame; - VclPtr<ListBox> m_pLbObjecttype; - VclPtr<VclFrame> m_pFileFrame; - VclPtr<Edit> m_pEdFilepath; - VclPtr<PushButton> m_pBtnFilepath; - VclPtr<CheckBox> m_pCbFilelink; - VclPtr<CheckBox> m_pCbAsIcon; const SvObjectServerList* m_pServers; css::uno::Sequence< sal_Int8 > m_aIconMetaFile; OUString m_aIconMediaType; - DECL_LINK(DoubleClickHdl, ListBox&, void); - DECL_LINK(BrowseHdl, Button*, void); - DECL_LINK(RadioHdl, Button*, void); - bool IsCreateNew() const override - { return m_pRbNewObject->IsChecked(); } + std::unique_ptr<weld::RadioButton> m_xRbNewObject; + std::unique_ptr<weld::RadioButton> m_xRbObjectFromfile; + std::unique_ptr<weld::Frame> m_xObjectTypeFrame; + std::unique_ptr<weld::TreeView> m_xLbObjecttype; + std::unique_ptr<weld::Frame> m_xFileFrame; + std::unique_ptr<weld::Entry> m_xEdFilepath; + std::unique_ptr<weld::Button> m_xBtnFilepath; + std::unique_ptr<weld::CheckButton> m_xCbFilelink; + std::unique_ptr<weld::CheckButton> m_xCbAsIcon; + + DECL_LINK(DoubleClickHdl, weld::TreeView&, void); + DECL_LINK(BrowseHdl, weld::Button&, void); + DECL_LINK(RadioHdl, weld::Button&, void); + bool IsCreateNew() const override { return m_xRbNewObject->get_active(); } public: - SvInsertOleDlg( vcl::Window* pParent, + SvInsertOleDlg(weld::Window* pParent, const css::uno::Reference < css::embed::XStorage >& xStorage, const SvObjectServerList* pServers ); - virtual ~SvInsertOleDlg() override; - virtual void dispose() override; - virtual short Execute() override; + virtual short execute() override; /// get replacement for the iconified embedded object and the mediatype of the replacement css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ) override; @@ -91,37 +91,35 @@ public: class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl { private: - VclPtr<Edit> m_pEDName; - VclPtr<Edit> m_pEDURL; - VclPtr<PushButton> m_pBTOpen; + std::unique_ptr<weld::Entry> m_xEDName; + std::unique_ptr<weld::Entry> m_xEDURL; + std::unique_ptr<weld::Button> m_xBTOpen; - VclPtr<RadioButton> m_pRBScrollingOn; - VclPtr<RadioButton> m_pRBScrollingOff; - VclPtr<RadioButton> m_pRBScrollingAuto; + std::unique_ptr<weld::RadioButton> m_xRBScrollingOn; + std::unique_ptr<weld::RadioButton> m_xRBScrollingOff; + std::unique_ptr<weld::RadioButton> m_xRBScrollingAuto; - VclPtr<RadioButton> m_pRBFrameBorderOn; - VclPtr<RadioButton> m_pRBFrameBorderOff; + std::unique_ptr<weld::RadioButton> m_xRBFrameBorderOn; + std::unique_ptr<weld::RadioButton> m_xRBFrameBorderOff; - VclPtr<FixedText> m_pFTMarginWidth; - VclPtr<NumericField> m_pNMMarginWidth; - VclPtr<CheckBox> m_pCBMarginWidthDefault; - VclPtr<FixedText> m_pFTMarginHeight; - VclPtr<NumericField> m_pNMMarginHeight; - VclPtr<CheckBox> m_pCBMarginHeightDefault; + std::unique_ptr<weld::Label> m_xFTMarginWidth; + std::unique_ptr<weld::SpinButton> m_xNMMarginWidth; + std::unique_ptr<weld::CheckButton> m_xCBMarginWidthDefault; + std::unique_ptr<weld::Label> m_xFTMarginHeight; + std::unique_ptr<weld::SpinButton> m_xNMMarginHeight; + std::unique_ptr<weld::CheckButton> m_xCBMarginHeightDefault; - DECL_LINK(OpenHdl, Button*, void ); - DECL_LINK(CheckHdl, Button*, void ); + DECL_LINK(OpenHdl, weld::Button&, void); + DECL_LINK(CheckHdl, weld::Button&, void); void Init(); public: - SfxInsertFloatingFrameDialog(vcl::Window *pParent, - const css::uno::Reference < css::embed::XStorage >& xStorage ); - SfxInsertFloatingFrameDialog( vcl::Window* pParent, - const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ); - virtual ~SfxInsertFloatingFrameDialog() override; - virtual void dispose() override; - virtual short Execute() override; + SfxInsertFloatingFrameDialog(weld::Window *pParent, + const css::uno::Reference<css::embed::XStorage>& xStorage); + SfxInsertFloatingFrameDialog(weld::Window* pParent, + const css::uno::Reference<css::embed::XEmbeddedObject>& xObj); + virtual short execute() override; }; #endif // INCLUDED_CUI_SOURCE_INC_INSDLG_HXX diff --git a/cui/uiconfig/ui/insertfloatingframe.ui b/cui/uiconfig/ui/insertfloatingframe.ui index 08528d2f71ed..d12d9e160da4 100644 --- a/cui/uiconfig/ui/insertfloatingframe.ui +++ b/cui/uiconfig/ui/insertfloatingframe.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.20.4 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> <object class="GtkAdjustment" id="adjustment1"> @@ -7,16 +7,81 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="upper">99</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkDialog" id="InsertFloatingFrameDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="insertfloatingframe|InsertFloatingFrameDialog">Floating Frame Properties</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> @@ -132,7 +197,6 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">scrollbaroff</property> </object> <packing> <property name="expand">False</property> @@ -148,7 +212,7 @@ <property name="receives_default">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">scrollbarauto</property> + <property name="group">scrollbaron</property> </object> <packing> <property name="expand">False</property> @@ -220,7 +284,6 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">borderoff</property> </object> <packing> <property name="expand">False</property> @@ -291,8 +354,8 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_right">12</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="insertfloatingframe|widthlabel">Width:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -304,8 +367,8 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_right">12</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="insertfloatingframe|heightlabel">Height:</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -329,7 +392,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="margin_right">12</property> - <property name="adjustment">adjustment1</property> + <property name="adjustment">adjustment2</property> </object> <packing> <property name="left_attach">1</property> @@ -400,63 +463,6 @@ <property name="position">0</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - <property name="secondary">True</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">1</property> - </packing> - </child> </object> </child> <action-widgets> @@ -464,5 +470,8 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> diff --git a/cui/uiconfig/ui/insertoleobject.ui b/cui/uiconfig/ui/insertoleobject.ui index 67ac37dcdb21..c37a9ff733b7 100644 --- a/cui/uiconfig/ui/insertoleobject.ui +++ b/cui/uiconfig/ui/insertoleobject.ui @@ -1,15 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.20.4 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkDialog" id="InsertOLEObjectDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="insertoleobject|InsertOLEObjectDialog">Insert OLE Object</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> @@ -71,9 +84,10 @@ </child> <child> <object class="GtkBox" id="box1"> - <property name="width_request">400</property> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child> @@ -125,20 +139,50 @@ <object class="GtkFrame" id="objecttypeframe"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkTreeView" id="types:border"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> <property name="can_focus">True</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="types"> + <property name="visible">True</property> + <property name="can_focus">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="headers_clickable">False</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn1"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> </child> </object> </child> @@ -269,5 +313,8 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx index 5a6cefa5ba5a..8a5b0015a705 100644 --- a/include/sfx2/filedlghelper.hxx +++ b/include/sfx2/filedlghelper.hxx @@ -107,6 +107,10 @@ public: FileDialogHelper(sal_Int16 nDialogType, FileDialogFlags nFlags, + weld::Window* _pPreferredParent); + + FileDialogHelper(sal_Int16 nDialogType, + FileDialogFlags nFlags, const OUString& rFactory, SfxFilterFlags nMust, SfxFilterFlags nDont, @@ -115,6 +119,13 @@ public: FileDialogHelper(sal_Int16 nDialogType, FileDialogFlags nFlags, const OUString& rFactory, + SfxFilterFlags nMust, + SfxFilterFlags nDont, + weld::Window* _pPreferredParent); + + FileDialogHelper(sal_Int16 nDialogType, + FileDialogFlags nFlags, + const OUString& rFactory, sal_Int16 nDialog, SfxFilterFlags nMust, SfxFilterFlags nDont, @@ -255,7 +266,7 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent, const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >()); -ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, vcl::Window* pParent); +ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, const css::uno::Reference<css::awt::XWindow>& rParent); } #endif diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index 732bb30f2ee7..9d3f23f0e3d2 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -134,10 +134,10 @@ public: const css::uno::Reference< css::frame::XFrame >& xViewFrame ) = 0; virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0; virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) = 0; - virtual VclPtr<SfxAbstractInsertObjectDialog> CreateInsertObjectDialog( vcl::Window* pParent, const OUString& rCommand, + virtual VclPtr<SfxAbstractInsertObjectDialog> CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand, const css::uno::Reference < css::embed::XStorage >& xStor, const SvObjectServerList* pList )=0; - virtual VclPtr<VclAbstractDialog> CreateEditObjectDialog( const OUString& rCommand, + virtual VclPtr<VclAbstractDialog> CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommand, const css::uno::Reference < css::embed::XEmbeddedObject >& xObj )=0; virtual VclPtr<SfxAbstractPasteDialog> CreatePasteDialog(weld::Window* pParent) = 0; virtual VclPtr<SfxAbstractLinksDialog> CreateLinksDialog( vcl::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML=false, sfx2::SvBaseLink* p=nullptr )=0; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 63b27b0f7162..52f247921289 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -142,6 +142,8 @@ public: virtual OUString get_title() const = 0; virtual void set_busy_cursor(bool bBusy) = 0; + virtual css::uno::Reference<css::awt::XWindow> GetXWindow() = 0; + void connect_help(const Link<Widget&, bool>& rLink) { m_aHelpRequestHdl = rLink; } }; diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 948e13d40797..b56a1c1d7f0a 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -267,7 +267,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( - pFact->CreateInsertObjectDialog( pViewShell->GetWindow(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(), + pFact->CreateInsertObjectDialog( pViewShell->GetFrameWeld(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(), xStorage, &aServerLst )); if ( pDlg ) { diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index b31b22ef0d11..312a03d4c557 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -494,7 +494,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( - pFact->CreateInsertObjectDialog( mpViewShell->GetActiveWindow(), SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommandString(), + pFact->CreateInsertObjectDialog( mpViewShell->GetFrameWeld(), SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommandString(), xStorage, &aServerLst )); if ( pDlg ) { diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index be129dabac5f..60b279fe2d0a 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -329,7 +329,7 @@ void ShutdownIcon::StartFileDialog() if ( !m_pFileDlg ) m_pFileDlg = new FileDialogHelper( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, - FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, nullptr ); + FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, static_cast<const vcl::Window*>(nullptr) ); m_pFileDlg->StartExecuteModal( LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) ); } diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 78d5a3a409a4..d0f87eda0829 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -30,6 +30,7 @@ #include <unotools/useroptions.hxx> #include <svtools/controldims.hxx> #include <svtools/imagemgr.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <memory> @@ -869,7 +870,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void) if (!pFilter) break; - sfx2::RequestPassword(pFilter, OUString(), pMedSet, GetParentDialog()); + sfx2::RequestPassword(pFilter, OUString(), pMedSet, VCLUnoHelper::GetInterface(GetParentDialog())); pShell->SetModified(); } while (false); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 8c2e0ecc4175..c8f2ad762e85 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -847,12 +847,22 @@ static open_or_save_t lcl_OpenOrSave(sal_Int16 const nDialogType) // FileDialogHelper_Impl +css::uno::Reference<css::awt::XWindow> FileDialogHelper_Impl::GetFrameInterface() +{ + if (mpFrameWeld) + return mpFrameWeld->GetXWindow(); + if (mpPreferredParentWindow) + return VCLUnoHelper::GetInterface(mpPreferredParentWindow); + return css::uno::Reference<css::awt::XWindow>(); +} + FileDialogHelper_Impl::FileDialogHelper_Impl( FileDialogHelper* _pAntiImpl, sal_Int16 nDialogType, FileDialogFlags nFlags, sal_Int16 nDialog, - const vcl::Window* _pPreferredParentWindow, + const vcl::Window* pPreferredParentWindow, + weld::Window* pFrameWeld, const OUString& sStandardDir, const css::uno::Sequence< OUString >& rBlackList ) @@ -881,7 +891,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( // create the file open dialog // the flags can be SFXWB_INSERT or SFXWB_MULTISELECTION - mpPreferredParentWindow = _pPreferredParentWindow ? _pPreferredParentWindow->GetSystemWindow() : nullptr; + mpPreferredParentWindow = pPreferredParentWindow ? pPreferredParentWindow->GetSystemWindow() : nullptr; + mpFrameWeld = pFrameWeld; mpAntiImpl = _pAntiImpl; mbHasAutoExt = false; mbHasPassword = false; @@ -1035,7 +1046,9 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( maPreviewIdle.SetInvokeHandler( LINK( this, FileDialogHelper_Impl, TimeOutHdl_Impl ) ); } - Sequence < Any > aInitArguments( !mpPreferredParentWindow ? 3 : 4 ); + auto xWindow = GetFrameInterface(); + + Sequence < Any > aInitArguments(!xWindow.is() ? 3 : 4); // This is a hack. We currently know that the internal file picker implementation // supports the extended arguments as specified below. @@ -1045,8 +1058,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( if ( mbSystemPicker ) { aInitArguments[0] <<= nTemplateDescription; - if ( mpPreferredParentWindow ) - aInitArguments[1] <<= VCLUnoHelper::GetInterface( mpPreferredParentWindow ); + if (xWindow.is()) + aInitArguments[1] <<= xWindow; } else { @@ -1066,11 +1079,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( ); - if ( mpPreferredParentWindow ) - aInitArguments[3] <<= NamedValue( - "ParentWindow", - makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) ) - ); + if (xWindow.is()) + aInitArguments[3] <<= NamedValue("ParentWindow", makeAny(xWindow)); } try @@ -1513,7 +1523,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, { // ask for a password OUString aDocName(rpURLList[0]); - ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet, mpPreferredParentWindow); + ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet, GetFrameInterface()); if (errCode != ERRCODE_NONE) return errCode; } @@ -1540,7 +1550,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, } catch( const IllegalArgumentException& ) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(mpPreferredParentWindow ? mpPreferredParentWindow->GetFrameWeld() : nullptr, + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning, VclButtonsType::Ok, SfxResId(RID_SVXSTR_GPG_ENCRYPT_FAILURE))); xBox->run(); @@ -2274,9 +2284,25 @@ FileDialogHelper::FileDialogHelper( const OUString& rFact, SfxFilterFlags nMust, SfxFilterFlags nDont, - const vcl::Window* _pPreferredParent) + const vcl::Window* pPreferredParent) + : m_nError(0), + mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr)) +{ + + // create the list of filters + mpImpl->addFilters( + SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont ); +} + +FileDialogHelper::FileDialogHelper( + sal_Int16 nDialogType, + FileDialogFlags nFlags, + const OUString& rFact, + SfxFilterFlags nMust, + SfxFilterFlags nDont, + weld::Window* pPreferredParent) : m_nError(0), - mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent)) + mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, nullptr, pPreferredParent)) { // create the list of filters @@ -2293,9 +2319,9 @@ FileDialogHelper::FileDialogHelper( SfxFilterFlags nDont, const OUString& rStandardDir, const css::uno::Sequence< OUString >& rBlackList, - const vcl::Window* _pPreferredParent) + const vcl::Window* pPreferredParent) : m_nError(0), - mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, _pPreferredParent, rStandardDir, rBlackList ) ) + mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, pPreferredParent, nullptr, rStandardDir, rBlackList ) ) { // create the list of filters mpImpl->addFilters( @@ -2305,9 +2331,15 @@ FileDialogHelper::FileDialogHelper( FileDialogHelper::FileDialogHelper( sal_Int16 nDialogType, FileDialogFlags nFlags, - const vcl::Window* _pPreferredParent ) + const vcl::Window* pPreferredParent ) + : m_nError(0), + mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr ) ) +{ +} + +FileDialogHelper::FileDialogHelper(sal_Int16 nDialogType, FileDialogFlags nFlags, weld::Window* pPreferredParent) : m_nError(0), - mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent ) ) + mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, nullptr, pPreferredParent ) ) { } @@ -2318,9 +2350,9 @@ FileDialogHelper::FileDialogHelper( const OUString& aExtName, const OUString& rStandardDir, const css::uno::Sequence< OUString >& rBlackList, - const vcl::Window* _pPreferredParent ) + const vcl::Window* pPreferredParent ) : m_nError(0), - mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent,rStandardDir, rBlackList ) ) + mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr, rStandardDir, rBlackList ) ) { // the wildcard here is expected in form "*.extension" OUString aWildcard; @@ -2662,9 +2694,9 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent, return nRet; } -ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, vcl::Window* pPreferredParentWindow) +ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, const css::uno::Reference<css::awt::XWindow>& rParent) { - uno::Reference<task::XInteractionHandler2> xInteractionHandler = task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), VCLUnoHelper::GetInterface(pPreferredParentWindow)); + uno::Reference<task::XInteractionHandler2> xInteractionHandler = task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), rParent); // TODO: need a save way to distinguish MS filters from other filters // for now MS-filters are the only alien filters that support encryption bool bMSType = !pCurrentFilter->IsOwnFormat(); diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 38a894e0d42e..0d7de0b2cf22 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -53,6 +53,7 @@ namespace sfx2 std::unique_ptr<GraphicFilter> mpGraphicFilter; FileDialogHelper* mpAntiImpl; VclPtr<vcl::Window> mpPreferredParentWindow; + weld::Window* mpFrameWeld; ::std::vector< OUString > mlLastURLs; @@ -171,7 +172,7 @@ namespace sfx2 const short nDialogType, FileDialogFlags nFlags, sal_Int16 nDialog, - const vcl::Window* _pPreferredParentWindow, + const vcl::Window* _pPreferredParentWindow, weld::Window* pFrameWeld, const OUString& sStandardDir = OUString(), const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >() ); @@ -209,6 +210,17 @@ namespace sfx2 bool isSystemFilePicker() const { return mbSystemPicker; } bool isPasswordEnabled() const { return mbIsPwdEnabled; } + + weld::Window* GetFrameWeld() + { + if (mpFrameWeld) + return mpFrameWeld; + if (mpPreferredParentWindow) + return mpPreferredParentWindow->GetFrameWeld(); + return nullptr; + } + + css::uno::Reference<css::awt::XWindow> GetFrameInterface(); }; } // end of namespace sfx2 diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 5a05e36aeec4..ccc726dbc865 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -393,7 +393,7 @@ void SAL_CALL IFrameObject::removeVetoableChangeListener(const OUString&, const ::sal_Int16 SAL_CALL IFrameObject::execute() { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateEditObjectDialog( ".uno:InsertObjectFloatingFrame", mxObj )); + ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateEditObjectDialog(nullptr, ".uno:InsertObjectFloatingFrame", mxObj)); //TODO if ( pDlg ) pDlg->Execute(); return 0; diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 59962673e9ef..12a2c158da63 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -375,8 +375,10 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName OString aCmd(".uno:"); aCmd += pSlot->GetUnoName(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( pFact->CreateInsertObjectDialog( GetWin(), OUString::fromUtf8( aCmd ), xStor, &aServerList )); - if ( pDlg ) + vcl::Window* pWin = GetWin(); + ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(pFact->CreateInsertObjectDialog(pWin ? pWin->GetFrameWeld() : nullptr, + OUString::fromUtf8( aCmd ), xStor, &aServerList)); + if (pDlg) { pDlg->Execute(); bDoVerb = pDlg->IsCreateNew(); diff --git a/sw/uiconfig/swriter/ui/autoformattable.ui b/sw/uiconfig/swriter/ui/autoformattable.ui index 1d9a6eb4f8be..84539082ac5c 100644 --- a/sw/uiconfig/swriter/ui/autoformattable.ui +++ b/sw/uiconfig/swriter/ui/autoformattable.ui @@ -6,6 +6,8 @@ <columns> <!-- column-name text --> <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> </columns> </object> <object class="GtkDialog" id="AutoFormatTableDialog"> diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 2da209730e93..9a3cb48dfe03 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -251,6 +251,117 @@ private: mutable std::shared_ptr<vcl::unx::GtkPrintWrapper> m_xPrintWrapper; }; +typedef cppu::WeakComponentImplHelper<css::awt::XWindow> SalGtkXWindow_Base; + +class SalGtkXWindow : public SalGtkXWindow_Base +{ +private: + osl::Mutex m_aHelperMtx; + GtkWidget* m_pWidget; +public: + + SalGtkXWindow(GtkWidget* pWidget) + : SalGtkXWindow_Base(m_aHelperMtx) + , m_pWidget(pWidget) + { + } + + void clear() + { + m_pWidget = nullptr; + } + + GtkWidget * getWidget() const + { + return m_pWidget; + } + + // css::awt::XWindow + void SAL_CALL setPosSize(sal_Int32, sal_Int32, sal_Int32, sal_Int32, sal_Int16) override + { + throw css::uno::RuntimeException("not implemented"); + } + + css::awt::Rectangle SAL_CALL getPosSize() override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL setVisible(sal_Bool) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL setEnable(sal_Bool) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL setFocus() override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addWindowListener(const css::uno::Reference< css::awt::XWindowListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + void SAL_CALL removeWindowListener(const css::uno::Reference< css::awt::XWindowListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addFocusListener(const css::uno::Reference< css::awt::XFocusListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL removeFocusListener(const css::uno::Reference< css::awt::XFocusListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addKeyListener(const css::uno::Reference< css::awt::XKeyListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL removeKeyListener(const css::uno::Reference< css::awt::XKeyListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } + + void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener >& ) override + { + throw css::uno::RuntimeException("not implemented"); + } +}; + #endif // INCLUDED_VCL_INC_UNX_GTK_GTKINST_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 48f1959f0d74..d473f7b59ddd 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -501,6 +501,12 @@ public: m_xWindow->LeaveWait(); } + virtual css::uno::Reference<css::awt::XWindow> GetXWindow() override + { + css::uno::Reference<css::awt::XWindow> xWindow(m_xWindow->GetComponentInterface(), css::uno::UNO_QUERY); + return xWindow; + } + virtual ~SalInstanceWindow() override { clear_child_help(m_xWindow); @@ -1017,7 +1023,7 @@ public: virtual void insert_text(const OUString& rText, int pos) override { - m_xTreeView->InsertEntry(rText, pos); + m_xTreeView->InsertEntry(rText, pos == -1 ? LISTBOX_APPEND : pos); } virtual void insert(int pos, const OUString& rId, const OUString& rStr, const OUString& rImage) override diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 7437bf44cb2a..e499350b12b4 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1582,15 +1582,20 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu if (xParentWindow.is()) { - css::uno::Reference<css::awt::XSystemDependentWindowPeer> xSysDepWin(xParentWindow, css::uno::UNO_QUERY); - if (xSysDepWin.is()) + if (SalGtkXWindow* pGtkXWindow = dynamic_cast<SalGtkXWindow*>(xParentWindow.get())) + m_pParentWidget = pGtkXWindow->getWidget(); + else { - css::uno::Sequence<sal_Int8> aProcessIdent(16); - rtl_getGlobalProcessId(reinterpret_cast<sal_uInt8*>(aProcessIdent.getArray())); - aAny = xSysDepWin->getWindowHandle(aProcessIdent, css::lang::SystemDependent::SYSTEM_XWINDOW); - css::awt::SystemDependentXWindow tmp; - aAny >>= tmp; - m_pParentWidget = GetGtkSalData()->GetGtkDisplay()->findGtkWidgetForNativeHandle(tmp.WindowHandle); + css::uno::Reference<css::awt::XSystemDependentWindowPeer> xSysDepWin(xParentWindow, css::uno::UNO_QUERY); + if (xSysDepWin.is()) + { + css::uno::Sequence<sal_Int8> aProcessIdent(16); + rtl_getGlobalProcessId(reinterpret_cast<sal_uInt8*>(aProcessIdent.getArray())); + aAny = xSysDepWin->getWindowHandle(aProcessIdent, css::lang::SystemDependent::SYSTEM_XWINDOW); + css::awt::SystemDependentXWindow tmp; + aAny >>= tmp; + m_pParentWidget = GetGtkSalData()->GetGtkDisplay()->findGtkWidgetForNativeHandle(tmp.WindowHandle); + } } } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index ebe1e226b723..916fda03ff74 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1577,6 +1577,7 @@ class GtkInstanceWindow : public GtkInstanceContainer, public virtual weld::Wind { private: GtkWindow* m_pWindow; + rtl::Reference<SalGtkXWindow> m_xWindow; //uno api static void help_pressed(GtkAccelGroup*, GObject*, guint, GdkModifierType, gpointer widget) { @@ -1608,6 +1609,13 @@ public: return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); } + virtual css::uno::Reference<css::awt::XWindow> GetXWindow() override + { + if (!m_xWindow.is()) + m_xWindow.set(new SalGtkXWindow(m_pWidget)); + return css::uno::Reference<css::awt::XWindow>(m_xWindow.get()); + } + virtual void set_busy_cursor(bool bBusy) override { gtk_widget_realize(m_pWidget); @@ -1618,6 +1626,12 @@ public: if (pCursor) g_object_unref(pCursor); } + + virtual ~GtkInstanceWindow() override + { + if (m_xWindow.is()) + m_xWindow->clear(); + } }; namespace |