27#include <com/sun/star/beans/PropertyBag.hpp>
28#include <com/sun/star/container/XSet.hpp>
29#include <com/sun/star/document/MacroExecMode.hpp>
30#include <com/sun/star/embed/XTransactedObject.hpp>
31#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
32#include <com/sun/star/embed/StorageFactory.hpp>
33#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
34#include <com/sun/star/io/IOException.hpp>
35#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
36#include <com/sun/star/sdb/BooleanComparisonMode.hpp>
37#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
38#include <com/sun/star/script/DocumentDialogLibraryContainer.hpp>
39#include <com/sun/star/util/NumberFormatsSupplier.hpp>
40#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
41#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
42#include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
52#include <osl/file.hxx>
53#include <osl/diagnose.h>
80using namespace ::
cppu;
89 , XTransactionListener >
117 virtual Reference< XStorage > SAL_CALL
getDocumentSubStorage(
const OUString& aStorageName, ::sal_Int32 _nMode )
override;
121 virtual void SAL_CALL
preCommit(
const css::lang::EventObject& aEvent )
override;
122 virtual void SAL_CALL
commited(
const css::lang::EventObject& aEvent )
override;
123 virtual void SAL_CALL
preRevert(
const css::lang::EventObject& aEvent )
override;
124 virtual void SAL_CALL
reverted(
const css::lang::EventObject& aEvent )
override;
127 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
158 ::osl::MutexGuard aGuard(
m_aMutex );
164 Reference< XTransactionBroadcaster > xBroadcaster(exposedStorage.second, UNO_QUERY);
165 if ( xBroadcaster.is() )
166 xBroadcaster->removeTransactionListener(
this );
181 OSL_ENSURE( !_rStorageName.isEmpty(),
"ODatabaseModelImpl::impl_openSubStorage_nothrow: Invalid storage name!" );
183 Reference< XStorage > xStorage;
187 if ( xRootStorage.is() )
190 if ( nRealMode == ElementModes::READ )
192 if ( xRootStorage.is() && !xRootStorage->hasByName( _rStorageName ) )
196 xStorage = xRootStorage->openStorageElement( _rStorageName, nRealMode );
198 Reference< XTransactionBroadcaster > xBroad( xStorage, UNO_QUERY );
200 xBroad->addTransactionListener(
this );
219 ::comphelper::disposeComponent( exposedStorage.second );
240 catch(
const WrappedTargetException&)
249 if ( _bPreventRootCommits )
252 bool bSuccess =
false;
264 if ( _bPreventRootCommits )
273 ::osl::MutexGuard aGuard(
m_aMutex );
287 if ( !xRootStor.is() )
288 return Sequence< OUString >();
290 std::vector< OUString > aNames;
292 const Sequence< OUString > aElementNames( xRootStor->getElementNames() );
293 for ( OUString
const &
name : aElementNames )
295 if ( xRootStor->isStorageElement(
name ) )
296 aNames.push_back(
name );
298 return aNames.empty()
299 ? Sequence< OUString >()
300 : Sequence< OUString >( aNames.data(), aNames.size() );
310 ::osl::MutexGuard aGuard(
m_aMutex );
318 Reference< XStorage > xStorage(
aEvent.Source, UNO_QUERY );
323 && (
pos->second == xStorage )
343 OSL_ENSURE( Reference< XStorage >(
Source.Source, UNO_QUERY ).is(),
"DocumentStorageAccess::disposing: No storage? What's this?" );
349 [&
Source](
const NamedStorages::value_type& rEntry) { return rEntry.second == Source.Source; });
358 ,m_aMacroMode( *this )
359 ,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
360 ,m_rDBContext( _rDBContext )
362 ,m_bModificationLock( false )
363 ,m_bDocumentInitialized( false )
368 ,m_bPasswordRequired(false)
369 ,m_bSuppressVersionColumns(true)
371 ,m_bDocumentReadOnly(false)
372 ,m_bMacroCallsSeenWhileLoading(false)
373 ,m_pSharedConnectionManager(nullptr)
374 ,m_nControllerLockCount(0)
377 m_sConnectURL =
"jdbc:";
378 m_aTableFilter = {
"%" };
379 impl_construct_nothrow();
383 OUString _sRegistrationName,
384 const Reference< XComponentContext >& _rxContext,
385 ODatabaseContext& _rDBContext
388 ,m_aMacroMode( *this )
389 ,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
390 ,m_rDBContext( _rDBContext )
392 ,m_bModificationLock( false )
393 ,m_bDocumentInitialized( false )
399 ,m_bPasswordRequired(false)
400 ,m_bSuppressVersionColumns(true)
402 ,m_bDocumentReadOnly(false)
403 ,m_bMacroCallsSeenWhileLoading(false)
404 ,m_pSharedConnectionManager(nullptr)
405 ,m_nControllerLockCount(0)
407 impl_construct_nothrow();
420 Sequence< Type > aAllowedTypes({
432 Reference< XPropertyContainer > xContainer(
m_xSettings, UNO_QUERY_THROW );
433 Reference< XSet > xSettingsSet(
m_xSettings, UNO_QUERY_THROW );
435 for ( ; pSettings->
AsciiName; ++pSettings )
440 OUString::createFromAscii( pSettings->
AsciiName ),
443 PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | PropertyAttribute::MAYBEVOID
445 xSettingsSet->insert(
Any( aProperty ) );
449 xContainer->addProperty(
450 OUString::createFromAscii( pSettings->
AsciiName ),
451 PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT,
468 const char* pAsciiName(
nullptr );
478 return OUString::createFromAscii( pAsciiName );
481 bool lcl_hasObjectWithMacros_throw(
const ODefinitionContainer_Impl& _rObjectDefinitions,
const Reference< XStorage >& _rxContainerStorage )
483 bool bSomeDocHasMacros =
false;
485 for (
auto const& objectDefinition : _rObjectDefinitions)
487 const TContentPtr& rDefinition( objectDefinition.second );
488 const OUString& rPersistentName( rDefinition->m_aProps.sPersistentName );
490 if ( rPersistentName.isEmpty() )
492 const ODefinitionContainer_Impl& rSubFoldersObjectDefinitions(
dynamic_cast< const ODefinitionContainer_Impl&
>( *rDefinition ) );
493 bSomeDocHasMacros = lcl_hasObjectWithMacros_throw( rSubFoldersObjectDefinitions, _rxContainerStorage );
494 if (bSomeDocHasMacros)
500 if (bSomeDocHasMacros)
503 return bSomeDocHasMacros;
508 bool bSomeDocHasMacros =
false;
510 const OContentHelper_Impl& rContainerData( *_rModel.getObjectContainer( _eType ) );
511 const ODefinitionContainer_Impl& rObjectDefinitions =
dynamic_cast< const ODefinitionContainer_Impl&
>( rContainerData );
515 Reference< XStorage > xContainerStorage( _rModel.getStorage( _eType ) );
524 if ( xContainerStorage.is() )
525 bSomeDocHasMacros = lcl_hasObjectWithMacros_throw( rObjectDefinitions, xContainerStorage );
527 catch(
const Exception& )
532 bSomeDocHasMacros =
true;
535 return bSomeDocHasMacros;
541 OSL_PRECOND( _rxContainerStorage.is(),
"ODatabaseModelImpl::objectHasMacros: this will crash!" );
543 bool bHasMacros =
true;
546 if ( !_rxContainerStorage->hasByName( _rPersistentName ) )
549 Reference< XStorage > xObjectStor( _rxContainerStorage->openStorageElement(
550 _rPersistentName, ElementModes::READ ) );
576 Reference<XConnection> xCon(
Source.Source,UNO_QUERY);
582 css::uno::Reference< css::sdbc::XConnection > xIterConn ( *
i );
583 if ( !xIterConn.is())
587 else if ( xCon == xIterConn )
589 *
i = css::uno::WeakReference< css::sdbc::XConnection >();
601 OSL_FAIL(
"ODatabaseModelImpl::disposing: where does this come from?" );
610 Reference< XConnection > xConn;
611 for (
auto const& connection : aConnections)
637 ::comphelper::disposeComponent( xDS );
640 ::comphelper::disposeComponent(
xModel );
647 m_xModel = WeakReference< XModel >();
652 elem->m_pDataSource =
nullptr;
707#if OSL_DEBUG_LEVEL > 0
708 if ( aMediaDescriptor.
has(
"SalvagedFile" ) )
716 OSL_ENSURE(
sSalvagedFile == i_rDocumentURL,
"ODatabaseModelImpl::setResource: inconsistency!" );
728 OSL_ENSURE( !_rArguments.has(
"Model" ),
"ODatabaseModelImpl::stripLoadArguments: this is suspicious (1)!" );
729 OSL_ENSURE( !_rArguments.has(
"ViewName" ),
"ODatabaseModelImpl::stripLoadArguments: this is suspicious (2)!" );
732 aMutableArgs.
remove(
"Model" );
733 aMutableArgs.
remove(
"ViewName" );
751 SAL_WARN_IF(!bSuccess && xStorage.is(),
"dbaccess",
752 "ODatabaseModelImpl::commitRootStorage: could not commit the storage!");
759 Reference< XSingleServiceFactory> xStorageFactory = StorageFactory::create(
m_aContext );
761 if ( !aSource.hasValue() )
767 OSL_ENSURE( aSource.hasValue(),
"ODatabaseModelImpl::getOrCreateRootStorage: no source to create the storage from!" );
769 if ( aSource.hasValue() )
771 Sequence< Any > aStorageCreationArgs{ aSource,
Any(ElementModes::READWRITE) };
773 Reference< XStorage > xDocumentStorage;
777 if (!sURL.startsWithIgnoreAsciiCase(
"vnd.sun.star.pkg:"))
781 xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
786 aStorageCreationArgs.getArray()[1] <<= ElementModes::READ;
789 xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
838 bool bTryToPreserveScriptSignature =
false;
841 OUString sTmpFileUrl = aTempFile.
GetURL();
844 bool bIsEmbedded = sLocation.startsWith(
"vnd.sun.star.pkg:") && sLocation.endsWith(
"/EmbeddedDatabase");
845 if (!bIsEmbedded && !sLocation.isEmpty()
846 && (aSignatureState == SignatureState::OK || aSignatureState == SignatureState::NOTVALIDATED
847 || aSignatureState == SignatureState::INVALID
848 || aSignatureState == SignatureState::UNKNOWN))
850 bTryToPreserveScriptSignature =
true;
853 osl::File::RC rc = osl::File::copy(sLocation, sTmpFileUrl);
854 if (rc != osl::FileBase::E_None)
855 throw uno::RuntimeException(
"Could not create temp file");
858 bool bSuccess =
false;
869 if (bTryToPreserveScriptSignature)
872 uno::Reference<security::XDocumentDigitalSignatures> xDDSigns;
875 xDDSigns = security::DocumentDigitalSignatures::createWithVersion(
878 const OUString aScriptSignName
879 = xDDSigns->getScriptingContentSignatureDefaultStreamName();
881 if (!aScriptSignName.isEmpty())
883 Reference<XStorage> xReadOrig
887 throw uno::RuntimeException(
"Could not read " + sTmpFileUrl);
888 uno::Reference<embed::XStorage> xMetaInf
889 = xReadOrig->openStorageElement(
"META-INF", embed::ElementModes::READ);
891 uno::Reference<embed::XStorage> xTargetMetaInf
892 = _rxStorage->openStorageElement(
"META-INF", embed::ElementModes::READWRITE);
893 if (xMetaInf.is() && xTargetMetaInf.is() && xMetaInf->hasByName(aScriptSignName))
895 xMetaInf->copyElementTo(aScriptSignName, xTargetMetaInf, aScriptSignName);
897 uno::Reference<embed::XTransactedObject> xTransact(xTargetMetaInf,
902 xTargetMetaInf->dispose();
905 uno::Sequence<security::DocumentSignatureInformation>
aInfos
906 = xDDSigns->verifyScriptingContentSignatures(
907 _rxStorage, uno::Reference<io::XInputStream>());
909 if (
nState == SignatureState::OK ||
nState == SignatureState::NOTVALIDATED
910 ||
nState == SignatureState::PARTIAL_OK)
913 xTransact.set(_rxStorage, uno::UNO_QUERY);
919 SAL_WARN(
"dbaccess",
"An invalid signature was copied!");
924 catch (uno::Exception&)
940 Reference< XModifiable > xModi(
m_xModel.get(), UNO_QUERY );
942 xModi->setModified( _bModified );
971 OSL_PRECOND( !
xModel.is(),
"ODatabaseModelImpl::createNewModel_deliverOwnership: not to be called if there already is a model!" );
981 Reference< XGlobalEventBroadcaster > xModelCollection = theGlobalEventBroadcaster::get(
m_aContext );
982 xModelCollection->insert(
Any(
xModel ) );
989 if ( bHadModelBefore )
1010 if ( osl_atomic_decrement(&
m_refCount) == 0 )
1030 css::embed::ElementModes::READWRITE );
1103 return aKnownSettings;
1112 rContentPtr = std::make_shared<ODefinitionContainer_Impl>();
1113 rContentPtr->m_pDataSource =
this;
1114 rContentPtr->m_aProps.aTitle = lcl_getContainerStorageName_throw( _eType );
1126 Reference< XInteractionHandler > xInteraction;
1139 if ( rxContainer.is() )
1142 Reference< XStorageBasedDocument > xDocument(
getModel_noCreate(), UNO_QUERY_THROW );
1148 Reference< XStorageBasedLibraryContainer > (*Factory)(
const Reference< XComponentContext >&,
const Reference< XStorageBasedDocument >&)
1149 = _bScript ? &DocumentScriptLibraryContainer::create : &DocumentDialogLibraryContainer::create;
1162 throw WrappedTargetRuntimeException(
1165 ::cppu::getCaughtException()
1182 if ( !_rxNewRootStorage.is() )
1183 throw IllegalArgumentException();
1194 Reference< XModifiable > xModify( _rxStorage, UNO_QUERY );
1195 OSL_ENSURE( xModify.is() || !_rxStorage.is(),
"lcl_modifyListening: storage can't notify us!" );
1197 if ( xModify.is() && !_bListen && _inout_rListener.is() )
1199 xModify->removeModifyListener( _inout_rListener );
1202 if ( _inout_rListener.is() )
1204 _inout_rListener->dispose();
1205 _inout_rListener =
nullptr;
1208 if ( xModify.is() && _bListen )
1210 _inout_rListener = new ::sfx2::DocumentStorageModifyListener( _rDocument, _rMutex );
1211 xModify->addModifyListener( _inout_rListener );
1218 void lcl_rebaseScriptStorage_throw(
const Reference< XStorageBasedLibraryContainer >& _rxContainer,
1219 const Reference< XStorage >& _rxNewRootStorage )
1221 if ( _rxContainer.is() )
1223 if ( _rxNewRootStorage.is() )
1224 _rxContainer->setRootStorage( _rxNewRootStorage );
1264 if (
aURL.GetProtocol() != INetProtocol::NotValid )
1279 if (!sOldURL.isEmpty())
1287 return lcl_getContainerStorageName_throw( _eType );
1292 sal_Int16 nCurrentMode = MacroExecMode::NEVER_EXECUTE;
1301 return nCurrentMode;
1365 bool bResult =
false;
1375 uno::Reference<security::XDocumentDigitalSignatures> xSigner(
1376 security::DocumentDigitalSignatures::createWithVersion(
1378 const uno::Sequence<security::DocumentSignatureInformation> aInfo
1379 = xSigner->verifyScriptingContentSignatures(xStorage,
1380 uno::Reference<io::XInputStream>());
1382 if (!aInfo.hasElements())
1389 bResult = std::any_of(aInfo.begin(), aInfo.end(),
1390 [&xSigner](
const security::DocumentSignatureInformation& rInfo) {
1391 return xSigner->isAuthorTrusted(rInfo.Signer);
1395 if (!bResult && bAllowUIToAddAuthor)
1397 Reference<XInteractionHandler> xInteraction;
1399 if (xInteraction.is())
1401 task::DocumentMacroConfirmationRequest aRequest;
1403 aRequest.DocumentStorage = xStorage;
1404 aRequest.DocumentSignatureInformation = aInfo;
1405 aRequest.DocumentVersion = aODFVersion;
1406 aRequest.Classification = task::InteractionClassification_QUERY;
1411 catch (uno::Exception&)
constexpr OUStringLiteral sSalvagedFile
static comphelper::SolarMutex & GetSolarMutex()
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static bool CallApproveHandler(const css::uno::Reference< css::task::XInteractionHandler > &xHandler, const css::uno::Any &rRequest, bool bAllowAbort)
bool has(const OUString &_rValueName) const
const css::uno::Any & get(const OUString &_rValueName) const
bool remove(const OUString &_rValueName)
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
static OUString GetODFVersionFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage)
static css::uno::Reference< css::embed::XStorage > GetStorageOfFormatFromURL(const OUString &aFormat, const OUString &aURL, sal_Int32 nStorageMode, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
css::uno::Type const & get()
void impl_resumeCommitPropagation()
virtual void SAL_CALL commited(const css::lang::EventObject &aEvent) override
void commitStorages()
disposes all known sub storages
virtual void SAL_CALL preCommit(const css::lang::EventObject &aEvent) override
virtual ~DocumentStorageAccess() override
bool m_bDisposingSubStorages
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL preRevert(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL reverted(const css::lang::EventObject &aEvent) override
ODatabaseModelImpl * m_pModelImplementation
std::map< OUString, Reference< XStorage > > NamedStorages
virtual Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override
bool m_bPropagateCommitToRoot
DocumentStorageAccess(ODatabaseModelImpl &_rModelImplementation)
Reference< XStorage > impl_openSubStorage_nothrow(const OUString &_rStorageName, sal_Int32 _nMode)
opens the sub storage with the given name, in the given mode
void impl_suspendCommitPropagation()
bool commitEmbeddedStorage(bool _bPreventRootCommits)
commits the dedicated "database" storage
void disposeStorages()
disposes all storages managed by this instance
NamedStorages m_aExposedStorages
all sub storages which we ever gave to the outer world
virtual Reference< XStorage > SAL_CALL getDocumentSubStorage(const OUString &aStorageName, ::sal_Int32 _nMode) override
virtual ~ModelDependentComponent()
ModelDependentComponent(::rtl::Reference< ODatabaseModelImpl > _model)
void removeFromTerminateListener(const ODatabaseModelImpl &_rDataSourceModel)
void databaseDocumentURLChange(const OUString &_sOldName, const OUString &_sNewName)
void storeTransientProperties(ODatabaseModelImpl &_rModelImpl)
void registerDatabaseDocument(ODatabaseModelImpl &_rModelImpl)
void revokeDatabaseDocument(const ODatabaseModelImpl &_rModelImpl)
void appendAtTerminateListener(const ODatabaseModelImpl &_rDataSourceModel)
static rtl::Reference< ODatabaseDocument > createDatabaseDocument(const ::rtl::Reference< ODatabaseModelImpl > &_pImpl, FactoryAccess)
TContentPtr & getObjectContainer(const ObjectType _eType)
retrieves the requested container of objects (forms/reports/tables/queries)
void setResource(const OUString &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArgs)
virtual bool hasTrustedScriptingSignature(bool bAllowUIToAddAuthor) override
bool m_bDocumentInitialized
true if and only if a database document existed previously (though meanwhile disposed),...
SharedStorage m_xDocumentStorage
virtual void storageIsModified() override
static const AsciiPropertyValue * getDefaultDataSourceSettings()
returns all known data source settings, including their default values
const css::uno::Reference< css::uno::XComponentContext > m_aContext
ODatabaseModelImpl(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, ODatabaseContext &_pDBContext)
::comphelper::NamedValueCollection stripLoadArguments(const ::comphelper::NamedValueCollection &_rArguments)
OUString m_sDocFileLocation
the URL the document was loaded from
virtual bool macroCallsSeenWhileLoading() const override
css::uno::WeakReference< css::sdbc::XDataSource > m_xDataSource
o3tl::enumarray< ObjectType, TContentPtr > m_aContainer
bool isModifyLocked() const
bool commitEmbeddedStorage(bool _bPreventRootCommits=false)
stores the embedded storage ("database")
const css::uno::Reference< css::util::XNumberFormatsSupplier > & getNumberFormatsSupplier()
virtual sal_Int16 getCurrentMacroExecMode() const override
css::uno::Reference< css::document::XDocumentSubStorageSupplier > getDocumentSubStorageSupplier()
::comphelper::NamedValueCollection m_aMediaDescriptor
void impl_construct_nothrow()
css::uno::Reference< css::embed::XStorage > const & getRootStorage() const
css::uno::Reference< css::embed::XStorage > const & getOrCreateRootStorage()
void modelIsDisposing(const bool _wasInitialized, ResetModelAccess)
resets the model to NULL
rtl::Reference< DocumentStorageAccess > m_pStorageAccess
css::uno::Reference< css::lang::XEventListener > m_xSharedConnectionManager
css::uno::Reference< css::script::XStorageBasedLibraryContainer > m_xDialogLibraries
::sfx2::DocumentMacroMode m_aMacroMode
ODatabaseContext & m_rDBContext
css::uno::Reference< css::beans::XPropertyBag > m_xSettings
SignatureState m_nScriptingSignatureState
::std::optional< EmbeddedMacros > m_aEmbeddedMacros
do we have any object (forms/reports) which contains macros?
virtual ~ODatabaseModelImpl()
void storeLibraryContainersTo(const css::uno::Reference< css::embed::XStorage > &_rxToRootStorage)
lets our library containers store themself into the given root storage
void impl_switchToLogicalURL(const OUString &i_rDocumentURL)
switches to the given document URL, which denotes the logical URL of the document,...
css::uno::Reference< css::embed::XStorage > getStorage(const ObjectType _eType)
const OUString & getDocFileLocation() const
bool m_bMacroCallsSeenWhileLoading
OUString m_sDocumentURL
the URL which the document should report as its URL
void resetMacroExecutionMode()
resets our macro execute mode, so next time the checkMacrosOnLoading is called, it will behave as if ...
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListener
OWeakConnectionArray m_aConnections
virtual SignatureState getScriptingSignatureState() override
void commitRootStorage()
commits our storage
bool commitStorageIfWriteable_ignoreErrors(const css::uno::Reference< css::embed::XStorage > &_rxStorage)
commits a given storage if it's not readonly, ignoring (but asserting) all errors
DocumentStorageAccess * getDocumentStorageAccess()
const OUString & getURL() const
void setModified(bool bModified)
css::uno::Reference< css::script::XStorageBasedLibraryContainer > getLibraryContainer(bool _bScript)
ensures that ->m_xBasicLibraries resp.
void disposing(const css::lang::EventObject &Source)
css::uno::WeakReference< css::frame::XModel > m_xModel
void setDocFileLocation(const OUString &i_rLoadedFrom)
OSharedConnectionManager * m_pSharedConnectionManager
virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override
css::uno::Reference< css::embed::XStorage > const & impl_switchToStorage_throw(const css::uno::Reference< css::embed::XStorage > &_rxNewRootStorage)
void commitStorages()
commits all sub storages
css::uno::Reference< css::lang::XSingleServiceFactory > createStorageFactory() const
creates a ->css::embed::StorageFactory
css::uno::Reference< css::sdbc::XDataSource > getOrCreateDataSource()
returns the data source.
bool adjustMacroMode_AutoReject()
adjusts our document's macro execution mode, without using any UI, assuming the user would reject exe...
oslInterlockedCount m_refCount
virtual bool documentStorageHasMacros() const override
virtual OUString getDocumentLocation() const override
bool checkMacrosOnLoading()
checks our document's macro execution mode, using the interaction handler as supplied with our load a...
virtual void setCurrentMacroExecMode(sal_uInt16) override
css::uno::Reference< css::frame::XModel > getModel_noCreate() const
returns the model, if there already exists one
css::uno::Reference< css::embed::XStorage > switchToStorage(const css::uno::Reference< css::embed::XStorage > &_rxNewRootStorage)
rebases the document to the given storage
css::uno::Reference< css::script::XStorageBasedLibraryContainer > m_xBasicLibraries
EmbeddedMacros determineEmbeddedMacros()
determines which kind of embedded macros are present in the document
css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier
css::uno::Reference< css::frame::XModel > createNewModel_deliverOwnership()
returns a new ->ODatabaseDocument
static OUString getObjectContainerStorageName(const ObjectType _eType)
returns the name of the storage which is used to stored objects of the given type,...
static bool objectHasMacros(const css::uno::Reference< css::embed::XStorage > &_rxContainerStorage, const OUString &_rPersistentName)
determines whether a given object storage contains macros
bool adjustMacroMode(const css::uno::Reference< css::task::XInteractionHandler > &_rxInteraction, bool bHasValidContentSignature=false)
bool checkMacrosOnLoading(const css::uno::Reference< css::task::XInteractionHandler > &_rxInteraction, bool bHasValidContentSignature=false)
static bool storageHasMacros(const css::uno::Reference< css::embed::XStorage > &_rxStorage)
static OUString getWorkLocale()
const css::uno::Reference< INTERFACE > & getTyped() const
void reset(const css::uno::Reference< INTERFACE > &_rxComponent, AssignmentMode _eMode=TakeOwnership)
void EnableKillingFile(bool bEnable=true)
OUString const & GetURL() const
Reference< XComponentContext > m_aContext
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
SignatureState getSignatureState(const uno::Sequence< security::DocumentSignatureInformation > &aSigInfo)
Reference< XComponentContext > getProcessComponentContext()
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
std::shared_ptr< OContentHelper_Impl > TContentPtr
std::vector< css::uno::WeakReference< css::sdbc::XConnection > > OWeakConnectionArray
Sequence< Property > aInfos
constexpr OUStringLiteral ZIP_STORAGE_FORMAT_STRING
const css::uno::Type & ValueType
css::uno::Any DefaultValue
Reference< XModel > xModel
the model of the sub component. Might be <NULL>