20#include <config_features.h>
32#include <com/sun/star/awt/XTopWindow.hpp>
33#include <com/sun/star/beans/XPropertySet.hpp>
34#include <com/sun/star/container/XChild.hpp>
35#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
36#include <com/sun/star/document/XDocumentProperties.hpp>
37#include <com/sun/star/document/MacroExecMode.hpp>
38#include <com/sun/star/document/XScriptInvocationContext.hpp>
39#include <com/sun/star/embed/EmbedStates.hpp>
40#include <com/sun/star/embed/XEmbeddedObject.hpp>
41#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
42#include <com/sun/star/script/provider/XScript.hpp>
43#include <com/sun/star/script/provider/XScriptProvider.hpp>
44#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
45#include <com/sun/star/uri/UriReferenceFactory.hpp>
46#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
47#include <com/sun/star/util/XModifiable.hpp>
49#include <com/sun/star/uno/Reference.h>
50#include <com/sun/star/uno/Any.h>
51#include <com/sun/star/task/ErrorCodeRequest.hpp>
56#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
57#include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
58#include <com/sun/star/task/InteractionClassification.hpp>
59#include <com/sun/star/task/XInteractionHandler.hpp>
60#include <com/sun/star/frame/XModel.hpp>
80#include <officecfg/Office/Common.hxx>
96#include <sfx2/sfxsids.hrc>
97#include <sfx2/strings.hrc>
114using namespace ::com::sun::star::script::provider;
131 xIter( pSh->GetMedium()->GetHeaderAttributes_Impl() ),
135 virtual bool GetNext(
SvKeyValue& rKV )
override {
return xIter->GetNext( rKV ); }
139 void SetAttributes();
156 return pImpl->bIsAbortingImport;
160uno::Reference<document::XDocumentProperties>
163 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
165 uno::Reference<document::XDocumentProperties> xDocProps(
166 xDPS->getDocumentProperties());
168 "SfxObjectShell: model has no DocumentProperties");
186 uno::Reference<document::XDocumentProperties> xDocProps(
getDocProperties());
188 const OUString url(xDocProps->getAutoloadURL());
189 sal_Int32 delay(xDocProps->getAutoloadSecs());
191 (delay > 0) || !url.isEmpty() );
195 const OUString& sSecondaryMessage,
243 SAL_INFO_IF( bEnable ==
pImpl->m_bEnableSetModified,
"sfx",
"SFX_PERSIST: EnableSetModified 2x called with the same value" );
244 pImpl->m_bEnableSetModified = bEnable;
261 if (
pImpl->m_bIsModified )
272 if (
pImpl->mxObjectContainer)
275 for (
const auto& rName : aNames )
278 OSL_ENSURE( xObj.is(),
"An empty entry in the embedded objects list!" );
283 sal_Int32
nState = xObj->getCurrentState();
284 if (
nState != embed::EmbedStates::LOADED )
286 uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
287 if ( xModifiable.is() && xModifiable->isModified() )
291 catch( uno::Exception& )
304 "SFX_PERSIST: SetModified( sal_False ), although IsEnableSetModified() == sal_False" );
309 if(
pImpl->m_bIsModified != bModifiedP )
311 pImpl->m_bIsModified = bModifiedP;
319 if (
pImpl->bClosing )
345 return pImpl->bReadOnlyUI;
424 return pImpl->bModalMode ||
pImpl->bRunningMacro;
435 if ( !
pImpl->bRunningMacro != !bModal )
437 pImpl->bRunningMacro = bModal;
447 if (
pImpl->bModalMode == bModal )
458 pImpl->bModalMode = bModal;
462#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
472 if ( aOrigURL.isEmpty() && bSave )
485 bResult = ( pResult && pResult->
GetValue() );
494 bool bRemoveEntryOnError =
false;
495 if ( bResult && bShared )
500 aControlFile.InsertOwnEntry();
501 bRemoveEntryOnError =
true;
503 catch( uno::Exception& )
509 if ( bResult && bSave )
520 pImpl->pBaseModel->store();
535 pImpl->m_aSharedFileURL = aOrigURL;
542 pImpl->m_aSharedFileURL.clear();
545 ::utl::UCBContentHelper::Kill( aTempFileURL );
551 aControlFile.RemoveFile();
553 catch( uno::Exception& )
561 if ( bRemoveEntryOnError )
566 aControlFile.RemoveEntry();
568 catch( uno::Exception& )
593 if (
pImpl->m_bAllowShareControlFileClean )
598 aControlFile.RemoveEntry();
600 catch( uno::Exception& )
606 pImpl->m_bAllowShareControlFileClean =
true;
609 ::utl::UCBContentHelper::Kill( aTempFileURL );
611 pImpl->m_aSharedFileURL.clear();
617 pImpl->m_bAllowShareControlFileClean =
false;
623 pImpl->m_bSharedXMLFlag = bFlag;
629 return pImpl->m_bSharedXMLFlag;
636#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
637 return ( !
pImpl->m_aSharedFileURL.isEmpty() );
646#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
647 return pImpl->m_aSharedFileURL;
661 return pImpl->aBitSet;
669 const OUString& rTitle
691 if (
pImpl->bIsNamedVisible && USHRT_MAX !=
pImpl->nVisualDocumentNumber )
694 pImpl->bIsNamedVisible =
false;
698 pImpl->aTitle = rTitle;
730 static bool bRecur =
false;
732 return "-not available-";
744 if ( aTitle.isEmpty() )
766 DBG_ASSERT( !HasName() || pMed,
"HasName() but no Medium?!?" );
767 if ( !HasName() || !pMed )
770 if ( !pImpl->aTitle.isEmpty() )
771 return pImpl->aTitle;
774 const OUString aNoName(
SfxResId(STR_NONAME));
775 if (pImpl->bIsNamedVisible)
778 return aNoName +
" " + OUString::number(pImpl->nVisualDocumentNumber);
790 if (
aURL.GetProtocol() == INetProtocol::File)
798 if (
aURL.GetProtocol() == INetProtocol::File )
804 if ( pImpl->aTitle.isEmpty() )
813 if( aComplete.getLength() > nMaxLength )
814 return OUString::Concat(
"...") + aComplete.subView( aComplete.getLength() - nMaxLength + 3, nMaxLength - 3 );
826 if ( pImpl->aTitle.isEmpty() )
827 pImpl->aTitle =
aURL.GetBase();
830 if ( pImpl->aTitle.isEmpty() )
835 return pImpl->aTitle;
848 pImpl->aTitle.clear();
857 if ( !
pImpl->bIsNamedVisible )
859 pImpl->bIsNamedVisible =
true;
860 if ( !
HasName() && USHRT_MAX ==
pImpl->nVisualDocumentNumber &&
pImpl->aTitle.isEmpty() )
879 return pImpl->pProgress;
897 (
pImpl->pProgress && !pProgress ),
898 "Progress activation/deactivation mismatch" );
899 pImpl->pProgress = pProgress;
910 if ( !pHiddenItem || !pHiddenItem->
GetValue() )
940 pImpl->m_bMacroSignBroken = bBreakMacroSign;
949 uno::Reference< task::XInteractionHandler > xInteraction;
960 pImpl->aMacroMode.checkMacrosOnLoading( xInteraction, bHasValidContentSignature );
967 bool bIsEncrypted =
false;
968 bool bHasNonEncrypted =
false;
972 uno::Reference < beans::XPropertySet > xPropSet(
GetStorage(), uno::UNO_QUERY_THROW );
973 xPropSet->getPropertyValue(
"Version") >>= aVersion;
974 xPropSet->getPropertyValue(
"HasEncryptedEntries") >>= bIsEncrypted;
975 xPropSet->getPropertyValue(
"HasNonEncryptedEntries") >>= bHasNonEncrypted;
977 catch( uno::Exception& )
985 if ( !(bIsEncrypted && bHasNonEncrypted) )
988 if ( !
pImpl->m_bIncomplEncrWarnShown )
991 css::task::ErrorCodeRequest aErrorCode;
995 pImpl->m_bIncomplEncrWarnShown =
true;
999 pImpl->aMacroMode.disallowMacroExecution();
1007 if ( !bSignatureBroken )
1011 pImpl->aMacroMode.disallowMacroExecution();
1018 pImpl->pReloadTimer.reset();
1024 pImpl->pReloadTimer->Start();
1030 pImpl->nLoadedFlags = nFlags;
1040 if (
pImpl->bModelInitialized )
1064 uno::Sequence< beans::PropertyValue > aArgs;
1070 pImpl->bModelInitialized =
true;
1075 bool bSetModifiedTRUE =
false;
1088 bSetModifiedTRUE =
true;
1108 uno::Reference<document::XDocumentProperties> xDocProps(
1110 const OUString url(xDocProps->getAutoloadURL());
1111 sal_Int32 delay(xDocProps->getAutoloadSecs());
1113 (delay > 0) || !url.isEmpty() );
1120 pImpl->nLoadedFlags |= nFlags;
1128 if ( bSetModifiedTRUE )
1136 bool bTemplate = pTemplateItem && pTemplateItem->
GetValue();
1173 OUString aTemplateName;
1174 if ( pTemplNamItem )
1175 aTemplateName = pTemplNamItem->
GetValue();
1181 if ( aTemplateName.isEmpty() )
1184 aURL.CutExtension();
1190 pTmpMedium->
SetName( OUString(),
true );
1208 pTmpMedium->
Close();
1219 bool bSalvage = pSalvageItem !=
nullptr;
1273 pImpl->bIsAbortingImport =
true;
1282 :
Timer(
"sfx2 AutoReloadTimer_Impl"), aUrl(
std::move( _aURL )), pObjSh( pSh )
1304 if ( !
aUrl.isEmpty() )
1327 std::u16string_view rBasic,
SbxArray* pArgs,
1331 if( pApp->
GetName() != rBasic )
1338 if( pApp->
GetName() == rBasic )
1348 Reference< XEmbeddedScripts > xScripts( _rxScriptContext, UNO_QUERY );
1349 if ( !xScripts.is() )
1351 Reference< XScriptInvocationContext > xContext( _rxScriptContext, UNO_QUERY_THROW );
1352 xScripts.set( xContext->getScriptContainer(), UNO_SET_THROW );
1355 return xScripts->getAllowMacroExecution();
1367 if (!rScriptURL.startsWith(
"vnd.sun.star.script:"))
1371 css::uno::Reference<css::uri::XUriReference> uri(
1373 css::uno::Reference<css::uri::XVndSunStarScriptUrl> sfUri(uri, css::uno::UNO_QUERY);
1379 OUString
sScript = sfUri->getName().replace(
'|',
'/');
1386 if (aToken.startsWithIgnoreAsciiCase(
"LibreLogo") || aToken.indexOf(
'~') != -1)
1397 const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam,
bool bRaiseError,
const css::uno::Any* pCaller )
1399 SAL_INFO(
"sfx",
"in CallXScript" );
1402 bool bCaughtException =
false;
1413 Reference< provider::XScriptProvider > xScriptProvider;
1414 Reference< provider::XScriptProviderSupplier > xSPS( _rxScriptContext, UNO_QUERY );
1416 xScriptProvider.set( xSPS->getScriptProvider() );
1418 if ( !xScriptProvider.is() )
1420 Reference< provider::XScriptProviderFactory > xScriptProviderFactory =
1421 provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
1422 xScriptProvider.set( xScriptProviderFactory->createScriptProvider(
Any( _rxScriptContext ) ), UNO_SET_THROW );
1429 Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_SET_THROW );
1430 if ( pCaller && pCaller->hasValue() )
1432 Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
1435 Sequence< uno::Any > aArgs{ *pCaller };
1436 xProps->setPropertyValue(
"Caller",
uno::Any( aArgs ) );
1439 aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam );
1441 catch (
const uno::Exception& )
1443 aException = ::cppu::getCaughtException();
1444 bCaughtException =
true;
1448 if ( bCaughtException && bRaiseError )
1454 SAL_INFO(
"sfx",
"leaving CallXScript" );
1461 const css::uno::Sequence< css::uno::Any >& aParams,
1462 css::uno::Any& aRet,
1463 css::uno::Sequence< sal_Int16 >& aOutParamIndex,
1464 css::uno::Sequence< css::uno::Any >& aOutParam,
1466 const css::uno::Any* pCaller )
1468 return CallXScript(
GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError, pCaller );
1471void SfxHeaderAttributes_Impl::SetAttributes()
1475 for(
bool bCont = xIter->GetFirst( aPair ); bCont;
1476 bCont = xIter->GetNext( aPair ) )
1477 SetAttribute( aPair );
1480void SfxHeaderAttributes_Impl::SetAttribute(
const SvKeyValue& rKV )
1482 const OUString& aValue = rKV.
GetValue();
1483 if( rKV.
GetKey().equalsIgnoreAsciiCase(
"refresh") && !rKV.
GetValue().isEmpty() )
1485 sal_Int32 nIdx{ 0 };
1488 uno::Reference<document::XDocumentProperties> xDocProps(
1490 if(
aURL.startsWithIgnoreAsciiCase(
"url=" ) )
1493 xDocProps->setAutoloadURL(
1495 }
catch (rtl::MalformedUriException &) {
1501 xDocProps->setAutoloadSecs( nTime );
1503 catch (lang::IllegalArgumentException &)
1508 else if( rKV.
GetKey().equalsIgnoreAsciiCase(
"expires" ) )
1511 if( INetMIMEMessage::ParseDateField( rKV.
GetValue(), aDateTime ) )
1513 aDateTime.ConvertToLocalTime();
1523void SfxHeaderAttributes_Impl::Append(
const SvKeyValue& rKV )
1525 xIter->Append( rKV );
1526 if( bAlert ) SetAttribute( rKV );
1531 if( !
pImpl->xHeaderAttributes.is() )
1534 pImpl->xHeaderAttributes =
new SfxHeaderAttributes_Impl(
this );
1542 ->ClearForSourceView();
1557 bool bPreview =
false;
1562 const OUString aFileFlags = pFlags->
GetValue().toAsciiUpperCase();
1563 if ( -1 != aFileFlags.indexOf(
'B' ) )
1582 pFrame->GetFrame().GetWindow().EnterWait();
1584 pFrame->GetFrame().GetWindow().LeaveWait();
1592 if(
aName.isEmpty() )
1594 if (
aName.isEmpty() )
1607 uno::Reference< task::XInteractionHandler > xInteraction;
1615 return pImpl->aMacroMode.adjustMacroMode( xInteraction );
1620 css::uno::Reference<css::awt::XWindow> xWindow;
1625 const uno::Reference < frame::XFrame >&
xFrame( pUnoItem->
GetFrame() );
1626 xWindow =
xFrame->getContainerWindow();
1633 if( pFrameItem && pFrameItem->
GetFrame() )
1658 if ( !pHiddenItem || !pHiddenItem->
GetValue() )
1660 xWindow->setVisible(
true);
1661 css::uno::Reference<css::awt::XTopWindow> xTopWindow(xWindow, uno::UNO_QUERY);
1662 SAL_WARN_IF(!xTopWindow,
"sfx.appl",
"XTopWindow not available from XWindow");
1664 xTopWindow->toFront();
1695 const uno::Reference< task::XInteractionHandler >& xHandler,
1698 bool bResult =
false;
1700 if ( xHandler.is() )
1707 uno::Sequence< uno::Reference< task::XInteractionContinuation > > lContinuations{
1711 task::ErrorCodeRequest aErrorCode;
1712 aErrorCode.ErrCode = sal_uInt32(nError);
1713 aInteraction <<= aErrorCode;
1715 bResult = pAbort->wasSelected();
1717 catch( uno::Exception& )
1726 sal_Int16 nImposedExecMode( MacroExecMode::NEVER_EXECUTE );
1729 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getCurrentMacroExecMode: no medium!" );
1733 if ( pMacroModeItem )
1734 nImposedExecMode = pMacroModeItem->
GetValue();
1736 return nImposedExecMode;
1742 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getCurrentMacroExecMode: no medium!" );
1754 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getDocumentLocation: no medium!" );
1757 sLocation = pMedium->
GetName();
1758 if ( sLocation.isEmpty() )
1765 if (sLocation.isEmpty())
1774 return ::sfx2::DocumentMacroMode::storageHasMacros(
m_xDocStorage );
1797 return nSignatureState;
1802 bool bResult =
false;
1809 uno::Reference < beans::XPropertySet > xPropSet(
rDocShell.
GetStorage(), uno::UNO_QUERY_THROW );
1810 xPropSet->getPropertyValue(
"Version") >>= aVersion;
1812 catch( uno::Exception& )
1824 if ( aInfo.hasElements() )
1832 bResult = std::any_of(aInfo.begin(), aInfo.end(),
1833 [&xSigner](
const security::DocumentSignatureInformation& rInfo) {
1834 return xSigner->isAuthorTrusted( rInfo.Signer ); });
1836 if ( !bResult && bAllowUIToAddAuthor )
1838 uno::Reference< task::XInteractionHandler > xInteraction;
1842 if ( xInteraction.is() )
1844 task::DocumentMacroConfirmationRequest aRequest;
1847 aRequest.DocumentSignatureInformation = aInfo;
1848 aRequest.DocumentVersion = aVersion;
1849 aRequest.Classification = task::InteractionClassification_QUERY;
1857 catch( uno::Exception& )
1870 OUString aMessage =
SfxResId(STR_QMSG_ERROR_OPENING_FILE);
1871 if (!aErrMessage.empty())
1872 aMessage +=
SfxResId(STR_QMSG_ERROR_OPENING_FILE_DETAILS) + aErrMessage;
1873 aMessage +=
SfxResId(STR_QMSG_ERROR_OPENING_FILE_CONTINUE);
1875 VclMessageType::Question, VclButtonsType::YesNo, aMessage));
1889 if (!officecfg::Office::Common::Misc::AllowEditReadonlyDocs::get())
SfxApplication * SfxGetpApp()
void SetTemplate_Impl(std::u16string_view rFileName, const OUString &rLongName, SfxObjectShell *pDoc)
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
static DialogCancelMode GetDialogCancelMode()
static bool IsUICaptured()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
AutoReloadTimer_Impl(OUString aURL, sal_uInt32 nTime, SfxObjectShell *pSh)
virtual void Invoke() override
sal_uInt16 GetValue() const
const OUString & GetValue() const
ErrCode IgnoreWarning() const
static OUString GetEventName(GlobalEventId nID)
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString PathToFileName() const
OUString msPrimaryMessage
InfobarType maInfobarType
OUString msSecondaryMessage
virtual void ShowAsyncScriptErrorDialog(weld::Window *pParent, const css::uno::Any &rException)=0
static SfxAbstractDialogFactory * Create()
SAL_DLLPRIVATE SfxAppData_Impl * Get_Impl() const
void ReleaseIndex(sal_uInt16 i)
static BasicManager * GetBasicManager()
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
static ErrCode CallBasic(const OUString &, BasicManager *, SbxArray *pArgs, SbxValue *pRet)
sal_uInt16 GetFreeIndex()
const SfxPoolItem * ExecuteSynchron(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr)
void Invalidate(sal_uInt16 nId)
void Broadcast(const SfxHint &rHint)
SfxFrame * GetFrame() const
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
bool IsClosing_Impl() const
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
css::uno::Reference< css::frame::XController > GetController() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetOpenMode(StreamMode nStorOpen, bool bDontClose=false)
void Close(bool bInDestruction=false)
bool IsOriginallyLoadedReadOnly() const
const INetURLObject & GetURLObject() const
SAL_DLLPRIVATE void SetStorage_Impl(const css::uno::Reference< css::embed::XStorage > &xNewStorage)
SfxItemSet & GetItemSet() const
ErrCode GetErrorCode() const
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
bool IsOriginallyReadOnly() const
StreamMode GetOpenMode() const
const OUString & GetOrigURL() const
void SetName(const OUString &rName, bool bSetOrigURL=false)
const OUString & GetName() const
bool SwitchDocumentToFile(const OUString &aURL)
SAL_DLLPRIVATE bool HasStorage_Impl() const
void UnlockFile(bool bReleaseLockStream)
void CreateTempFile(bool bReplace=true)
static bool CallApproveHandler(const css::uno::Reference< css::task::XInteractionHandler > &xHandler, const css::uno::Any &rRequest, bool bAllowAbort)
SAL_DLLPRIVATE void SetExpired_Impl(const DateTime &rDateTime)
OUString SwitchDocumentToTempFile()
SAL_DLLPRIVATE css::uno::Reference< css::embed::XStorage > const & GetZipStorageToSign_Impl(bool bReadOnly=true)
SAL_DLLPRIVATE void Init_Impl()
const OUString & GetPhysicalName() const
css::uno::Reference< css::task::XInteractionHandler > GetInteractionHandler(bool bGetAlways=false)
SfxModule * GetModule() const
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
bool IsOriginallyReadOnlyMedium() const
bool isEditDocLocked() const
SAL_DLLPRIVATE void BreakMacroSign_Impl(bool bBreakMacroSing)
void SetWaitCursor(bool bSet) const
void SetError(ErrCode rErr)
virtual void CancelTransfers()
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
SAL_DLLPRIVATE void SetNamedVisibility_Impl()
void SetTitle(const OUString &rTitle)
virtual bool DoSaveCompleted(SfxMedium *pNewStor=nullptr, bool bRegisterRecent=true)
SAL_DLLPRIVATE bool CanReload_Impl()
ErrCode GetErrorCode() const
bool HasValidSignatures() const
bool AcceptStateUpdate() const
SAL_DLLPRIVATE void SetInitialized_Impl(const bool i_fromInitNew)
void SetAutoLoad(const INetURLObject &, sal_uInt32 nTime, bool bReload)
bool IsInModalMode() const
bool IsLoadingFinished() const
bool isSaveLocked() const
bool IsReadOnlyMedium() const
OUString GetSharedFileURL() const
sal_uInt32 GetModifyPasswordHash() const
bool IsAutoLoadLocked() const
void SetHeaderAttributesForSourceViewHack()
SfxProgress * GetProgress() const
void ClearHeaderAttributesForSourceViewHack()
BasicManager * GetBasicManager() const
bool IsContinueImportOnFilterExceptions(std::u16string_view aErrMessage)
On first error ask user if import should continue; return saved answer.
bool IsEnableSetModified() const
SfxObjectCreateMode eCreateMode
bool isContentExtractionLocked() const
void SetSharedXMLFlag(bool bFlag) const
virtual SfxObjectFactory & GetFactory() const =0
bool isExportLocked() const
SAL_DLLPRIVATE void SetMacroMode_Impl(bool bModal=true)
virtual void Invalidate(sal_uInt16 nId=0) override
With this method can the slots of the subclasses be invalidated through the slot Id or alternatively ...
css::uno::Reference< css::awt::XWindow > GetDialogParent(SfxMedium const *pMedium=nullptr)
bool SwitchToShared(bool bShared, bool bSave)
bool IsAbortingImport() const
bool IsOriginallyLoadedReadOnlyMedium() const
ErrCode CallXScript(const OUString &rScriptURL, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Any &aRet, css::uno::Sequence< sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam, bool bRaiseError=true, const css::uno::Any *aCaller=nullptr)
bool IsReadOnlyUI() const
SfxModule * GetModule() const
SAL_DLLPRIVATE void FreeSharedFile(const OUString &aTempFileURL)
static bool UnTrustedScript(const OUString &rScriptURL)
static bool isScriptAccessAllowed(const css::uno::Reference< css::uno::XInterface > &rScriptContext)
void FinishedLoading(SfxLoadedFlags nWhich=SfxLoadedFlags::ALL)
SvKeyValueIterator * GetHeaderAttributes()
TriState mbContinueImportOnFilterExceptions
SAL_DLLPRIVATE SfxObjectShell_Impl * Get_Impl()
SfxMedium * GetMedium() const
void SetReadOnlyUI(bool bReadOnly=true)
bool HasSharedXMLFlagSet() const
SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl()
css::uno::Reference< css::frame::XModel3 > GetModel() const
bool AdjustMacroMode()
adjusts the internal macro mode, according to the current security settings
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool isPrintLocked() const
void SetLoading(SfxLoadedFlags nFlags)
SAL_DLLPRIVATE void InitOwnModel_Impl()
virtual void DoFlushDocInfo()
template method, called by FlushDocInfo; this implementation is empty
virtual OUString getDocumentBaseURL() const override
SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *pProgress)
SAL_DLLPRIVATE void PostActivateEvent_Impl(SfxViewFrame const *)
std::unique_ptr< struct SfxObjectShell_Impl > pImpl
SAL_DLLPRIVATE void CheckForBrokenDocSignatures_Impl()
bool GetMacroCallsSeenWhileLoading() const
static SAL_DLLPRIVATE bool IsPackageStorageFormat_Impl(const SfxMedium &)
css::uno::Reference< css::embed::XStorage > const & GetStorage()
SAL_DLLPRIVATE void SetCreateMode_Impl(SfxObjectCreateMode nMode)
const tools::Rectangle & GetVisArea() const
void EnableSetModified(bool bEnable=true)
Size GetFirstPageSize() const
static SAL_DLLPRIVATE bool UseInteractionToHandleError(const css::uno::Reference< css::task::XInteractionHandler > &xHandler, ErrCode nError)
SAL_DLLPRIVATE IndexBitSet & GetNoSet_Impl()
std::vector< InfobarData > & getPendingInfobars()
void TemplateDisconnectionAfterLoad()
OUString GetAPIName() const
css::uno::Sequence< css::security::DocumentSignatureInformation > GetDocumentSignatureInformation(bool bScriptingContent, const css::uno::Reference< css::security::XDocumentDigitalSignatures > &xSigner=css::uno::Reference< css::security::XDocumentDigitalSignatures >())
SignatureState GetScriptingSignatureState()
bool IsInPlaceActive() const
SAL_DLLPRIVATE bool IsModifyPasswordEntered() const
const css::uno::Sequence< css::beans::PropertyValue > & GetModifyPasswordInfo() const
SignatureState GetDocumentSignatureState()
SAL_DLLPRIVATE void CheckEncryption_Impl(const css::uno::Reference< css::task::XInteractionHandler > &xHandler)
SAL_DLLPRIVATE void SetActivateEvent_Impl(SfxEventHintId)
SAL_DLLPRIVATE void DoNotCleanShareControlFile()
SAL_DLLPRIVATE void SetModalMode_Impl(bool bModal)
void AppendInfoBarWhenReady(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
Append Infobar once the frame is ready.
virtual void SetModified(bool bModified=true)
ErrCode CallBasic(std::u16string_view rMacro, std::u16string_view rBasicName, SbxArray *pArgs, SbxValue *pRet=nullptr)
const OUString & GetName() const
Returns the name of the Shell object.
SAL_DLLPRIVATE void Invalidate_Impl(SfxBindings &rBindings, sal_uInt16 nId)
void SetName(const OUString &rName)
Sets the name of the Shell object.
const css::uno::Reference< css::frame::XFrame > & GetFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
void ExecReload_Impl(SfxRequest &rReq)
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
bool IsVisible_Impl() const
virtual void Append(const SvKeyValue &rKeyVal)
virtual bool GetFirst(SvKeyValue &rKeyVal)
virtual bool GetNext(SvKeyValue &rKeyVal)
const OUString & GetKey() const
const OUString & GetValue() const
void SetTimeout(sal_uInt64 nTimeoutMs)
virtual void Start(bool bStartTimer=true) override
css::uno::Sequence< OUString > GetObjectNames() const
css::uno::Reference< css::embed::XEmbeddedObject > GetEmbeddedObject(const OUString &, OUString const *pBaseURL=nullptr)
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
static css::uno::Reference< css::task::XInteractionRequest > CreateRequest(const css::uno::Any &aRequest, const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &lContinuations)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
virtual OUString GetName() const override
constexpr OUStringLiteral ODFVER_012_TEXT
#define ERRCODE_IO_ACCESSDENIED
#define ERRCODE_IO_GENERAL
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
SignatureState getSignatureState(const uno::Sequence< security::DocumentSignatureInformation > &aSigInfo)
OString strip(const OString &rIn, char c)
Reference< XComponentContext > getProcessComponentContext()
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
bool parse(OUString const &uri, SourceProviderScannerData *data)
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
sal_uInt16 const aTitleMap_Impl[3][2]
#define SFX_TITLE_FILENAME
#define SFX_TITLE_PICKLIST
#define SFX_TITLE_FULLNAME
#define SFX_TITLE_CAPTION
#define SFX_TITLE_APINAME
#define SFX_TITLE_HISTORY
void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel > &xModel)
#define SFX_STREAM_READONLY
#define SFX_STREAM_READWRITE
#define ERRCODE_BASIC_INTERNAL_ERROR
#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION
OUString SfxResId(TranslateId aId)
virtual sal_Int16 getCurrentMacroExecMode() const override
retrieves the current MacroExecutionMode.
virtual OUString getDocumentLocation() const override
returns the origin of the document
virtual bool macroCallsSeenWhileLoading() const override
checks whether the document's contained calls to macros or scripts after loading
SignatureState nScriptingSignatureState
std::unique_ptr< AutoReloadTimer_Impl > pReloadTimer
virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override
provides access to the XEmbeddedScripts interface of the document
SfxObjectShell & rDocShell
virtual void setCurrentMacroExecMode(sal_uInt16 nMacroMode) override
sets the MacroExecutionMode of the document, as calculated by the DocumentMacroMode class.
css::uno::Reference< css::embed::XStorage > m_xDocStorage
virtual bool documentStorageHasMacros() const override
checks whether the document's storage contains sub storages with macros or scripts
virtual bool hasTrustedScriptingSignature(bool bAllowUIToAddAuthor) override
allows to detect whether there is a trusted scripting signature
virtual SignatureState getScriptingSignatureState() override
returns the state of the signatures for the scripts embedded in the document
std::vector< InfobarData > m_aPendingInfobars
Holds Infobars until View is fully loaded.
Reference< XFrame > xFrame
Reference< XModel > xModel
constexpr OUStringLiteral sScript