23#include <osl/file.hxx>
24#include <osl/thread.h>
48 virtual void Closed()
override;
49 virtual ::sfx2::SvBaseLink::UpdateResult
DataChanged(
50 const OUString& rMimeType,
const css::uno::Any & rValue )
override;
67 const OUString& ,
const css::uno::Any & )
69 bool bForceReload =
false;
82 if(
pData->maFileName != aFile ||
83 pData->maFilterName != aFilter )
85 pData->maFileName = aFile;
86 pData->maFilterName = aFilter;
102 meCharSet(RTL_TEXTENCODING_DONTKNOW)
117 pData->mpLink =
nullptr;
118 return std::unique_ptr<SdrObjUserData>(
pData);
124 rtl_TextEncoding eCharSet = osl_getThreadTextEncoding();
127 if (
pData!=
nullptr) {
131 pData->maFileName = rFileName;
132 pData->maFilterName = rFilterName;
133 pData->meCharSet = eCharSet;
142 for (sal_uInt16 nNum=
nCount; nNum>0;) {
164 DBG_ASSERT(
aURL.GetProtocol() != INetProtocol::NotValid,
"invalid URL" );
168 css::util::DateTime aDateTime;
171 ::utl::typeConvert( aDateTime, aFileDT );
184 bLoad = ( aFileDT >
pData->maFileDate0 );
191 pData->maFileDate0 = aFileDT;
203 if( aFileURL.
GetProtocol() == INetProtocol::NotValid )
205 OUString aFileURLStr;
207 if( osl::FileBase::getFileURLFromSystemPath( rFileName, aFileURLStr ) == osl::FileBase::E_None )
223 pIStm->ReadBytes(cRTF, 5);
225 bool bRTF = cRTF[0] ==
'{' && cRTF[1] ==
'\\' && cRTF[2] ==
'r' && cRTF[3] ==
't' && cRTF[4] ==
'f';
229 if( !pIStm->GetError() )
242 for (sal_uInt16 nNum=
nCount; nNum>0;) {
258 if (pLinkManager!=
nullptr &&
pData!=
nullptr &&
pData->mpLink==
nullptr) {
261 !
pData->maFilterName.isEmpty() ?
262 &
pData->maFilterName :
nullptr);
272 if (pLinkManager!=
nullptr &&
pData->mpLink!=
nullptr) {
275 pData->mpLink=
nullptr;
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
INetProtocol GetProtocol() const
virtual std::unique_ptr< SdrObjUserData > Clone(SdrObject *pObj1) const override
rtl_TextEncoding meCharSet
ImpSdrObjTextLinkUserData()
virtual ~ImpSdrObjTextLinkUserData() override
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(const OUString &rMimeType, const css::uno::Any &rValue) override
ImpSdrObjTextLink(SdrTextObj *pObj1)
virtual void Closed() override
sfx2::LinkManager * GetLinkManager()
User data of a drawing object, e.g.
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
sal_uInt16 GetUserDataCount() const
SdrModel & getSdrModelFromSdrObject() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
virtual void SetChanged()
void DeleteUserData(sal_uInt16 nNum)
SVX_DLLPRIVATE ImpSdrObjTextLinkUserData * GetLinkUserData() const
bool LoadText(const OUString &rFileName, rtl_TextEncoding eCharSet)
SVX_DLLPRIVATE void ImpDeregisterLink()
bool ReloadLinkedText(bool bForceLoad)
SVX_DLLPRIVATE void ImpRegisterLink()
friend class ImpSdrObjTextLinkUserData
void SetText(const OUString &rStr)
friend class ImpSdrObjTextLink
void SetTextLink(const OUString &rFileName, const OUString &rFilterName)
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
void Remove(SvBaseLink const *pLink)
css::uno::Any getPropertyValue(const OUString &rPropertyName)
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
#define DBG_ASSERT(sCon, aError)
std::unique_ptr< sal_Int32[]> pData
Reference< XComponentContext > getProcessComponentContext()
constexpr OUStringLiteral EMPTY
constexpr const sal_uInt16 SDRUSERDATA_OBJTEXTLINK
TOOLS_DLLPUBLIC rtl_TextEncoding GetSOLoadTextEncoding(rtl_TextEncoding eEncoding)