26#include <config_features.h>
30#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
31#include <com/sun/star/task/XInteractionHandler.hpp>
32#include <com/sun/star/task/ErrorCodeIOException.hpp>
33#include <com/sun/star/task/ErrorCodeRequest.hpp>
34#include <com/sun/star/view/XSelectionSupplier.hpp>
35#include <com/sun/star/view/XPrintJobListener.hpp>
36#include <com/sun/star/lang/DisposedException.hpp>
37#include <com/sun/star/lang/IllegalArgumentException.hpp>
38#include <com/sun/star/lang/NoSupportException.hpp>
39#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
40#include <com/sun/star/lang/NotInitializedException.hpp>
41#include <com/sun/star/frame/Desktop.hpp>
42#include <com/sun/star/frame/IllegalArgumentIOException.hpp>
43#include <com/sun/star/frame/XUntitledNumbers.hpp>
44#include <com/sun/star/frame/DoubleInitializationException.hpp>
45#include <com/sun/star/embed/XStorage.hpp>
46#include <com/sun/star/document/XStorageChangeListener.hpp>
47#include <com/sun/star/beans/XPropertySet.hpp>
48#include <com/sun/star/beans/XPropertySetInfo.hpp>
49#include <com/sun/star/container/XIndexContainer.hpp>
50#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
51#include <com/sun/star/script/provider/XScriptProvider.hpp>
52#include <com/sun/star/ui/UIConfigurationManager.hpp>
53#include <com/sun/star/embed/ElementModes.hpp>
54#include <com/sun/star/embed/Aspects.hpp>
55#include <com/sun/star/document/DocumentProperties.hpp>
56#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
57#include <com/sun/star/ucb/XCommandEnvironment.hpp>
58#include <com/sun/star/ucb/ContentCreationException.hpp>
59#include <com/sun/star/ucb/CommandAbortedException.hpp>
60#include <com/sun/star/util/XCloneable.hpp>
61#include <com/sun/star/util/InvalidStateException.hpp>
62#include <com/sun/star/util/CloseVetoException.hpp>
86#include <osl/mutex.hxx>
120#include <sfx2/sfxsids.hrc>
121#include <sfx2/strings.hrc>
139#include <LibreOfficeKit/LibreOfficeKitEnums.h>
146using ::com::sun::star::beans::PropertyValue;
147using ::com::sun::star::document::CmisProperty;
148using ::com::sun::star::frame::XFrame;
149using ::com::sun::star::frame::XController;
150using ::com::sun::star::frame::XController2;
151using ::com::sun::star::lang::IllegalArgumentException;
152using ::com::sun::star::io::IOException;
153using ::com::sun::star::uno::Sequence;
154using ::com::sun::star::document::XDocumentRecovery;
155using ::com::sun::star::document::XUndoManager;
156using ::com::sun::star::document::XUndoAction;
157using ::com::sun::star::frame::XModel;
164class SfxDocInfoListener_Impl :
public ::cppu::WeakImplHelper<
165 util::XModifyListener >
175 virtual void SAL_CALL disposing(
const lang::EventObject& )
override;
176 virtual void SAL_CALL modified(
const lang::EventObject& )
override;
181void SAL_CALL SfxDocInfoListener_Impl::modified(
const lang::EventObject& )
186 m_rShell.FlushDocInfo();
189void SAL_CALL SfxDocInfoListener_Impl::disposing(
const lang::EventObject& )
206 std::unordered_map<css::uno::Reference< css::drawing::XShape >,
264 const Reference< document::XDocumentProperties >& );
266 Reference<rdf::XDocumentMetadataAccess>
GetDMA()
276 const Reference<XComponentContext> xContext(
277 ::comphelper::getProcessComponentContext());
278 const Reference<frame::XModel>
xModel(
280 const Reference<lang::XMultiComponentFactory> xMsf(
281 xContext->getServiceManager());
283 XTransientDocumentsDocumentContentFactory> xTDDCF(
284 xMsf->createInstanceWithContext(
285 "com.sun.star.frame.TransientDocumentsDocumentContentFactory",
288 const Reference<ucb::XContent> xContent(
289 xTDDCF->createDocumentContent(
xModel) );
290 OSL_ENSURE(xContent.is(),
"GetDMA: cannot create DocumentContent");
295 OUString uri = xContent->getIdentifier()->getContentIdentifier();
296 OSL_ENSURE(!uri.isEmpty(),
"GetDMA: empty uri?");
297 if (!uri.isEmpty() && !uri.endsWith(
"/"))
311 ? new ::sfx2::DocumentMetadataAccess(
336class SfxPrintHelperListener_Impl :
public ::cppu::WeakImplHelper< view::XPrintJobListener >
344 virtual void SAL_CALL disposing(
const lang::EventObject& aEvent )
override ;
345 virtual void SAL_CALL printJobEvent(
const view::PrintJobEvent& rEvent )
override;
350void SAL_CALL SfxPrintHelperListener_Impl::disposing(
const lang::EventObject& )
352 m_pData->m_xPrintable =
nullptr;
355void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent(
const view::PrintJobEvent& rEvent )
358 if ( pContainer!=
nullptr )
361 while (pIterator.hasMoreElements())
362 static_cast<view::XPrintJobListener*
>(pIterator.next())->printJobEvent( rEvent );
370class SfxOwnFramesLocker
372 Sequence< Reference< frame::XFrame > > m_aLockedFrames;
374 static vcl::Window* GetVCLWindow(
const Reference< frame::XFrame >& xFrame );
376 explicit SfxOwnFramesLocker(
SfxObjectShell const * ObjechShell );
377 ~SfxOwnFramesLocker();
382SfxOwnFramesLocker::SfxOwnFramesLocker(
SfxObjectShell const * pObjectShell )
392 SfxFrame& rSfxFrame = pFrame->GetFrame();
407 sal_Int32 nLen = m_aLockedFrames.getLength();
408 m_aLockedFrames.realloc( nLen + 1 );
409 m_aLockedFrames.getArray()[nLen] =
xFrame;
420 OSL_FAIL(
"Not possible to lock the frame window!" );
425SfxOwnFramesLocker::~SfxOwnFramesLocker()
427 for (
auto& rFrame : asNonConstRange(m_aLockedFrames) )
445 OSL_FAIL(
"Can't unlock the frame window!" );
450vcl::Window* SfxOwnFramesLocker::GetVCLWindow(
const Reference< frame::XFrame >& xFrame )
456 Reference< awt::XWindow > xWindow =
xFrame->getContainerWindow();
470 Reference< frame::XModel >
m_xModel;
472 std::unique_ptr<SfxOwnFramesLocker> m_pFramesLock;
474 SfxSaveGuard(SfxSaveGuard
const &) =
delete;
475 void operator =(
const SfxSaveGuard&) =
delete;
478 SfxSaveGuard(
const Reference< frame::XModel >& xModel ,
485SfxSaveGuard::SfxSaveGuard(
const Reference< frame::XModel >& xModel ,
491 throw lang::DisposedException(
"Object already disposed.");
494 m_pFramesLock.reset(
new SfxOwnFramesLocker(
m_pData->m_pObjectShell.get() ));
497SfxSaveGuard::~SfxSaveGuard()
499 m_pFramesLock.reset();
517 Reference< util::XCloseable > xClose(m_xModel, UNO_QUERY);
521 catch(
const util::CloseVetoException&)
528, m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->Get_Impl() && !pObjectShell->Get_Impl()->m_bNoBasicCapabilities )
529, m_bSupportDocRecovery( pObjectShell && pObjectShell->Get_Impl() && pObjectShell->Get_Impl()->m_bDocRecoverySupport )
531 if ( pObjectShell !=
nullptr )
550 return SfxBaseModel_Base::queryInterface( rType );
559 void lcl_stripType( Sequence< uno::Type >& io_rTypes,
const uno::Type& i_rTypeToStrip )
561 Sequence< uno::Type > aStrippedTypes( io_rTypes.getLength() - 1 );
562 ::std::remove_copy_if(
563 std::cbegin(io_rTypes),
564 std::cend(io_rTypes),
565 aStrippedTypes.getArray(),
566 [&i_rTypeToStrip](
const uno::Type& aType) { return aType == i_rTypeToStrip; }
568 io_rTypes = aStrippedTypes;
574 Sequence< uno::Type >
aTypes( SfxBaseModel_Base::getTypes() );
591 return css::uno::Sequence<sal_Int8>();
597#if HAVE_FEATURE_SCRIPTING
599static Reference< script::XStarBasicAccess > implGetStarBasicAccess(
SfxObjectShell const * pObjectShell )
601 Reference< script::XStarBasicAccess > xRet;
603#if !HAVE_FEATURE_SCRIPTING
619#if !HAVE_FEATURE_SCRIPTING
620 Reference< container::XNameContainer > dummy;
626 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
627 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
628 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
630 Reference< container::XNameContainer > xRet;
632 xRet = rxAccess->getLibraryContainer();
641 const OUString& ExternalSourceURL,
const OUString& LinkTargetURL )
643#if !HAVE_FEATURE_SCRIPTING
646 (void) ExternalSourceURL;
647 (void) LinkTargetURL;
651 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
652 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
653 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
656 rxAccess->createLibrary( LibName,
Password, ExternalSourceURL, LinkTargetURL );
664 const OUString& Language,
const OUString& Source )
666#if !HAVE_FEATURE_SCRIPTING
674 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
675 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
676 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
679 rxAccess->addModule( LibraryName, ModuleName, Language,
Source );
689#if !HAVE_FEATURE_SCRIPTING
696 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
697 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
698 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
701 rxAccess->addDialog( LibraryName, DialogName,
Data );
742 catch ( util::CloseVetoException& )
753 if (
m_pData->m_pStorageModifyListen.is() )
755 m_pData->m_pStorageModifyListen->dispose();
756 m_pData->m_pStorageModifyListen =
nullptr;
759 if (
m_pData->m_pDocumentUndoManager.is() )
761 m_pData->m_pDocumentUndoManager->disposing();
762 m_pData->m_pDocumentUndoManager =
nullptr;
765 lang::EventObject
aEvent(
static_cast<frame::XModel *
>(
this) );
768 m_pData->m_xDocumentProperties.clear();
770 m_pData->m_xDocumentMetadata.clear();
772 if (
m_pData->m_pObjectShell.is() )
778 m_pData->m_seqControllers.clear();
808 const Reference< document::XDocumentProperties >& rxNewDocProps)
813 Reference<util::XModifyBroadcaster>
const xMB(
815 xMB->addModifyListener(
new SfxDocInfoListener_Impl(*
m_pObjectShell));
820Reference< document::XDocumentProperties > SAL_CALL
824 if ( !
m_pData->m_xDocumentProperties.is() )
826 Reference< document::XDocumentProperties > xDocProps(
827 document::DocumentProperties::create( ::comphelper::getProcessComponentContext() ) );
828 m_pData->impl_setDocumentProperties(xDocProps);
831 return m_pData->m_xDocumentProperties;
844 Reference< util::XModifyListener > xMod( aObject.Source, UNO_QUERY );
845 Reference< lang::XEventListener > xListener( aObject.Source, UNO_QUERY );
846 Reference< document::XEventListener > xDocListener( aObject.Source, UNO_QUERY );
850 else if ( xListener.is() )
852 else if ( xDocListener.is() )
861 const Sequence< beans::PropertyValue >& rArgs )
864 if ( rURL.isEmpty() && rArgs.getLength() == 1 && rArgs[0].Name ==
"SetEmbedded" )
868 if (
m_pData->m_pObjectShell.is() && !
m_pData->m_pObjectShell->GetMedium() )
871 if ( ( rArgs[0].
Value >>= bEmb ) && bEmb )
878 if (
m_pData->m_pObjectShell.is() )
884 Sequence< sal_Int32 > aWinExtent;
885 for (
const beans::PropertyValue & rProp : rArgs)
887 if (rProp.Name ==
"WinExtent" && (rProp.Value >>= aWinExtent) && ( aWinExtent.getLength() == 4 ) )
889 tools::Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] );
893 bool bBreakMacroSign =
false;
894 if ( rProp.Name ==
"BreakMacroSignature" && (rProp.Value >>= bBreakMacroSign) )
898 bool bMacroEventRead =
false;
899 if ( rProp.Name ==
"MacroEventRead" && (rProp.Value >>= bMacroEventRead) && bMacroEventRead)
904 Sequence<beans::PropertyValue> aStrippedArgs(rArgs.getLength());
905 beans::PropertyValue* pStripped = aStrippedArgs.getArray();
906 for (
const beans::PropertyValue & rProp : rArgs)
908 if (rProp.Name ==
"WinExtent"
909 || rProp.Name ==
"BreakMacroSignature"
910 || rProp.Name ==
"MacroEventRead"
911 || rProp.Name ==
"Stream"
912 || rProp.Name ==
"InputStream"
913 || rProp.Name ==
"URL"
914 || rProp.Name ==
"Frame"
915 || rProp.Name ==
"Password"
916 || rProp.Name ==
"EncryptionData")
918 *pStripped++ = rProp;
920 aStrippedArgs.realloc(pStripped - aStrippedArgs.getArray());
924 m_pData->m_seqArguments = aStrippedArgs;
981 SAL_WARN(
"sfx.appl",
"Unexpected operations on model");
982 return m_pData->m_seqArguments;
985 std::set<std::u16string_view> requestedArgs;
986 for (OUString
const & s : requestedArgsSeq)
987 requestedArgs.insert(s);
989 if (
m_pData->m_pObjectShell.is() )
991 Sequence< beans::PropertyValue > seqArgsNew;
992 Sequence< beans::PropertyValue > seqArgsOld;
1003 sal_Int32 nNewLength = seqArgsNew.getLength();
1005 if (requestedArgs.empty() || requestedArgs.count(
u"WinExtent"))
1013 Sequence< sal_Int32 > aRectSeq
1015 o3tl::narrowing<int>(aTmpRect.
Left()),
1016 o3tl::narrowing<int>(aTmpRect.
Top()),
1021 seqArgsNew.realloc( ++nNewLength );
1022 auto pseqArgsNew = seqArgsNew.getArray();
1023 pseqArgsNew[ nNewLength - 1 ].Name =
"WinExtent";
1024 pseqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq;
1027 if (requestedArgs.empty() || requestedArgs.count(
u"PreusedFilterName"))
1029 if ( !
m_pData->m_aPreusedFilterName.isEmpty() )
1031 seqArgsNew.realloc( ++nNewLength );
1032 auto pseqArgsNew = seqArgsNew.getArray();
1033 pseqArgsNew[ nNewLength - 1 ].Name =
"PreusedFilterName";
1034 pseqArgsNew[ nNewLength - 1 ].Value <<=
m_pData->m_aPreusedFilterName;
1038 if (requestedArgs.empty() || requestedArgs.count(
u"DocumentBorder"))
1045 Sequence< sal_Int32 > aBorderSeq
1047 o3tl::narrowing<int>(aBorder.
Left()),
1048 o3tl::narrowing<int>(aBorder.
Top()),
1049 o3tl::narrowing<int>(aBorder.
Right()),
1050 o3tl::narrowing<int>(aBorder.
Bottom())
1053 seqArgsNew.realloc( ++nNewLength );
1054 auto pseqArgsNew = seqArgsNew.getArray();
1055 pseqArgsNew[ nNewLength - 1 ].Name =
"DocumentBorder";
1056 pseqArgsNew[ nNewLength - 1 ].Value <<= aBorderSeq;
1060 if (requestedArgs.empty())
1063 Sequence< beans::PropertyValue > aFinalCache;
1064 sal_Int32 nFinalLength = 0;
1066 for (
const auto& rOrg : std::as_const(
m_pData->m_seqArguments) )
1068 auto bNew = std::none_of(std::cbegin(seqArgsOld), std::cend(seqArgsOld),
1069 [&rOrg](
const beans::PropertyValue& rOld){
return rOld.Name == rOrg.Name; });
1075 seqArgsNew.realloc( ++nNewLength );
1076 seqArgsNew.getArray()[ nNewLength - 1 ] = rOrg;
1078 aFinalCache.realloc( ++nFinalLength );
1079 aFinalCache.getArray()[ nFinalLength - 1 ] = rOrg;
1083 m_pData->m_seqArguments = aFinalCache;
1089 return m_pData->m_seqArguments;
1099 throw util::InvalidStateException(
1100 "Medium could not be retrieved, unable to execute setArgs");
1103 for (
const auto& rArg : aArgs)
1108 if (rArg.Name ==
"SuggestedSaveAsName")
1110 if (rArg.Value >>= sValue)
1116 else if (rArg.Name ==
"SuggestedSaveAsDir")
1118 if (rArg.Value >>= sValue)
1124 else if (rArg.Name ==
"LockContentExtraction")
1126 if (rArg.Value >>= bValue)
1132 else if (rArg.Name ==
"LockExport")
1134 if (rArg.Value >>= bValue)
1140 else if (rArg.Name ==
"LockPrint")
1142 if (rArg.Value >>= bValue)
1148 else if (rArg.Name ==
"LockSave")
1150 if (rArg.Value >>= bValue)
1156 else if (rArg.Name ==
"LockEditDoc")
1158 if (rArg.Value >>= bValue)
1164 else if (rArg.Name ==
"Replaceable")
1166 if (rArg.Value >>= bValue)
1172 else if (rArg.Name ==
"EncryptionData")
1179 throw lang::IllegalArgumentException(
"Setting property not supported: " + rArg.Name,
1191 OSL_PRECOND(
xController.is(),
"SfxBaseModel::connectController: invalid controller!" );
1197 if (
m_pData->m_seqControllers.size() == 1 )
1203 if ( !sDocumentURL.isEmpty() )
1216 if (
m_pData->m_seqControllers.empty() )
1219 auto& vec =
m_pData->m_seqControllers;
1220 vec.erase(std::remove(vec.begin(), vec.end(),
xController), vec.end());
1228 class ControllerLockUndoAction :
public ::cppu::WeakImplHelper< XUndoAction >
1231 ControllerLockUndoAction(
const Reference< XModel >& i_model,
const bool i_undoIsUnlock )
1233 ,m_bUndoIsUnlock( i_undoIsUnlock )
1238 virtual OUString SAL_CALL
getTitle()
override;
1239 virtual void SAL_CALL undo( )
override;
1240 virtual void SAL_CALL redo( )
override;
1243 const Reference< XModel >
m_xModel;
1244 const bool m_bUndoIsUnlock;
1247 OUString SAL_CALL ControllerLockUndoAction::getTitle()
1253 void SAL_CALL ControllerLockUndoAction::undo( )
1255 if ( m_bUndoIsUnlock )
1261 void SAL_CALL ControllerLockUndoAction::redo( )
1263 if ( m_bUndoIsUnlock )
1278 ++
m_pData->m_nControllerLockCount ;
1280 if (
m_pData->m_pDocumentUndoManager.is()
1281 &&
m_pData->m_pDocumentUndoManager->isInContext()
1282 && !
m_pData->m_pDocumentUndoManager->isLocked()
1285 m_pData->m_pDocumentUndoManager->addUndoAction(
new ControllerLockUndoAction(
this,
true ) );
1297 --
m_pData->m_nControllerLockCount ;
1299 if (
m_pData->m_pDocumentUndoManager.is()
1300 &&
m_pData->m_pDocumentUndoManager->isInContext()
1301 && !
m_pData->m_pDocumentUndoManager->isLocked()
1304 m_pData->m_pDocumentUndoManager->addUndoAction(
new ControllerLockUndoAction(
this,
false ) );
1315 return (
m_pData->m_nControllerLockCount != 0 ) ;
1327 if (
m_pData->m_xCurrent.is() )
1331 return !
m_pData->m_seqControllers.empty() ?
m_pData->m_seqControllers.front() :
m_pData->m_xCurrent;
1342 m_pData->m_xCurrent = xCurrentController;
1353 Reference< XInterface > xReturn;
1358 Reference< view::XSelectionSupplier > xDocView(
xController, UNO_QUERY );
1359 if ( xDocView.is() )
1361 Any aSel = xDocView->getSelection();
1377 if ( !
m_pData->m_pObjectShell.is() )
1380 bool bResult =
m_pData->m_pObjectShell->IsEnableSetModified();
1381 m_pData->m_pObjectShell->EnableSetModified(
false );
1390 if ( !
m_pData->m_pObjectShell.is() )
1393 bool bResult =
m_pData->m_pObjectShell->IsEnableSetModified();
1394 m_pData->m_pObjectShell->EnableSetModified();
1403 if ( !
m_pData->m_pObjectShell.is() )
1406 return m_pData->m_pObjectShell->IsEnableSetModified();
1417 return m_pData->m_pObjectShell.is() &&
m_pData->m_pObjectShell->IsModified();
1428 if (
m_pData->m_pObjectShell.is() )
1429 m_pData->m_pObjectShell->SetModified(bModified);
1464 Reference< XInterface > xSelfHold( getXWeak() );
1465 lang::EventObject aSource ( getXWeak() );
1467 if (pContainer!=
nullptr)
1474 static_cast<util::XCloseListener*
>(pIterator.
next())->queryClosing( aSource, bDeliverOwnership );
1485 if (bDeliverOwnership)
1487 throw util::CloseVetoException(
1488 "Can not close while saving.",
1489 static_cast< util::XCloseable*
>(
this));
1495 if (pContainer!=
nullptr)
1502 static_cast<util::XCloseListener*
>(pCloseIterator.
next())->notifyClosing( aSource );
1548 return m_pData->m_xPrintable->getPrinter();
1556 m_pData->m_xPrintable->setPrinter( rPrinter );
1576 return m_pData->m_pObjectShell.is() &&
m_pData->m_pObjectShell->HasName();
1587 if (
m_pData->m_pObjectShell.is() )
1590 if (
m_pData->m_pObjectShell->IsDocShared() )
1591 return m_pData->m_pObjectShell->GetSharedFileURL();
1593 return m_pData->m_pObjectShell->GetMedium()->GetName();
1607 return !
m_pData->m_pObjectShell.is() ||
m_pData->m_pObjectShell->IsReadOnly();
1617 if ( !
m_pData->m_pObjectShell.is() )
1620 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1622 bool bCheckIn =
false;
1623 bool bOnMainThread =
false;
1624 for (
const auto& rArg : aSeqArgs )
1627 if ( rArg.Name !=
"VersionComment" && rArg.Name !=
"Author"
1628 && rArg.Name !=
"DontTerminateEdit"
1629 && rArg.Name !=
"InteractionHandler" && rArg.Name !=
"StatusIndicator"
1630 && rArg.Name !=
"VersionMajor"
1631 && rArg.Name !=
"FailOnWarning"
1632 && rArg.Name !=
"CheckIn"
1633 && rArg.Name !=
"NoFileSync"
1634 && rArg.Name !=
"OnMainThread" )
1636 const OUString aMessage(
"Unexpected MediaDescriptor parameter: " + rArg.Name );
1637 throw lang::IllegalArgumentException( aMessage, Reference< XInterface >(), 1 );
1639 else if ( rArg.Name ==
"CheckIn" )
1641 rArg.Value >>= bCheckIn;
1643 else if (rArg.Name ==
"OnMainThread")
1645 rArg.Value >>= bOnMainThread;
1650 sal_uInt16 nSlotId = SID_SAVEDOC;
1651 Sequence< beans::PropertyValue > aArgs = aSeqArgs;
1654 nSlotId = SID_CHECKIN;
1655 sal_Int32
nLength = aSeqArgs.getLength( );
1656 aArgs = Sequence< beans::PropertyValue >(
nLength - 1 );
1657 std::copy_if(aSeqArgs.begin(), aSeqArgs.end(), aArgs.getArray(),
1658 [](
const beans::PropertyValue& rProp) { return rProp.Name !=
"CheckIn"; });
1661 std::optional<SfxAllItemSet> pParams(
SfxGetpApp()->GetPool() );
1678 bRet =
m_pData->m_pObjectShell->DoSave()
1679 &&
m_pData->m_pObjectShell->DoSaveCompleted();
1683 bRet =
m_pData->m_pObjectShell->Save_Impl( &*pParams );
1689 m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId == SID_CHECKIN );
1692 [
this, &pParams] {
return m_pData->m_pObjectShell->Save_Impl(&*pParams); });
1694 bRet =
m_pData->m_pObjectShell->Save_Impl(&*pParams);
1695 m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId != SID_CHECKIN );
1702 m_pData->m_pObjectShell->ResetError();
1715 throw task::ErrorCodeIOException(
1716 "SfxBaseModel::storeSelf: " + nErrCode.
toString(),
1717 Reference< XInterface >(), sal_uInt32(nErrCode));
1728 storeSelf( Sequence< beans::PropertyValue >() );
1736 const Sequence< beans::PropertyValue >& rArgs )
1741 if ( !
m_pData->m_pObjectShell.is() )
1744 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1747 bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault(
"OnMainThread",
false);
1757 Sequence< beans::PropertyValue > aSequence ;
1763#if OSL_DEBUG_LEVEL > 0
1764 const SfxStringItem* pPasswdItem =
m_pData->m_pObjectShell->GetMedium()->GetItemSet().GetItem(SID_PASSWORD,
false);
1765 OSL_ENSURE( !pPasswdItem,
"There should be no Password property in the document MediaDescriptor!" );
1775 if ( !
m_pData->m_pDocumentUndoManager.is() )
1776 m_pData->m_pDocumentUndoManager.set( new ::sfx2::DocumentUndoManager( *
this ) );
1777 return m_pData->m_pDocumentUndoManager;
1785 const Sequence< beans::PropertyValue >& rArgs )
1790 if ( !
m_pData->m_pObjectShell.is() )
1793 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1796 bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault(
"OnMainThread",
false);
1802 catch (
const uno::Exception &e)
1807 throw io::IOException(e.Message, e.Context);
1814 return m_pData->m_oDirtyTimestamp.has_value();
1822 SfxSaveGuard aSaveGuard(
this,
m_pData.get() );
1823 impl_store( i_TargetLocation, i_MediaDescriptor,
true );
1826 m_pData->setModifiedForAutoSave(
false);
1832 if (!
m_pData->m_oDirtyTimestamp)
1834 auto ms = std::chrono::ceil<std::chrono::milliseconds>(std::chrono::steady_clock::now()
1835 - *
m_pData->m_oDirtyTimestamp);
1839void SAL_CALL
SfxBaseModel::recoverFromFile(
const OUString& i_SourceLocation,
const OUString& i_SalvagedFile,
const Sequence< PropertyValue >& i_MediaDescriptor )
1847 OSL_ENSURE( !aMediaDescriptor.
has(
"SalvagedFile" ) || ( aMediaDescriptor.
getOrDefault(
"SalvagedFile", OUString() ) == i_SalvagedFile ),
1848 "SfxBaseModel::recoverFromFile: inconsistent information!" );
1849 aMediaDescriptor.
put(
"SalvagedFile", i_SalvagedFile );
1852 OSL_ENSURE( !aMediaDescriptor.
has(
"URL" ) || ( aMediaDescriptor.
getOrDefault(
"URL", OUString() ) == i_SourceLocation ),
1853 "SfxBaseModel::recoverFromFile: inconsistent information!" );
1854 aMediaDescriptor.
put(
"URL", i_SourceLocation );
1874 throw frame::DoubleInitializationException( OUString(), *
this );
1877 DBG_ASSERT(
m_pData->m_pObjectShell.is(),
"Model is useless without an ObjectShell" );
1878 if ( !
m_pData->m_pObjectShell.is() )
1881 if(
m_pData->m_pObjectShell->GetMedium() )
1882 throw frame::DoubleInitializationException();
1884 bool bRes =
m_pData->m_pObjectShell->DoInitNew();
1887 m_pData->m_pObjectShell->ResetError();
1890 throw task::ErrorCodeIOException(
1891 "SfxBaseModel::initNew: " + nErrCode.
toString(),
1892 Reference< XInterface >(), sal_uInt32(nErrCode));
1897OUString getFilterProvider(
SfxMedium const & rMedium )
1899 const std::shared_ptr<const SfxFilter>& pFilter = rMedium.
GetFilter();
1903 return pFilter->GetProviderName();
1906void setUpdatePickList(
SfxMedium* pMedium )
1911 bool bHidden =
false;
1925 throw frame::DoubleInitializationException( OUString(), *
this );
1928 DBG_ASSERT(
m_pData->m_pObjectShell.is(),
"Model is useless without an ObjectShell" );
1930 if (!
m_pData->m_pObjectShell.is())
1933 if(
m_pData->m_pObjectShell->GetMedium() )
1935 throw frame::DoubleInitializationException();
1940 if (!getFilterProvider(*pMedium).isEmpty())
1942 if (!
m_pData->m_pObjectShell->DoLoadExternal(pMedium))
1946 setUpdatePickList(pMedium);
1950 OUString aFilterName;
1952 if( pFilterNameItem )
1953 aFilterName = pFilterNameItem->
GetValue();
1954 if( !
m_pData->m_pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName ) )
1958 throw frame::IllegalArgumentIOException();
1962 bool bSalvage = pSalvageItem !=
nullptr;
1965 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
1970 if(
m_pData->m_pObjectShell->GetErrorCode() )
1972 nError =
m_pData->m_pObjectShell->GetErrorCode();
1977 if ( !pRepairItem || !pRepairItem->
GetValue() )
1991 m_pData->m_pObjectShell->PrepareSecondTryLoad_Impl();
1993 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
1995 if (
m_pData->m_pObjectShell->GetErrorCode())
1996 nError =
m_pData->m_pObjectShell->GetErrorCode();
2009 if(
m_pData->m_pObjectShell->IsAbortingImport() )
2019 m_pData->m_pObjectShell->SetModified();
2033 m_pData->m_pObjectShell->ResetError();
2037 setUpdatePickList(pMedium);
2039#if OSL_DEBUG_LEVEL > 0
2041 OSL_ENSURE( !pPasswdItem,
"There should be no Password property in the document MediaDescriptor!" );
2055 if (
m_pData->m_pObjectShell.is() )
2057 if ( aFlavor.MimeType ==
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
2060 throw datatransfer::UnsupportedFlavorException();
2065 aDesc.
maTypeName = aFlavor.HumanPresentableName;
2068 aDesc.
mnViewAspect = sal::static_int_cast< sal_uInt16 >( embed::Aspects::MSOLE_CONTENT );
2070 Size aSize =
m_pData->m_pObjectShell->GetVisArea().GetSize();
2079 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ), aMemStm.
Tell() );
2081 else if ( aFlavor.MimeType ==
"application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" )
2084 throw datatransfer::UnsupportedFlavorException();
2091 std::unique_ptr<SvStream> pStream(aTmp.
GetStream( StreamMode::READ ));
2092 const sal_uInt32 nLen = pStream->TellEnd();
2094 pStream->ReadBytes(
aSeq.getArray(), nLen);
2095 if(
aSeq.hasElements() )
2102 else if ( aFlavor.MimeType ==
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2105 throw datatransfer::UnsupportedFlavorException();
2108 std::shared_ptr<GDIMetaFile> xMetaFile =
2109 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2117 aWriter.
Write( *xMetaFile );
2118 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ),
2122 else if ( aFlavor.MimeType ==
"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2125 throw datatransfer::UnsupportedFlavorException();
2127 std::shared_ptr<GDIMetaFile> xMetaFile =
2128 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2136 aWriter.
Write( *xMetaFile );
2137 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ),
2141 else if ( aFlavor.MimeType ==
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"" )
2145 std::shared_ptr<GDIMetaFile> xMetaFile =
2146 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2150 std::unique_ptr<SvMemoryStream>
xStream(
2151 GraphicHelper::getFormatStrFromGDI_Impl(
2152 xMetaFile.get(), ConvertDataFormat::EMF ) );
2156 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2161 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2164 std::shared_ptr<GDIMetaFile> xMetaFile =
2165 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2169 aAny <<= reinterpret_cast< sal_uInt64 >(
2170 GraphicHelper::getEnhMetaFileFromGDI_Impl( xMetaFile.get() ) );
2174 throw datatransfer::UnsupportedFlavorException();
2176 else if ( aFlavor.MimeType ==
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )
2180 std::shared_ptr<GDIMetaFile> xMetaFile =
2181 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2185 std::unique_ptr<SvMemoryStream>
xStream(
2186 GraphicHelper::getFormatStrFromGDI_Impl(
2187 xMetaFile.get(), ConvertDataFormat::WMF ) );
2192 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2197 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2202 std::shared_ptr<GDIMetaFile> xMetaFile =
2203 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2207 Size aMetaSize = xMetaFile->GetPrefSize();
2208 aAny <<= reinterpret_cast< sal_uInt64 >(
2209 GraphicHelper::getWinMetaFileFromGDI_Impl(
2210 xMetaFile.get(), aMetaSize ) );
2214 throw datatransfer::UnsupportedFlavorException();
2216 else if ( aFlavor.MimeType ==
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )
2219 throw datatransfer::UnsupportedFlavorException();
2221 std::shared_ptr<GDIMetaFile> xMetaFile =
2222 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2226 std::unique_ptr<SvMemoryStream>
xStream(
2227 GraphicHelper::getFormatStrFromGDI_Impl(
2228 xMetaFile.get(), ConvertDataFormat::BMP ) );
2233 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2238 else if ( aFlavor.MimeType ==
"image/png" )
2241 throw datatransfer::UnsupportedFlavorException();
2243 std::shared_ptr<GDIMetaFile> xMetaFile =
2244 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2248 std::unique_ptr<SvMemoryStream>
xStream(
2249 GraphicHelper::getFormatStrFromGDI_Impl(
2250 xMetaFile.get(), ConvertDataFormat::PNG ) );
2255 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2261 throw datatransfer::UnsupportedFlavorException();
2275 const sal_Int32 nSuppFlavors = GraphicHelper::supportsMetaFileHandle_Impl() ? 10 : 8;
2276 Sequence< datatransfer::DataFlavor > aFlavorSeq( nSuppFlavors );
2277 auto pFlavorSeq = aFlavorSeq.getArray();
2279 pFlavorSeq[0].MimeType =
2280 "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"";
2281 pFlavorSeq[0].HumanPresentableName =
"GDIMetaFile";
2284 pFlavorSeq[1].MimeType =
2285 "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"";
2286 pFlavorSeq[1].HumanPresentableName =
"GDIMetaFile";
2289 pFlavorSeq[2].MimeType =
2290 "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ;
2291 pFlavorSeq[2].HumanPresentableName =
"Enhanced Windows MetaFile";
2294 pFlavorSeq[3].MimeType =
2295 "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
2296 pFlavorSeq[3].HumanPresentableName =
"Windows MetaFile";
2299 pFlavorSeq[4].MimeType =
2300 "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"";
2301 pFlavorSeq[4].HumanPresentableName =
"Star Object Descriptor (XML)";
2304 pFlavorSeq[5].MimeType =
2305 "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"";
2306 pFlavorSeq[5].HumanPresentableName =
"Star Embed Source (XML)";
2309 pFlavorSeq[6].MimeType =
2310 "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"";
2311 pFlavorSeq[6].HumanPresentableName =
"Bitmap";
2314 pFlavorSeq[7].MimeType =
"image/png";
2315 pFlavorSeq[7].HumanPresentableName =
"PNG";
2318 if ( nSuppFlavors == 10 )
2320 pFlavorSeq[8].MimeType =
2321 "application/x-openoffice-emf;windows_formatname=\"Image EMF\"";
2322 pFlavorSeq[8].HumanPresentableName =
"Enhanced Windows MetaFile";
2325 pFlavorSeq[9].MimeType =
2326 "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
2327 pFlavorSeq[9].HumanPresentableName =
"Windows MetaFile";
2342 if ( aFlavor.MimeType ==
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2347 else if ( aFlavor.MimeType ==
"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2352 else if ( aFlavor.MimeType ==
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"" )
2356 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2360 else if ( aFlavor.MimeType ==
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )
2364 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2368 else if ( aFlavor.MimeType ==
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
2373 else if ( aFlavor.MimeType ==
"application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" )
2378 else if ( aFlavor.MimeType ==
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )
2383 else if ( aFlavor.MimeType ==
"image/png" )
2400 if ( !
m_pData->m_xEvents.is() )
2416 Reference< script::XStorageBasedLibraryContainer > xBasicLibraries;
2417 if (
m_pData->m_pObjectShell.is() )
2418 xBasicLibraries.set(
m_pData->m_pObjectShell->GetBasicContainer(), UNO_QUERY);
2419 return xBasicLibraries;
2426 Reference< script::XStorageBasedLibraryContainer > xDialogLibraries;
2427 if (
m_pData->m_pObjectShell.is() )
2428 xDialogLibraries.set(
m_pData->m_pObjectShell->GetDialogContainer(), UNO_QUERY);
2429 return xDialogLibraries;
2436 if (
m_pData->m_pObjectShell.is() )
2437 return m_pData->m_pObjectShell->AdjustMacroMode();
2449 Reference< document::XEmbeddedScripts > xDocumentScripts;
2453 Reference< frame::XModel > xDocument(
this );
2454 xDocumentScripts.set( xDocument, UNO_QUERY );
2455 while ( !xDocumentScripts.is() && xDocument.is() )
2457 Reference< container::XChild > xDocAsChild( xDocument, UNO_QUERY );
2458 if ( !xDocAsChild.is() )
2460 xDocument =
nullptr;
2464 xDocument.set( xDocAsChild->getParent(), UNO_QUERY );
2465 xDocumentScripts.set( xDocument, UNO_QUERY );
2471 xDocumentScripts =
nullptr;
2474 return xDocumentScripts;
2503 assert(xShape.is() &&
"no shape?");
2506 m_pData->maShapeListeners[xShape].push_back(xListener);
2517 auto it =
m_pData->maShapeListeners.find(xShape);
2518 if (it !=
m_pData->maShapeListeners.end())
2520 auto rVec = it->second;
2521 auto it2 = std::find(rVec.begin(), rVec.end(), xListener);
2522 if (it2 != rVec.end())
2526 m_pData->maShapeListeners.erase(it);
2550 throw lang::NoSupportException(
"SfxBaseModel controls all the sent notifications itself!" );
2556 return Sequence<document::CmisProperty>();
2557 return m_pData->m_cmisProperties;
2562 m_pData->m_cmisProperties = _cmisproperties;
2574 Reference<ucb::XCommandEnvironment>(),
2583 throw lang::WrappedTargetRuntimeException( e.Message,
2598 Reference<ucb::XCommandEnvironment>(),
2605 m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
2606 m_pData->m_pObjectShell->GetMedium( )->GetMedium_Impl( );
2608 Sequence< beans::PropertyValue > aSequence ;
2618 throw lang::WrappedTargetRuntimeException( e.Message,
2632 Reference<ucb::XCommandEnvironment>(),
2639 m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
2644 throw lang::WrappedTargetRuntimeException( e.Message,
2657 Sequence< beans::PropertyValue > aProps{
2667 pMedium =
m_pData->m_pObjectShell->GetMedium( );
2668 const OUString sNewName( pMedium->
GetName( ) );
2671 if (
sName != sNewName )
2674 Sequence< beans::PropertyValue > aSequence ;
2685 throw lang::WrappedTargetRuntimeException( e.Message,
2692 uno::Sequence<document::CmisVersion> aVersions;
2701 Reference<ucb::XCommandEnvironment>(),
2705 aResult >>= aVersions;
2710 throw lang::WrappedTargetRuntimeException( e.Message,
2719 bool bValue =
false;
2720 if (
m_pData->m_pObjectShell.is() )
2730 Reference < beans::XPropertySetInfo > xProps = aContent.
getProperties();
2731 if ( xProps->hasPropertyByName( rName ) )
2777 Reference < beans::XPropertySetInfo > xProps = aContent.
getProperties();
2778 static constexpr OUStringLiteral aCmisProps(
u"CmisProperties" );
2779 if ( xProps->hasPropertyByName( aCmisProps ) )
2781 Sequence< document::CmisProperty> aCmisProperties;
2786 catch (
const ucb::ContentCreationException &)
2789 catch (
const ucb::CommandAbortedException &)
2802 bool bSilent =
false;
2818 if (
m_pData->m_pObjectShell->GetMedium() != pMedium )
2821 OSL_FAIL(
"Document has rejected the medium?!");
2829 throw task::ErrorCodeIOException(
2830 "SfxBaseModel::handleLoadError: 0x" + nError.
toString(),
2831 Reference< XInterface >(), sal_uInt32(nError));
2843static void addTitle_Impl( Sequence < beans::PropertyValue >& rSeq,
const OUString& rTitle )
2845 auto [
begin,
end] = asNonConstRange(rSeq);
2846 auto pProp = std::find_if(
begin,
end,
2847 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"Title"; });
2850 pProp->Value <<= rTitle;
2854 sal_Int32
nCount = rSeq.getLength();
2855 rSeq.realloc(
nCount+1 );
2856 auto& el = rSeq.getArray()[
nCount];
2858 el.Value <<= rTitle;
2868 if ( &rBC !=
m_pData->m_pObjectShell.get() )
2871 if ( rHint.
GetId() == SfxHintId::DocChanged )
2882 if (
m_pData->m_xUIConfigurationManager.is()
2885 Reference< embed::XStorage > xConfigStorage;
2886 static constexpr OUStringLiteral aUIConfigFolderName(
u"Configurations2" );
2889 if ( !xConfigStorage.is() )
2892 if ( xConfigStorage.is() || !
m_pData->m_pObjectShell->GetStorage()->hasByName( aUIConfigFolderName ) )
2895 m_pData->m_xUIConfigurationManager->setStorage( xConfigStorage );
2899 OSL_FAIL(
"Unexpected scenario!" );
2911 m_pData->setModifiedForAutoSave(
false);
2917 m_pData->m_sURL =
m_pData->m_pObjectShell->GetMedium()->GetName();
2919 Sequence< beans::PropertyValue > aArgs;
2929 m_pData->setModifiedForAutoSave(
false);
2943 aSupplement <<= pPrintingHint->GetWhich();
2948 if ( rHint.
GetId() == SfxHintId::TitleChanged )
2953 else if ( rHint.
GetId() == SfxHintId::ModeChanged )
2968 lang::EventObject
aEvent(
static_cast<frame::XModel *
>(
const_cast<SfxBaseModel *
>(
this)) );
2982 if ( !
m_pData->m_pObjectShell.is() || !
m_pData->m_pObjectShell->IsEnableSetModified() )
3005 OSL_FAIL(
"SfxBaseModel::IsInitialized: this should have been caught earlier!" );
3009 return m_pData->m_pObjectShell->GetMedium() !=
nullptr;
3015 throw lang::DisposedException( OUString(), *
const_cast< SfxBaseModel*
>(
this ) );
3017 throw lang::NotInitializedException( OUString(), *
const_cast< SfxBaseModel*
>(
this ) );
3022 return (
m_pData ==
nullptr ) ;
3031 std::shared_ptr<const SfxFilter> pFilter;
3037 return pFilter->GetName();
3043 const Sequence< beans::PropertyValue >& seqArguments ,
3046 if( sURL.isEmpty() )
3047 throw frame::IllegalArgumentIOException();
3049 bool bSaved =
false;
3051 if ( !bSaveTo &&
m_pData->m_pObjectShell.is() && !sURL.isEmpty()
3052 && !sURL.startsWith(
"private:stream" )
3053 && ::utl::UCBContentHelper::EqualURLs(
getLocation(), sURL ) )
3057 static constexpr OUStringLiteral aFilterString(
u"FilterName" );
3059 if ( !aFilterName.isEmpty() )
3064 const std::shared_ptr<const SfxFilter>& pFilter = pMedium->
GetFilter();
3065 if ( pFilter && aFilterName == pFilter->GetFilterName() )
3068 bool bFormerPassword =
false;
3070 uno::Sequence< beans::NamedValue > aOldEncryptionData;
3073 bFormerPassword =
true;
3076 if ( !bFormerPassword )
3078 aArgHash.
erase( aFilterString );
3079 aArgHash.
erase(
"URL" );
3086 catch(
const lang::IllegalArgumentException& )
3088#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
3093 if (
m_pData->m_pObjectShell->IsDocShared() )
3095 uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.
getUnpackedValueOrDefault(
"EncryptionData", uno::Sequence< beans::NamedValue >() );
3096 if ( !aNewEncryptionData.hasElements() )
3101 uno::Sequence< beans::NamedValue > aOldEncryptionData;
3104 if ( !aOldEncryptionData.hasElements() && !aNewEncryptionData.hasElements() )
3120 if ( bSaved || !
m_pData->m_pObjectShell.is() )
3124 m_pData->m_pObjectShell.get() ) );
3127 OUString aPassword, aPasswordToModify;
3135 aArgHash.
erase(
"PasswordToModify");
3137 std::optional<SfxAllItemSet> pItemSet(
SfxGetpApp()->GetPool());
3142 if (!aFilterName.isEmpty() && (!aPassword.isEmpty() || !aPasswordToModify.isEmpty()))
3144 &*pItemSet, aPassword, aPasswordToModify,
false);
3150 if ( pCopyStreamItem && pCopyStreamItem->
GetValue() && !bSaveTo )
3152 throw frame::IllegalArgumentIOException(
3153 "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!" );
3156 sal_uInt32 nModifyPasswordHash = 0;
3157 Sequence< beans::PropertyValue > aModifyPasswordInfo;
3159 if ( pModifyPasswordInfoItem )
3163 sal_Int32 nMPHTmp = 0;
3164 pModifyPasswordInfoItem->
GetValue() >>= nMPHTmp;
3165 nModifyPasswordHash =
static_cast<sal_uInt32
>(nMPHTmp);
3166 pModifyPasswordInfoItem->
GetValue() >>= aModifyPasswordInfo;
3168 pItemSet->ClearItem(SID_MODIFYPASSWORDINFO);
3169 sal_uInt32 nOldModifyPasswordHash =
m_pData->m_pObjectShell->GetModifyPasswordHash();
3170 m_pData->m_pObjectShell->SetModifyPasswordHash( nModifyPasswordHash );
3171 Sequence< beans::PropertyValue > aOldModifyPasswordInfo =
m_pData->m_pObjectShell->GetModifyPasswordInfo();
3172 m_pData->m_pObjectShell->SetModifyPasswordInfo( aModifyPasswordInfo );
3177 bool bCopyTo = bSaveTo ||
3179 Reference<document::XDocumentProperties> xOldDocProps;
3183 const Reference<util::XCloneable> xCloneable(xOldDocProps,
3185 const Reference<document::XDocumentProperties> xNewDocProps(
3186 xCloneable->createClone(), UNO_QUERY_THROW);
3187 m_pData->m_xDocumentProperties = xNewDocProps;
3190 bool bRet =
m_pData->m_pObjectShell->APISaveAs_Impl(sURL, *pItemSet, seqArguments);
3195 m_pData->m_xDocumentProperties = xOldDocProps;
3198 Reference < task::XInteractionHandler > xHandler;
3206 if ( !bRet && !nErrCode )
3208 SAL_WARN(
"sfx.doc",
"Storing has failed, no error is set!");
3211 m_pData->m_pObjectShell->ResetError();
3218 if ( xHandler.is() )
3223 task::ErrorCodeRequest aErrorCode;
3224 aErrorCode.ErrCode = sal_uInt32(nErrCode);
3232 m_pData->m_pObjectShell->SetModifyPasswordEntered();
3238 m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
3239 m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
3246 m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
3247 m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
3251 m_pData->m_pObjectShell.get() ) );
3256 std::stringstream aErrCode;
3257 aErrCode << nErrCode;
3258 throw task::ErrorCodeIOException(
3259 "SfxBaseModel::impl_store <" + sURL +
"> failed: " + OUString::fromUtf8(aErrCode.str()),
3260 Reference< XInterface >(), sal_uInt32(nErrCode));
3266template<
typename ListenerT,
typename EventT >
3267class NotifySingleListenerIgnoreRE
3270 typedef void ( SAL_CALL ListenerT::*NotificationMethod )(
const EventT& );
3274 NotifySingleListenerIgnoreRE( NotificationMethod method,
const EventT& event ) :
m_pMethod( method ),
m_rEvent( event ) { }
3276 void operator()(
const Reference<ListenerT>& listener )
const
3280 (listener.get()->*
m_pMethod)( m_rEvent );
3297 std::shared_ptr<IMPL_SfxBaseModel_DataContainer> xKeepAlive(
m_pData);
3303 if (
aName.isEmpty())
3312 document::DocumentEvent aDocumentEvent(
static_cast<frame::XModel*
>(
this),
aName,
xController, supplement );
3314 pIC->
forEach< document::XDocumentEventListener, NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent > >(
3315 NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent >(
3316 &document::XDocumentEventListener::documentEventOccured,
3325 document::EventObject
aEvent(
static_cast<frame::XModel*
>(
this),
aName );
3327 pIC->
forEach< document::XEventListener, NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject > >(
3328 NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject >(
3329 &document::XEventListener::notifyEvent,
3339 if (
m_pData->m_pObjectShell.is() && !
m_pData->m_contViewData.is() )
3347 return Reference < container::XIndexAccess >();
3351 if ( !
m_pData->m_contViewData.is() )
3354 return Reference < container::XIndexAccess >();
3357 Reference < container::XIndexContainer > xCont(
m_pData->m_contViewData, UNO_QUERY );
3359 Sequence < beans::PropertyValue >
aSeq;
3363 bool bIsActive = ( pFrame == pActFrame );
3364 pFrame->GetViewShell()->WriteUserDataSequence(
aSeq );
3370 return m_pData->m_contViewData;
3406 if (
aEvent.EventName ==
"ShapeModified")
3408 uno::Reference<drawing::XShape> xShape(
aEvent.Source, uno::UNO_QUERY);
3411 auto it =
m_pData->maShapeListeners.find(xShape);
3412 if (it !=
m_pData->maShapeListeners.end())
3413 for (
auto const & rListenerUnoRef : it->second)
3414 rListenerUnoRef->notifyShapeEvent(
aEvent);
3424 || !
m_pData->maShapeListeners.empty());
3432 Reference < view::XPrintJobBroadcaster > xPJB(
m_pData->m_xPrintable, UNO_QUERY );
3434 xPJB->addPrintJobListener( xListener );
3442 Reference < view::XPrintJobBroadcaster > xPJB(
m_pData->m_xPrintable, UNO_QUERY );
3444 xPJB->removePrintJobListener( xListener );
3469 Reference< util::XModifiable > xModifiable( xStorage, UNO_QUERY );
3470 if ( xModifiable.is() )
3472 if ( !
m_pData->m_pStorageModifyListen.is() )
3478 xModifiable->addModifyListener(
m_pData->m_pStorageModifyListen );
3486 Reference< embed::XStorage > xResult;
3487 if (
m_pData->m_pObjectShell.is() )
3489 Reference< embed::XStorage > xStorage =
m_pData->m_pObjectShell->GetStorage();
3490 if ( xStorage.is() )
3494 xResult = xStorage->openStorageElement( aStorageName, nMode );
3509 Sequence< OUString > aResult;
3510 bool bSuccess =
false;
3511 if (
m_pData->m_pObjectShell.is() )
3513 Reference < embed::XStorage > xStorage =
m_pData->m_pObjectShell->GetStorage();
3514 if ( xStorage.is() )
3516 const Sequence< OUString > aTemp = xStorage->getElementNames();
3517 sal_Int32 nResultSize = 0;
3518 for (
const auto& rName : aTemp )
3520 if ( xStorage->isStorageElement( rName ) )
3522 aResult.realloc( ++nResultSize );
3523 aResult.getArray()[ nResultSize - 1 ] = rName;
3532 throw io::IOException();
3545 Reference< script::provider::XScriptProviderFactory > xScriptProviderFactory =
3546 script::provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
3548 Reference< XScriptInvocationContext > xScriptContext(
this );
3550 Reference< script::provider::XScriptProvider > xScriptProvider(
3551 xScriptProviderFactory->createScriptProvider(
Any( xScriptContext ) ),
3554 return xScriptProvider;
3563 OSL_ENSURE( !
m_pData->m_sRuntimeUID.isEmpty(),
3564 "SfxBaseModel::getRuntimeUID - ID is empty!" );
3565 return m_pData->m_sRuntimeUID;
3571 if (
m_pData->m_pObjectShell.is() )
3579 m_pData->m_xGrabBagItem->QueryValue(rVal);
3581 rVal <<= uno::Sequence<beans::PropertyValue>();
3587 m_pData->m_xGrabBagItem = std::make_shared<SfxGrabBagItem>();
3589 m_pData->m_xGrabBagItem->PutValue(rVal, 0);
3592static void GetCommandFromSequence( OUString& rCommand, sal_Int32& nIndex,
const Sequence< beans::PropertyValue >& rSeqPropValue )
3596 auto pPropValue = std::find_if(rSeqPropValue.begin(), rSeqPropValue.end(),
3597 [](
const beans::PropertyValue& rPropValue) { return rPropValue.Name ==
"Command"; });
3598 if (pPropValue != rSeqPropValue.end())
3600 pPropValue->Value >>= rCommand;
3601 nIndex =
static_cast<sal_Int32
>(std::distance(rSeqPropValue.begin(), pPropValue));
3611 Sequence< beans::PropertyValue > aSeqPropValue;
3613 for ( sal_Int32
i = 0;
i < rToolbarDefinition->getCount();
i++ )
3615 if ( rToolbarDefinition->getByIndex(
i ) >>= aSeqPropValue )
3630 rToolbarDefinition->replaceByIndex(
i,
Any( aSeqPropValue ));
3646 if ( !
m_pData->m_xUIConfigurationManager.is() )
3648 Reference< ui::XUIConfigurationManager2 > xNewUIConfMan =
3651 Reference< embed::XStorage > xConfigStorage;
3653 OUString aUIConfigFolderName(
"Configurations2" );
3656 if ( xConfigStorage.is() )
3658 static constexpr OUStringLiteral aMediaTypeProp(
u"MediaType" );
3659 OUString aMediaType;
3660 Reference< beans::XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
3661 Any a = xPropSet->getPropertyValue( aMediaTypeProp );
3662 if ( !(
a >>= aMediaType ) || aMediaType.isEmpty())
3664 xPropSet->setPropertyValue( aMediaTypeProp,
Any(OUString(
"application/vnd.sun.xml.ui.configuration")) );
3671 xNewUIConfMan->setStorage( xConfigStorage );
3680 Reference< embed::XStorage > xOOo1ConfigStorage =
getDocumentSubStorage(
"Configurations", embed::ElementModes::READ );
3681 if ( xOOo1ConfigStorage.is() )
3683 Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
3684 std::vector< Reference< container::XIndexContainer > > rToolbars;
3686 bool bImported = framework::UIConfigurationImporterOOo1x::ImportCustomToolbars(
3687 xNewUIConfMan, rToolbars, xContext, xOOo1ConfigStorage );
3692 for (
size_t i = 0;
i < rToolbars.size();
i++ )
3694 const OUString
sId(OUString::number(
i + 1 ));
3695 const OUString aCustomTbxName =
"private:resource/toolbar/custom_OOo1x_" +
sId;
3697 Reference< container::XIndexContainer > xToolbar = rToolbars[
i];
3699 if ( !xNewUIConfMan->hasSettings( aCustomTbxName ))
3702 Reference< beans::XPropertySet > xPropSet( xToolbar, UNO_QUERY );
3703 if ( xPropSet.is() )
3707 xPropSet->setPropertyValue(
"UIName",
Any(
"Toolbar " +
sId ) );
3709 catch ( beans::UnknownPropertyException& )
3714 xNewUIConfMan->insertSettings( aCustomTbxName, xToolbar );
3715 xNewUIConfMan->store();
3722 m_pData->m_xUIConfigurationManager = xNewUIConfMan;
3725 return m_pData->m_xUIConfigurationManager;
3736 if ( !
m_pData->m_pObjectShell.is() )
3737 throw Exception(
"no object shell",
nullptr);
3743 Size aWinSize = pWindow->GetSizePixel();
3745 Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height );
3749 pWindow->SetSizePixel( aWinSize );
3754 aTmpRect.
SetSize(
Size( aSize.Width, aSize.Height ) );
3755 m_pData->m_pObjectShell->SetVisArea( aTmpRect );
3763 if ( !
m_pData->m_pObjectShell.is() )
3764 throw Exception(
"no object shell",
nullptr);
3776 if ( !
m_pData->m_pObjectShell.is() )
3777 throw Exception(
"no object shell",
nullptr);
3786 datatransfer::DataFlavor aDataFlavor(
3787 "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"",
3791 embed::VisualRepresentation aVisualRepresentation;
3793 aVisualRepresentation.Flavor = aDataFlavor;
3795 return aVisualRepresentation;
3803 const Sequence< beans::PropertyValue >& aMediaDescriptor )
3807 throw frame::DoubleInitializationException( OUString(), *
this );
3822 bool bTemplate = pTemplateItem && pTemplateItem->
GetValue();
3824 m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage =
false;
3827 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
3831 throw task::ErrorCodeIOException(
3832 "SfxBaseModel::loadFromStorage: " + nError.
toString(),
3833 Reference< XInterface >(), sal_uInt32(nError));
3839 const Sequence< beans::PropertyValue >& aMediaDescriptor )
3843 if ( !
m_pData->m_pObjectShell.is() )
3844 throw io::IOException();
3846 auto xSet = std::make_shared<SfxAllItemSet>(
m_pData->m_pObjectShell->GetPool());
3855 if ( pFilter && pFilter->UsesStorage() )
3859 bool bSuccess =
false;
3860 if ( xStorage ==
m_pData->m_pObjectShell->GetStorage() )
3863 bSuccess =
m_pData->m_pObjectShell->DoSave();
3872 SfxMedium aMedium( xStorage, OUString(), xSet );
3877 bSuccess =
m_pData->m_pObjectShell->DoSaveObjectAs( aMedium,
true );
3878 m_pData->m_pObjectShell->DoSaveCompleted();
3883 m_pData->m_pObjectShell->ResetError();
3889 throw task::ErrorCodeIOException(
3890 "SfxBaseModel::storeToStorage: " + nError.
toString(),
3891 Reference< XInterface >(), sal_uInt32(nError));
3899 if ( !
m_pData->m_pObjectShell.is() )
3900 throw io::IOException();
3903 if ( xStorage !=
m_pData->m_pObjectShell->GetStorage() )
3905 if ( !
m_pData->m_pObjectShell->SwitchPersistence( xStorage ) )
3909 throw task::ErrorCodeIOException(
3910 "SfxBaseModel::switchToStorage: " + nError.
toString(),
3911 Reference< XInterface >(), sal_uInt32(nError));
3919 m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage =
false;
3926 if ( !
m_pData->m_pObjectShell.is() )
3927 throw io::IOException();
3929 return m_pData->m_pObjectShell->GetStorage();
3933 const Reference< document::XStorageChangeListener >& xListener )
3937 m_pData->m_aInterfaceContainer.addInterface(
3942 const Reference< document::XStorageChangeListener >& xListener )
3946 m_pData->m_aInterfaceContainer.removeInterface(
3952 if (
m_pData->m_xPrintable.is() )
3955 Reference < lang::XInitialization > xInit(
m_pData->m_xPrintable, UNO_QUERY );
3956 xInit->initialize( {
Any(Reference < frame::XModel > (
this)) } );
3957 Reference < view::XPrintJobBroadcaster > xBrd(
m_pData->m_xPrintable, UNO_QUERY );
3958 xBrd->addPrintJobListener(
new SfxPrintHelperListener_Impl(
m_pData.get() ) );
3974 if (!
m_pData->m_sModuleIdentifier.isEmpty())
3975 return m_pData->m_sModuleIdentifier;
3976 if (
m_pData->m_pObjectShell.is())
3977 return m_pData->m_pObjectShell->GetFactory().GetDocumentServiceName();
3986 if ( !
m_pData->m_xTitleHelper.is ())
3988 Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
3989 Reference< frame::XUntitledNumbers > xDesktop( frame::Desktop::create(xContext), UNO_QUERY_THROW);
3991 m_pData->m_xTitleHelper = new ::framework::TitleHelper(xContext, Reference< frame::XModel >(
this), xDesktop);
3994 return m_pData->m_xTitleHelper;
4002 if ( !
m_pData->m_xNumberedControllers.is ())
4005 m_pData->m_xNumberedControllers = pHelper;
4006 pHelper->setOwner (Reference< frame::XModel >(
this));
4007 pHelper->setUntitledPrefix (
" : ");
4010 return m_pData->m_xNumberedControllers;
4030 const Reference < beans::XPropertySetInfo > xProps
4034 static constexpr OUStringLiteral aServerTitle(
u"TitleOnServer" );
4035 if ( xProps->hasPropertyByName( aServerTitle ) )
4042 catch (
const ucb::ContentCreationException &)
4045 catch (
const ucb::CommandAbortedException &)
4049 if ( pRepairedDocItem && pRepairedDocItem->
GetValue() )
4050 aResult +=
SfxResId(STR_REPAIREDDOCUMENT);
4053 if (
m_pData->m_pObjectShell->IsReadOnlyUI() || (pMedium && pMedium->
IsReadOnly()) )
4055 else if (
m_pData->m_pObjectShell->IsDocShared() )
4059 aResult +=
SfxResId(RID_XMLSEC_DOCUMENTSIGNED);
4073 m_pData->m_bExternalTitle =
true;
4083 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), UNO_QUERY);
4084 if (xBroadcaster.is ())
4085 xBroadcaster->addTitleChangeListener (xListener);
4095 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), UNO_QUERY);
4096 if (xBroadcaster.is ())
4097 xBroadcaster->removeTitleChangeListener (xListener);
4139 sal_Int32 c =
m_pData->m_seqControllers.size();
4140 Sequence< Any > lEnum(c);
4141 std::transform(
m_pData->m_seqControllers.begin(),
m_pData->m_seqControllers.end(),
4142 lEnum.getArray(), [](
const auto&
x) { return css::uno::Any(x); });
4144 return new ::comphelper::OAnyEnumeration(lEnum);
4156 Sequence< OUString > aViewNames( nViewFactoryCount );
4157 auto aViewNamesRange = asNonConstRange(aViewNames);
4158 for ( sal_Int16 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
4202 OSL_PRECOND( !
m_aWeakFrame,
"ViewCreationGuard::takeFrameOwnership: already have a frame!" );
4203 OSL_PRECOND( i_pFrame !=
nullptr,
"ViewCreationGuard::takeFrameOwnership: invalid frame!" );
4232 #if OSL_DEBUG_LEVEL > 0
4238 if ( pCheckFrame->GetFrameInterface() == i_rFrame )
4240 if ( ( pCheckFrame->GetCurrentViewFrame() !=
nullptr )
4241 || ( pCheckFrame->GetCurrentDocument() != nullptr )
4248 OSL_FAIL(
"SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" );
4271 const OUString& i_rViewName,
const Sequence< PropertyValue >& i_rArguments,
const Reference< XFrame >& i_rFrame )
4275 if ( !i_rFrame.is() )
4276 throw lang::IllegalArgumentException( OUString(), *
this, 3 );
4280 if ( !pViewFactory )
4281 throw IllegalArgumentException( OUString(), *
this, 1 );
4284 Reference< XController > xPreviousController( i_rFrame->getController() );
4285 const Reference< XModel > xMe(
this );
4286 if ( ( xPreviousController.is() )
4287 && ( xMe != xPreviousController->getModel() )
4290 xPreviousController.clear();
4293 OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell !=
nullptr ),
4294 "SfxBaseModel::createViewController: invalid old controller!" );
4301 assert(pViewFrame &&
"SfxBaseModel::createViewController: no frame");
4307 ENSURE_OR_THROW( pViewShell,
"invalid view shell provided by factory" );
4322 ENSURE_OR_THROW( pBaseController,
"invalid controller implementation!" );
4327 if ( aDocumentLoadArgs.
getOrDefault(
"ViewOnly",
false ) )
4330 const sal_Int16 nPluginMode = aDocumentLoadArgs.
getOrDefault(
"PluginMode", sal_Int16( 0 ) );
4331 if ( nPluginMode == 1 )
4349 return pBaseController;
4356Reference< rdf::XRepository > SAL_CALL
4361 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4366 return xDMA->getRDFRepository();
4375 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4380 return xDMA->getStringValue();
4389 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4394 return xDMA->getNamespace();
4402 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4407 return xDMA->getLocalName();
4411Reference< rdf::XMetadatable > SAL_CALL
4413 const beans::StringPair & i_rReference)
4417 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4422 return xDMA->getElementByMetadataReference(i_rReference);
4425Reference< rdf::XMetadatable > SAL_CALL
4430 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4435 return xDMA->getElementByURI(i_xURI);
4438Sequence< Reference< rdf::XURI > > SAL_CALL
4440 const Reference<rdf::XURI> & i_xType)
4444 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4449 return xDMA->getMetadataGraphsWithType(i_xType);
4452Reference<rdf::XURI> SAL_CALL
4454 const Sequence < Reference< rdf::XURI > > & i_rTypes)
4458 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4463 return xDMA->addMetadataFile(i_rFileName, i_rTypes);
4466Reference<rdf::XURI> SAL_CALL
4468 const Reference< io::XInputStream > & i_xInStream,
4469 const OUString & i_rFileName,
4470 const Reference< rdf::XURI > & i_xBaseURI,
4471 const Sequence < Reference< rdf::XURI > > & i_rTypes)
4475 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4480 return xDMA->importMetadataFile(i_Format,
4481 i_xInStream, i_rFileName, i_xBaseURI, i_rTypes);
4486 const Reference< rdf::XURI > & i_xGraphName)
4490 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4495 return xDMA->removeMetadataFile(i_xGraphName);
4503 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4508 return xDMA->addContentOrStylesFile(i_rFileName);
4516 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4521 return xDMA->removeContentOrStylesFile(i_rFileName);
4526 Reference< embed::XStorage >
const & i_xStorage,
4527 Reference<rdf::XURI>
const & i_xBaseURI,
4528 Reference<task::XInteractionHandler>
const & i_xHandler)
4532 const Reference<rdf::XDocumentMetadataAccess> xDMA(
4533 m_pData->CreateDMAUninitialized());
4539 xDMA->loadMetadataFromStorage(i_xStorage, i_xBaseURI, i_xHandler);
4540 }
catch (lang::IllegalArgumentException &) {
4544 m_pData->m_xDocumentMetadata = xDMA;
4547 m_pData->m_xDocumentMetadata = xDMA;
4553 Reference< embed::XStorage >
const & i_xStorage)
4557 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4562 return xDMA->storeMetadataToStorage(i_xStorage);
4567 const Sequence< beans::PropertyValue > & i_rMedium)
4571 const Reference<rdf::XDocumentMetadataAccess> xDMA(
4572 m_pData->CreateDMAUninitialized());
4578 xDMA->loadMetadataFromMedium(i_rMedium);
4579 }
catch (lang::IllegalArgumentException &) {
4583 m_pData->m_xDocumentMetadata = xDMA;
4586 m_pData->m_xDocumentMetadata = xDMA;
4591 const Sequence< beans::PropertyValue > & i_rMedium)
4595 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4600 return xDMA->storeMetadataToMedium(i_rMedium);
PropertiesInfo aProperties
SfxApplication * SfxGetpApp()
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
void TransformParameters(sal_uInt16 nSlotId, const uno::Sequence< beans::PropertyValue > &rArgs, SfxAllItemSet &rSet, const SfxSlot *pSlot)
uno::Reference< script::XStarBasicAccess > getStarBasicAccess(BasicManager *pMgr)
const sal_uInt16 nVersion
static comphelper::SolarMutex & GetSolarMutex()
const OUString & GetValue() const
COMPHELPER_DLLPUBLIC OUString toString() const
static OUString GetEventName(GlobalEventId nID)
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
css::uno::Reference< css::task::XInteractionRequest > GetRequest() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
css::uno::Reference< css::task::XInteractionRequest > GetRequest() const
SfxFilterMatcher & GetFilterMatcher()
static SfxApplication * Get()
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
SAL_DLLPRIVATE void SetCreationArguments_Impl(const css::uno::Sequence< css::beans::PropertyValue > &i_rCreationArgs)
virtual void SAL_CALL print(const css::uno::Sequence< css::beans::PropertyValue > &seqOptions) override
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
virtual sal_Bool SAL_CALL canCheckOut() override
virtual void SAL_CALL storeMetadataToStorage(const css::uno::Reference< css::embed::XStorage > &i_xStorage) override
virtual void SAL_CALL removePrintJobListener(const css::uno::Reference< css::view::XPrintJobListener > &xListener) override
virtual css::uno::Sequence< css::document::CmisVersion > SAL_CALL getAllVersions() override
virtual OUString SAL_CALL getUntitledPrefix() override
virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override
virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
SAL_DLLPRIVATE OUString GetMediumFilterName_Impl() const
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage() override
virtual void SAL_CALL storeAsURL(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &seqArguments) override
virtual void SAL_CALL addCloseListener(const css::uno::Reference< css::util::XCloseListener > &xListener) override
css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2()
virtual void SAL_CALL addShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::document::XShapeEventListener > &xListener) override
virtual sal_Bool SAL_CALL attachResource(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual css::uno::Reference< css::document::XDocumentProperties > SAL_CALL getDocumentProperties() override
virtual void SAL_CALL recoverFromFile(const OUString &i_SourceLocation, const OUString &i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue > &i_MediaDescriptor) override
virtual void SAL_CALL addDialog(const OUString &LibraryName, const OUString &DialogName, const css::uno::Sequence< sal_Int8 > &Data) override
virtual void SAL_CALL addContentOrStylesFile(const OUString &i_rFileName) override
virtual void SAL_CALL setCmisProperties(const css::uno::Sequence< css::document::CmisProperty > &_cmisproperties) override
SfxBaseModel(SfxObjectShell *pObjectShell)
virtual void SAL_CALL loadMetadataFromMedium(const css::uno::Sequence< css::beans::PropertyValue > &i_rMedium) override
virtual void SAL_CALL close(sal_Bool bDeliverOwnership) override
virtual sal_Int64 SAL_CALL getModifiedStateDuration() override
virtual sal_Bool SAL_CALL canCheckIn() override
virtual void SAL_CALL removeContentOrStylesFile(const OUString &i_rFileName) override
virtual css::uno::Reference< css::rdf::XURI > SAL_CALL importMetadataFile(::sal_Int16 i_Format, const css::uno::Reference< css::io::XInputStream > &i_xInStream, const OUString &i_rFileName, const css::uno::Reference< css::rdf::XURI > &i_xBaseURI, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &i_rTypes) override
virtual void SAL_CALL store() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() override
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame > &Frame) override
void Notify(SfxBroadcaster &aBC, const SfxHint &aHint) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual void SAL_CALL storeToURL(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &seqArguments) override
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() override
virtual void SAL_CALL updateCmisProperties(const css::uno::Sequence< css::document::CmisProperty > &_cmisproperties) override
virtual OUString SAL_CALL getIdentifier() override
virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() override
virtual void SAL_CALL addTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
get information about supported interfaces @seealso XTypeProvider
void impl_getPrintHelper()
virtual void SAL_CALL connectController(const css::uno::Reference< css::frame::XController > &xController) override
bool IsInitialized() const
void notifyEvent(const css::document::EventObject &aEvent) const
calls all XEventListeners
virtual OUString SAL_CALL getLocalName() override
virtual OUString SAL_CALL getLocation() override
virtual sal_Bool SAL_CALL isReadonly() override
virtual void SAL_CALL setTitle(const OUString &sTitle) override
virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() override
SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper()
virtual ::sal_Int32 SAL_CALL leaseNumber(const css::uno::Reference< css::uno::XInterface > &xComponent) override
virtual void SAL_CALL cancelCheckOut() override
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
virtual sal_Bool SAL_CALL canCancelCheckOut() override
void getGrabBagItem(css::uno::Any &rVal) const
bool hasValidSignatures() const
SAL_DLLPRIVATE SfxViewFrame * FindOrCreateViewFrame_Impl(const css::uno::Reference< css::frame::XFrame > &i_rFrame, ::sfx::intern::ViewCreationGuard &i_rGuard) const
virtual void SAL_CALL unlockControllers() override
virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getLibraryContainer() override
SAL_DLLPRIVATE void impl_store(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &seqArguments, bool bSaveTo)
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames() override
virtual css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(const css::uno::Reference< css::rdf::XURI > &i_xType) override
virtual OUString SAL_CALL getNamespace() override
virtual void SAL_CALL storeSelf(const css::uno::Sequence< css::beans::PropertyValue > &seqArguments) override
SAL_DLLPRIVATE void postEvent_Impl(const OUString &aName, const css::uno::Reference< css::frame::XController2 > &xController=css::uno::Reference< css::frame::XController2 >(), const css::uno::Any &aSupplement=css::uno::Any())
virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation(::sal_Int64 nAspect) override
virtual void SAL_CALL releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface > &xComponent) override
virtual sal_Bool SAL_CALL getAllowMacroExecution() override
virtual void SAL_CALL removeMetadataFile(const css::uno::Reference< css::rdf::XURI > &i_xGraphName) override
virtual void SAL_CALL setCurrentController(const css::uno::Reference< css::frame::XController > &xController) override
virtual sal_Bool SAL_CALL isSetModifiedEnabled() override
virtual void SAL_CALL notifyDocumentEvent(const OUString &EventName, const css::uno::Reference< css::frame::XController2 > &ViewController, const css::uno::Any &Supplement) override
virtual OUString SAL_CALL getTitle() override
virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual void SAL_CALL setModified(sal_Bool bModified) override
virtual sal_Bool SAL_CALL hasLocation() override
virtual sal_Bool SAL_CALL enableSetModified() override
virtual void SAL_CALL addModule(const OUString &LibraryName, const OUString &ModuleName, const OUString &Language, const OUString &Source) override
virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL getElementByURI(const css::uno::Reference< css::rdf::XURI > &i_xURI) override
SAL_DLLPRIVATE SfxMedium * handleLoadError(ErrCode nError, SfxMedium *pMedium)
virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage(const OUString &aStorageName, sal_Int32 nMode) override
SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper()
virtual css::awt::Size SAL_CALL getVisualAreaSize(sal_Int64 nAspect) override
SAL_DLLPRIVATE void ListenForStorage_Impl(const css::uno::Reference< css::embed::XStorage > &xStorage)
virtual void SAL_CALL setVisualAreaSize(sal_Int64 nAspect, const css::awt::Size &aSize) override
virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL getElementByMetadataReference(const css::beans::StringPair &i_rReference) override
std::shared_ptr< IMPL_SfxBaseModel_DataContainer > m_pData
virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL getUndoManager() override
virtual void SAL_CALL loadFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const
virtual void SAL_CALL load(const css::uno::Sequence< css::beans::PropertyValue > &seqArguments) override
virtual OUString SAL_CALL getURL() override
virtual void SAL_CALL checkIn(sal_Bool bIsMajor, const OUString &rMessage) override
virtual sal_Bool SAL_CALL isVersionable() override
virtual void SAL_CALL addDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener) override
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &aFlavor) override
virtual sal_Bool SAL_CALL disableSetModified() override
virtual void SAL_CALL releaseNumber(::sal_Int32 nNumber) override
virtual ~SfxBaseModel() override
virtual void SAL_CALL addStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
virtual void SAL_CALL loadMetadataFromStorage(const css::uno::Reference< css::embed::XStorage > &i_xStorage, const css::uno::Reference< css::rdf::XURI > &i_xBaseURI, const css::uno::Reference< css::task::XInteractionHandler > &i_xHandler) override
void MethodEntryCheck(const bool i_mustBeInitialized) const
const bool m_bSupportEmbeddedScripts
virtual void SAL_CALL disconnectController(const css::uno::Reference< css::frame::XController > &xController) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual OUString SAL_CALL getStringValue() override
virtual void SAL_CALL removeDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener) override
virtual void SAL_CALL createLibrary(const OUString &LibName, const OUString &Password, const OUString &ExternalSourceURL, const OUString &LinkTargetURL) override
virtual css::uno::Sequence< css::document::CmisProperty > SAL_CALL getCmisProperties() override
virtual void SAL_CALL setIdentifier(const OUString &sIdentifier) override
bool getBoolPropertyValue(const OUString &rName)
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &xParent) override
void SAL_CALL setViewData(const css::uno::Reference< css::container::XIndexAccess > &aData) override
virtual sal_Bool SAL_CALL hasControllersLocked() override
SfxObjectShell * GetObjectShell() const
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs2(const css::uno::Sequence< OUString > &requestedArgs) override
virtual void SAL_CALL addPrintJobListener(const css::uno::Reference< css::view::XPrintJobListener > &xListener) override
virtual css::uno::Reference< css::rdf::XRepository > SAL_CALL getRDFRepository() override
virtual void SAL_CALL switchToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage) override
virtual css::uno::Reference< css::rdf::XURI > SAL_CALL addMetadataFile(const OUString &i_rFileName, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &i_rTypes) override
virtual void SAL_CALL storeMetadataToMedium(const css::uno::Sequence< css::beans::PropertyValue > &i_rMedium) override
virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const OUString &ViewName, const css::uno::Sequence< css::beans::PropertyValue > &Arguments, const css::uno::Reference< css::frame::XFrame > &Frame) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() override
OUString const & getRuntimeUID() const
SAL_DLLPRIVATE void loadCmisProperties()
virtual void SAL_CALL storeToRecoveryFile(const OUString &i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue > &i_MediaDescriptor) override
virtual void SAL_CALL dispose() override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
virtual void SAL_CALL removeShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::document::XShapeEventListener > &xListener) override
virtual void SAL_CALL checkOut() override
virtual void SAL_CALL lockControllers() override
virtual void SAL_CALL setPrinter(const css::uno::Sequence< css::beans::PropertyValue > &seqPrinter) override
virtual sal_Bool SAL_CALL isModified() override
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
virtual void SAL_CALL setArgs(const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers() override
void setGrabBagItem(const css::uno::Any &rVal)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
give answer, if interface is supported @descr The interfaces are searched by type.
virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() override
virtual void SAL_CALL removeCloseListener(const css::uno::Reference< css::util::XCloseListener > &xListener) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
get implementation id @descr This ID is necessary for UNO-caching.
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &aFlavor) override
SAL_DLLPRIVATE bool impl_isDisposed() const
virtual void SAL_CALL removeStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override
const bool m_bSupportDocRecovery
bool hasEventListeners() const
returns true if someone added a XEventListener to this XEventBroadcaster
css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData() override
virtual sal_Int32 SAL_CALL getMapUnit(sal_Int64 nAspect) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL initNew() override
virtual void SAL_CALL removeTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
void HidePopups(bool bHide=true)
void Broadcast(const SfxHint &rHint)
void SetDisableFlags(SfxDisableFlags nFlags)
const OUString & GetEventName() const
SfxEventHintId GetEventId() const
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
static SfxFrame * Create(const css::uno::Reference< css::frame::XFrame > &xFrame)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SAL_DLLPRIVATE void PrepareForDoc_Impl(const SfxObjectShell &i_rDoc)
SAL_DLLPRIVATE void SetMenuBarOn_Impl(bool bOn)
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl() const
static SAL_WARN_UNUSED_RESULT SfxFrame * GetNext(SfxFrame &)
static SAL_WARN_UNUSED_RESULT SfxFrame * GetFirst()
vcl::Window & GetWindow() 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 StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
const std::shared_ptr< const SfxFilter > & GetFilter() const
const INetURLObject & GetURLObject() const
void UseInteractionHandler(bool)
SfxItemSet & GetItemSet() const
SAL_DLLPRIVATE void SetUpdatePickList(bool)
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
const OUString & GetName() const
void SetWarningError(ErrCode nWarningError)
static bool CallApproveHandler(const css::uno::Reference< css::task::XInteractionHandler > &xHandler, const css::uno::Any &rRequest, bool bAllowAbort)
void SetFilter(const std::shared_ptr< const SfxFilter > &pFilter)
Does not take ownership of pFlt but pFlt needs to be around as long as the SfxMedium instance.
css::uno::Reference< css::task::XInteractionHandler > GetInteractionHandler(bool bGetAlways=false)
virtual ~SfxModelSubComponent()
SfxSlotPool * GetSlotPool() const
SfxModule * GetModule() const
SfxFilterContainer * GetFilterContainer() const
SfxViewFactory * GetViewFactoryByViewName(std::u16string_view i_rViewName) const
returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical nam...
SfxViewFactory & GetViewFactory(sal_uInt16 i=0) const
sal_uInt16 GetViewFactoryCount() const
SAL_DLLPRIVATE void BreakMacroSign_Impl(bool bBreakMacroSing)
MapUnit GetMapUnit() const
BasicManager * GetBasicManager() const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
virtual SfxObjectFactory & GetFactory() const =0
SfxMedium * GetMedium() const
static SAL_DLLPRIVATE bool UseInteractionToHandleError(const css::uno::Reference< css::task::XInteractionHandler > &xHandler, ErrCode nError)
void SetMacroCallsSeenWhileLoading()
SfxItemPool & GetPool() const
Each Subclass of SfxShell must reference a pool.
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
const SfxSlot * GetSlot(sal_uInt16 nId) const
SFX2_DLLPUBLIC OUString GetCommand() const
const css::uno::Any & GetValue() const
const css::uno::Reference< css::frame::XController2 > & GetController() const
SfxViewShell * CreateInstance(SfxViewFrame &rViewFrame, SfxViewShell *pOldSh)
OUString GetAPIViewName() const
returns an API-compatible view name.
SfxInterfaceId GetOrdinal() const
SAL_DLLPRIVATE const SvBorder & GetBorderPixelImpl() const
SAL_DLLPRIVATE void UpdateDocument_Impl()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
vcl::Window & GetWindow() const
SAL_DLLPRIVATE void SetViewShell_Impl(SfxViewShell *pVSh)
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Get(const css::uno::Reference< css::frame::XController > &i_rController, const SfxObjectShell *i_pDoc)
SAL_DLLPRIVATE void ForceOuterResize_Impl()
SAL_DLLPRIVATE void SetCurViewId_Impl(const SfxInterfaceId i_nID)
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
css::uno::Reference< css::frame::XController > GetController() const
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
Invokes the registered callback, if there are any.
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
SAL_DLLPRIVATE SfxBaseController * GetBaseController_Impl() const
void SetController(SfxBaseController *pController)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
vcl::Window * GetWindow() const
void MakeVisible_Impl(bool)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
virtual sal_uInt64 TellEnd() override
void SetVersion(sal_Int32 n)
SvStream & Write(const GDIMetaFile &rMetaFile)
static sal_Int32 VCL2UnoEmbedMapUnit(MapUnit nVCLMapUnit)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
bool has(const OUString &_rValueName) const
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
void forEach(FuncT const &func)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
css::uno::XInterface * next()
bool hasMoreElements() const
static css::uno::Sequence< css::beans::NamedValue > CreatePackageEncryptionData(std::u16string_view aPassword)
iterator erase(iterator it)
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
css::uno::Sequence< css::beans::PropertyValue > getAsConstPropertyValueList() const
css::uno::Type const & get()
callback for the DocumentStorageModifyListener class
a class which, in its dtor, cleans up various objects (well, at the moment only the frame) collected ...
void takeFrameOwnership(SfxFrame *i_pFrame)
SfxFrameWeakRef m_aWeakFrame
css::uno::Any getPropertyValue(const OUString &rPropertyName)
css::uno::Reference< css::beans::XPropertySetInfo > getProperties()
css::uno::Any executeCommand(const OUString &rCommandName, const css::uno::Any &rCommandArgument)
void EnableKillingFile(bool bEnable=true)
SvStream * GetStream(StreamMode eMode)
OUString const & GetURL() const
Point LogicToPixel(const Point &rLogicPt) const
void Disable(bool bChild=true)
void Enable(bool bEnable=true, bool bChild=true)
void SetBorderStyle(WindowBorderStyle nBorderStyle)
#define DBG_ASSERT(sCon, aError)
const ContainerEvent & m_rEvent
ContainerApprovalMethod m_pMethod
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
Reference< frame::XModel > m_xModel
#define ERRCODE_IO_CANTREAD
#define ERRCODE_IO_CANTCREATE
#define ERRCODE_IO_GENERAL
#define ERRCODE_IO_BROKENPACKAGE
#define ERRCODE_IO_CANTWRITE
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
sal_Int64 getSomething_cast(void *p)
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Any SAL_CALL getCaughtException()
std::u16string_view getTitle(std::u16string_view aPath)
std::shared_ptr< T > make_shared(Args &&... args)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
enumrange< T >::Iterator begin(enumrange< T >)
ErrCode SetPassword(const std::shared_ptr< const SfxFilter > &pCurrentFilter, SfxItemSet *pSet, const OUString &rPasswordToOpen, std::u16string_view rPasswordToModify, bool bAllowPasswordReset)
UNOTOOLS_DLLPUBLIC css::uno::Reference< css::ucb::XCommandEnvironment > getDefaultCommandEnvironment()
auto syncExecute(FuncT const &func) -> decltype(func())
#define SFX_GLOBAL_CLASSID
bool GetEncryptionData_Impl(const SfxItemSet *pSet, uno::Sequence< beans::NamedValue > &o_rEncryptionData)
static void GetCommandFromSequence(OUString &rCommand, sal_Int32 &nIndex, const Sequence< beans::PropertyValue > &rSeqPropValue)
static void addTitle_Impl(Sequence< beans::PropertyValue > &rSeq, const OUString &rTitle)
static void ConvertSlotsToCommands(SfxObjectShell const *pDoc, Reference< container::XIndexContainer > const &rToolbarDefinition)
#define ERRCTX_SFX_SAVEASDOC
#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE
OUString SfxResId(TranslateId aId)
std::vector< Reference< frame::XController > > m_seqControllers
OUString m_sModuleIdentifier
OUString m_aPreusedFilterName
Reference< ui::XUIConfigurationManager2 > m_xUIConfigurationManager
Reference< container::XIndexAccess > m_contViewData
::rtl::Reference< ::sfx2::DocumentUndoManager > m_pDocumentUndoManager
Reference< rdf::XDocumentMetadataAccess > CreateDMAUninitialized()
static sal_Int64 g_nInstanceCounter
Reference< container::XNameReplace > m_xEvents
virtual ~IMPL_SfxBaseModel_DataContainer()
Reference< rdf::XDocumentMetadataAccess > m_xDocumentMetadata
void setModifiedForAutoSave(bool val)
Reference< frame::XController > m_xCurrent
Reference< XInterface > m_xParent
std::optional< std::chrono::steady_clock::time_point > m_oDirtyTimestamp
Reference< view::XPrintable > m_xPrintable
Sequence< beans::PropertyValue > m_seqArguments
Reference< frame::XTitle > m_xTitleHelper
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListen
SfxObjectShellRef m_pObjectShell
IMPL_SfxBaseModel_DataContainer(::osl::Mutex &rMutex, SfxObjectShell *pObjectShell)
Reference< document::XDocumentProperties > m_xDocumentProperties
Reference< script::XStarBasicAccess > m_xStarBasicAccess
Reference< frame::XUntitledNumbers > m_xNumberedControllers
Sequence< document::CmisProperty > m_cmisProperties
comphelper::OMultiTypeInterfaceContainerHelper2 m_aInterfaceContainer
std::unordered_map< css::uno::Reference< css::drawing::XShape >, std::vector< css::uno::Reference< css::document::XShapeEventListener > > > maShapeListeners
virtual void storageIsModified() override
indicates the root or a sub storage of the document has been modified
void impl_setDocumentProperties(const Reference< document::XDocumentProperties > &)
std::shared_ptr< SfxGrabBagItem > m_xGrabBagItem
Reference< rdf::XDocumentMetadataAccess > GetDMA()
sal_uInt16 m_nControllerLockCount
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
SvStream & WriteTransferableObjectDescriptor(SvStream &rOStm, const TransferableObjectDescriptor &rObjDesc)