summaryrefslogtreecommitdiff
path: root/sw/inc/fmtmeta.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-10 08:18:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-03-10 14:31:54 +0100
commit6a114b8ffaac52322c318d2dba543a2ad52cc892 (patch)
tree1306b5d7caedc5a36aded233257e5b4708f21065 /sw/inc/fmtmeta.hxx
parent1b98d7a3c4f1de39226e44e5b27351d8bfbbe6c0 (diff)
sw: make metadata available in copy result
The "copy" part of copy&paste works in sw by creating a separate SwDoc, then copying the selection of the original SwDoc into it, so filters can easily just export the whole clipboard document. A side effect of this is that the clipboard document has no documnent shell, that would contain the metadata. Add a new member to MetaFieldManager that can store metadata in the clipboard case, let SwTransferable::GetData() write metadata there, and finally adapt the RTF export to look for metadata there as well. Change-Id: Icfe32abca4290af8bf5b24a34160c43d4c87c04a
Diffstat (limited to 'sw/inc/fmtmeta.hxx')
-rw-r--r--sw/inc/fmtmeta.hxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index ab1ac82ddefb..eb276dfc2690 100644
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -31,6 +31,9 @@
#include <vector>
namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
namespace text {
class XTextField;
}
@@ -190,12 +193,14 @@ public:
};
/// knows all meta-fields in the document.
-class MetaFieldManager
+class SW_DLLPUBLIC MetaFieldManager
: private ::boost::noncopyable
{
private:
typedef ::std::vector< std::weak_ptr<MetaField> > MetaFieldList_t;
MetaFieldList_t m_MetaFields;
+ /// Document properties of a clipboard document, empty for non-clipboard documents.
+ css::uno::Reference<css::document::XDocumentProperties> m_xDocumentProperties;
public:
MetaFieldManager();
@@ -205,6 +210,9 @@ public:
const bool bIsFixedLanguage = false );
/// get all meta fields
::std::vector< css::uno::Reference<css::text::XTextField> > getMetaFields();
+ /// Copy document properties from rSource to m_xDocumentProperties.
+ void copyDocumentProperties(const SwDoc& rSource);
+ css::uno::Reference<css::document::XDocumentProperties> getDocumentProperties();
};
} // namespace sw