Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / cui / source / dialogs / insdlg.cxx
blob3cb50c2a6066866004655b8cd7b625e56f2ff956
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/beans/XPropertySet.hpp>
21 #include <com/sun/star/beans/PropertyValue.hpp>
22 #include <com/sun/star/embed/EmbedStates.hpp>
23 #include <com/sun/star/embed/XInsertObjectDialog.hpp>
24 #include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
25 #include <com/sun/star/task/InteractionHandler.hpp>
26 #include <com/sun/star/ucb/CommandAbortedException.hpp>
27 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
28 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
29 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
30 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
31 #include <comphelper/processfactory.hxx>
32 #include <comphelper/propertyvalue.hxx>
34 #include <insdlg.hxx>
35 #include <dialmgr.hxx>
36 #include <osl/diagnose.h>
37 #include <svtools/imagemgr.hxx>
38 #include <svtools/strings.hrc>
39 #include <svtools/svtresid.hxx>
41 #include <tools/urlobj.hxx>
42 #include <tools/debug.hxx>
43 #include <tools/stream.hxx>
44 #include <comphelper/diagnose_ex.hxx>
45 #include <utility>
46 #include <vcl/image.hxx>
47 #include <vcl/weld.hxx>
48 #include <vcl/svapp.hxx>
49 #include <comphelper/classids.hxx>
50 #include <sfx2/filedlghelper.hxx>
51 #include <sfx2/frmdescr.hxx>
52 #include <sfx2/viewsh.hxx>
53 #include <comphelper/seqstream.hxx>
54 #include <sfx2/viewfrm.hxx>
56 #include <strings.hrc>
58 using namespace ::com::sun::star;
59 using namespace ::com::sun::star::lang;
60 using namespace ::com::sun::star::uno;
61 using namespace ::com::sun::star::container;
62 using namespace ::com::sun::star::ui::dialogs;
64 bool InsertObjectDialog_Impl::IsCreateNew() const
66 return false;
69 uno::Reference< io::XInputStream > InsertObjectDialog_Impl::GetIconIfIconified( OUString* /*pGraphicMediaType*/ )
71 return uno::Reference< io::XInputStream >();
74 InsertObjectDialog_Impl::InsertObjectDialog_Impl(weld::Window* pParent,
75 const OUString& rUIXMLDescription, const OUString& rID,
76 css::uno::Reference < css::embed::XStorage > xStorage)
77 : GenericDialogController(pParent, rUIXMLDescription, rID)
78 , m_xStorage(std::move( xStorage ))
79 , aCnt( m_xStorage )
83 IMPL_LINK_NOARG(SvInsertOleDlg, DoubleClickHdl, weld::TreeView&, bool)
85 m_xDialog->response(RET_OK);
86 return true;
89 IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl, weld::Button&, void)
91 sfx2::FileDialogHelper aHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, m_xDialog.get());
92 aHelper.SetContext(sfx2::FileDialogHelper::InsertOLE);
93 const Reference< XFilePicker3 >& xFilePicker = aHelper.GetFilePicker();
95 // add filter
96 try
98 xFilePicker->appendFilter(CuiResId(RID_CUISTR_FILTER_ALL), "*.*");
100 catch( const IllegalArgumentException& )
102 TOOLS_WARN_EXCEPTION("cui.dialogs", "caught IllegalArgumentException when registering filter" );
105 if( xFilePicker->execute() == ExecutableDialogResults::OK )
107 Sequence< OUString > aPathSeq( xFilePicker->getSelectedFiles() );
108 INetURLObject aObj( aPathSeq[0] );
109 m_xEdFilepath->set_text(aObj.PathToFileName());
113 IMPL_LINK(SvInsertOleDlg, RadioHdl, weld::Toggleable&, rButton, void)
115 if (!rButton.get_active())
116 return;
118 if (m_xRbNewObject->get_active())
120 m_xObjectTypeFrame->show();
121 m_xFileFrame->hide();
123 else
125 m_xFileFrame->show();
126 m_xObjectTypeFrame->hide();
130 SvInsertOleDlg::SvInsertOleDlg(weld::Window* pParent, const Reference<embed::XStorage>& xStorage,
131 const SvObjectServerList* pServers)
132 : InsertObjectDialog_Impl( pParent, "cui/ui/insertoleobject.ui", "InsertOLEObjectDialog", xStorage)
133 , m_pServers( pServers )
134 , m_xRbNewObject(m_xBuilder->weld_radio_button("createnew"))
135 , m_xRbObjectFromfile(m_xBuilder->weld_radio_button("createfromfile"))
136 , m_xObjectTypeFrame(m_xBuilder->weld_frame("objecttypeframe"))
137 , m_xLbObjecttype(m_xBuilder->weld_tree_view("types"))
138 , m_xFileFrame(m_xBuilder->weld_frame("fileframe"))
139 , m_xEdFilepath(m_xBuilder->weld_entry("urled"))
140 , m_xBtnFilepath(m_xBuilder->weld_button("urlbtn"))
141 , m_xCbFilelink(m_xBuilder->weld_check_button("linktofile"))
142 , m_xCbAsIcon(m_xBuilder->weld_check_button("asicon"))
144 m_xLbObjecttype->set_size_request(m_xLbObjecttype->get_approximate_digit_width() * 32,
145 m_xLbObjecttype->get_height_rows(6));
146 m_xLbObjecttype->connect_row_activated(LINK(this, SvInsertOleDlg, DoubleClickHdl));
147 m_xBtnFilepath->connect_clicked(LINK( this, SvInsertOleDlg, BrowseHdl));
148 Link<weld::Toggleable&,void> aLink( LINK( this, SvInsertOleDlg, RadioHdl ) );
149 m_xRbNewObject->connect_toggled( aLink );
150 m_xRbObjectFromfile->connect_toggled( aLink );
151 m_xRbNewObject->set_active(true);
154 short SvInsertOleDlg::run()
156 short nRet = RET_OK;
157 SvObjectServerList aObjS;
158 if ( !m_pServers )
160 // if no list was provided, take the complete one
161 aObjS.FillInsertObjects();
162 m_pServers = &aObjS;
165 // fill listbox and select default
166 m_xLbObjecttype->freeze();
167 for ( size_t i = 0; i < m_pServers->Count(); i++ )
168 m_xLbObjecttype->append_text((*m_pServers)[i].GetHumanName());
169 m_xLbObjecttype->thaw();
170 m_xLbObjecttype->select(0);
172 DBG_ASSERT( m_xStorage.is(), "No storage!");
173 if ( m_xStorage.is() && ( nRet = InsertObjectDialog_Impl::run() ) == RET_OK )
175 OUString aFileName;
176 OUString aName;
177 bool bCreateNew = IsCreateNew();
178 if ( bCreateNew )
180 // create and insert new embedded object
181 OUString aServerName = m_xLbObjecttype->get_selected_text();
182 const SvObjectServer* pS = m_pServers->Get( aServerName );
183 if ( pS )
185 if( pS->GetClassName() == SvGlobalName( SO3_OUT_CLASSID ) )
189 uno::Reference < embed::XInsertObjectDialog > xDialogCreator(
190 embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() ),
191 uno::UNO_QUERY );
193 if ( xDialogCreator.is() )
195 aName = aCnt.CreateUniqueObjectName();
197 uno::Reference<task::XStatusIndicator> xProgress;
198 OUString aProgressText;
199 if (SfxViewFrame* pFrame = SfxViewFrame::Current())
201 // Have a current frame, create a matching progressbar, but don't start it yet.
202 uno::Reference<frame::XFrame> xFrame
203 = pFrame->GetFrame().GetFrameInterface();
204 uno::Reference<task::XStatusIndicatorFactory> xProgressFactory(
205 xFrame, uno::UNO_QUERY);
206 if (xProgressFactory.is())
208 xProgress = xProgressFactory->createStatusIndicator();
209 if (xProgress)
211 aProgressText = CuiResId(RID_CUISTR_OLE_INSERT);
216 const embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
217 m_xStorage,
218 aName,
219 {comphelper::makePropertyValue("StatusIndicator", xProgress),
220 comphelper::makePropertyValue("StatusIndicatorText", aProgressText)} );
222 OSL_ENSURE( aNewInf.Object.is(), "The object must be created or an exception must be thrown!" );
223 m_xObj = aNewInf.Object;
224 for ( const auto& opt : aNewInf.Options )
225 if ( opt.Name == "Icon" )
227 opt.Value >>= m_aIconMetaFile;
229 else if ( opt.Name == "IconFormat" )
231 datatransfer::DataFlavor aFlavor;
232 if ( opt.Value >>= aFlavor )
233 m_aIconMediaType = aFlavor.MimeType;
238 catch( ucb::CommandAbortedException& )
240 // the user has pressed cancel
242 catch( uno::Exception& )
244 // TODO: Error handling
247 else
249 // create object with desired ClassId
250 m_xObj = aCnt.CreateEmbeddedObject( pS->GetClassName().GetByteSequence(), aName );
253 if ( !m_xObj.is() )
255 if( !aFileName.isEmpty() ) // from OLE Dialog
257 // object couldn't be created from file
258 // global Resource from svtools (former so3 resource)
259 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
260 aErr = aErr.replaceFirst( "%", aFileName );
262 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
263 VclMessageType::Warning, VclButtonsType::Ok, aErr));
264 xBox->run();
266 else
268 // object couldn't be created
269 // global Resource from svtools (former so3 resource)
270 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE));
271 aErr = aErr.replaceFirst( "%", aServerName );
273 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
274 VclMessageType::Warning, VclButtonsType::Ok, aErr));
275 xBox->run();
280 else
282 aFileName = m_xEdFilepath->get_text();
283 INetURLObject aURL;
284 aURL.SetSmartProtocol( INetProtocol::File );
285 aURL.SetSmartURL( aFileName );
286 aFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
287 bool bLink = m_xCbFilelink->get_active();
289 if ( !aFileName.isEmpty() )
291 uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
292 uno::Reference< task::XInteractionHandler2 > xInteraction(
293 task::InteractionHandler::createWithParent(xContext, nullptr) );
295 // create MediaDescriptor for file to create object from
296 uno::Sequence < beans::PropertyValue > aMedium{
297 comphelper::makePropertyValue("URL", aFileName),
298 comphelper::makePropertyValue("InteractionHandler", xInteraction)
301 // create object from media descriptor
303 uno::Reference<task::XStatusIndicator> xProgress;
304 if (SfxViewFrame* pFrame = SfxViewFrame::Current())
306 // Have a current frame, create visual indication that insert is in progress.
307 uno::Reference<frame::XFrame> xFrame = pFrame->GetFrame().GetFrameInterface();
308 uno::Reference<task::XStatusIndicatorFactory> xProgressFactory(xFrame, uno::UNO_QUERY);
309 if (xProgressFactory.is())
311 xProgress = xProgressFactory->createStatusIndicator();
312 if (xProgress)
314 OUString aOleInsert(CuiResId(RID_CUISTR_OLE_INSERT));
315 xProgress->start(aOleInsert, 100);
320 if ( bLink )
321 m_xObj = aCnt.InsertEmbeddedLink( aMedium, aName );
322 else
323 m_xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
325 if (xProgress.is())
327 xProgress->end();
331 if ( !m_xObj.is() )
333 // object couldn't be created from file
334 // global Resource from svtools (former so3 resource)
335 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
336 aErr = aErr.replaceFirst( "%", aFileName );
338 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
339 VclMessageType::Warning, VclButtonsType::Ok, aErr));
340 xBox->run();
342 else
344 if (m_xCbAsIcon->get_active())
346 //something nice here I guess would be to write the filename into
347 //the image with this icon above it
348 Image aImage = SvFileInformationManager::GetImage(aURL, true);
349 SvMemoryStream aTemp;
350 WriteDIBBitmapEx(aImage.GetBitmapEx(), aTemp);
351 m_aIconMetaFile = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aTemp.GetData()), aTemp.TellEnd());
352 m_aIconMediaType = "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"";
358 m_pServers = nullptr;
359 return nRet;
362 uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( OUString* pGraphicMediaType )
364 if ( m_aIconMetaFile.hasElements() )
366 if ( pGraphicMediaType )
367 *pGraphicMediaType = m_aIconMediaType;
369 return uno::Reference< io::XInputStream >( new ::comphelper::SequenceInputStream( m_aIconMetaFile ) );
372 return uno::Reference< io::XInputStream >();
376 SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog(weld::Window *pParent,
377 const css::uno::Reference < css::embed::XStorage >& xStorage)
378 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
379 xStorage)
381 Init();
384 SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog(weld::Window *pParent,
385 const uno::Reference < embed::XEmbeddedObject >& xObj)
386 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
387 uno::Reference<embed::XStorage>())
389 m_xObj = xObj;
391 Init();
394 void SfxInsertFloatingFrameDialog::Init()
396 m_xEDName = m_xBuilder->weld_entry("edname");
397 m_xEDURL = m_xBuilder->weld_entry("edurl");
398 m_xBTOpen = m_xBuilder->weld_button("buttonbrowse");
399 m_xRBScrollingOn = m_xBuilder->weld_radio_button("scrollbaron");
400 m_xRBScrollingOff = m_xBuilder->weld_radio_button("scrollbaroff");
401 m_xRBScrollingAuto = m_xBuilder->weld_radio_button("scrollbarauto");
402 m_xRBFrameBorderOn = m_xBuilder->weld_radio_button("borderon");
403 m_xRBFrameBorderOff = m_xBuilder->weld_radio_button("borderoff");
404 m_xFTMarginWidth = m_xBuilder->weld_label("widthlabel");
405 m_xNMMarginWidth = m_xBuilder->weld_spin_button("width");
406 m_xCBMarginWidthDefault = m_xBuilder->weld_check_button("defaultwidth");
407 m_xFTMarginHeight = m_xBuilder->weld_label("heightlabel");
408 m_xNMMarginHeight = m_xBuilder->weld_spin_button("height");
409 m_xCBMarginHeightDefault = m_xBuilder->weld_check_button("defaultheight");
411 Link<weld::Toggleable&, void> aLink(LINK(this, SfxInsertFloatingFrameDialog, CheckHdl));
412 m_xCBMarginWidthDefault->connect_toggled(aLink);
413 m_xCBMarginHeightDefault->connect_toggled(aLink);
415 m_xCBMarginWidthDefault->set_active(true);
416 m_xCBMarginHeightDefault->set_active(true);
417 m_xRBScrollingAuto->set_active(true);
418 m_xRBFrameBorderOn->set_active(true);
420 m_xBTOpen->connect_clicked(LINK(this, SfxInsertFloatingFrameDialog, OpenHdl));
423 short SfxInsertFloatingFrameDialog::run()
425 short nRet = RET_OK;
426 bool bOK = false;
427 uno::Reference < beans::XPropertySet > xSet;
428 if ( m_xObj.is() )
432 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
433 m_xObj->changeState( embed::EmbedStates::RUNNING );
434 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
435 OUString aStr;
436 uno::Any aAny = xSet->getPropertyValue( "FrameURL" );
437 if ( aAny >>= aStr )
438 m_xEDURL->set_text( aStr );
439 aAny = xSet->getPropertyValue( "FrameName" );
440 if ( aAny >>= aStr )
441 m_xEDName->set_text(aStr);
443 sal_Int32 nSize = SIZE_NOT_SET;
444 aAny = xSet->getPropertyValue( "FrameMarginWidth" );
445 aAny >>= nSize;
447 if ( nSize == SIZE_NOT_SET )
449 m_xCBMarginWidthDefault->set_active(true);
450 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
451 m_xFTMarginWidth->set_sensitive(false);
452 m_xNMMarginWidth->set_sensitive(false);
454 else
455 m_xNMMarginWidth->set_text(OUString::number(nSize));
457 aAny = xSet->getPropertyValue( "FrameMarginHeight" );
458 aAny >>= nSize;
460 if ( nSize == SIZE_NOT_SET )
462 m_xCBMarginHeightDefault->set_active(true);
463 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
464 m_xFTMarginHeight->set_sensitive(false);
465 m_xNMMarginHeight->set_sensitive(false);
467 else
468 m_xNMMarginHeight->set_text(OUString::number(nSize));
470 bool bScrollOn = false;
471 bool bScrollOff = false;
472 bool bScrollAuto = false;
474 bool bSet = false;
475 aAny = xSet->getPropertyValue( "FrameIsAutoScroll" );
476 aAny >>= bSet;
477 if ( !bSet )
479 aAny = xSet->getPropertyValue( "FrameIsScrollingMode" );
480 aAny >>= bSet;
481 bScrollOn = bSet;
482 bScrollOff = !bSet;
484 else
485 bScrollAuto = true;
487 m_xRBScrollingOn->set_sensitive(bScrollOn);
488 m_xRBScrollingOff->set_sensitive(bScrollOff);
489 m_xRBScrollingAuto->set_sensitive(bScrollAuto);
491 bSet = false;
492 aAny = xSet->getPropertyValue( "FrameIsAutoBorder" );
493 aAny >>= bSet;
494 if ( !bSet )
496 aAny = xSet->getPropertyValue( "FrameIsBorder" );
497 aAny >>= bSet;
498 m_xRBFrameBorderOn->set_active(bSet);
499 m_xRBFrameBorderOff->set_active(!bSet);
502 bOK = true;
504 catch ( uno::Exception& )
506 OSL_FAIL( "No IFrame!" );
509 else
511 DBG_ASSERT( m_xStorage.is(), "No storage!");
512 bOK = m_xStorage.is();
515 if (!bOK)
516 return RET_OK;
518 nRet = InsertObjectDialog_Impl::run();
519 if ( nRet == RET_OK )
521 OUString aURL;
522 if (!m_xEDURL->get_text().isEmpty())
524 // URL can be a valid and absolute URL or a system file name
525 INetURLObject aObj;
526 aObj.SetSmartProtocol( INetProtocol::File );
527 if ( aObj.SetSmartURL( m_xEDURL->get_text() ) )
528 aURL = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
531 if ( !m_xObj.is() && !aURL.isEmpty() )
533 // create the object
534 OUString aName;
535 SvGlobalName aClassId( SO3_IFRAME_CLASSID );
536 m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName );
537 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
538 m_xObj->changeState( embed::EmbedStates::RUNNING );
539 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
542 if ( m_xObj.is() )
546 bool bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE;
547 if ( bIPActive )
548 m_xObj->changeState( embed::EmbedStates::RUNNING );
550 OUString aName = m_xEDName->get_text();
551 ScrollingMode eScroll = ScrollingMode::No;
552 if (m_xRBScrollingOn->get_active())
553 eScroll = ScrollingMode::Yes;
554 if (m_xRBScrollingOff->get_active())
555 eScroll = ScrollingMode::No;
556 if (m_xRBScrollingAuto->get_active())
557 eScroll = ScrollingMode::Auto;
559 bool bHasBorder = m_xRBFrameBorderOn->get_active();
561 tools::Long lMarginWidth;
562 if (!m_xCBMarginWidthDefault->get_active())
563 lMarginWidth = static_cast<tools::Long>(m_xNMMarginWidth->get_text().toInt32());
564 else
565 lMarginWidth = SIZE_NOT_SET;
567 tools::Long lMarginHeight;
568 if (!m_xCBMarginHeightDefault->get_active())
569 lMarginHeight = static_cast<tools::Long>(m_xNMMarginHeight->get_text().toInt32());
570 else
571 lMarginHeight = SIZE_NOT_SET;
573 xSet->setPropertyValue( "FrameURL", Any( aURL ) );
574 xSet->setPropertyValue( "FrameName", Any( aName ) );
576 if ( eScroll == ScrollingMode::Auto )
577 xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
578 else
579 xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingMode::Yes ) );
581 xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
582 xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
583 xSet->setPropertyValue( "FrameMarginHeight", Any( sal_Int32( lMarginHeight ) ) );
585 if ( bIPActive )
586 m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE );
588 catch ( uno::Exception& )
590 OSL_FAIL( "No IFrame!" );
595 return nRet;
598 IMPL_LINK(SfxInsertFloatingFrameDialog, CheckHdl, weld::Toggleable&, rButton, void)
600 weld::CheckButton& rCB = dynamic_cast<weld::CheckButton&>(rButton);
601 if (&rCB == m_xCBMarginWidthDefault.get())
603 if (rCB.get_active())
604 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
605 m_xFTMarginWidth->set_sensitive(!rCB.get_active());
606 m_xNMMarginWidth->set_sensitive(!rCB.get_active());
609 if (&rCB == m_xCBMarginHeightDefault.get())
611 if (rCB.get_active())
612 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
613 m_xFTMarginHeight->set_sensitive(!rCB.get_active());
614 m_xNMMarginHeight->set_sensitive(!rCB.get_active());
618 IMPL_LINK_NOARG( SfxInsertFloatingFrameDialog, OpenHdl, weld::Button&, void)
620 // create the file dialog
621 sfx2::FileDialogHelper aFileDlg(
622 ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, OUString(),
623 SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get());
625 // set the title
626 aFileDlg.SetTitle(CuiResId(RID_CUISTR_SELECT_FILE_IFRAME));
628 // show the dialog
629 if ( aFileDlg.Execute() == ERRCODE_NONE )
630 m_xEDURL->set_text(INetURLObject(aFileDlg.GetPath()).GetMainURL(INetURLObject::DecodeMechanism::WithCharset));
633 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */