24#include <config_features.h>
28#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
29#include <com/sun/star/task/XInteractionHandler.hpp>
30#include <com/sun/star/task/ErrorCodeIOException.hpp>
31#include <com/sun/star/task/ErrorCodeRequest.hpp>
32#include <com/sun/star/view/XSelectionSupplier.hpp>
33#include <com/sun/star/view/XPrintJobListener.hpp>
34#include <com/sun/star/lang/DisposedException.hpp>
35#include <com/sun/star/lang/IllegalArgumentException.hpp>
36#include <com/sun/star/lang/NoSupportException.hpp>
37#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
38#include <com/sun/star/lang/NotInitializedException.hpp>
39#include <com/sun/star/frame/Desktop.hpp>
40#include <com/sun/star/frame/IllegalArgumentIOException.hpp>
41#include <com/sun/star/frame/XUntitledNumbers.hpp>
42#include <com/sun/star/frame/DoubleInitializationException.hpp>
43#include <com/sun/star/embed/XStorage.hpp>
44#include <com/sun/star/document/XStorageChangeListener.hpp>
45#include <com/sun/star/beans/XPropertySet.hpp>
46#include <com/sun/star/beans/XPropertySetInfo.hpp>
47#include <com/sun/star/container/XIndexContainer.hpp>
48#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
49#include <com/sun/star/script/provider/XScriptProvider.hpp>
50#include <com/sun/star/ui/UIConfigurationManager.hpp>
51#include <com/sun/star/embed/ElementModes.hpp>
52#include <com/sun/star/embed/Aspects.hpp>
53#include <com/sun/star/document/DocumentProperties.hpp>
54#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
55#include <com/sun/star/ucb/XCommandEnvironment.hpp>
56#include <com/sun/star/ucb/ContentCreationException.hpp>
57#include <com/sun/star/ucb/CommandAbortedException.hpp>
58#include <com/sun/star/util/XCloneable.hpp>
59#include <com/sun/star/util/InvalidStateException.hpp>
60#include <com/sun/star/util/CloseVetoException.hpp>
84#include <osl/mutex.hxx>
118#include <sfx2/sfxsids.hrc>
119#include <sfx2/strings.hrc>
136#include <LibreOfficeKit/LibreOfficeKitEnums.h>
143using ::com::sun::star::beans::PropertyValue;
144using ::com::sun::star::document::CmisProperty;
145using ::com::sun::star::frame::XFrame;
146using ::com::sun::star::frame::XController;
147using ::com::sun::star::frame::XController2;
148using ::com::sun::star::lang::IllegalArgumentException;
149using ::com::sun::star::io::IOException;
150using ::com::sun::star::uno::Sequence;
151using ::com::sun::star::document::XDocumentRecovery;
152using ::com::sun::star::document::XUndoManager;
153using ::com::sun::star::document::XUndoAction;
154using ::com::sun::star::frame::XModel;
161class SfxDocInfoListener_Impl :
public ::cppu::WeakImplHelper<
162 util::XModifyListener >
172 virtual void SAL_CALL disposing(
const lang::EventObject& )
override;
173 virtual void SAL_CALL modified(
const lang::EventObject& )
override;
178void SAL_CALL SfxDocInfoListener_Impl::modified(
const lang::EventObject& )
183 m_rShell.FlushDocInfo();
186void SAL_CALL SfxDocInfoListener_Impl::disposing(
const lang::EventObject& )
203 std::unordered_map<css::uno::Reference< css::drawing::XShape >,
262 const Reference< document::XDocumentProperties >& );
264 Reference<rdf::XDocumentMetadataAccess>
GetDMA()
274 const Reference<XComponentContext> xContext(
275 ::comphelper::getProcessComponentContext());
276 const Reference<frame::XModel>
xModel(
278 const Reference<lang::XMultiComponentFactory> xMsf(
279 xContext->getServiceManager());
281 XTransientDocumentsDocumentContentFactory> xTDDCF(
282 xMsf->createInstanceWithContext(
283 "com.sun.star.frame.TransientDocumentsDocumentContentFactory",
286 const Reference<ucb::XContent> xContent(
287 xTDDCF->createDocumentContent(
xModel) );
288 OSL_ENSURE(xContent.is(),
"GetDMA: cannot create DocumentContent");
293 OUString uri = xContent->getIdentifier()->getContentIdentifier();
294 OSL_ENSURE(!uri.isEmpty(),
"GetDMA: empty uri?");
295 if (!uri.isEmpty() && !uri.endsWith(
"/"))
309 ? new ::sfx2::DocumentMetadataAccess(
321class SfxPrintHelperListener_Impl :
public ::cppu::WeakImplHelper< view::XPrintJobListener >
329 virtual void SAL_CALL disposing(
const lang::EventObject& aEvent )
override ;
330 virtual void SAL_CALL printJobEvent(
const view::PrintJobEvent& rEvent )
override;
335void SAL_CALL SfxPrintHelperListener_Impl::disposing(
const lang::EventObject& )
337 m_pData->m_xPrintable =
nullptr;
340void SAL_CALL SfxPrintHelperListener_Impl::printJobEvent(
const view::PrintJobEvent& rEvent )
343 if ( pContainer!=
nullptr )
346 while (pIterator.hasMoreElements())
347 static_cast<view::XPrintJobListener*
>(pIterator.next())->printJobEvent( rEvent );
355class SfxOwnFramesLocker
357 Sequence< Reference< frame::XFrame > > m_aLockedFrames;
359 static vcl::Window* GetVCLWindow(
const Reference< frame::XFrame >& xFrame );
361 explicit SfxOwnFramesLocker(
SfxObjectShell const * ObjechShell );
362 ~SfxOwnFramesLocker();
367SfxOwnFramesLocker::SfxOwnFramesLocker(
SfxObjectShell const * pObjectShell )
377 SfxFrame& rSfxFrame = pFrame->GetFrame();
392 sal_Int32 nLen = m_aLockedFrames.getLength();
393 m_aLockedFrames.realloc( nLen + 1 );
394 m_aLockedFrames.getArray()[nLen] =
xFrame;
405 OSL_FAIL(
"Not possible to lock the frame window!" );
410SfxOwnFramesLocker::~SfxOwnFramesLocker()
412 for (
auto& rFrame : asNonConstRange(m_aLockedFrames) )
430 OSL_FAIL(
"Can't unlock the frame window!" );
435vcl::Window* SfxOwnFramesLocker::GetVCLWindow(
const Reference< frame::XFrame >& xFrame )
441 Reference< awt::XWindow > xWindow =
xFrame->getContainerWindow();
455 Reference< frame::XModel >
m_xModel;
457 std::unique_ptr<SfxOwnFramesLocker> m_pFramesLock;
459 SfxSaveGuard(SfxSaveGuard
const &) =
delete;
460 void operator =(
const SfxSaveGuard&) =
delete;
463 SfxSaveGuard(
const Reference< frame::XModel >& xModel ,
470SfxSaveGuard::SfxSaveGuard(
const Reference< frame::XModel >& xModel ,
476 throw lang::DisposedException(
"Object already disposed.");
479 m_pFramesLock.reset(
new SfxOwnFramesLocker(
m_pData->m_pObjectShell.get() ));
482SfxSaveGuard::~SfxSaveGuard()
484 m_pFramesLock.reset();
502 Reference< util::XCloseable > xClose(m_xModel, UNO_QUERY);
506 catch(
const util::CloseVetoException&)
513, m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->Get_Impl() && !pObjectShell->Get_Impl()->m_bNoBasicCapabilities )
514, m_bSupportDocRecovery( pObjectShell && pObjectShell->Get_Impl() && pObjectShell->Get_Impl()->m_bDocRecoverySupport )
516 if ( pObjectShell !=
nullptr )
535 return SfxBaseModel_Base::queryInterface( rType );
544 void lcl_stripType( Sequence< uno::Type >& io_rTypes,
const uno::Type& i_rTypeToStrip )
546 Sequence< uno::Type > aStrippedTypes( io_rTypes.getLength() - 1 );
547 ::std::remove_copy_if(
548 std::cbegin(io_rTypes),
549 std::cend(io_rTypes),
550 aStrippedTypes.getArray(),
551 [&i_rTypeToStrip](
const uno::Type& aType) { return aType == i_rTypeToStrip; }
553 io_rTypes = aStrippedTypes;
559 Sequence< uno::Type >
aTypes( SfxBaseModel_Base::getTypes() );
576 return css::uno::Sequence<sal_Int8>();
582#if HAVE_FEATURE_SCRIPTING
584static Reference< script::XStarBasicAccess > implGetStarBasicAccess(
SfxObjectShell const * pObjectShell )
586 Reference< script::XStarBasicAccess > xRet;
588#if !HAVE_FEATURE_SCRIPTING
604#if !HAVE_FEATURE_SCRIPTING
605 Reference< container::XNameContainer > dummy;
611 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
612 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
613 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
615 Reference< container::XNameContainer > xRet;
617 xRet = rxAccess->getLibraryContainer();
626 const OUString& ExternalSourceURL,
const OUString& LinkTargetURL )
628#if !HAVE_FEATURE_SCRIPTING
631 (void) ExternalSourceURL;
632 (void) LinkTargetURL;
636 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
637 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
638 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
641 rxAccess->createLibrary( LibName,
Password, ExternalSourceURL, LinkTargetURL );
649 const OUString& Language,
const OUString& Source )
651#if !HAVE_FEATURE_SCRIPTING
659 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
660 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
661 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
664 rxAccess->addModule( LibraryName, ModuleName, Language,
Source );
674#if !HAVE_FEATURE_SCRIPTING
681 Reference< script::XStarBasicAccess >& rxAccess =
m_pData->m_xStarBasicAccess;
682 if( !rxAccess.is() &&
m_pData->m_pObjectShell.is() )
683 rxAccess = implGetStarBasicAccess(
m_pData->m_pObjectShell.get() );
686 rxAccess->addDialog( LibraryName, DialogName,
Data );
727 catch ( util::CloseVetoException& )
738 if (
m_pData->m_pStorageModifyListen.is() )
740 m_pData->m_pStorageModifyListen->dispose();
741 m_pData->m_pStorageModifyListen =
nullptr;
744 if (
m_pData->m_pDocumentUndoManager.is() )
746 m_pData->m_pDocumentUndoManager->disposing();
747 m_pData->m_pDocumentUndoManager =
nullptr;
750 lang::EventObject
aEvent(
static_cast<frame::XModel *
>(
this) );
753 m_pData->m_xDocumentProperties.clear();
755 m_pData->m_xDocumentMetadata.clear();
757 if (
m_pData->m_pObjectShell.is() )
763 m_pData->m_seqControllers.clear();
793 const Reference< document::XDocumentProperties >& rxNewDocProps)
798 Reference<util::XModifyBroadcaster>
const xMB(
800 xMB->addModifyListener(
new SfxDocInfoListener_Impl(*
m_pObjectShell));
805Reference< document::XDocumentProperties > SAL_CALL
809 if ( !
m_pData->m_xDocumentProperties.is() )
811 Reference< document::XDocumentProperties > xDocProps(
812 document::DocumentProperties::create( ::comphelper::getProcessComponentContext() ) );
813 m_pData->impl_setDocumentProperties(xDocProps);
816 return m_pData->m_xDocumentProperties;
829 Reference< util::XModifyListener > xMod( aObject.Source, UNO_QUERY );
830 Reference< lang::XEventListener > xListener( aObject.Source, UNO_QUERY );
831 Reference< document::XEventListener > xDocListener( aObject.Source, UNO_QUERY );
835 else if ( xListener.is() )
837 else if ( xDocListener.is() )
846 const Sequence< beans::PropertyValue >& rArgs )
849 if ( rURL.isEmpty() && rArgs.getLength() == 1 && rArgs[0].Name ==
"SetEmbedded" )
853 if (
m_pData->m_pObjectShell.is() && !
m_pData->m_pObjectShell->GetMedium() )
856 if ( ( rArgs[0].
Value >>= bEmb ) && bEmb )
863 if (
m_pData->m_pObjectShell.is() )
869 Sequence< sal_Int32 > aWinExtent;
870 for (
const beans::PropertyValue & rProp : rArgs)
872 if (rProp.Name ==
"WinExtent" && (rProp.Value >>= aWinExtent) && ( aWinExtent.getLength() == 4 ) )
874 tools::Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] );
878 bool bBreakMacroSign =
false;
879 if ( rProp.Name ==
"BreakMacroSignature" && (rProp.Value >>= bBreakMacroSign) )
883 bool bMacroEventRead =
false;
884 if ( rProp.Name ==
"MacroEventRead" && (rProp.Value >>= bMacroEventRead) && bMacroEventRead)
889 Sequence<beans::PropertyValue> aStrippedArgs(rArgs.getLength());
890 beans::PropertyValue* pStripped = aStrippedArgs.getArray();
891 for (
const beans::PropertyValue & rProp : rArgs)
893 if (rProp.Name ==
"WinExtent"
894 || rProp.Name ==
"BreakMacroSignature"
895 || rProp.Name ==
"MacroEventRead"
896 || rProp.Name ==
"Stream"
897 || rProp.Name ==
"InputStream"
898 || rProp.Name ==
"URL"
899 || rProp.Name ==
"Frame"
900 || rProp.Name ==
"Password"
901 || rProp.Name ==
"EncryptionData")
903 *pStripped++ = rProp;
905 aStrippedArgs.realloc(pStripped - aStrippedArgs.getArray());
909 m_pData->m_seqArguments = aStrippedArgs;
966 SAL_WARN(
"sfx.appl",
"Unexpected operations on model");
967 return m_pData->m_seqArguments;
970 std::set<std::u16string_view> requestedArgs;
971 for (OUString
const & s : requestedArgsSeq)
972 requestedArgs.insert(s);
974 if (
m_pData->m_pObjectShell.is() )
976 Sequence< beans::PropertyValue > seqArgsNew;
977 Sequence< beans::PropertyValue > seqArgsOld;
988 sal_Int32 nNewLength = seqArgsNew.getLength();
990 if (requestedArgs.empty() || requestedArgs.count(
u"WinExtent"))
998 Sequence< sal_Int32 > aRectSeq
1000 o3tl::narrowing<int>(aTmpRect.
Left()),
1001 o3tl::narrowing<int>(aTmpRect.
Top()),
1006 seqArgsNew.realloc( ++nNewLength );
1007 auto pseqArgsNew = seqArgsNew.getArray();
1008 pseqArgsNew[ nNewLength - 1 ].Name =
"WinExtent";
1009 pseqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq;
1012 if (requestedArgs.empty() || requestedArgs.count(
u"PreusedFilterName"))
1014 if ( !
m_pData->m_aPreusedFilterName.isEmpty() )
1016 seqArgsNew.realloc( ++nNewLength );
1017 auto pseqArgsNew = seqArgsNew.getArray();
1018 pseqArgsNew[ nNewLength - 1 ].Name =
"PreusedFilterName";
1019 pseqArgsNew[ nNewLength - 1 ].Value <<=
m_pData->m_aPreusedFilterName;
1023 if (requestedArgs.empty() || requestedArgs.count(
u"DocumentBorder"))
1030 Sequence< sal_Int32 > aBorderSeq
1032 o3tl::narrowing<int>(aBorder.
Left()),
1033 o3tl::narrowing<int>(aBorder.
Top()),
1034 o3tl::narrowing<int>(aBorder.
Right()),
1035 o3tl::narrowing<int>(aBorder.
Bottom())
1038 seqArgsNew.realloc( ++nNewLength );
1039 auto pseqArgsNew = seqArgsNew.getArray();
1040 pseqArgsNew[ nNewLength - 1 ].Name =
"DocumentBorder";
1041 pseqArgsNew[ nNewLength - 1 ].Value <<= aBorderSeq;
1045 if (requestedArgs.empty())
1048 Sequence< beans::PropertyValue > aFinalCache;
1049 sal_Int32 nFinalLength = 0;
1051 for (
const auto& rOrg : std::as_const(
m_pData->m_seqArguments) )
1053 auto bNew = std::none_of(std::cbegin(seqArgsOld), std::cend(seqArgsOld),
1054 [&rOrg](
const beans::PropertyValue& rOld){
return rOld.Name == rOrg.Name; });
1060 seqArgsNew.realloc( ++nNewLength );
1061 seqArgsNew.getArray()[ nNewLength - 1 ] = rOrg;
1063 aFinalCache.realloc( ++nFinalLength );
1064 aFinalCache.getArray()[ nFinalLength - 1 ] = rOrg;
1068 m_pData->m_seqArguments = aFinalCache;
1074 return m_pData->m_seqArguments;
1084 throw util::InvalidStateException(
1085 "Medium could not be retrieved, unable to execute setArgs");
1088 for (
const auto& rArg : aArgs)
1093 if (rArg.Name ==
"SuggestedSaveAsName")
1095 if (rArg.Value >>= sValue)
1101 else if (rArg.Name ==
"SuggestedSaveAsDir")
1103 if (rArg.Value >>= sValue)
1109 else if (rArg.Name ==
"LockContentExtraction")
1111 if (rArg.Value >>= bValue)
1117 else if (rArg.Name ==
"LockExport")
1119 if (rArg.Value >>= bValue)
1125 else if (rArg.Name ==
"LockPrint")
1127 if (rArg.Value >>= bValue)
1133 else if (rArg.Name ==
"LockSave")
1135 if (rArg.Value >>= bValue)
1141 else if (rArg.Name ==
"LockEditDoc")
1143 if (rArg.Value >>= bValue)
1149 else if (rArg.Name ==
"Replaceable")
1151 if (rArg.Value >>= bValue)
1157 else if (rArg.Name ==
"EncryptionData")
1164 throw lang::IllegalArgumentException(
"Setting property not supported: " + rArg.Name,
1176 OSL_PRECOND(
xController.is(),
"SfxBaseModel::connectController: invalid controller!" );
1182 if (
m_pData->m_seqControllers.size() == 1 )
1188 if ( !sDocumentURL.isEmpty() )
1201 if (
m_pData->m_seqControllers.empty() )
1204 auto& vec =
m_pData->m_seqControllers;
1205 vec.erase(std::remove(vec.begin(), vec.end(),
xController), vec.end());
1213 class ControllerLockUndoAction :
public ::cppu::WeakImplHelper< XUndoAction >
1216 ControllerLockUndoAction(
const Reference< XModel >& i_model,
const bool i_undoIsUnlock )
1218 ,m_bUndoIsUnlock( i_undoIsUnlock )
1223 virtual OUString SAL_CALL
getTitle()
override;
1224 virtual void SAL_CALL undo( )
override;
1225 virtual void SAL_CALL redo( )
override;
1228 const Reference< XModel >
m_xModel;
1229 const bool m_bUndoIsUnlock;
1232 OUString SAL_CALL ControllerLockUndoAction::getTitle()
1238 void SAL_CALL ControllerLockUndoAction::undo( )
1240 if ( m_bUndoIsUnlock )
1246 void SAL_CALL ControllerLockUndoAction::redo( )
1248 if ( m_bUndoIsUnlock )
1263 ++
m_pData->m_nControllerLockCount ;
1265 if (
m_pData->m_pDocumentUndoManager.is()
1266 &&
m_pData->m_pDocumentUndoManager->isInContext()
1267 && !
m_pData->m_pDocumentUndoManager->isLocked()
1270 m_pData->m_pDocumentUndoManager->addUndoAction(
new ControllerLockUndoAction(
this,
true ) );
1282 --
m_pData->m_nControllerLockCount ;
1284 if (
m_pData->m_pDocumentUndoManager.is()
1285 &&
m_pData->m_pDocumentUndoManager->isInContext()
1286 && !
m_pData->m_pDocumentUndoManager->isLocked()
1289 m_pData->m_pDocumentUndoManager->addUndoAction(
new ControllerLockUndoAction(
this,
false ) );
1300 return (
m_pData->m_nControllerLockCount != 0 ) ;
1312 if (
m_pData->m_xCurrent.is() )
1316 return !
m_pData->m_seqControllers.empty() ?
m_pData->m_seqControllers.front() :
m_pData->m_xCurrent;
1327 m_pData->m_xCurrent = xCurrentController;
1338 Reference< XInterface > xReturn;
1343 Reference< view::XSelectionSupplier > xDocView(
xController, UNO_QUERY );
1344 if ( xDocView.is() )
1346 Any aSel = xDocView->getSelection();
1362 if ( !
m_pData->m_pObjectShell.is() )
1365 bool bResult =
m_pData->m_pObjectShell->IsEnableSetModified();
1366 m_pData->m_pObjectShell->EnableSetModified(
false );
1375 if ( !
m_pData->m_pObjectShell.is() )
1378 bool bResult =
m_pData->m_pObjectShell->IsEnableSetModified();
1379 m_pData->m_pObjectShell->EnableSetModified();
1388 if ( !
m_pData->m_pObjectShell.is() )
1391 return m_pData->m_pObjectShell->IsEnableSetModified();
1402 return m_pData->m_pObjectShell.is() &&
m_pData->m_pObjectShell->IsModified();
1413 if (
m_pData->m_pObjectShell.is() )
1414 m_pData->m_pObjectShell->SetModified(bModified);
1452 if (pContainer!=
nullptr)
1459 static_cast<util::XCloseListener*
>(pIterator.
next())->queryClosing( aSource, bDeliverOwnership );
1470 if (bDeliverOwnership)
1472 throw util::CloseVetoException(
1473 "Can not close while saving.",
1474 static_cast< util::XCloseable*
>(
this));
1480 if (pContainer!=
nullptr)
1487 static_cast<util::XCloseListener*
>(pCloseIterator.
next())->notifyClosing( aSource );
1533 return m_pData->m_xPrintable->getPrinter();
1541 m_pData->m_xPrintable->setPrinter( rPrinter );
1561 return m_pData->m_pObjectShell.is() &&
m_pData->m_pObjectShell->HasName();
1572 if (
m_pData->m_pObjectShell.is() )
1575 if (
m_pData->m_pObjectShell->IsDocShared() )
1576 return m_pData->m_pObjectShell->GetSharedFileURL();
1578 return m_pData->m_pObjectShell->GetMedium()->GetName();
1592 return !
m_pData->m_pObjectShell.is() ||
m_pData->m_pObjectShell->IsReadOnly();
1602 if ( !
m_pData->m_pObjectShell.is() )
1605 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1607 bool bCheckIn =
false;
1608 bool bOnMainThread =
false;
1609 for (
const auto& rArg : aSeqArgs )
1612 if ( rArg.Name !=
"VersionComment" && rArg.Name !=
"Author"
1613 && rArg.Name !=
"DontTerminateEdit"
1614 && rArg.Name !=
"InteractionHandler" && rArg.Name !=
"StatusIndicator"
1615 && rArg.Name !=
"VersionMajor"
1616 && rArg.Name !=
"FailOnWarning"
1617 && rArg.Name !=
"CheckIn"
1618 && rArg.Name !=
"NoFileSync"
1619 && rArg.Name !=
"OnMainThread" )
1621 const OUString aMessage(
"Unexpected MediaDescriptor parameter: " + rArg.Name );
1622 throw lang::IllegalArgumentException( aMessage, Reference< XInterface >(), 1 );
1624 else if ( rArg.Name ==
"CheckIn" )
1626 rArg.Value >>= bCheckIn;
1628 else if (rArg.Name ==
"OnMainThread")
1630 rArg.Value >>= bOnMainThread;
1635 sal_uInt16 nSlotId = SID_SAVEDOC;
1636 Sequence< beans::PropertyValue > aArgs = aSeqArgs;
1639 nSlotId = SID_CHECKIN;
1640 sal_Int32
nLength = aSeqArgs.getLength( );
1641 aArgs = Sequence< beans::PropertyValue >(
nLength - 1 );
1642 std::copy_if(aSeqArgs.begin(), aSeqArgs.end(), aArgs.getArray(),
1643 [](
const beans::PropertyValue& rProp) { return rProp.Name !=
"CheckIn"; });
1646 std::optional<SfxAllItemSet> pParams(
SfxGetpApp()->GetPool() );
1663 bRet =
m_pData->m_pObjectShell->DoSave()
1664 &&
m_pData->m_pObjectShell->DoSaveCompleted();
1668 bRet =
m_pData->m_pObjectShell->Save_Impl( &*pParams );
1674 m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId == SID_CHECKIN );
1677 [
this, &pParams] {
return m_pData->m_pObjectShell->Save_Impl(&*pParams); });
1679 bRet =
m_pData->m_pObjectShell->Save_Impl(&*pParams);
1680 m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId != SID_CHECKIN );
1687 m_pData->m_pObjectShell->ResetError();
1700 throw task::ErrorCodeIOException(
1701 "SfxBaseModel::storeSelf: " + nErrCode.
toString(),
1702 Reference< XInterface >(), sal_uInt32(nErrCode));
1713 storeSelf( Sequence< beans::PropertyValue >() );
1721 const Sequence< beans::PropertyValue >& rArgs )
1726 if ( !
m_pData->m_pObjectShell.is() )
1729 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1732 bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault(
"OnMainThread",
false);
1742 Sequence< beans::PropertyValue > aSequence ;
1748#if OSL_DEBUG_LEVEL > 0
1749 const SfxStringItem* pPasswdItem = SfxItemSet::GetItem<SfxStringItem>(
m_pData->m_pObjectShell->GetMedium()->GetItemSet(), SID_PASSWORD,
false);
1750 OSL_ENSURE( !pPasswdItem,
"There should be no Password property in the document MediaDescriptor!" );
1760 if ( !
m_pData->m_pDocumentUndoManager.is() )
1761 m_pData->m_pDocumentUndoManager.set( new ::sfx2::DocumentUndoManager( *
this ) );
1762 return m_pData->m_pDocumentUndoManager;
1770 const Sequence< beans::PropertyValue >& rArgs )
1775 if ( !
m_pData->m_pObjectShell.is() )
1778 SfxSaveGuard aSaveGuard(
this,
m_pData.get());
1781 bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault(
"OnMainThread",
false);
1787 catch (
const uno::Exception &e)
1792 throw io::IOException(e.Message, e.Context);
1799 return m_pData->m_bModifiedSinceLastSave;
1807 SfxSaveGuard aSaveGuard(
this,
m_pData.get() );
1808 impl_store( i_TargetLocation, i_MediaDescriptor,
true );
1811 m_pData->m_bModifiedSinceLastSave =
false;
1814void SAL_CALL
SfxBaseModel::recoverFromFile(
const OUString& i_SourceLocation,
const OUString& i_SalvagedFile,
const Sequence< PropertyValue >& i_MediaDescriptor )
1822 OSL_ENSURE( !aMediaDescriptor.
has(
"SalvagedFile" ) || ( aMediaDescriptor.
getOrDefault(
"SalvagedFile", OUString() ) == i_SalvagedFile ),
1823 "SfxBaseModel::recoverFromFile: inconsistent information!" );
1824 aMediaDescriptor.
put(
"SalvagedFile", i_SalvagedFile );
1827 OSL_ENSURE( !aMediaDescriptor.
has(
"URL" ) || ( aMediaDescriptor.
getOrDefault(
"URL", OUString() ) == i_SourceLocation ),
1828 "SfxBaseModel::recoverFromFile: inconsistent information!" );
1829 aMediaDescriptor.
put(
"URL", i_SourceLocation );
1849 throw frame::DoubleInitializationException( OUString(), *
this );
1852 DBG_ASSERT(
m_pData->m_pObjectShell.is(),
"Model is useless without an ObjectShell" );
1853 if ( !
m_pData->m_pObjectShell.is() )
1856 if(
m_pData->m_pObjectShell->GetMedium() )
1857 throw frame::DoubleInitializationException();
1859 bool bRes =
m_pData->m_pObjectShell->DoInitNew();
1862 m_pData->m_pObjectShell->ResetError();
1865 throw task::ErrorCodeIOException(
1866 "SfxBaseModel::initNew: " + nErrCode.
toString(),
1867 Reference< XInterface >(), sal_uInt32(nErrCode));
1872OUString getFilterProvider(
SfxMedium const & rMedium )
1874 const std::shared_ptr<const SfxFilter>& pFilter = rMedium.
GetFilter();
1878 return pFilter->GetProviderName();
1881void setUpdatePickList(
SfxMedium* pMedium )
1886 bool bHidden =
false;
1887 const SfxBoolItem* pHidItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->
GetItemSet(), SID_HIDDEN,
false);
1900 throw frame::DoubleInitializationException( OUString(), *
this );
1903 DBG_ASSERT(
m_pData->m_pObjectShell.is(),
"Model is useless without an ObjectShell" );
1905 if (!
m_pData->m_pObjectShell.is())
1908 if(
m_pData->m_pObjectShell->GetMedium() )
1910 throw frame::DoubleInitializationException();
1915 if (!getFilterProvider(*pMedium).isEmpty())
1917 if (!
m_pData->m_pObjectShell->DoLoadExternal(pMedium))
1921 setUpdatePickList(pMedium);
1925 OUString aFilterName;
1926 const SfxStringItem* pFilterNameItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->
GetItemSet(), SID_FILTER_NAME,
false);
1927 if( pFilterNameItem )
1928 aFilterName = pFilterNameItem->
GetValue();
1929 if( !
m_pData->m_pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName ) )
1933 throw frame::IllegalArgumentIOException();
1936 const SfxStringItem* pSalvageItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->
GetItemSet(), SID_DOC_SALVAGE,
false);
1937 bool bSalvage = pSalvageItem !=
nullptr;
1940 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
1945 if(
m_pData->m_pObjectShell->GetErrorCode() )
1947 nError =
m_pData->m_pObjectShell->GetErrorCode();
1951 const SfxBoolItem* pRepairItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->
GetItemSet(), SID_REPAIRPACKAGE,
false);
1952 if ( !pRepairItem || !pRepairItem->
GetValue() )
1966 m_pData->m_pObjectShell->PrepareSecondTryLoad_Impl();
1968 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
1970 if (
m_pData->m_pObjectShell->GetErrorCode())
1971 nError =
m_pData->m_pObjectShell->GetErrorCode();
1984 if(
m_pData->m_pObjectShell->IsAbortingImport() )
1990 const SfxStringItem* pFilterItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->
GetItemSet(), SID_FILTER_NAME,
false);
1994 m_pData->m_pObjectShell->SetModified();
2000 const SfxStringItem* pFilterItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->
GetItemSet(), SID_FILTER_NAME,
false);
2008 m_pData->m_pObjectShell->ResetError();
2012 setUpdatePickList(pMedium);
2014#if OSL_DEBUG_LEVEL > 0
2015 const SfxStringItem* pPasswdItem = SfxItemSet::GetItem<SfxStringItem>(pMedium->
GetItemSet(), SID_PASSWORD,
false);
2016 OSL_ENSURE( !pPasswdItem,
"There should be no Password property in the document MediaDescriptor!" );
2030 if (
m_pData->m_pObjectShell.is() )
2032 if ( aFlavor.MimeType ==
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
2035 throw datatransfer::UnsupportedFlavorException();
2040 aDesc.
maTypeName = aFlavor.HumanPresentableName;
2043 aDesc.
mnViewAspect = sal::static_int_cast< sal_uInt16 >( embed::Aspects::MSOLE_CONTENT );
2045 Size aSize =
m_pData->m_pObjectShell->GetVisArea().GetSize();
2054 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ), aMemStm.
Tell() );
2056 else if ( aFlavor.MimeType ==
"application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" )
2059 throw datatransfer::UnsupportedFlavorException();
2066 std::unique_ptr<SvStream> pStream(aTmp.
GetStream( StreamMode::READ ));
2067 const sal_uInt32 nLen = pStream->TellEnd();
2069 pStream->ReadBytes(
aSeq.getArray(), nLen);
2070 if(
aSeq.hasElements() )
2077 else if ( aFlavor.MimeType ==
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2080 throw datatransfer::UnsupportedFlavorException();
2083 std::shared_ptr<GDIMetaFile> xMetaFile =
2084 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2092 aWriter.
Write( *xMetaFile );
2093 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ),
2097 else if ( aFlavor.MimeType ==
"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2100 throw datatransfer::UnsupportedFlavorException();
2102 std::shared_ptr<GDIMetaFile> xMetaFile =
2103 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2111 aWriter.
Write( *xMetaFile );
2112 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aMemStm.
GetData() ),
2116 else if ( aFlavor.MimeType ==
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"" )
2120 std::shared_ptr<GDIMetaFile> xMetaFile =
2121 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2125 std::unique_ptr<SvMemoryStream>
xStream(
2126 GraphicHelper::getFormatStrFromGDI_Impl(
2127 xMetaFile.get(), ConvertDataFormat::EMF ) );
2131 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2136 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2139 std::shared_ptr<GDIMetaFile> xMetaFile =
2140 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2144 aAny <<= reinterpret_cast< sal_uInt64 >(
2145 GraphicHelper::getEnhMetaFileFromGDI_Impl( xMetaFile.get() ) );
2149 throw datatransfer::UnsupportedFlavorException();
2151 else if ( aFlavor.MimeType ==
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )
2155 std::shared_ptr<GDIMetaFile> xMetaFile =
2156 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2160 std::unique_ptr<SvMemoryStream>
xStream(
2161 GraphicHelper::getFormatStrFromGDI_Impl(
2162 xMetaFile.get(), ConvertDataFormat::WMF ) );
2167 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2172 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2177 std::shared_ptr<GDIMetaFile> xMetaFile =
2178 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2182 Size aMetaSize = xMetaFile->GetPrefSize();
2183 aAny <<= reinterpret_cast< sal_uInt64 >(
2184 GraphicHelper::getWinMetaFileFromGDI_Impl(
2185 xMetaFile.get(), aMetaSize ) );
2189 throw datatransfer::UnsupportedFlavorException();
2191 else if ( aFlavor.MimeType ==
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )
2194 throw datatransfer::UnsupportedFlavorException();
2196 std::shared_ptr<GDIMetaFile> xMetaFile =
2197 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2201 std::unique_ptr<SvMemoryStream>
xStream(
2202 GraphicHelper::getFormatStrFromGDI_Impl(
2203 xMetaFile.get(), ConvertDataFormat::BMP ) );
2208 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2213 else if ( aFlavor.MimeType ==
"image/png" )
2216 throw datatransfer::UnsupportedFlavorException();
2218 std::shared_ptr<GDIMetaFile> xMetaFile =
2219 m_pData->m_pObjectShell->GetPreviewMetaFile(
true );
2223 std::unique_ptr<SvMemoryStream>
xStream(
2224 GraphicHelper::getFormatStrFromGDI_Impl(
2225 xMetaFile.get(), ConvertDataFormat::PNG ) );
2230 aAny <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>(
xStream->GetData() ),
2236 throw datatransfer::UnsupportedFlavorException();
2250 const sal_Int32 nSuppFlavors = GraphicHelper::supportsMetaFileHandle_Impl() ? 10 : 8;
2251 Sequence< datatransfer::DataFlavor > aFlavorSeq( nSuppFlavors );
2252 auto pFlavorSeq = aFlavorSeq.getArray();
2254 pFlavorSeq[0].MimeType =
2255 "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"";
2256 pFlavorSeq[0].HumanPresentableName =
"GDIMetaFile";
2259 pFlavorSeq[1].MimeType =
2260 "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"";
2261 pFlavorSeq[1].HumanPresentableName =
"GDIMetaFile";
2264 pFlavorSeq[2].MimeType =
2265 "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ;
2266 pFlavorSeq[2].HumanPresentableName =
"Enhanced Windows MetaFile";
2269 pFlavorSeq[3].MimeType =
2270 "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
2271 pFlavorSeq[3].HumanPresentableName =
"Windows MetaFile";
2274 pFlavorSeq[4].MimeType =
2275 "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"";
2276 pFlavorSeq[4].HumanPresentableName =
"Star Object Descriptor (XML)";
2279 pFlavorSeq[5].MimeType =
2280 "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"";
2281 pFlavorSeq[5].HumanPresentableName =
"Star Embed Source (XML)";
2284 pFlavorSeq[6].MimeType =
2285 "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"";
2286 pFlavorSeq[6].HumanPresentableName =
"Bitmap";
2289 pFlavorSeq[7].MimeType =
"image/png";
2290 pFlavorSeq[7].HumanPresentableName =
"PNG";
2293 if ( nSuppFlavors == 10 )
2295 pFlavorSeq[8].MimeType =
2296 "application/x-openoffice-emf;windows_formatname=\"Image EMF\"";
2297 pFlavorSeq[8].HumanPresentableName =
"Enhanced Windows MetaFile";
2300 pFlavorSeq[9].MimeType =
2301 "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
2302 pFlavorSeq[9].HumanPresentableName =
"Windows MetaFile";
2317 if ( aFlavor.MimeType ==
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2322 else if ( aFlavor.MimeType ==
"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" )
2327 else if ( aFlavor.MimeType ==
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"" )
2331 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2335 else if ( aFlavor.MimeType ==
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" )
2339 else if ( GraphicHelper::supportsMetaFileHandle_Impl()
2343 else if ( aFlavor.MimeType ==
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
2348 else if ( aFlavor.MimeType ==
"application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" )
2353 else if ( aFlavor.MimeType ==
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )
2358 else if ( aFlavor.MimeType ==
"image/png" )
2375 if ( !
m_pData->m_xEvents.is() )
2391 Reference< script::XStorageBasedLibraryContainer > xBasicLibraries;
2392 if (
m_pData->m_pObjectShell.is() )
2393 xBasicLibraries.set(
m_pData->m_pObjectShell->GetBasicContainer(), UNO_QUERY);
2394 return xBasicLibraries;
2401 Reference< script::XStorageBasedLibraryContainer > xDialogLibraries;
2402 if (
m_pData->m_pObjectShell.is() )
2403 xDialogLibraries.set(
m_pData->m_pObjectShell->GetDialogContainer(), UNO_QUERY);
2404 return xDialogLibraries;
2411 if (
m_pData->m_pObjectShell.is() )
2412 return m_pData->m_pObjectShell->AdjustMacroMode();
2424 Reference< document::XEmbeddedScripts > xDocumentScripts;
2428 Reference< frame::XModel > xDocument(
this );
2429 xDocumentScripts.set( xDocument, UNO_QUERY );
2430 while ( !xDocumentScripts.is() && xDocument.is() )
2432 Reference< container::XChild > xDocAsChild( xDocument, UNO_QUERY );
2433 if ( !xDocAsChild.is() )
2435 xDocument =
nullptr;
2439 xDocument.set( xDocAsChild->getParent(), UNO_QUERY );
2440 xDocumentScripts.set( xDocument, UNO_QUERY );
2446 xDocumentScripts =
nullptr;
2449 return xDocumentScripts;
2478 assert(xShape.is() &&
"no shape?");
2481 m_pData->maShapeListeners[xShape].push_back(xListener);
2492 auto it =
m_pData->maShapeListeners.find(xShape);
2493 if (it !=
m_pData->maShapeListeners.end())
2495 auto rVec = it->second;
2496 auto it2 = std::find(rVec.begin(), rVec.end(), xListener);
2497 if (it2 != rVec.end())
2501 m_pData->maShapeListeners.erase(it);
2525 throw lang::NoSupportException(
"SfxBaseModel controls all the sent notifications itself!" );
2531 return Sequence<document::CmisProperty>();
2532 return m_pData->m_cmisProperties;
2537 m_pData->m_cmisProperties = _cmisproperties;
2549 Reference<ucb::XCommandEnvironment>(),
2558 throw lang::WrappedTargetRuntimeException( e.Message,
2573 Reference<ucb::XCommandEnvironment>(),
2580 m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
2581 m_pData->m_pObjectShell->GetMedium( )->GetMedium_Impl( );
2583 Sequence< beans::PropertyValue > aSequence ;
2593 throw lang::WrappedTargetRuntimeException( e.Message,
2607 Reference<ucb::XCommandEnvironment>(),
2614 m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
2619 throw lang::WrappedTargetRuntimeException( e.Message,
2632 Sequence< beans::PropertyValue > aProps{
2642 pMedium =
m_pData->m_pObjectShell->GetMedium( );
2643 const OUString sNewName( pMedium->
GetName( ) );
2646 if (
sName != sNewName )
2649 Sequence< beans::PropertyValue > aSequence ;
2660 throw lang::WrappedTargetRuntimeException( e.Message,
2667 uno::Sequence<document::CmisVersion> aVersions;
2676 Reference<ucb::XCommandEnvironment>(),
2680 aResult >>= aVersions;
2685 throw lang::WrappedTargetRuntimeException( e.Message,
2694 bool bValue =
false;
2695 if (
m_pData->m_pObjectShell.is() )
2705 Reference < beans::XPropertySetInfo > xProps = aContent.
getProperties();
2706 if ( xProps->hasPropertyByName( rName ) )
2752 Reference < beans::XPropertySetInfo > xProps = aContent.
getProperties();
2753 static const OUStringLiteral aCmisProps(
u"CmisProperties" );
2754 if ( xProps->hasPropertyByName( aCmisProps ) )
2756 Sequence< document::CmisProperty> aCmisProperties;
2761 catch (
const ucb::ContentCreationException &)
2764 catch (
const ucb::CommandAbortedException &)
2777 bool bSilent =
false;
2778 const SfxBoolItem* pSilentItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->
GetItemSet(), SID_SILENT,
false);
2793 if (
m_pData->m_pObjectShell->GetMedium() != pMedium )
2796 OSL_FAIL(
"Document has rejected the medium?!");
2804 throw task::ErrorCodeIOException(
2805 "SfxBaseModel::handleLoadError: 0x" + nError.
toString(),
2806 Reference< XInterface >(), sal_uInt32(nError));
2818static void addTitle_Impl( Sequence < beans::PropertyValue >& rSeq,
const OUString& rTitle )
2820 auto [
begin,
end] = asNonConstRange(rSeq);
2821 auto pProp = std::find_if(
begin,
end,
2822 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"Title"; });
2825 pProp->Value <<= rTitle;
2829 sal_Int32
nCount = rSeq.getLength();
2830 rSeq.realloc(
nCount+1 );
2831 auto& el = rSeq.getArray()[
nCount];
2833 el.Value <<= rTitle;
2843 if ( &rBC !=
m_pData->m_pObjectShell.get() )
2846 if ( rHint.
GetId() == SfxHintId::DocChanged )
2857 if (
m_pData->m_xUIConfigurationManager.is()
2860 Reference< embed::XStorage > xConfigStorage;
2861 static const OUStringLiteral aUIConfigFolderName(
u"Configurations2" );
2864 if ( !xConfigStorage.is() )
2867 if ( xConfigStorage.is() || !
m_pData->m_pObjectShell->GetStorage()->hasByName( aUIConfigFolderName ) )
2870 m_pData->m_xUIConfigurationManager->setStorage( xConfigStorage );
2874 OSL_FAIL(
"Unexpected scenario!" );
2886 m_pData->m_bModifiedSinceLastSave =
false;
2892 m_pData->m_sURL =
m_pData->m_pObjectShell->GetMedium()->GetName();
2895 Sequence< beans::PropertyValue > aArgs;
2905 m_pData->m_bModifiedSinceLastSave =
false;
2919 aSupplement <<= pPrintingHint->GetWhich();
2924 if ( rHint.
GetId() == SfxHintId::TitleChanged )
2929 else if ( rHint.
GetId() == SfxHintId::ModeChanged )
2944 lang::EventObject
aEvent(
static_cast<frame::XModel *
>(
const_cast<SfxBaseModel *
>(
this)) );
2958 if ( !
m_pData->m_pObjectShell.is() || !
m_pData->m_pObjectShell->IsEnableSetModified() )
2981 OSL_FAIL(
"SfxBaseModel::IsInitialized: this should have been caught earlier!" );
2985 return m_pData->m_pObjectShell->GetMedium() !=
nullptr;
2991 throw lang::DisposedException( OUString(), *
const_cast< SfxBaseModel*
>(
this ) );
2993 throw lang::NotInitializedException( OUString(), *
const_cast< SfxBaseModel*
>(
this ) );
2998 return (
m_pData ==
nullptr ) ;
3007 std::shared_ptr<const SfxFilter> pFilter;
3013 return pFilter->GetName();
3019 const Sequence< beans::PropertyValue >& seqArguments ,
3022 if( sURL.isEmpty() )
3023 throw frame::IllegalArgumentIOException();
3025 bool bSaved =
false;
3026 if ( !bSaveTo &&
m_pData->m_pObjectShell.is() && !sURL.isEmpty()
3027 && !sURL.startsWith(
"private:stream" )
3028 && ::utl::UCBContentHelper::EqualURLs(
getLocation(), sURL ) )
3033 static const OUStringLiteral aFilterString(
u"FilterName" );
3035 if ( !aFilterName.isEmpty() )
3040 const std::shared_ptr<const SfxFilter>& pFilter = pMedium->
GetFilter();
3041 if ( pFilter && aFilterName == pFilter->GetFilterName() )
3044 bool bFormerPassword =
false;
3046 uno::Sequence< beans::NamedValue > aOldEncryptionData;
3049 bFormerPassword =
true;
3052 if ( !bFormerPassword )
3054 aArgHash.
erase( aFilterString );
3055 aArgHash.
erase(
"URL" );
3062 catch(
const lang::IllegalArgumentException& )
3064#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
3069 if (
m_pData->m_pObjectShell->IsDocShared() )
3071 uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.
getUnpackedValueOrDefault(
"EncryptionData", uno::Sequence< beans::NamedValue >() );
3072 if ( !aNewEncryptionData.hasElements() )
3077 uno::Sequence< beans::NamedValue > aOldEncryptionData;
3080 if ( !aOldEncryptionData.hasElements() && !aNewEncryptionData.hasElements() )
3096 if ( bSaved || !
m_pData->m_pObjectShell.is() )
3100 m_pData->m_pObjectShell.get() ) );
3102 std::optional<SfxAllItemSet> pItemSet(
SfxGetpApp()->GetPool());
3111 if ( pCopyStreamItem && pCopyStreamItem->
GetValue() && !bSaveTo )
3113 throw frame::IllegalArgumentIOException(
3114 "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!" );
3117 sal_uInt32 nModifyPasswordHash = 0;
3118 Sequence< beans::PropertyValue > aModifyPasswordInfo;
3120 if ( pModifyPasswordInfoItem )
3124 sal_Int32 nMPHTmp = 0;
3125 pModifyPasswordInfoItem->
GetValue() >>= nMPHTmp;
3126 nModifyPasswordHash =
static_cast<sal_uInt32
>(nMPHTmp);
3127 pModifyPasswordInfoItem->
GetValue() >>= aModifyPasswordInfo;
3129 pItemSet->ClearItem(SID_MODIFYPASSWORDINFO);
3130 sal_uInt32 nOldModifyPasswordHash =
m_pData->m_pObjectShell->GetModifyPasswordHash();
3131 m_pData->m_pObjectShell->SetModifyPasswordHash( nModifyPasswordHash );
3132 Sequence< beans::PropertyValue > aOldModifyPasswordInfo =
m_pData->m_pObjectShell->GetModifyPasswordInfo();
3133 m_pData->m_pObjectShell->SetModifyPasswordInfo( aModifyPasswordInfo );
3138 bool bCopyTo = bSaveTo ||
3140 Reference<document::XDocumentProperties> xOldDocProps;
3144 const Reference<util::XCloneable> xCloneable(xOldDocProps,
3146 const Reference<document::XDocumentProperties> xNewDocProps(
3147 xCloneable->createClone(), UNO_QUERY_THROW);
3148 m_pData->m_xDocumentProperties = xNewDocProps;
3151 bool bRet =
m_pData->m_pObjectShell->APISaveAs_Impl(sURL, *pItemSet, seqArguments);
3156 m_pData->m_xDocumentProperties = xOldDocProps;
3159 Reference < task::XInteractionHandler > xHandler;
3167 if ( !bRet && !nErrCode )
3169 SAL_WARN(
"sfx.doc",
"Storing has failed, no error is set!");
3172 m_pData->m_pObjectShell->ResetError();
3179 if ( xHandler.is() )
3184 task::ErrorCodeRequest aErrorCode;
3185 aErrorCode.ErrCode = sal_uInt32(nErrCode);
3193 m_pData->m_pObjectShell->SetModifyPasswordEntered();
3199 m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
3200 m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
3207 m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
3208 m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
3212 m_pData->m_pObjectShell.get() ) );
3217 std::stringstream aErrCode;
3218 aErrCode << nErrCode;
3219 throw task::ErrorCodeIOException(
3220 "SfxBaseModel::impl_store <" + sURL +
"> failed: " + OUString::fromUtf8(aErrCode.str().c_str()),
3221 Reference< XInterface >(), sal_uInt32(nErrCode));
3227template<
typename ListenerT,
typename EventT >
3228class NotifySingleListenerIgnoreRE
3231 typedef void ( SAL_CALL ListenerT::*NotificationMethod )(
const EventT& );
3235 NotifySingleListenerIgnoreRE( NotificationMethod method,
const EventT& event ) :
m_pMethod( method ),
m_rEvent( event ) { }
3237 void operator()(
const Reference<ListenerT>& listener )
const
3241 (listener.get()->*
m_pMethod)( m_rEvent );
3258 std::shared_ptr<IMPL_SfxBaseModel_DataContainer> xKeepAlive(
m_pData);
3264 if (
aName.isEmpty())
3273 document::DocumentEvent aDocumentEvent(
static_cast<frame::XModel*
>(
this),
aName,
xController, supplement );
3275 pIC->
forEach< document::XDocumentEventListener, NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent > >(
3276 NotifySingleListenerIgnoreRE< document::XDocumentEventListener, document::DocumentEvent >(
3277 &document::XDocumentEventListener::documentEventOccured,
3286 document::EventObject
aEvent(
static_cast<frame::XModel*
>(
this),
aName );
3288 pIC->
forEach< document::XEventListener, NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject > >(
3289 NotifySingleListenerIgnoreRE< document::XEventListener, document::EventObject >(
3290 &document::XEventListener::notifyEvent,
3300 if (
m_pData->m_pObjectShell.is() && !
m_pData->m_contViewData.is() )
3308 return Reference < container::XIndexAccess >();
3312 if ( !
m_pData->m_contViewData.is() )
3315 return Reference < container::XIndexAccess >();
3318 Reference < container::XIndexContainer > xCont(
m_pData->m_contViewData, UNO_QUERY );
3320 Sequence < beans::PropertyValue >
aSeq;
3324 bool bIsActive = ( pFrame == pActFrame );
3325 pFrame->GetViewShell()->WriteUserDataSequence(
aSeq );
3331 return m_pData->m_contViewData;
3367 if (
aEvent.EventName ==
"ShapeModified")
3369 uno::Reference<drawing::XShape> xShape(
aEvent.Source, uno::UNO_QUERY);
3372 auto it =
m_pData->maShapeListeners.find(xShape);
3373 if (it !=
m_pData->maShapeListeners.end())
3374 for (
auto const & rListenerUnoRef : it->second)
3375 rListenerUnoRef->notifyShapeEvent(
aEvent);
3385 || !
m_pData->maShapeListeners.empty());
3393 Reference < view::XPrintJobBroadcaster > xPJB(
m_pData->m_xPrintable, UNO_QUERY );
3395 xPJB->addPrintJobListener( xListener );
3403 Reference < view::XPrintJobBroadcaster > xPJB(
m_pData->m_xPrintable, UNO_QUERY );
3405 xPJB->removePrintJobListener( xListener );
3430 Reference< util::XModifiable > xModifiable( xStorage, UNO_QUERY );
3431 if ( xModifiable.is() )
3433 if ( !
m_pData->m_pStorageModifyListen.is() )
3439 xModifiable->addModifyListener(
m_pData->m_pStorageModifyListen );
3447 Reference< embed::XStorage > xResult;
3448 if (
m_pData->m_pObjectShell.is() )
3450 Reference< embed::XStorage > xStorage =
m_pData->m_pObjectShell->GetStorage();
3451 if ( xStorage.is() )
3455 xResult = xStorage->openStorageElement( aStorageName, nMode );
3470 Sequence< OUString > aResult;
3471 bool bSuccess =
false;
3472 if (
m_pData->m_pObjectShell.is() )
3474 Reference < embed::XStorage > xStorage =
m_pData->m_pObjectShell->GetStorage();
3475 if ( xStorage.is() )
3477 const Sequence< OUString > aTemp = xStorage->getElementNames();
3478 sal_Int32 nResultSize = 0;
3479 for (
const auto& rName : aTemp )
3481 if ( xStorage->isStorageElement( rName ) )
3483 aResult.realloc( ++nResultSize );
3484 aResult.getArray()[ nResultSize - 1 ] = rName;
3493 throw io::IOException();
3506 Reference< script::provider::XScriptProviderFactory > xScriptProviderFactory =
3507 script::provider::theMasterScriptProviderFactory::get( ::comphelper::getProcessComponentContext() );
3509 Reference< XScriptInvocationContext > xScriptContext(
this );
3511 Reference< script::provider::XScriptProvider > xScriptProvider(
3512 xScriptProviderFactory->createScriptProvider(
Any( xScriptContext ) ),
3515 return xScriptProvider;
3524 OSL_ENSURE( !
m_pData->m_sRuntimeUID.isEmpty(),
3525 "SfxBaseModel::getRuntimeUID - ID is empty!" );
3526 return m_pData->m_sRuntimeUID;
3532 if (
m_pData->m_pObjectShell.is() )
3540 m_pData->m_xGrabBagItem->QueryValue(rVal);
3542 rVal <<= uno::Sequence<beans::PropertyValue>();
3548 m_pData->m_xGrabBagItem = std::make_shared<SfxGrabBagItem>();
3550 m_pData->m_xGrabBagItem->PutValue(rVal, 0);
3553static void GetCommandFromSequence( OUString& rCommand, sal_Int32& nIndex,
const Sequence< beans::PropertyValue >& rSeqPropValue )
3557 auto pPropValue = std::find_if(rSeqPropValue.begin(), rSeqPropValue.end(),
3558 [](
const beans::PropertyValue& rPropValue) { return rPropValue.Name ==
"Command"; });
3559 if (pPropValue != rSeqPropValue.end())
3561 pPropValue->Value >>= rCommand;
3562 nIndex =
static_cast<sal_Int32
>(std::distance(rSeqPropValue.begin(), pPropValue));
3572 Sequence< beans::PropertyValue > aSeqPropValue;
3574 for ( sal_Int32
i = 0;
i < rToolbarDefinition->getCount();
i++ )
3576 if ( rToolbarDefinition->getByIndex(
i ) >>= aSeqPropValue )
3589 OUStringBuffer aStrBuf(
".uno:" );
3592 aCommand = aStrBuf.makeStringAndClear();
3594 rToolbarDefinition->replaceByIndex(
i,
Any( aSeqPropValue ));
3610 if ( !
m_pData->m_xUIConfigurationManager.is() )
3612 Reference< ui::XUIConfigurationManager2 > xNewUIConfMan =
3615 Reference< embed::XStorage > xConfigStorage;
3617 OUString aUIConfigFolderName(
"Configurations2" );
3620 if ( xConfigStorage.is() )
3622 static const OUStringLiteral aMediaTypeProp(
u"MediaType" );
3623 OUString aMediaType;
3624 Reference< beans::XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
3625 Any a = xPropSet->getPropertyValue( aMediaTypeProp );
3626 if ( !(
a >>= aMediaType ) || aMediaType.isEmpty())
3628 xPropSet->setPropertyValue( aMediaTypeProp,
Any(OUString(
"application/vnd.sun.xml.ui.configuration")) );
3635 xNewUIConfMan->setStorage( xConfigStorage );
3644 Reference< embed::XStorage > xOOo1ConfigStorage =
getDocumentSubStorage(
"Configurations", embed::ElementModes::READ );
3645 if ( xOOo1ConfigStorage.is() )
3647 Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
3648 std::vector< Reference< container::XIndexContainer > > rToolbars;
3650 bool bImported = framework::UIConfigurationImporterOOo1x::ImportCustomToolbars(
3651 xNewUIConfMan, rToolbars, xContext, xOOo1ConfigStorage );
3656 for (
size_t i = 0;
i < rToolbars.size();
i++ )
3658 const OUString
sId(OUString::number(
i + 1 ));
3659 const OUString aCustomTbxName =
"private:resource/toolbar/custom_OOo1x_" +
sId;
3661 Reference< container::XIndexContainer > xToolbar = rToolbars[
i];
3663 if ( !xNewUIConfMan->hasSettings( aCustomTbxName ))
3666 Reference< beans::XPropertySet > xPropSet( xToolbar, UNO_QUERY );
3667 if ( xPropSet.is() )
3671 xPropSet->setPropertyValue(
"UIName",
Any(
"Toolbar " +
sId ) );
3673 catch ( beans::UnknownPropertyException& )
3678 xNewUIConfMan->insertSettings( aCustomTbxName, xToolbar );
3679 xNewUIConfMan->store();
3686 m_pData->m_xUIConfigurationManager = xNewUIConfMan;
3689 return m_pData->m_xUIConfigurationManager;
3700 if ( !
m_pData->m_pObjectShell.is() )
3701 throw Exception(
"no object shell",
nullptr);
3707 Size aWinSize = pWindow->GetSizePixel();
3709 Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height );
3713 pWindow->SetSizePixel( aWinSize );
3718 aTmpRect.
SetSize(
Size( aSize.Width, aSize.Height ) );
3719 m_pData->m_pObjectShell->SetVisArea( aTmpRect );
3727 if ( !
m_pData->m_pObjectShell.is() )
3728 throw Exception(
"no object shell",
nullptr);
3740 if ( !
m_pData->m_pObjectShell.is() )
3741 throw Exception(
"no object shell",
nullptr);
3750 datatransfer::DataFlavor aDataFlavor(
3751 "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"",
3755 embed::VisualRepresentation aVisualRepresentation;
3757 aVisualRepresentation.Flavor = aDataFlavor;
3759 return aVisualRepresentation;
3767 const Sequence< beans::PropertyValue >& aMediaDescriptor )
3771 throw frame::DoubleInitializationException( OUString(), *
this );
3786 bool bTemplate = pTemplateItem && pTemplateItem->
GetValue();
3788 m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage =
false;
3791 if ( !
m_pData->m_pObjectShell->DoLoad(pMedium) )
3795 throw task::ErrorCodeIOException(
3796 "SfxBaseModel::loadFromStorage: " + nError.
toString(),
3797 Reference< XInterface >(), sal_uInt32(nError));
3803 const Sequence< beans::PropertyValue >& aMediaDescriptor )
3807 if ( !
m_pData->m_pObjectShell.is() )
3808 throw io::IOException();
3810 auto xSet = std::make_shared<SfxAllItemSet>(
m_pData->m_pObjectShell->GetPool());
3819 if ( pFilter && pFilter->UsesStorage() )
3823 bool bSuccess =
false;
3824 if ( xStorage ==
m_pData->m_pObjectShell->GetStorage() )
3827 bSuccess =
m_pData->m_pObjectShell->DoSave();
3836 SfxMedium aMedium( xStorage, OUString(), xSet );
3841 bSuccess =
m_pData->m_pObjectShell->DoSaveObjectAs( aMedium,
true );
3842 m_pData->m_pObjectShell->DoSaveCompleted();
3847 m_pData->m_pObjectShell->ResetError();
3853 throw task::ErrorCodeIOException(
3854 "SfxBaseModel::storeToStorage: " + nError.
toString(),
3855 Reference< XInterface >(), sal_uInt32(nError));
3863 if ( !
m_pData->m_pObjectShell.is() )
3864 throw io::IOException();
3867 if ( xStorage !=
m_pData->m_pObjectShell->GetStorage() )
3869 if ( !
m_pData->m_pObjectShell->SwitchPersistence( xStorage ) )
3873 throw task::ErrorCodeIOException(
3874 "SfxBaseModel::switchToStorage: " + nError.
toString(),
3875 Reference< XInterface >(), sal_uInt32(nError));
3883 m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage =
false;
3890 if ( !
m_pData->m_pObjectShell.is() )
3891 throw io::IOException();
3893 return m_pData->m_pObjectShell->GetStorage();
3897 const Reference< document::XStorageChangeListener >& xListener )
3901 m_pData->m_aInterfaceContainer.addInterface(
3906 const Reference< document::XStorageChangeListener >& xListener )
3910 m_pData->m_aInterfaceContainer.removeInterface(
3916 if (
m_pData->m_xPrintable.is() )
3919 Reference < lang::XInitialization > xInit(
m_pData->m_xPrintable, UNO_QUERY );
3920 xInit->initialize( {
Any(Reference < frame::XModel > (
this)) } );
3921 Reference < view::XPrintJobBroadcaster > xBrd(
m_pData->m_xPrintable, UNO_QUERY );
3922 xBrd->addPrintJobListener(
new SfxPrintHelperListener_Impl(
m_pData.get() ) );
3938 if (!
m_pData->m_sModuleIdentifier.isEmpty())
3939 return m_pData->m_sModuleIdentifier;
3940 if (
m_pData->m_pObjectShell.is())
3941 return m_pData->m_pObjectShell->GetFactory().GetDocumentServiceName();
3950 if ( !
m_pData->m_xTitleHelper.is ())
3952 Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
3953 Reference< frame::XUntitledNumbers > xDesktop( frame::Desktop::create(xContext), UNO_QUERY_THROW);
3955 m_pData->m_xTitleHelper = new ::framework::TitleHelper(xContext, Reference< frame::XModel >(
this), xDesktop);
3958 return m_pData->m_xTitleHelper;
3966 if ( !
m_pData->m_xNumberedControllers.is ())
3969 m_pData->m_xNumberedControllers = pHelper;
3970 pHelper->setOwner (Reference< frame::XModel >(
this));
3971 pHelper->setUntitledPrefix (
" : ");
3974 return m_pData->m_xNumberedControllers;
3994 const Reference < beans::XPropertySetInfo > xProps
3998 static const OUStringLiteral aServerTitle(
u"TitleOnServer" );
3999 if ( xProps->hasPropertyByName( aServerTitle ) )
4006 catch (
const ucb::ContentCreationException &)
4009 catch (
const ucb::CommandAbortedException &)
4012 const SfxBoolItem* pRepairedDocItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->
GetItemSet(), SID_REPAIRPACKAGE,
false);
4013 if ( pRepairedDocItem && pRepairedDocItem->
GetValue() )
4014 aResult +=
SfxResId(STR_REPAIREDDOCUMENT);
4017 if (
m_pData->m_pObjectShell->IsReadOnlyUI() || (pMedium && pMedium->
IsReadOnly()) )
4019 else if (
m_pData->m_pObjectShell->IsDocShared() )
4023 aResult +=
SfxResId(RID_XMLSEC_DOCUMENTSIGNED);
4037 m_pData->m_bExternalTitle =
true;
4047 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), UNO_QUERY);
4048 if (xBroadcaster.is ())
4049 xBroadcaster->addTitleChangeListener (xListener);
4059 Reference< frame::XTitleChangeBroadcaster > xBroadcaster(
impl_getTitleHelper(), UNO_QUERY);
4060 if (xBroadcaster.is ())
4061 xBroadcaster->removeTitleChangeListener (xListener);
4103 sal_Int32 c =
m_pData->m_seqControllers.size();
4104 Sequence< Any > lEnum(c);
4105 std::transform(
m_pData->m_seqControllers.begin(),
m_pData->m_seqControllers.end(),
4106 lEnum.getArray(), [](
const auto&
x) { return css::uno::Any(x); });
4108 return new ::comphelper::OAnyEnumeration(lEnum);
4120 Sequence< OUString > aViewNames( nViewFactoryCount );
4121 auto aViewNamesRange = asNonConstRange(aViewNames);
4122 for ( sal_Int16 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
4166 OSL_PRECOND( !
m_aWeakFrame,
"ViewCreationGuard::takeFrameOwnership: already have a frame!" );
4167 OSL_PRECOND( i_pFrame !=
nullptr,
"ViewCreationGuard::takeFrameOwnership: invalid frame!" );
4196 #if OSL_DEBUG_LEVEL > 0
4202 if ( pCheckFrame->GetFrameInterface() == i_rFrame )
4204 if ( ( pCheckFrame->GetCurrentViewFrame() !=
nullptr )
4205 || ( pCheckFrame->GetCurrentDocument() != nullptr )
4212 OSL_FAIL(
"SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" );
4235 const OUString& i_rViewName,
const Sequence< PropertyValue >& i_rArguments,
const Reference< XFrame >& i_rFrame )
4239 if ( !i_rFrame.is() )
4240 throw lang::IllegalArgumentException( OUString(), *
this, 3 );
4244 if ( !pViewFactory )
4245 throw IllegalArgumentException( OUString(), *
this, 1 );
4248 Reference< XController > xPreviousController( i_rFrame->getController() );
4249 const Reference< XModel > xMe(
this );
4250 if ( ( xPreviousController.is() )
4251 && ( xMe != xPreviousController->getModel() )
4254 xPreviousController.clear();
4257 OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell !=
nullptr ),
4258 "SfxBaseModel::createViewController: invalid old controller!" );
4265 assert(pViewFrame &&
"SfxBaseModel::createViewController: no frame");
4271 ENSURE_OR_THROW( pViewShell,
"invalid view shell provided by factory" );
4286 ENSURE_OR_THROW( pBaseController,
"invalid controller implementation!" );
4291 if ( aDocumentLoadArgs.
getOrDefault(
"ViewOnly",
false ) )
4294 const sal_Int16 nPluginMode = aDocumentLoadArgs.
getOrDefault(
"PluginMode", sal_Int16( 0 ) );
4295 if ( nPluginMode == 1 )
4313 return pBaseController;
4320Reference< rdf::XRepository > SAL_CALL
4325 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4330 return xDMA->getRDFRepository();
4339 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4344 return xDMA->getStringValue();
4353 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4358 return xDMA->getNamespace();
4366 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4371 return xDMA->getLocalName();
4375Reference< rdf::XMetadatable > SAL_CALL
4377 const beans::StringPair & i_rReference)
4381 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4386 return xDMA->getElementByMetadataReference(i_rReference);
4389Reference< rdf::XMetadatable > SAL_CALL
4394 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4399 return xDMA->getElementByURI(i_xURI);
4402Sequence< Reference< rdf::XURI > > SAL_CALL
4404 const Reference<rdf::XURI> & i_xType)
4408 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4413 return xDMA->getMetadataGraphsWithType(i_xType);
4416Reference<rdf::XURI> SAL_CALL
4418 const Sequence < Reference< rdf::XURI > > & i_rTypes)
4422 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4427 return xDMA->addMetadataFile(i_rFileName, i_rTypes);
4430Reference<rdf::XURI> SAL_CALL
4432 const Reference< io::XInputStream > & i_xInStream,
4433 const OUString & i_rFileName,
4434 const Reference< rdf::XURI > & i_xBaseURI,
4435 const Sequence < Reference< rdf::XURI > > & i_rTypes)
4439 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4444 return xDMA->importMetadataFile(i_Format,
4445 i_xInStream, i_rFileName, i_xBaseURI, i_rTypes);
4450 const Reference< rdf::XURI > & i_xGraphName)
4454 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4459 return xDMA->removeMetadataFile(i_xGraphName);
4467 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4472 return xDMA->addContentOrStylesFile(i_rFileName);
4480 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4485 return xDMA->removeContentOrStylesFile(i_rFileName);
4490 Reference< embed::XStorage >
const & i_xStorage,
4491 Reference<rdf::XURI>
const & i_xBaseURI,
4492 Reference<task::XInteractionHandler>
const & i_xHandler)
4496 const Reference<rdf::XDocumentMetadataAccess> xDMA(
4497 m_pData->CreateDMAUninitialized());
4503 xDMA->loadMetadataFromStorage(i_xStorage, i_xBaseURI, i_xHandler);
4504 }
catch (lang::IllegalArgumentException &) {
4508 m_pData->m_xDocumentMetadata = xDMA;
4511 m_pData->m_xDocumentMetadata = xDMA;
4517 Reference< embed::XStorage >
const & i_xStorage)
4521 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4526 return xDMA->storeMetadataToStorage(i_xStorage);
4531 const Sequence< beans::PropertyValue > & i_rMedium)
4535 const Reference<rdf::XDocumentMetadataAccess> xDMA(
4536 m_pData->CreateDMAUninitialized());
4542 xDMA->loadMetadataFromMedium(i_rMedium);
4543 }
catch (lang::IllegalArgumentException &) {
4547 m_pData->m_xDocumentMetadata = xDMA;
4550 m_pData->m_xDocumentMetadata = xDMA;
4555 const Sequence< beans::PropertyValue > & i_rMedium)
4559 const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->GetDMA());
4564 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_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)
SAL_DLLPRIVATE void SetUpdatePickList(bool)
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
SfxItemSet * GetItemSet() const
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
const char * GetUnoName() 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
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
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
Invokes the registered callback, if there are any.
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 >)
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
Reference< frame::XController > m_xCurrent
Reference< XInterface > m_xParent
bool m_bModifiedSinceLastSave
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 > &)