diff options
author | Andres Gomez <agomez@igalia.com> | 2013-09-17 18:30:17 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-20 10:35:51 +0200 |
commit | bee6b8f2ba4ea04135bb47e24c520015129aca27 (patch) | |
tree | 032922998c6b69099055f81416bc16d9ceb8a4d0 /sfx2 | |
parent | 652b0b6d189b4c0925ab859e81c6005a4a348a55 (diff) |
uno: new InteropGrabBag UNO prop in OfficeDocument
Added the new InteropGrabBag property to the OfficeDocument service
and modified the JUnit UNO unit tests for it.
Added specific implementation in the sfx2 module for the SfxBaseModel
class.
Added specific inherited implementations in the sc, sd, starmath and
sw modules for the ScModelObj, SdXImpressDocument, SmModel, and
SwXTextDocument classes.
This new property is intended by now for its usage on preserving OOX's
theming although the aim is to be able to re-create the theming in the
future from saved properties.
It could also be used for preserving other attributes for
interoperability among document formats.
Change-Id: Ia822856293c70ae22911afa794e3e38bcaa31f86
Reviewed-on: https://gerrit.libreoffice.org/6000
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 1fc65d2279af..c7d7dcb5a90c 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -60,6 +60,7 @@ #include <svl/stritem.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> +#include <svl/grabbagitem.hxx> #include <basic/sbx.hxx> #include <basic/sbuno.hxx> #include <tools/urlobj.hxx> @@ -213,6 +214,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata; ::rtl::Reference< ::sfx2::DocumentUndoManager > m_pDocumentUndoManager; Sequence< document::CmisProperty> m_cmisProperties; + SfxGrabBagItem* m_pGrabBagItem ; IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell ) : m_pObjectShell ( pObjectShell ) @@ -231,6 +233,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument , m_xDocumentMetadata () // lazy , m_pDocumentUndoManager () , m_cmisProperties () + , m_pGrabBagItem ( NULL ) { // increase global instance counter. ++g_nInstanceCounter; @@ -240,6 +243,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument virtual ~IMPL_SfxBaseModel_DataContainer() { + delete m_pGrabBagItem; } // ::sfx2::IModifiableDocument @@ -3460,6 +3464,24 @@ sal_Bool SfxBaseModel::hasValidSignatures() const return sal_False; } +void SfxBaseModel::getGrabBagItem(com::sun::star::uno::Any& rVal) const +{ + if (m_pData->m_pGrabBagItem != NULL) + m_pData->m_pGrabBagItem->QueryValue(rVal); + else { + uno::Sequence<beans::PropertyValue> aValue(0); + rVal = uno::makeAny(aValue); + } +} + +void SfxBaseModel::setGrabBagItem(const com::sun::star::uno::Any& rVal) +{ + if (m_pData->m_pGrabBagItem == NULL) + m_pData->m_pGrabBagItem = new SfxGrabBagItem; + + m_pData->m_pGrabBagItem->PutValue(rVal); +} + static void GetCommandFromSequence( OUString& rCommand, sal_Int32& nIndex, const Sequence< beans::PropertyValue >& rSeqPropValue ) { nIndex = -1; |