summaryrefslogtreecommitdiff
path: root/sw/source/ui/fldui/fldtdlg.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-02-26 13:24:57 +0000
committerOliver Bolte <obo@openoffice.org>2008-02-26 13:24:57 +0000
commitda0987ab59860b5c1d2a3e426b27f7d7acf2afac (patch)
tree6386f3ff04f355bdc34f0bff2ff6dd3d229d2bb5 /sw/source/ui/fldui/fldtdlg.cxx
parent6f0cdbfcdc4382f3fb33fd0c709b5ebd6b0bf464 (diff)
INTEGRATION: CWS custommeta (1.19.30); FILE MERGED
2008/01/18 10:24:11 mst 1.19.30.1: remove support for field types DI_INFO[1-4] - sw/inc/docufld.hxx, sw/source/core/fields/docufld.cxx: + nsSwDocInfoSubType: removed constants DI_INFO[1-4] + use XDocumentProperties instead of SfxDocumentInfo + adapt to SwDoc interface change - sw/source/ui/fldui/{flddinf.cxx,fldedt.cxx,fldmgr.cxx,fldtdlg.cxx}: + remove support for field types DI_INFO[1-4] + use XDocumentProperties instead of SfxDocumentInfo + fix bug in SwFldDokInfPage::FillItemSet: name of custom property was lost - sw/source/ui/fldui/makefile.mk: + enable exceptions for fldedt.cxx, fldtdlg.cxx - sw/source/ui/inc/utlui.hrc, sw/source/ui/utlui/initui.src: + remove FLD_DOCINFO_INFO[1-4]
Diffstat (limited to 'sw/source/ui/fldui/fldtdlg.cxx')
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 0a24ed40bc16..8a6e5d45e054 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: fldtdlg.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: ihi $ $Date: 2007-11-26 15:32:59 $
+ * last change: $Author: obo $ $Date: 2008-02-26 14:24:57 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -68,8 +68,6 @@
#include <svx/htmlmode.hxx>
#endif
-#include <sfx2/docinf.hxx>
-
#ifndef _VIEWOPT_HXX
#include <viewopt.hxx>
#endif
@@ -123,6 +121,10 @@
#include <fldtdlg.hrc>
#endif
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+
+
/*--------------------------------------------------------------------
Beschreibung: Der Traeger des Dialoges
--------------------------------------------------------------------*/
@@ -266,9 +268,23 @@ SfxItemSet* SwFldDlg::CreateInputItemSet( USHORT nID )
{
SwDocShell* pDocSh = (SwDocShell*)SfxObjectShell::Current();
SfxItemSet* pISet = new SfxItemSet( pDocSh->GetPool(), SID_DOCINFO, SID_DOCINFO );
- com::sun::star::uno::Any aAny;
- aAny <<= pDocSh->GetDocInfo().GetCustomPropertyNames();
- pISet->Put( SfxUnoAnyItem( SID_DOCINFO, aAny ) );
+ using namespace ::com::sun::star;
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ pDocSh->GetModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> xDocProps
+ = xDPS->getDocumentProperties();
+ uno::Reference< beans::XPropertySet > xUDProps(
+ xDocProps->getUserDefinedProperties(),
+ uno::UNO_QUERY_THROW);
+ uno::Reference< beans::XPropertySetInfo > xSetInfo
+ = xUDProps->getPropertySetInfo();
+ const uno::Sequence< beans::Property > props
+ = xSetInfo->getProperties();
+ uno::Sequence< ::rtl::OUString > names(props.getLength());
+ for (sal_Int32 i = 0; i < props.getLength(); ++i) {
+ names[i] = props[i].Name;
+ }
+ pISet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(names) ) );
return pISet;
}
else