1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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>
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
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
))
83 IMPL_LINK_NOARG(SvInsertOleDlg
, DoubleClickHdl
, weld::TreeView
&, bool)
85 m_xDialog
->response(RET_OK
);
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();
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())
118 if (m_xRbNewObject
->get_active())
120 m_xObjectTypeFrame
->show();
121 m_xFileFrame
->hide();
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()
157 SvObjectServerList aObjS
;
160 // if no list was provided, take the complete one
161 aObjS
.FillInsertObjects();
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
)
177 bool bCreateNew
= IsCreateNew();
180 // create and insert new embedded object
181 OUString aServerName
= m_xLbObjecttype
->get_selected_text();
182 const SvObjectServer
* pS
= m_pServers
->Get( aServerName
);
185 if( pS
->GetClassName() == SvGlobalName( SO3_OUT_CLASSID
) )
189 uno::Reference
< embed::XInsertObjectDialog
> xDialogCreator(
190 embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() ),
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();
211 aProgressText
= CuiResId(RID_CUISTR_OLE_INSERT
);
216 const embed::InsertedObjectInfo aNewInf
= xDialogCreator
->createInstanceByDialog(
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
249 // create object with desired ClassId
250 m_xObj
= aCnt
.CreateEmbeddedObject( pS
->GetClassName().GetByteSequence(), aName
);
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
));
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
));
282 aFileName
= m_xEdFilepath
->get_text();
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();
314 OUString
aOleInsert(CuiResId(RID_CUISTR_OLE_INSERT
));
315 xProgress
->start(aOleInsert
, 100);
321 m_xObj
= aCnt
.InsertEmbeddedLink( aMedium
, aName
);
323 m_xObj
= aCnt
.InsertEmbeddedObject( aMedium
, aName
);
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
));
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;
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",
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
>())
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()
427 uno::Reference
< beans::XPropertySet
> xSet
;
432 if ( m_xObj
->getCurrentState() == embed::EmbedStates::LOADED
)
433 m_xObj
->changeState( embed::EmbedStates::RUNNING
);
434 xSet
.set( m_xObj
->getComponent(), uno::UNO_QUERY
);
436 uno::Any aAny
= xSet
->getPropertyValue( "FrameURL" );
438 m_xEDURL
->set_text( aStr
);
439 aAny
= xSet
->getPropertyValue( "FrameName" );
441 m_xEDName
->set_text(aStr
);
443 sal_Int32 nSize
= SIZE_NOT_SET
;
444 aAny
= xSet
->getPropertyValue( "FrameMarginWidth" );
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);
455 m_xNMMarginWidth
->set_text(OUString::number(nSize
));
457 aAny
= xSet
->getPropertyValue( "FrameMarginHeight" );
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);
468 m_xNMMarginHeight
->set_text(OUString::number(nSize
));
470 bool bScrollOn
= false;
471 bool bScrollOff
= false;
472 bool bScrollAuto
= false;
475 aAny
= xSet
->getPropertyValue( "FrameIsAutoScroll" );
479 aAny
= xSet
->getPropertyValue( "FrameIsScrollingMode" );
487 m_xRBScrollingOn
->set_sensitive(bScrollOn
);
488 m_xRBScrollingOff
->set_sensitive(bScrollOff
);
489 m_xRBScrollingAuto
->set_sensitive(bScrollAuto
);
492 aAny
= xSet
->getPropertyValue( "FrameIsAutoBorder" );
496 aAny
= xSet
->getPropertyValue( "FrameIsBorder" );
498 m_xRBFrameBorderOn
->set_active(bSet
);
499 m_xRBFrameBorderOff
->set_active(!bSet
);
504 catch ( uno::Exception
& )
506 OSL_FAIL( "No IFrame!" );
511 DBG_ASSERT( m_xStorage
.is(), "No storage!");
512 bOK
= m_xStorage
.is();
518 nRet
= InsertObjectDialog_Impl::run();
519 if ( nRet
== RET_OK
)
522 if (!m_xEDURL
->get_text().isEmpty())
524 // URL can be a valid and absolute URL or a system file name
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() )
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
);
546 bool bIPActive
= m_xObj
->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
;
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());
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());
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 ) );
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
) ) );
586 m_xObj
->changeState( embed::EmbedStates::INPLACE_ACTIVE
);
588 catch ( uno::Exception
& )
590 OSL_FAIL( "No IFrame!" );
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());
626 aFileDlg
.SetTitle(CuiResId(RID_CUISTR_SELECT_FILE_IFRAME
));
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: */