24#include <osl/file.hxx>
32#include <com/sun/star/system/SystemShellExecute.hpp>
33#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
35using namespace css::uno;
36using namespace css::system;
57 pData->Update( newGraphic );
72class ExternalToolEditThread
76 OUString
const m_aFileName;
78 virtual void execute()
override;
81 explicit ExternalToolEditThread(OUString aFileName)
83 , m_aFileName(
std::move(aFileName))
89void ExternalToolEditThread::execute()
93 Reference<XSystemShellExecute>
const xSystemShellExecute(
94 SystemShellExecute::create( ::comphelper::getProcessComponentContext()));
95 xSystemShellExecute->execute(m_aFileName, OUString(),
96 SystemShellExecuteFlags::URIS_ONLY);
98 catch (Exception
const&)
111 GraphicHelper::GetPreferredExtension(fExtension, aGraphic);
114 OUString aTempFileBase;
115 OUString aTempFileName;
117 osl::FileBase::RC rc =
118 osl::FileBase::createTempFile(
nullptr,
nullptr, &aTempFileBase);
119 if (osl::FileBase::E_None != rc)
121 SAL_WARN(
"svx",
"ExternalToolEdit::Edit: cannot create temp file");
126 aTempFileName = aTempFileBase +
"." + fExtension;
128 rc = osl::File::move(aTempFileBase, aTempFileName);
129 if (osl::FileBase::E_None != rc)
131 SAL_WARN(
"svx",
"ExternalToolEdit::Edit: cannot move temp file");
170 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
172 SdrHint const*
const pSdrHint(
static_cast<SdrHint const*
>(&rHint));
193 OUString
const description =
196 pNewObj->SetGraphicObject(rGraphic);
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
sal_uInt16 GetExportFormatNumberForShortName(std::u16string_view rShortName)
static GraphicFilter & GetGraphicFilter()
OUString GetExportFormatShortName(sal_uInt16 nFormat)
const Graphic & GetGraphic() const
void ReplaceObjectAtView(SdrObject *pOldObj, SdrPageView &rPV, SdrObject *pNewObj, bool bMark=true)
This class represents an embedded or linked bitmap graphic object.
SdrHintKind GetKind() const
const SdrObject * GetObject() const
OUString const & GetDescriptionOfMarkedObjects() const
static rtl::Reference< T > Clone(T const &rObj, SdrModel &rTargetModel)
SdrPageView * GetSdrPageView() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
static ErrCode WriteGraphic(const Graphic &rGraphic, OUString &rFileName, const OUString &rFilterName, const XOutFlags nFlags, const Size *pMtfSize_100TH_MM=nullptr, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr, OUString *pMediaType=nullptr)
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData