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;
257 if (
pImpl->m_bIsModified )
268 if (
pImpl->mxObjectContainer)
271 for (
const auto& rName : aNames )
274 OSL_ENSURE( xObj.is(),
"An empty entry in the embedded objects list!" );
279 sal_Int32
nState = xObj->getCurrentState();
280 if (
nState != embed::EmbedStates::LOADED )
282 uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
283 if ( xModifiable.is() && xModifiable->isModified() )
287 catch( uno::Exception& )
300 "SFX_PERSIST: SetModified( sal_False ), although IsEnableSetModified() == sal_False" );
305 if(
pImpl->m_bIsModified != bModifiedP )
307 pImpl->m_bIsModified = bModifiedP;
315 if (
pImpl->bClosing )
341 return pImpl->bReadOnlyUI;
420 return pImpl->bModalMode ||
pImpl->bRunningMacro;
431 if ( !
pImpl->bRunningMacro != !bModal )
433 pImpl->bRunningMacro = bModal;
443 if (
pImpl->bModalMode == bModal )
454 pImpl->bModalMode = bModal;
458#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
468 if ( aOrigURL.isEmpty() && bSave )
481 bResult = ( pResult && pResult->
GetValue() );
490 bool bRemoveEntryOnError =
false;
491 if ( bResult && bShared )
496 aControlFile.InsertOwnEntry();
497 bRemoveEntryOnError =
true;
499 catch( uno::Exception& )
505 if ( bResult && bSave )
516 pImpl->pBaseModel->store();
531 pImpl->m_aSharedFileURL = aOrigURL;
538 pImpl->m_aSharedFileURL.clear();
541 ::utl::UCBContentHelper::Kill( aTempFileURL );
547 aControlFile.RemoveFile();
549 catch( uno::Exception& )
557 if ( bRemoveEntryOnError )
562 aControlFile.RemoveEntry();
564 catch( uno::Exception& )
589 if (
pImpl->m_bAllowShareControlFileClean )
594 aControlFile.RemoveEntry();
596 catch( uno::Exception& )
602 pImpl->m_bAllowShareControlFileClean =
true;
605 ::utl::UCBContentHelper::Kill( aTempFileURL );
607 pImpl->m_aSharedFileURL.clear();
613 pImpl->m_bAllowShareControlFileClean =
false;
619 pImpl->m_bSharedXMLFlag = bFlag;
625 return pImpl->m_bSharedXMLFlag;
632#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
633 return ( !
pImpl->m_aSharedFileURL.isEmpty() );
642#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
643 return pImpl->m_aSharedFileURL;
657 return pImpl->aBitSet;
665 const OUString& rTitle
687 if (
pImpl->bIsNamedVisible && USHRT_MAX !=
pImpl->nVisualDocumentNumber )
690 pImpl->bIsNamedVisible =
false;
694 pImpl->aTitle = rTitle;
726 static bool bRecur =
false;
728 return "-not available-";
735 const SfxStringItem* pNameItem = SfxItemSet::GetItem<SfxStringItem>(pMed->
GetItemSet(), SID_DOCINFO_TITLE,
false);
740 if ( aTitle.isEmpty() )
756 const SfxStringItem* pNameItem = SfxItemSet::GetItem<SfxStringItem>(pMed->
GetItemSet(), SID_DOCINFO_TITLE,
false);
762 DBG_ASSERT( !HasName() || pMed,
"HasName() but no Medium?!?" );
763 if ( !HasName() || !pMed )
766 if ( !pImpl->aTitle.isEmpty() )
767 return pImpl->aTitle;
770 const OUString aNoName(
SfxResId(STR_NONAME));
771 if (pImpl->bIsNamedVisible)
774 return aNoName +
" " + OUString::number(pImpl->nVisualDocumentNumber);
786 if (
aURL.GetProtocol() == INetProtocol::File)
794 if (
aURL.GetProtocol() == INetProtocol::File )
800 if ( pImpl->aTitle.isEmpty() )
809 if( aComplete.getLength() > nMaxLength )
810 return OUString::Concat(
"...") + aComplete.subView( aComplete.getLength() - nMaxLength + 3, nMaxLength - 3 );
822 if ( pImpl->aTitle.isEmpty() )
823 pImpl->aTitle =
aURL.GetBase();
826 if ( pImpl->aTitle.isEmpty() )
831 return pImpl->aTitle;
844 pImpl->aTitle.clear();
853 if ( !
pImpl->bIsNamedVisible )
855 pImpl->bIsNamedVisible =
true;
856 if ( !
HasName() && USHRT_MAX ==
pImpl->nVisualDocumentNumber &&
pImpl->aTitle.isEmpty() )
875 return pImpl->pProgress;
893 (
pImpl->pProgress && !pProgress ),
894 "Progress activation/deactivation mismatch" );
895 pImpl->pProgress = pProgress;
906 if ( !pHiddenItem || !pHiddenItem->
GetValue() )
936 pImpl->m_bMacroSignBroken = bBreakMacroSign;
945 uno::Reference< task::XInteractionHandler > xInteraction;
956 pImpl->aMacroMode.checkMacrosOnLoading( xInteraction, bHasValidContentSignature );
963 bool bIsEncrypted =
false;
964 bool bHasNonEncrypted =
false;
968 uno::Reference < beans::XPropertySet > xPropSet(
GetStorage(), uno::UNO_QUERY_THROW );
969 xPropSet->getPropertyValue(
"Version") >>= aVersion;
970 xPropSet->getPropertyValue(
"HasEncryptedEntries") >>= bIsEncrypted;
971 xPropSet->getPropertyValue(
"HasNonEncryptedEntries") >>= bHasNonEncrypted;
973 catch( uno::Exception& )
981 if ( !(bIsEncrypted && bHasNonEncrypted) )
984 if ( !
pImpl->m_bIncomplEncrWarnShown )
987 css::task::ErrorCodeRequest aErrorCode;
991 pImpl->m_bIncomplEncrWarnShown =
true;
995 pImpl->aMacroMode.disallowMacroExecution();
1003 if ( !bSignatureBroken )
1007 pImpl->aMacroMode.disallowMacroExecution();
1014 pImpl->pReloadTimer.reset();
1020 pImpl->pReloadTimer->Start();
1026 pImpl->nLoadedFlags = nFlags;
1036 if (
pImpl->bModelInitialized )
1060 uno::Sequence< beans::PropertyValue > aArgs;
1066 pImpl->bModelInitialized =
true;
1071 bool bSetModifiedTRUE =
false;
1084 bSetModifiedTRUE =
true;
1104 uno::Reference<document::XDocumentProperties> xDocProps(
1106 const OUString url(xDocProps->getAutoloadURL());
1107 sal_Int32 delay(xDocProps->getAutoloadSecs());
1109 (delay > 0) || !url.isEmpty() );
1116 pImpl->nLoadedFlags |= nFlags;
1124 if ( bSetModifiedTRUE )
1132 bool bTemplate = pTemplateItem && pTemplateItem->
GetValue();
1168 const SfxStringItem* pTemplNamItem = SfxItemSet::GetItem<SfxStringItem>(pTmpMedium->
GetItemSet(), SID_TEMPLATE_NAME,
false);
1169 OUString aTemplateName;
1170 if ( pTemplNamItem )
1171 aTemplateName = pTemplNamItem->
GetValue();
1177 if ( aTemplateName.isEmpty() )
1180 aURL.CutExtension();
1186 pTmpMedium->
SetName( OUString(),
true );
1204 pTmpMedium->
Close();
1215 bool bSalvage = pSalvageItem !=
nullptr;
1269 pImpl->bIsAbortingImport =
true;
1278 :
Timer(
"sfx2 AutoReloadTimer_Impl"), aUrl(
std::move( _aURL )), pObjSh( pSh )
1300 if ( !
aUrl.isEmpty() )
1323 std::u16string_view rBasic,
SbxArray* pArgs,
1327 if( pApp->
GetName() != rBasic )
1334 if( pApp->
GetName() == rBasic )
1344 Reference< XEmbeddedScripts > xScripts( _rxScriptContext, UNO_QUERY );
1345 if ( !xScripts.is() )
1347 Reference< XScriptInvocationContext > xContext( _rxScriptContext, UNO_QUERY_THROW );
1348 xScripts.set( xContext->getScriptContainer(), UNO_SET_THROW );
1351 return xScripts->getAllowMacroExecution();
1363 if (!rScriptURL.startsWith(
"vnd.sun.star.script:"))
1367 css::uno::Reference<css::uri::XUriReference> uri(
1369 css::uno::Reference<css::uri::XVndSunStarScriptUrl> sfUri(uri, css::uno::UNO_QUERY);
1375 OUString
sScript = sfUri->getName().replace(
'|',
'/');
1382 if (aToken.startsWithIgnoreAsciiCase(
"LibreLogo") || aToken.indexOf(
'~') != -1)
1393 const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam,
bool bRaiseError,
const css::uno::Any* pCaller )
1395 SAL_INFO(
"sfx",
"in CallXScript" );
1398 bool bCaughtException =
false;
1409 Reference< provider::XScriptProvider > xScriptProvider;
1410 Reference< provider::XScriptProviderSupplier > xSPS( _rxScriptContext, UNO_QUERY );
1412 xScriptProvider.set( xSPS->getScriptProvider() );
1414 if ( !xScriptProvider.is() )
1416 Reference< provider::XScriptProviderFactory > xScriptProviderFactory =
1417 provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
1418 xScriptProvider.set( xScriptProviderFactory->createScriptProvider(
Any( _rxScriptContext ) ), UNO_SET_THROW );
1425 Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_SET_THROW );
1426 if ( pCaller && pCaller->hasValue() )
1428 Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
1431 Sequence< uno::Any > aArgs{ *pCaller };
1432 xProps->setPropertyValue(
"Caller",
uno::Any( aArgs ) );
1435 aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam );
1437 catch (
const uno::Exception& )
1439 aException = ::cppu::getCaughtException();
1440 bCaughtException =
true;
1444 if ( bCaughtException && bRaiseError )
1450 SAL_INFO(
"sfx",
"leaving CallXScript" );
1457 const css::uno::Sequence< css::uno::Any >& aParams,
1458 css::uno::Any& aRet,
1459 css::uno::Sequence< sal_Int16 >& aOutParamIndex,
1460 css::uno::Sequence< css::uno::Any >& aOutParam,
1462 const css::uno::Any* pCaller )
1464 return CallXScript(
GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError, pCaller );
1467void SfxHeaderAttributes_Impl::SetAttributes()
1471 for(
bool bCont = xIter->GetFirst( aPair ); bCont;
1472 bCont = xIter->GetNext( aPair ) )
1473 SetAttribute( aPair );
1476void SfxHeaderAttributes_Impl::SetAttribute(
const SvKeyValue& rKV )
1478 const OUString& aValue = rKV.
GetValue();
1479 if( rKV.
GetKey().equalsIgnoreAsciiCase(
"refresh") && !rKV.
GetValue().isEmpty() )
1481 sal_Int32 nIdx{ 0 };
1484 uno::Reference<document::XDocumentProperties> xDocProps(
1486 if(
aURL.startsWithIgnoreAsciiCase(
"url=" ) )
1489 xDocProps->setAutoloadURL(
1491 }
catch (rtl::MalformedUriException &) {
1497 xDocProps->setAutoloadSecs( nTime );
1499 catch (lang::IllegalArgumentException &)
1504 else if( rKV.
GetKey().equalsIgnoreAsciiCase(
"expires" ) )
1507 if( INetMIMEMessage::ParseDateField( rKV.
GetValue(), aDateTime ) )
1509 aDateTime.ConvertToLocalTime();
1519void SfxHeaderAttributes_Impl::Append(
const SvKeyValue& rKV )
1521 xIter->Append( rKV );
1522 if( bAlert ) SetAttribute( rKV );
1527 if( !
pImpl->xHeaderAttributes.is() )
1530 pImpl->xHeaderAttributes =
new SfxHeaderAttributes_Impl(
this );
1538 ->ClearForSourceView();
1553 bool bPreview =
false;
1558 const OUString aFileFlags = pFlags->
GetValue().toAsciiUpperCase();
1559 if ( -1 != aFileFlags.indexOf(
'B' ) )
1578 pFrame->GetFrame().GetWindow().EnterWait();
1580 pFrame->GetFrame().GetWindow().LeaveWait();
1588 if(
aName.isEmpty() )
1590 if (
aName.isEmpty() )
1603 uno::Reference< task::XInteractionHandler > xInteraction;
1611 return pImpl->aMacroMode.adjustMacroMode( xInteraction );
1616 css::uno::Reference<css::awt::XWindow> xWindow;
1618 const SfxUnoFrameItem* pUnoItem = SfxItemSet::GetItem<SfxUnoFrameItem>(pSet, SID_FILLFRAME,
false);
1621 const uno::Reference < frame::XFrame >&
xFrame( pUnoItem->
GetFrame() );
1622 xWindow =
xFrame->getContainerWindow();
1628 const SfxFrameItem* pFrameItem = SfxItemSet::GetItem<SfxFrameItem>(pSet, SID_DOCFRAME,
false);
1629 if( pFrameItem && pFrameItem->
GetFrame() )
1653 const SfxBoolItem* pHiddenItem = SfxItemSet::GetItem<SfxBoolItem>(pSet, SID_HIDDEN,
false);
1654 if ( !pHiddenItem || !pHiddenItem->
GetValue() )
1656 xWindow->setVisible(
true);
1657 css::uno::Reference<css::awt::XTopWindow> xTopWindow(xWindow, uno::UNO_QUERY);
1658 SAL_WARN_IF(!xTopWindow,
"sfx.appl",
"XTopWindow not available from XWindow");
1660 xTopWindow->toFront();
1691 const uno::Reference< task::XInteractionHandler >& xHandler,
1694 bool bResult =
false;
1696 if ( xHandler.is() )
1703 uno::Sequence< uno::Reference< task::XInteractionContinuation > > lContinuations{
1707 task::ErrorCodeRequest aErrorCode;
1708 aErrorCode.ErrCode = sal_uInt32(nError);
1709 aInteraction <<= aErrorCode;
1711 bResult = pAbort->wasSelected();
1713 catch( uno::Exception& )
1722 sal_Int16 nImposedExecMode( MacroExecMode::NEVER_EXECUTE );
1725 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getCurrentMacroExecMode: no medium!" );
1728 const SfxUInt16Item* pMacroModeItem = SfxItemSet::GetItem<SfxUInt16Item>(pMedium->
GetItemSet(), SID_MACROEXECMODE,
false);
1729 if ( pMacroModeItem )
1730 nImposedExecMode = pMacroModeItem->
GetValue();
1732 return nImposedExecMode;
1738 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getCurrentMacroExecMode: no medium!" );
1750 OSL_PRECOND( pMedium,
"SfxObjectShell_Impl::getDocumentLocation: no medium!" );
1753 sLocation = pMedium->
GetName();
1754 if ( sLocation.isEmpty() )
1761 if (sLocation.isEmpty())
1770 return ::sfx2::DocumentMacroMode::storageHasMacros(
m_xDocStorage );
1793 return nSignatureState;
1798 bool bResult =
false;
1805 uno::Reference < beans::XPropertySet > xPropSet(
rDocShell.
GetStorage(), uno::UNO_QUERY_THROW );
1806 xPropSet->getPropertyValue(
"Version") >>= aVersion;
1808 catch( uno::Exception& )
1820 if ( aInfo.hasElements() )
1828 bResult = std::any_of(aInfo.begin(), aInfo.end(),
1829 [&xSigner](
const security::DocumentSignatureInformation& rInfo) {
1830 return xSigner->isAuthorTrusted( rInfo.Signer ); });
1832 if ( !bResult && bAllowUIToAddAuthor )
1834 uno::Reference< task::XInteractionHandler > xInteraction;
1838 if ( xInteraction.is() )
1840 task::DocumentMacroConfirmationRequest aRequest;
1843 aRequest.DocumentSignatureInformation = aInfo;
1844 aRequest.DocumentVersion = aVersion;
1845 aRequest.Classification = task::InteractionClassification_QUERY;
1853 catch( uno::Exception& )
1866 OUString aMessage =
SfxResId(STR_QMSG_ERROR_OPENING_FILE);
1867 if (!aErrMessage.empty())
1868 aMessage +=
SfxResId(STR_QMSG_ERROR_OPENING_FILE_DETAILS) + aErrMessage;
1869 aMessage +=
SfxResId(STR_QMSG_ERROR_OPENING_FILE_CONTINUE);
1871 VclMessageType::Question, VclButtonsType::YesNo, aMessage));
1885 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 * 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)
ErrCode GetErrorCode() const
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
SfxItemSet * GetItemSet() const
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 IsLoadReadonly() 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