[Libreoffice-commits] .: 2 commits - basic/inc comphelper/source cui/source filter/source odk/pack offapi/com qadevOOo/tests sd/source sfx2/inc sfx2/source svtools/source swext/mediawiki sw/inc sw/source vbahelper/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 22 03:18:14 PST 2012
basic/inc/basic/basicmanagerrepository.hxx | 3
comphelper/source/misc/documentinfo.cxx | 2
cui/source/customize/cfgutil.cxx | 1
filter/source/msfilter/msvbahelper.cxx | 15
odk/pack/copying/idl_chapter_refs.txt | 16
offapi/com/sun/star/document/XDocumentSubStorageSupplier.idl | 3
offapi/com/sun/star/sdb/DocumentDefinition.idl | 3
qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java | 12
qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java | 22 -
qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java | 14
qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java | 37 +
qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java | 13
qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java | 22 -
qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java | 12
qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java | 23 -
qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java | 14
qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java | 23 -
sd/source/filter/ppt/pptin.cxx | 2
sfx2/inc/guisaveas.hxx | 5
sfx2/source/appl/appopen.cxx | 2
sfx2/source/doc/doctemplates.cxx | 56 --
sfx2/source/doc/guisaveas.cxx | 74 ++-
sfx2/source/doc/objcont.cxx | 32 -
sfx2/source/doc/objxtor.cxx | 1
svtools/source/contnr/contentenumeration.cxx | 25 -
svtools/source/contnr/contentenumeration.hxx | 7
sw/inc/doc.hxx | 13
sw/inc/unomap.hxx | 1
sw/inc/unoprnms.hxx | 95 ++--
sw/source/core/doc/docnew.cxx | 47 --
sw/source/core/layout/laycache.cxx | 70 ---
sw/source/core/unocore/unomap.cxx | 1
sw/source/core/unocore/unoprnms.cxx | 93 ++--
sw/source/filter/html/swhtml.cxx | 2
sw/source/filter/ww8/ww8par.cxx | 7
sw/source/ui/uno/unotxdoc.cxx | 14
sw/source/ui/vba/vbadocument.cxx | 9
sw/source/ui/vba/vbadocumentproperties.cxx | 222 +++++++++--
swext/mediawiki/src/com/sun/star/wiki/Helper.java | 38 -
vbahelper/source/vbahelper/vbaapplicationbase.cxx | 1
40 files changed, 509 insertions(+), 543 deletions(-)
New commits:
commit 9c5d6ea5efb5f56a4ac96b4a8505ed84abbbc6bf
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Nov 21 22:46:01 2012 +0100
sw: remove WorkaroundForB6375613
... which is incidentally the last user of XDocumentInfo.
Change-Id: I47dc31c8739aa1d50c2a3b26ac51a239417fa5b0
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 0127616..ae910d8 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -481,13 +481,6 @@ private:
bool mbXMLExport : 1; ///< sal_True: during XML export
#endif
- // Document flag to trigger conversion, which applys the workaround for documents,
- // which uses a certain layout defect in OOo 1.x to layout the documents.
- // This conversion is performed, when the frames for the layout are created.
- // Thus, this document flag has to be set after load a document and before
- // creating the document view.
- bool mbApplyWorkaroundForB6375613 : 1;
-
//
// COMPATIBILITY FLAGS START
//
@@ -2036,12 +2029,6 @@ public:
void initXForms( bool bCreateDefaultModel );
// access methods for XForms model(s)
- inline bool ApplyWorkaroundForB6375613() const
- {
- return mbApplyWorkaroundForB6375613;
- }
- void SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 );
-
//Update all the page masters
void SetDefaultPageMode(bool bSquaredPageMode);
sal_Bool IsSquaredPageMode() const;
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index cd583e2..7f130a2 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -238,7 +238,6 @@
#define WID_DOC_HAS_VALID_SIGNATURES 1017
#define WID_DOC_BUILDID 1024
#define WID_DOC_ISTEMPLATEID 1025
-#define WID_APPLY_WORKAROUND_FOR_B6375613 1070
// MailMerge
#define WID_SELECTION 1071
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 2f3c2d3..28c7ba4 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -753,71 +753,70 @@ enum SwPropNameIds
/* 0708 */ UNO_NAME_CHAR_AUTO_STYLE_NAME,
/* 0709 */ UNO_NAME_PARA_AUTO_STYLE_NAME,
-/* 0710 */ UNO_NAME_APPLY_WORKAROUND_FOR_B6375613,
-/* 0711 */ UNO_NAME_LAYOUT_SIZE,
+/* 0710 */ UNO_NAME_LAYOUT_SIZE,
-/* 0712 */ UNO_NAME_HELP,
-/* 0713 */ UNO_NAME_TOOLTIP,
+/* 0711 */ UNO_NAME_HELP,
+/* 0712 */ UNO_NAME_TOOLTIP,
-/* 0714 */ UNO_NAME_DIALOG_LIBRARIES,
-/* 0715 */ UNO_NAME_HEADER_ROW_COUNT,
-/* 0716 */ UNO_NAME_INPUT,
-/* 0717 */ UNO_NAME_ROW_SPAN,
+/* 0713 */ UNO_NAME_DIALOG_LIBRARIES,
+/* 0714 */ UNO_NAME_HEADER_ROW_COUNT,
+/* 0715 */ UNO_NAME_INPUT,
+/* 0716 */ UNO_NAME_ROW_SPAN,
-/* 0718 */ UNO_NAME_POSITION_AND_SPACE_MODE,
-/* 0719 */ UNO_NAME_LABEL_FOLLOWED_BY,
-/* 0720 */ UNO_NAME_LISTTAB_STOP_POSITION,
-/* 0721 */ UNO_NAME_FIRST_LINE_INDENT,
-/* 0722 */ UNO_NAME_INDENT_AT,
+/* 0717 */ UNO_NAME_POSITION_AND_SPACE_MODE,
+/* 0718 */ UNO_NAME_LABEL_FOLLOWED_BY,
+/* 0719 */ UNO_NAME_LISTTAB_STOP_POSITION,
+/* 0720 */ UNO_NAME_FIRST_LINE_INDENT,
+/* 0721 */ UNO_NAME_INDENT_AT,
-/* 0723 */ UNO_NAME_CHAPTER_LEVEL,
+/* 0722 */ UNO_NAME_CHAPTER_LEVEL,
-/* 0724 */ UNO_NAME_GRID_BASE_WIDTH,
-/* 0725 */ UNO_NAME_GRID_SNAP_TO_CHARS,
-/* 0726 */ UNO_NAME_GRID_STANDARD_PAGE_MODE,
-/* 0727 */ UNO_NAME_TABLE_BORDER_DISTANCES,
+/* 0723 */ UNO_NAME_GRID_BASE_WIDTH,
+/* 0724 */ UNO_NAME_GRID_SNAP_TO_CHARS,
+/* 0725 */ UNO_NAME_GRID_STANDARD_PAGE_MODE,
+/* 0726 */ UNO_NAME_TABLE_BORDER_DISTANCES,
-/* 0728 */ UNO_NAME_LIST_ID,
-/* 0729 */ UNO_NAME_DEFAULT_LIST_ID,
+/* 0727 */ UNO_NAME_LIST_ID,
+/* 0728 */ UNO_NAME_DEFAULT_LIST_ID,
-/* 0730 */ UNO_NAME_STREAM_NAME,
+/* 0729 */ UNO_NAME_STREAM_NAME,
-/* 0731 */ UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE,
-/* 0732 */ UNO_NAME_PARA_LIST_LABEL_STRING,
+/* 0730 */ UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE,
+/* 0731 */ UNO_NAME_PARA_LIST_LABEL_STRING,
-/* 0733 */ UNO_NAME_CHAR_OVERLINE,
-/* 0734 */ UNO_NAME_CHAR_OVERLINE_COLOR,
-/* 0735 */ UNO_NAME_CHAR_OVERLINE_HAS_COLOR,
-/* 0736 */ UNO_NAME_OUTLINE_LEVEL,
+/* 0732 */ UNO_NAME_CHAR_OVERLINE,
+/* 0733 */ UNO_NAME_CHAR_OVERLINE_COLOR,
+/* 0734 */ UNO_NAME_CHAR_OVERLINE_HAS_COLOR,
+/* 0735 */ UNO_NAME_OUTLINE_LEVEL,
-/* 0737 */ UNO_NAME_DESCRIPTION,
-/* 0738 */ UNO_NAME_META,
-/* 0739 */ UNO_NAME_IS_TEMPLATE,
-/* 0740 */ UNO_NAME_VBA_DOCOBJ,
-/* 0741 */ UNO_NAME_NESTED_TEXT_CONTENT,
-/* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE,
-/* 0743 */ UNO_NAME_FOOTNOTE_LINE_STYLE,
-/* 0744 */ UNO_NAME_EMBEDDED_OBJECT,
-/* 0745 */ UNO_NAME_RSID,
-/* 0746 */ UNO_NAME_PARRSID,
+/* 0736 */ UNO_NAME_DESCRIPTION,
+/* 0737 */ UNO_NAME_META,
+/* 0738 */ UNO_NAME_IS_TEMPLATE,
+/* 0739 */ UNO_NAME_VBA_DOCOBJ,
+/* 0740 */ UNO_NAME_NESTED_TEXT_CONTENT,
+/* 0741 */ UNO_NAME_SEPARATOR_LINE_STYLE,
+/* 0742 */ UNO_NAME_FOOTNOTE_LINE_STYLE,
+/* 0743 */ UNO_NAME_EMBEDDED_OBJECT,
+/* 0744 */ UNO_NAME_RSID,
+/* 0745 */ UNO_NAME_PARRSID,
-/* 0747 */ UNO_NAME_LINE_STYLE,
-/* 0748 */ UNO_NAME_LINE_WIDTH,
+/* 0746 */ UNO_NAME_LINE_STYLE,
+/* 0747 */ UNO_NAME_LINE_WIDTH,
-/* 0749 */ UNO_NAME_PARA_CONTEXT_MARGIN,
+/* 0748 */ UNO_NAME_PARA_CONTEXT_MARGIN,
-/* 0750 */ UNO_NAME_PARAGRAPH_STYLE_NAME,
+/* 0749 */ UNO_NAME_PARAGRAPH_STYLE_NAME,
-/* 0751 */ UNO_NAME_FIRST_IS_SHARED,
-/* 0752 */ UNO_NAME_HEADER_TEXT_FIRST,
-/* 0753 */ UNO_NAME_FOOTER_TEXT_FIRST,
+/* 0750 */ UNO_NAME_FIRST_IS_SHARED,
+/* 0751 */ UNO_NAME_HEADER_TEXT_FIRST,
+/* 0752 */ UNO_NAME_FOOTER_TEXT_FIRST,
-/* 0754 */ UNO_NAME_INITIALS,
-/* 0755 */ UNO_NAME_TABLE_BORDER2,
+/* 0753 */ UNO_NAME_INITIALS,
+/* 0754 */ UNO_NAME_TABLE_BORDER2,
-/* 0756 */ UNO_NAME_REPLACEMENT_GRAPHIC_URL,
+/* 0755 */ UNO_NAME_REPLACEMENT_GRAPHIC_URL,
-/* 0757 */ SW_PROPNAME_END
+/* 0756 */ SW_PROPNAME_END
// new items in this array must match SwPropNameTab aPropNameTab
};
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 0adddef..f2ac06e 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -102,18 +102,11 @@
#include <cmdid.h> // for the default printer in SetJob
-
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <com/sun/star/beans/XPropertyContainer.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
#include <pausethreadstarting.hxx>
#include <numrule.hxx>
#include <list.hxx>
#include <listfunc.hxx>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-
#include <sfx2/Metadatable.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
#include <boost/foreach.hpp>
@@ -304,8 +297,6 @@ SwDoc::SwDoc()
mbXMLExport(false),
#endif
- mbApplyWorkaroundForB6375613(false),
-
// COMPATIBILITY FLAGS START
mbAddFlyOffsets(false),
@@ -1000,44 +991,6 @@ void SwDoc::UpdateLinks( bool bUI )
}
-void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
-{
- if ( mbApplyWorkaroundForB6375613 != p_bApplyWorkaroundForB6375613 )
- {
- mbApplyWorkaroundForB6375613 = p_bApplyWorkaroundForB6375613;
-
- uno::Reference< document::XDocumentInfoSupplier > xDoc(
- GetDocShell()->GetBaseModel(),
- uno::UNO_QUERY);
- if ( xDoc.is() )
- {
- uno::Reference< beans::XPropertyContainer > xDocInfo(
- xDoc->getDocumentInfo(),
- uno::UNO_QUERY );
- if ( xDocInfo.is() )
- {
- try
- {
- if ( mbApplyWorkaroundForB6375613 )
- {
- xDocInfo->addProperty(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")),
- beans::PropertyAttribute::TRANSIENT | beans::PropertyAttribute::REMOVABLE,
- uno::makeAny( false ) );
- }
- else
- {
- xDocInfo->removeProperty( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")) );
- }
- }
- catch( uno::Exception& )
- {
- }
- }
- }
- }
-}
-
::sfx2::IXmlIdRegistry&
SwDoc::GetXmlIdRegistry()
{
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 8752828..69a7618 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -61,8 +61,6 @@
#include <pam.hxx>
#include <docsh.hxx>
#include <poolfmt.hxx>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <set>
@@ -682,69 +680,6 @@ sal_Bool SwLayHelper::CheckInsertPage()
return sal_False;
}
-//
-static bool lcl_HasTextFrmAnchoredObjs( SwTxtFrm* p_pTxtFrm )
-{
- bool bHasTextFrmAnchoredObjs( false );
-
- const SwFrmFmts* pSpzFrmFmts = p_pTxtFrm->GetTxtNode()->GetDoc()->GetSpzFrmFmts();
- for ( sal_uInt16 i = 0; i < pSpzFrmFmts->size(); ++i )
- {
- SwFrmFmt *pFmt = (SwFrmFmt*)(*pSpzFrmFmts)[i];
- const SwFmtAnchor &rAnch = pFmt->GetAnchor();
- if ( rAnch.GetCntntAnchor() &&
- ((rAnch.GetAnchorId() == FLY_AT_PARA) ||
- (rAnch.GetAnchorId() == FLY_AT_CHAR)) &&
- rAnch.GetCntntAnchor()->nNode.GetIndex() ==
- p_pTxtFrm->GetTxtNode()->GetIndex() )
- {
- bHasTextFrmAnchoredObjs = true;
- break;
- }
- }
-
- return bHasTextFrmAnchoredObjs;
-}
-
-static void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
-{
- SwTxtFrm* pFirstTextFrmOnNewPage = dynamic_cast<SwTxtFrm*>(p_pFirstFrmOnNewPage);
- //
- if ( pFirstTextFrmOnNewPage &&
- !pFirstTextFrmOnNewPage->IsFollow() &&
- pFirstTextFrmOnNewPage->GetTxt().Len() == 0 &&
- lcl_HasTextFrmAnchoredObjs( pFirstTextFrmOnNewPage ) )
- {
- // apply page break before at this text frame to assure, that it doesn't flow backward.
- const SvxBreak eBreak =
- pFirstTextFrmOnNewPage->GetAttrSet()->GetBreak().GetBreak();
- if ( eBreak == SVX_BREAK_NONE )
- {
- pFirstTextFrmOnNewPage->GetTxtNode()->LockModify();
- SwDoc* pDoc( pFirstTextFrmOnNewPage->GetTxtNode()->GetDoc() );
- IDocumentContentOperations* pIDCO = pFirstTextFrmOnNewPage->GetTxtNode()->getIDocumentContentOperations();
- const SwPaM aTmpPaM( *(pFirstTextFrmOnNewPage->GetTxtNode()) );
- pIDCO->InsertPoolItem( aTmpPaM,
- SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ), 0 );
- pFirstTextFrmOnNewPage->GetTxtNode()->UnlockModify();
-
- uno::Reference< document::XDocumentInfoSupplier > xDoc(
- pDoc->GetDocShell()->GetBaseModel(),
- uno::UNO_QUERY);
- uno::Reference< beans::XPropertySet > xDocInfo(
- xDoc->getDocumentInfo(),
- uno::UNO_QUERY );
- try
- {
- xDocInfo->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")), uno::makeAny( true ) );
- }
- catch( uno::Exception& )
- {
- }
- }
- }
-}
-
/*
* SwLayHelper::CheckInsert
* is the entry point for the _InsertCnt-function.
@@ -937,11 +872,6 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
SwPageFrm* pLastPage = rpPage;
if( CheckInsertPage() )
{
- //
- if ( pDoc->ApplyWorkaroundForB6375613() )
- {
- lcl_ApplyWorkaroundForB6375613( rpFrm );
- }
_CheckFlyCache( pLastPage );
if( rpPrv && rpPrv->IsTxtFrm() && !rpPrv->GetValidSizeFlag() )
rpPrv->Frm().Height( rpPrv->GetUpper()->Prt().Height() );
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index d997895..8849dfd 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1549,7 +1549,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_LOCK_UPDATES), WID_DOC_LOCK_UPDATES, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_HAS_VALID_SIGNATURES), WID_DOC_HAS_VALID_SIGNATURES, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_BUILDID), WID_DOC_BUILDID, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0},
- { SW_PROP_NMID(UNO_NAME_APPLY_WORKAROUND_FOR_B6375613), WID_APPLY_WORKAROUND_FOR_B6375613, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, 0},
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aDocMap_Impl;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index b4ea5b9..d2d653f 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -737,55 +737,54 @@ const SwPropNameTab aPropNameTab = {
/* 0707 UNO_NAME_HAS_VALID_SIGNATURES*/ {MAP_CHAR_LEN("HasValidSignatures")},
/* 0708 UNO_CHAR_AUTO_STYLE_NAME */ {MAP_CHAR_LEN("CharAutoStyleName")},
/* 0709 UNO_PARA_AUTO_STYLE_NAME */ {MAP_CHAR_LEN("ParaAutoStyleName")},
-/* 0710 UNO_NAME_APPLY_WORKAROUND_FOR_B6375613*/ {MAP_CHAR_LEN("ApplyWorkaroundForB6375613")},
-/* 0711 UNO_NAME_LAYOUT_SIZE*/ {MAP_CHAR_LEN("LayoutSize")},
-/* 0712 UNO_NAME_HELP */ {MAP_CHAR_LEN("Help")},
-/* 0713 UNO_NAME_TOOLTIP */ {MAP_CHAR_LEN("Tooltip")},
-/* 0714 UNO_NAME_DIALOG_LIBRARIES*/ {MAP_CHAR_LEN("DialogLibraries")},
-/* 0715 UNO_NAME_HEADER_ROW_COUNT*/ {MAP_CHAR_LEN("HeaderRowCount")},
-/* 0716 UNO_NAME_INPUT */ {MAP_CHAR_LEN("Input")},
-/* 0717 UNO_NAME_ROW_SPAN */ {MAP_CHAR_LEN("RowSpan")},
-/* 0718 UNO_NAME_POSITION_AND_SPACE_MODE */ {MAP_CHAR_LEN("PositionAndSpaceMode")},
-/* 0719 UNO_NAME_LABEL_FOLLOWED_BY */ {MAP_CHAR_LEN("LabelFollowedBy")},
-/* 0720 UNO_NAME_LISTTAB_STOP_POSITION */ {MAP_CHAR_LEN("ListtabStopPosition")},
-/* 0721 UNO_NAME_FIRST_LINE_INDENT */ {MAP_CHAR_LEN("FirstLineIndent")},
-/* 0722 UNO_NAME_INDENT_AT */ {MAP_CHAR_LEN("IndentAt")},
-/* 0723 UNO_NAME_CHAPTER_LEVEL */ {MAP_CHAR_LEN("ChapterLevel")},
-/* 0724 UNO_NAME_GRID_BASE_WIDTH*/ {MAP_CHAR_LEN("GridBaseWidth")},
-/* 0725 UNO_NAME_GRID_SNAP_TO_CHARS*/ {MAP_CHAR_LEN("GridSnapToChars")},
-/* 0726 UNO_NAME_GRID_STANDARD_PAGE_MODE*/ {MAP_CHAR_LEN("StandardPageMode")},
-/* 0727 UNO_NAME_TABLE_BORDER_DISTANCES */ {MAP_CHAR_LEN("TableBorderDistances")},
-/* 0728 UNO_NAME_LIST_ID*/ {MAP_CHAR_LEN("ListId")},
-/* 0729 UNO_NAME_DEFAULT_LIST_ID*/ {MAP_CHAR_LEN("DefaultListId")},
-/* 0730 UNO_NAME_STREAM_NAME */ {MAP_CHAR_LEN("StreamName")},
-/* 0731 UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE */ {MAP_CHAR_LEN("ContinueingPreviousSubTree")},
-/* 0732 UNO_NAME_PARA_LIST_LABEL_STRING */ {MAP_CHAR_LEN("ListLabelString")},
-/* 0733 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")},
-/* 0734 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")},
-/* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")},
-/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel
-/* 0737 UNO_NAME_DESCRIPTION */ {MAP_CHAR_LEN("Description")},
-/* 0738 UNO_NAME_META */ {MAP_CHAR_LEN("InContentMetadata")},
-/* 0739 UNO_NAME_IS_TEMPLATE */ {MAP_CHAR_LEN("IsTemplate")},
-/* 0740 UNO_NAME_VBA_DOCOBJ */ {MAP_CHAR_LEN("ThisVBADocObj")},
-/* 0741 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
-/* 0742 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")},
-/* 0743 UNO_NAME_FOOTNOTE_LINE_STYLE */ {MAP_CHAR_LEN("FootnoteLineStyle")},
-/* 0744 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
-/* 0745 UNO_NAME_RSID */ {MAP_CHAR_LEN("Rsid")},
-/* 0746 UNO_NAME_PARRSID */ {MAP_CHAR_LEN("ParRsid")},
+/* 0710 UNO_NAME_LAYOUT_SIZE*/ {MAP_CHAR_LEN("LayoutSize")},
+/* 0711 UNO_NAME_HELP */ {MAP_CHAR_LEN("Help")},
+/* 0712 UNO_NAME_TOOLTIP */ {MAP_CHAR_LEN("Tooltip")},
+/* 0713 UNO_NAME_DIALOG_LIBRARIES*/ {MAP_CHAR_LEN("DialogLibraries")},
+/* 0714 UNO_NAME_HEADER_ROW_COUNT*/ {MAP_CHAR_LEN("HeaderRowCount")},
+/* 0715 UNO_NAME_INPUT */ {MAP_CHAR_LEN("Input")},
+/* 0716 UNO_NAME_ROW_SPAN */ {MAP_CHAR_LEN("RowSpan")},
+/* 0717 UNO_NAME_POSITION_AND_SPACE_MODE */ {MAP_CHAR_LEN("PositionAndSpaceMode")},
+/* 0718 UNO_NAME_LABEL_FOLLOWED_BY */ {MAP_CHAR_LEN("LabelFollowedBy")},
+/* 0719 UNO_NAME_LISTTAB_STOP_POSITION */ {MAP_CHAR_LEN("ListtabStopPosition")},
+/* 0720 UNO_NAME_FIRST_LINE_INDENT */ {MAP_CHAR_LEN("FirstLineIndent")},
+/* 0721 UNO_NAME_INDENT_AT */ {MAP_CHAR_LEN("IndentAt")},
+/* 0722 UNO_NAME_CHAPTER_LEVEL */ {MAP_CHAR_LEN("ChapterLevel")},
+/* 0723 UNO_NAME_GRID_BASE_WIDTH*/ {MAP_CHAR_LEN("GridBaseWidth")},
+/* 0724 UNO_NAME_GRID_SNAP_TO_CHARS*/ {MAP_CHAR_LEN("GridSnapToChars")},
+/* 0725 UNO_NAME_GRID_STANDARD_PAGE_MODE*/ {MAP_CHAR_LEN("StandardPageMode")},
+/* 0726 UNO_NAME_TABLE_BORDER_DISTANCES */ {MAP_CHAR_LEN("TableBorderDistances")},
+/* 0727 UNO_NAME_LIST_ID*/ {MAP_CHAR_LEN("ListId")},
+/* 0728 UNO_NAME_DEFAULT_LIST_ID*/ {MAP_CHAR_LEN("DefaultListId")},
+/* 0729 UNO_NAME_STREAM_NAME */ {MAP_CHAR_LEN("StreamName")},
+/* 0730 UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE */ {MAP_CHAR_LEN("ContinueingPreviousSubTree")},
+/* 0731 UNO_NAME_PARA_LIST_LABEL_STRING */ {MAP_CHAR_LEN("ListLabelString")},
+/* 0732 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")},
+/* 0733 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")},
+/* 0734 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")},
+/* 0735 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel
+/* 0736 UNO_NAME_DESCRIPTION */ {MAP_CHAR_LEN("Description")},
+/* 0737 UNO_NAME_META */ {MAP_CHAR_LEN("InContentMetadata")},
+/* 0738 UNO_NAME_IS_TEMPLATE */ {MAP_CHAR_LEN("IsTemplate")},
+/* 0739 UNO_NAME_VBA_DOCOBJ */ {MAP_CHAR_LEN("ThisVBADocObj")},
+/* 0740 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
+/* 0741 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")},
+/* 0742 UNO_NAME_FOOTNOTE_LINE_STYLE */ {MAP_CHAR_LEN("FootnoteLineStyle")},
+/* 0743 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
+/* 0744 UNO_NAME_RSID */ {MAP_CHAR_LEN("Rsid")},
+/* 0745 UNO_NAME_PARRSID */ {MAP_CHAR_LEN("ParRsid")},
-/* 0747 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")},
-/* 0748 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")},
+/* 0746 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")},
+/* 0747 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")},
-/* 0749 PARA_CONTEXT_MARGIN */ {MAP_CHAR_LEN("ParaContextMargin")},
-/* 0750 PARAGRAPH_STYLE_NAME */ {MAP_CHAR_LEN("ParagraphStyleName")},
-/* 0751 FIRST_IS_SHARED */ {MAP_CHAR_LEN("FirstIsShared")},
-/* 0752 HEADER_TEXT_FIRST */ {MAP_CHAR_LEN("HeaderTextFirst")},
-/* 0753 FOOTER_TEXT_FIRST */ {MAP_CHAR_LEN("FooterTextFirst")},
-/* 0754 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("Initials")},
-/* 0755 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("TableBorder2")},
-/* 0756 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
+/* 0748 PARA_CONTEXT_MARGIN */ {MAP_CHAR_LEN("ParaContextMargin")},
+/* 0749 PARAGRAPH_STYLE_NAME */ {MAP_CHAR_LEN("ParagraphStyleName")},
+/* 0750 FIRST_IS_SHARED */ {MAP_CHAR_LEN("FirstIsShared")},
+/* 0751 HEADER_TEXT_FIRST */ {MAP_CHAR_LEN("HeaderTextFirst")},
+/* 0752 FOOTER_TEXT_FIRST */ {MAP_CHAR_LEN("FooterTextFirst")},
+/* 0753 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("Initials")},
+/* 0754 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("TableBorder2")},
+/* 0755 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
// new items in this array must match enum SwPropNameIds
};
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index da4f190..acc7706 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1982,14 +1982,6 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
case WID_DOC_BUILDID:
aValue >>= maBuildId;
break;
- //
- case WID_APPLY_WORKAROUND_FOR_B6375613:
- {
- bool bApplyWorkaroundForB6375613( false );
- aValue >>= bApplyWorkaroundForB6375613;
- pDocShell->GetDoc()->SetApplyWorkaroundForB6375613( bApplyWorkaroundForB6375613 );
- }
- break;
default:
{
@@ -2144,12 +2136,6 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
case WID_DOC_HAS_VALID_SIGNATURES:
aAny <<= hasValidSignatures();
break;
- //
- case WID_APPLY_WORKAROUND_FOR_B6375613:
- {
- aAny <<= pDocShell->GetDoc()->ApplyWorkaroundForB6375613();
- }
- break;
default:
{
commit 117fdb9898dcc379b4f83437e858c57fd1d11911
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Nov 21 22:21:40 2012 +0100
convert users of XDocumentInfo to XDocumentProperties
Change-Id: I10f395f90d554d0ec26fe9f2654ae839e21c7ee5
diff --git a/basic/inc/basic/basicmanagerrepository.hxx b/basic/inc/basic/basicmanagerrepository.hxx
index 490457e..411aead 100644
--- a/basic/inc/basic/basicmanagerrepository.hxx
+++ b/basic/inc/basic/basicmanagerrepository.hxx
@@ -76,7 +76,8 @@ namespace basic
@param _rxDocumentModel
denotes the document model whose BasicManager is to be retrieved. Must not be <NULL/>.
- The document should support the XDocumentInfoSupplier interface, for retrieving
+ The document should support the XDocumentPropertiesSupplier
+ interface, for retrieving
its title, which is needed in some error conditions.
Also it <em>must</em> support the XStorageBasedDocument interface, since we
must be able to retrieve the document's storage. If this interface is <em>not</em>
diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx
index 9a99945..0ada1a7 100644
--- a/comphelper/source/misc/documentinfo.cxx
+++ b/comphelper/source/misc/documentinfo.cxx
@@ -112,7 +112,7 @@ namespace comphelper {
return sTitle;
}
- // 3. try the UNO DocumentInfo
+ // 3. try the UNO XDocumentProperties
Reference< XDocumentPropertiesSupplier > xDPS( _rxDocument, UNO_QUERY );
if ( xDPS.is() )
{
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 410cd10..4043252 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/frame/UICommandDescription.hpp>
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index be76c32..cdfa730 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -25,7 +25,6 @@
#include <basic/sbmeth.hxx>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/script/ModuleType.hpp>
@@ -127,11 +126,13 @@ SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
{
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( xModel, uno::UNO_QUERY );
- if( xDocInfoSupp.is() )
+ uno::Reference<document::XDocumentPropertiesSupplier> const
+ xDocPropSupp(xModel, uno::UNO_QUERY);
+ if (xDocPropSupp.is())
{
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > const
+ xDocProps(xDocPropSupp->getDocumentProperties(),
+ uno::UNO_QUERY_THROW);
rtl::OUString sCurrName = xDocProps->getTemplateName();
if( sMacroURLOrPath.lastIndexOf( sCurrName ) >= 0 )
{
@@ -391,8 +392,8 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString&
if ( xPrjNameCache.is() )
{
// is this document created from a template?
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentPropertiesSupplier > const
+ xDocPropSupp(pShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
diff --git a/odk/pack/copying/idl_chapter_refs.txt b/odk/pack/copying/idl_chapter_refs.txt
index 58d93cc..852ede0 100644
--- a/odk/pack/copying/idl_chapter_refs.txt
+++ b/odk/pack/copying/idl_chapter_refs.txt
@@ -2088,7 +2088,7 @@ com.sun.star.document.OfficeDocument
com.sun.star.lang.XMultiServiceFactory
com.sun.star.container.XChild
com.sun.star.document.XEventsSupplier
-com.sun.star.document.XDocumentInfoSupplier
+com.sun.star.document.XDocumentPropertiesSupplier
TOPIC:
LINK:Documentation/DevGuide/GUI/The_Example_Listings
@@ -6599,12 +6599,12 @@ com.sun.star.document.ImportFilter
com.sun.star.document.ExportFilter
TOPIC:
-LINK:Documentation/DevGuide/OfficeDev/Component/Models#XDocumentInfoSupplier
-DESCR:OfficeDev - Component - Models - XDocumentInfoSupplier
+LINK:Documentation/DevGuide/OfficeDev/Component/Models#XDocumentPropertiesSupplier
+DESCR:OfficeDev - Component - Models - XDocumentPropertiesSupplier
REF:
-com.sun.star.document.XDocumentInfoSupplier
+com.sun.star.document.XDocumentPropertiesSupplier
TOPIC:
-com.sun.star.document.XDocumentInfoSupplier
+com.sun.star.document.XDocumentPropertiesSupplier
LINK:Documentation/DevGuide/FirstSteps/Struct
DESCR:FirstSteps - Struct
@@ -7024,10 +7024,10 @@ com.sun.star.lang.XComponent
LINK:Documentation/DevGuide/Text/Settings#General_Document_Information
DESCR:Text - Settings - General Document Information
REF:
-com.sun.star.document.DocumentInfo
-com.sun.star.document.XDocumentInfoSupplier
+com.sun.star.document.DocumentProperties
+com.sun.star.document.XDocumentPropertiesSupplier
TOPIC:
-com.sun.star.document.XDocumentInfoSupplier
+com.sun.star.document.XDocumentPropertiesSupplier
LINK:Documentation/DevGuide/Text/Sorting_Text
DESCR:Text - Sorting Text
diff --git a/offapi/com/sun/star/document/XDocumentSubStorageSupplier.idl b/offapi/com/sun/star/document/XDocumentSubStorageSupplier.idl
index 48cddc3..ce2d7ef 100644
--- a/offapi/com/sun/star/document/XDocumentSubStorageSupplier.idl
+++ b/offapi/com/sun/star/document/XDocumentSubStorageSupplier.idl
@@ -31,9 +31,6 @@ module com { module sun { module star { module document {
<p>
A temporary interface to get access to documents substorages.
</p>
-
- @see DocumentInfo
- @see StandaloneDocumentInfo
*/
interface XDocumentSubStorageSupplier: com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/sdb/DocumentDefinition.idl b/offapi/com/sun/star/sdb/DocumentDefinition.idl
index 1dafb93..3a72200 100644
--- a/offapi/com/sun/star/sdb/DocumentDefinition.idl
+++ b/offapi/com/sun/star/sdb/DocumentDefinition.idl
@@ -51,7 +51,8 @@ service DocumentDefinition
the <code>execute</code> method is the model of the loaded document.</li>
<li><strong>preview</strong>: retrieves an image showing a preview of the sub document.</li>
<li><strong>getDocumentInfo</strong>: retrieves the document information, as
- <type scope="com::sun::star::document">XDocumentInfo</type> instance, of the sub document.</li>
+ <type scope="com::sun::star::document">XDocumentProperties</type>
+ instance, of the sub document.</li>
<li><strong>delete</strong>: deletes the sub document from the database document.</li>
<li><strong>close</strong>: closes the sub document, if it had previously been opened
using either the <code>open</code> or <code>openDesign</code> command. The return value
diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
index 2fde6b2..9732359 100644
--- a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
@@ -28,7 +28,8 @@ import util.SOfficeFactory;
import util.XMLTools;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XExporter;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@@ -133,11 +134,10 @@ public class XMLMetaExporter extends TestCase {
xEx.setSourceDocument(xSheetDoc);
// Obtaining and changing property values
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class,
- xSheetDoc) ;
- XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
- docInfo.setPropertyValue("Title", "TestDocument");
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xSheetDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
+ xDocProps.setTitle("TestDocument");
log.println("fill sheet 1 with contnet...");
util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50);
diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
index f5df59c..c494520 100644
--- a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
@@ -27,7 +27,8 @@ import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XImporter;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@@ -160,24 +161,17 @@ public class XMLMetaImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ;
- final XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xSheetDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
- try {
- String title = (String) docInfo.getPropertyValue
- ("Title") ;
- logF.println("Title returned = '" + title + "'") ;
- return impTitle.equals(title) ;
- } catch (com.sun.star.uno.Exception e) {
- logF.println("Exception occurred while checking filter :") ;
- e.printStackTrace(logF) ;
- return false ;
- }
+ String title = xDocProps.getTitle();
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
}
}) ;
diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
index 9c96185..2c7535c 100644
--- a/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
@@ -27,8 +27,9 @@ import lib.TestParameters;
import util.SOfficeFactory;
import util.XMLTools;
-import com.sun.star.document.XDocumentInfo;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.beans.XPropertyContainer;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XExporter;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@@ -126,10 +127,11 @@ public class XMLMetaExporter extends TestCase {
xEx.setSourceDocument(xMathDoc);
// setting a new name and value for user info field
- XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xMathDoc) ;
- XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
- xDocInfo.setUserFieldName((short) 0, expName) ;
- xDocInfo.setUserFieldValue((short) 0, expValue) ;
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xMathDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
+ XPropertyContainer xProps = xDocProps.getUserDefinedProperties();
+ xProps.addProperty(expName, (short)0, expValue);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log) ;
throw new StatusException("Can't create component.", e) ;
diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
index bde9b09..ebd31eb 100644
--- a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
@@ -27,8 +27,10 @@ import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfo;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.beans.Property;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
@@ -114,13 +116,9 @@ public class XMLMetaImporter extends TestCase {
final String impValue = "XMLMetaImporter_Value" ;
final String impTitle = "XMLMetaImporter Title" ;
- final XDocumentInfoSupplier xDocInfoSup ;
try {
oObj = (XInterface)xMSF.createInstance(
"com.sun.star.comp.Math.XMLMetaImporter");
-
- xDocInfoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xMathDoc) ;
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Unexpected exception", e);
@@ -156,20 +154,29 @@ public class XMLMetaImporter extends TestCase {
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
try {
- XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
- XPropertySet xDocInfoProp = UnoRuntime.queryInterface
- (XPropertySet.class, xDocInfo) ;
- boolean result = false ;
- for (short i = 0; i < xDocInfo.getUserFieldCount(); i++) {
- String gName = xDocInfo.getUserFieldName(i) ;
- String gValue = xDocInfo.getUserFieldValue(i) ;
+ XDocumentPropertiesSupplier xPropSup =
+ UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xMathDoc);
+ final XDocumentProperties xDocProps =
+ xPropSup.getDocumentProperties();
+
+ XPropertySet xUDProps = UnoRuntime.queryInterface(
+ XPropertySet.class,
+ xDocProps.getUserDefinedProperties());
+ XPropertySetInfo xInfo =
+ xUDProps.getPropertySetInfo();
+ Property[] props = xInfo.getProperties();
+ boolean result = false;
+ for (int i = 0; i < props.length; i++) {
+ String gName = props[i].Name;
+ String gValue = (String)
+ xUDProps.getPropertyValue(gName);
logF.println("Field '" + gName + "' = '"
+ gValue + "'") ;
if (impName.equals(gName) && impValue.equals(gValue))
result = true ;
}
- String gTitle = (String) xDocInfoProp.getPropertyValue
- ("Title");
+ String gTitle = xDocProps.getTitle();
logF.println("Title returned : '" + gTitle + "'");
result &= impTitle.equals(gTitle) ;
diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
index dadcd90..1de4f4b 100644
--- a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
@@ -28,7 +28,8 @@ import util.SOfficeFactory;
import util.XMLTools;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XExporter;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument;
@@ -129,12 +130,10 @@ public class XMLMetaExporter extends TestCase {
xEx.setSourceDocument(xTextDoc);
//set some meta data
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xTextDoc) ;
- XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
- docInfo.setPropertyValue("Title", TITLE);
-
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xTextDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
+ xDocProps.setTitle(TITLE);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log) ;
throw new StatusException("Can't create component.", e) ;
diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
index c234003..7e071d8 100644
--- a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
@@ -27,7 +27,8 @@ import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
@@ -153,24 +154,17 @@ public class XMLMetaImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xTextDoc) ;
- final XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xTextDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
- try {
- String title = (String) docInfo.getPropertyValue("Title") ;
- logF.println("Title returned = '" + title + "'") ;
- return impTitle.equals(title) ;
- } catch (com.sun.star.uno.Exception e) {
- logF.println("Exception occurred while checking filter :") ;
- e.printStackTrace(logF) ;
- return false ;
- }
+ String title = xDocProps.getTitle();
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
}
}) ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
index 01b61cb..af8a5b7 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
@@ -28,7 +28,8 @@ import util.SOfficeFactory;
import util.XMLTools;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XExporter;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@@ -128,11 +129,10 @@ public class XMLMetaExporter extends TestCase {
xEx.setSourceDocument(xDrawDoc);
//set some meta data
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
- xDrawDoc) ;
- XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
- docInfo.setPropertyValue("Title", TITLE);
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xDrawDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
+ xDocProps.setTitle(TITLE);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log) ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
index 1fbfb34..afbfad4 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
@@ -27,7 +27,8 @@ import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
@@ -152,25 +153,17 @@ public class XMLMetaImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
//set some meta data
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xDrawDoc);
- final XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo());
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xDrawDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
- try {
- String title = (String) docInfo.getPropertyValue
- ("Title") ;
- logF.println("Title returned = '" + title + "'") ;
- return impTitle.equals(title) ;
- } catch (com.sun.star.uno.Exception e) {
- logF.println("Exception occurred while checking filter :") ;
- e.printStackTrace(logF) ;
- return false ;
- }
+ String title = xDocProps.getTitle();
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
}
}) ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
index 1ab04a1..5a21079 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
@@ -28,7 +28,8 @@ import util.SOfficeFactory;
import util.XMLTools;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.document.XExporter;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@@ -128,12 +129,11 @@ public class XMLMetaExporter extends TestCase {
XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
- //change title name
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xImpressDoc) ;
- XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
- docInfo.setPropertyValue("Title", NAME);
+ // change title name
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xImpressDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
+ xDocProps.setTitle(NAME);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log) ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
index b504d26..6dbd37f 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
@@ -27,7 +27,8 @@ import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
@@ -151,25 +152,17 @@ public class XMLMetaImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
- XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xImpressDoc) ;
- final XPropertySet docInfo = UnoRuntime.queryInterface
- (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface
+ (XDocumentPropertiesSupplier.class, xImpressDoc);
+ final XDocumentProperties xDocProps = xPropSup.getDocumentProperties();
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
- try {
- String title = (String)
- docInfo.getPropertyValue("Title") ;
- logF.println("Title returned = '" + title + "'") ;
- return impTitle.equals(title) ;
- } catch (com.sun.star.uno.Exception e) {
- logF.println("Exception occurred while checking filter :") ;
- e.printStackTrace(logF) ;
- return false ;
- }
+ String title = xDocProps.getTitle();
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
}
} );
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index acda309..2ed3aeb 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -1367,7 +1367,7 @@ sal_Bool ImplSdPPTImport::Import()
delete pStbMgr;
- // read DocumentInfo
+ // read DocumentProperties
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mpDoc->GetObjectShell()->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 689c237..5145087 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -35,7 +35,7 @@
namespace com { namespace sun { namespace star {
namespace document {
- class XDocumentInfo;
+ class XDocumentProperties;
}
} } }
@@ -75,7 +75,8 @@ public:
static void SetDocInfoState(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentInfo>& i_xOldDocInfo,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>& i_xOldDocInfo,
sal_Bool bNoModify );
static sal_Bool WarnUnacceptableFormat(
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 348f1c1..6c764b8 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -223,7 +223,7 @@ void SetTemplate_Impl( const String &rFileName,
const String &rLongName,
SfxObjectShell *pDoc)
{
- // write TemplateName to DocumentInfo of document
+ // write TemplateName to DocumentProperties of document
// TemplateDate stays as default (=current date)
pDoc->ResetFromTemplate( rLongName, rFileName );
}
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 92b9194..a724dea 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -42,7 +42,7 @@
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
-#include <com/sun/star/document/XStandaloneDocumentInfo.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
@@ -75,7 +75,6 @@
#define TEMPLATE_IMPLEMENTATION_NAME "com.sun.star.comp.sfx2.DocumentTemplates"
#define SERVICENAME_TYPEDETECTION "com.sun.star.document.TypeDetection"
-#define SERVICENAME_DOCINFO "com.sun.star.document.StandaloneDocumentInfo"
#define TEMPLATE_ROOT_URL "vnd.sun.star.hier:/templates"
#define TITLE "Title"
@@ -177,7 +176,7 @@ class SfxDocTplService_Impl
{
uno::Reference< XMultiServiceFactory > mxFactory;
uno::Reference< XCommandEnvironment > maCmdEnv;
- uno::Reference< XStandaloneDocumentInfo > mxInfo;
+ uno::Reference<XDocumentProperties> m_xDocProps;
uno::Reference< XTypeDetection > mxType;
::osl::Mutex maMutex;
@@ -441,16 +440,15 @@ void SfxDocTplService_Impl::init_Impl()
if ( bIsInitialized )
{
- OUString aService( SERVICENAME_DOCINFO );
try {
- mxInfo = uno::Reference< XStandaloneDocumentInfo > (
- mxFactory->createInstance( aService ), UNO_QUERY );
- } catch (uno::RuntimeException &) {
- OSL_FAIL("SfxDocTplService_Impl::init_Impl: "
- "cannot create DocumentProperties service");
+ m_xDocProps.set(document::DocumentProperties::create(
+ ::comphelper::getProcessComponentContext()));
+ } catch (uno::RuntimeException const& e) {
+ SAL_WARN("sfx.doc", "SfxDocTplService_Impl::init_Impl: "
+ "cannot create DocumentProperties service:" << e.Message);
}
- aService = OUString( SERVICENAME_TYPEDETECTION );
+ OUString const aService = OUString( SERVICENAME_TYPEDETECTION );
mxType = uno::Reference< XTypeDetection > ( mxFactory->createInstance( aService ), UNO_QUERY );
getDirList();
@@ -643,24 +641,20 @@ sal_Bool SfxDocTplService_Impl::needsUpdate()
// -----------------------------------------------------------------------
sal_Bool SfxDocTplService_Impl::setTitleForURL( const OUString& rURL, const OUString& aTitle )
{
- sal_Bool bResult = sal_False;
- if ( mxInfo.is() )
+ if (m_xDocProps.is())
{
try
{
- mxInfo->loadFromURL( rURL );
- uno::Reference< XPropertySet > xPropSet( mxInfo, UNO_QUERY_THROW );
- OUString aPropName( TITLE );
- xPropSet->setPropertyValue( aPropName, uno::makeAny( aTitle ) );
- mxInfo->storeIntoURL( rURL );
- bResult = sal_True;
+ m_xDocProps->loadFromMedium(rURL, Sequence<PropertyValue>());
+ m_xDocProps->setTitle(aTitle );
+ m_xDocProps->storeToMedium(rURL, Sequence<PropertyValue>());
+ return true;
}
catch ( Exception& )
{
}
}
-
- return bResult;
+ return false;
}
// -----------------------------------------------------------------------
@@ -668,32 +662,16 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
{
bDocHasTitle = sal_False;
- if ( mxInfo.is() )
+ if (m_xDocProps.is())
{
try
{
- mxInfo->loadFromURL( rURL );
+ m_xDocProps->loadFromMedium(rURL, Sequence<PropertyValue>());
+ aTitle = m_xDocProps->getTitle();
}
catch ( Exception& )
{
}
-
- try
- {
- uno::Reference< XPropertySet > aPropSet( mxInfo, UNO_QUERY );
- if ( aPropSet.is() )
- {
- OUString aPropName( TITLE );
- Any aValue = aPropSet->getPropertyValue( aPropName );
- aValue >>= aTitle;
-
- aPropName = OUString( "MIMEType" );
- aValue = aPropSet->getPropertyValue( aPropName );
- aValue >>= aType;
- }
- }
- catch ( UnknownPropertyException& ) {}
- catch ( Exception& ) {}
}
if ( aType.isEmpty() && mxType.is() )
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f90432f..c6af316 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -29,8 +29,8 @@
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <com/sun/star/document/XDocumentInfo.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
@@ -1579,11 +1579,11 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
// so the document info can be updated
// on export document info must be preserved
- uno::Reference<document::XDocumentInfoSupplier> xDIS(
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
aModelData.GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<util::XCloneable> xCloneable(
- xDIS->getDocumentInfo(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentInfo> xOldDocInfo(
+ xDPS->getDocumentProperties(), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> xOldDocProps(
xCloneable->createClone(), uno::UNO_QUERY_THROW);
// use dispatch API to show document info dialog
@@ -1605,13 +1605,16 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
catch( const uno::Exception& )
{
if ( ( nStoreMode & EXPORT_REQUESTED ) )
- SetDocInfoState( aModelData.GetModel(), xOldDocInfo, sal_True );
-
+ {
+ SetDocInfoState(aModelData.GetModel(), xOldDocProps, sal_True);
+ }
throw;
}
if ( ( nStoreMode & EXPORT_REQUESTED ) )
- SetDocInfoState( aModelData.GetModel(), xOldDocInfo, sal_True );
+ {
+ SetDocInfoState(aModelData.GetModel(), xOldDocProps, sal_True);
+ }
}
else
{
@@ -1665,16 +1668,15 @@ sal_Bool SfxStoringHelper::CheckFilterOptionsAppearence(
// static
void SfxStoringHelper::SetDocInfoState(
const uno::Reference< frame::XModel >& xModel,
- const uno::Reference< document::XDocumentInfo >& i_xOldDocInfo,
+ const uno::Reference< document::XDocumentProperties>& i_xOldDocProps,
sal_Bool bNoModify )
{
- uno::Reference< document::XDocumentInfoSupplier > xModelDocInfoSupplier( xModel, uno::UNO_QUERY );
- if ( !xModelDocInfoSupplier.is() )
- throw uno::RuntimeException(); // TODO:
-
- uno::Reference< document::XDocumentInfo > xDocInfoToFill = xModelDocInfoSupplier->getDocumentInfo();
- uno::Reference< beans::XPropertySet > xPropSet( i_xOldDocInfo,
- uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentPropertiesSupplier> const
+ xModelDocPropsSupplier(xModel, uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocPropsToFill =
+ xModelDocPropsSupplier->getDocumentProperties();
+ uno::Reference< beans::XPropertySet > const xPropSet(
+ i_xOldDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
uno::Reference< util::XModifiable > xModifiable( xModel, uno::UNO_QUERY );
if ( bNoModify && !xModifiable.is() )
@@ -1684,7 +1686,8 @@ void SfxStoringHelper::SetDocInfoState(
try
{
- uno::Reference< beans::XPropertySet > xSet( xDocInfoToFill, uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > const xSet(
+ xDocPropsToFill->getUserDefinedProperties(), uno::UNO_QUERY);
uno::Reference< beans::XPropertyContainer > xContainer( xSet, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
uno::Sequence< beans::Property > lProps = xSetInfo->getProperties();
@@ -1695,8 +1698,12 @@ void SfxStoringHelper::SetDocInfoState(
{
uno::Any aValue = xPropSet->getPropertyValue( pProps[i].Name );
if ( pProps[i].Attributes & ::com::sun::star::beans::PropertyAttribute::REMOVABLE )
+ try
+ {
// QUESTION: DefaultValue?!
xContainer->addProperty( pProps[i].Name, pProps[i].Attributes, aValue );
+ }
+ catch (beans::PropertyExistException const&) {}
try
{
// it is possible that the propertysets from XML and binary files differ; we shouldn't break then
@@ -1705,17 +1712,30 @@ void SfxStoringHelper::SetDocInfoState(
catch ( const uno::Exception& ) {}
}
- sal_Int16 nCount = i_xOldDocInfo->getUserFieldCount();
- sal_Int16 nSupportedCount = xDocInfoToFill->getUserFieldCount();
- for ( sal_Int16 nInd = 0; nInd < nCount && nInd < nSupportedCount; nInd++ )
- {
- ::rtl::OUString aPropName = i_xOldDocInfo->getUserFieldName( nInd );
- xDocInfoToFill->setUserFieldName( nInd, aPropName );
- ::rtl::OUString aPropVal = i_xOldDocInfo->getUserFieldValue( nInd );
- xDocInfoToFill->setUserFieldValue( nInd, aPropVal );
- }
+ // sigh... have to set these manually i'm afraid... wonder why
+ // SfxObjectShell doesn't handle this internally, should be easier
+ xDocPropsToFill->setAuthor(i_xOldDocProps->getAuthor());
+ xDocPropsToFill->setGenerator(i_xOldDocProps->getGenerator());
+ xDocPropsToFill->setCreationDate(i_xOldDocProps->getCreationDate());
+ xDocPropsToFill->setTitle(i_xOldDocProps->getTitle());
+ xDocPropsToFill->setSubject(i_xOldDocProps->getSubject());
+ xDocPropsToFill->setDescription(i_xOldDocProps->getDescription());
+ xDocPropsToFill->setKeywords(i_xOldDocProps->getKeywords());
+ xDocPropsToFill->setModifiedBy(i_xOldDocProps->getModifiedBy());
+ xDocPropsToFill->setModificationDate(i_xOldDocProps->getModificationDate());
+ xDocPropsToFill->setPrintedBy(i_xOldDocProps->getPrintedBy());
+ xDocPropsToFill->setPrintDate(i_xOldDocProps->getPrintDate());
+ xDocPropsToFill->setAutoloadURL(i_xOldDocProps->getAutoloadURL());
+ xDocPropsToFill->setAutoloadSecs(i_xOldDocProps->getAutoloadSecs());
+ xDocPropsToFill->setDefaultTarget(i_xOldDocProps->getDefaultTarget());
+ xDocPropsToFill->setEditingCycles(i_xOldDocProps->getEditingCycles());
+ xDocPropsToFill->setEditingDuration(i_xOldDocProps->getEditingDuration());
+ // other attributes e.g. DocumentStatistics are not editable from dialog
+ }
+ catch (const uno::Exception& e)
+ {
+ SAL_INFO("sfx.doc", "SetDocInfoState: caught exception: " << e.Message);
}
- catch ( const uno::Exception& ) {}
// set the modified flag back if required
if ( bNoModify && bIsModified != xModifiable->isModified() )
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index c96162e..8511f63 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -20,12 +20,11 @@
#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/document/XStandaloneDocumentInfo.hpp>
-#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <vcl/msgbox.hxx>
#include <svl/style.hxx>
#include <vcl/wrkwin.hxx>
@@ -893,29 +892,22 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
// should the document checked against changes in the template ?
if ( IsQueryLoadTemplate() )
{
- // load document info of template
- sal_Bool bOK = sal_False;
+ // load document properties of template
+ bool bOK = false;
util::DateTime aTemplDate;
try
{
- Reference < document::XStandaloneDocumentInfo > xDocInfo (
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.StandaloneDocumentInfo") ) ),
- UNO_QUERY_THROW );
- Reference < beans::XFastPropertySet > xSet( xDocInfo,
- UNO_QUERY_THROW );
- xDocInfo->loadFromURL( aTemplURL );
- Any aAny = xSet->getFastPropertyValue( WID_DATE_MODIFIED );
- ::com::sun::star::util::DateTime aTmp;
- if ( aAny >>= aTemplDate )
- {
- // get modify date from document info
- bOK = sal_True;
- }
+ Reference<document::XDocumentProperties> const
+ xTemplateDocProps( document::DocumentProperties::create(
+ ::comphelper::getProcessComponentContext()));
+ xTemplateDocProps->loadFromMedium(aTemplURL,
+ Sequence<beans::PropertyValue>());
+ aTemplDate = xTemplateDocProps->getModificationDate();
+ bOK = true;
}
- catch (const Exception&)
+ catch (const Exception& e)
{
+ SAL_INFO("sfx.doc", "caught exception" << e.Message);
}
// if modify date was read successfully
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index deee41b..08b2743 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -110,7 +110,6 @@ using ::basic::BasicManagerRepository;
DBG_NAME(SfxObjectShell)
-#define DocumentInfo
#include "sfxslots.hxx"
namespace {
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index c317a23..766221a 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
@@ -71,6 +72,8 @@ namespace svt
using ::com::sun::star::ucb::XContentAccess;
using ::com::sun::star::ucb::XCommandEnvironment;
using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::document::DocumentProperties;
using ::rtl::OUString;
using ::ucbhelper::ResultSetInclude;
using ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
@@ -379,26 +382,20 @@ namespace svt
try
{
::osl::MutexGuard aGuard( m_aMutex );
- if( !m_xDocInfo.is() )
+ if (!m_xDocProps.is())
{
- m_xDocInfo = m_xDocInfo.query(
- ::comphelper::getProcessServiceFactory()->createInstance(
- String( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.StandaloneDocumentInfo") )
- )
- );
+ m_xDocProps.set(DocumentProperties::create(
+ ::comphelper::getProcessComponentContext()));
}
- DBG_ASSERT( m_xDocInfo.is(), "FileViewContentEnumerator::implGetDocTitle: no DocumentProperties service!" );
- if ( !m_xDocInfo.is() )
+ assert(m_xDocProps.is());
+ if (!m_xDocProps.is())
return sal_False;
- m_xDocInfo->loadFromURL( _rTargetURL );
- Reference< XPropertySet > xPropSet( m_xDocInfo, UNO_QUERY );
+ m_xDocProps->loadFromMedium(_rTargetURL, Sequence<PropertyValue>());
- Any aAny = xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" )) );
-
- OUString sTitle;
- if ( ( aAny >>= sTitle ) && !sTitle.isEmpty() )
+ OUString const sTitle(m_xDocProps->getTitle());
+ if (!sTitle.isEmpty())
{
_rRet = sTitle;
bRet = sal_True;
diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx
index 8188bde..775f2a6 100644
--- a/svtools/source/contnr/contentenumeration.hxx
+++ b/svtools/source/contnr/contentenumeration.hxx
@@ -21,7 +21,7 @@
#define SVTOOLS_SOURCE_CONTNR_CONTENTENUMERATION_HXX
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <com/sun/star/document/XStandaloneDocumentInfo.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
#include <salhelper/thread.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/ustring.hxx>
@@ -198,8 +198,9 @@ namespace svt
IEnumerationResultHandler* m_pResultHandler;
bool m_bCancelled;
- mutable ::com::sun::star::uno::Reference< ::com::sun::star::document::XStandaloneDocumentInfo >
- m_xDocInfo;
+ mutable ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>
+ m_xDocProps;
::com::sun::star::uno::Sequence< ::rtl::OUString > m_rBlackList;
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 4c2d5e3..b9eb534 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -845,7 +845,7 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
}
}
- // und noch die DocumentInfo aufbereiten
+ // adjust AutoLoad in DocumentProperties
if( IsNewDoc() )
{
SwDocShell *pDocShell(pDoc->GetDocShell());
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0bd27b2..ef163cd 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -106,7 +106,6 @@
#include "ww8toolbar.hxx"
#include <osl/file.hxx>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <breakit.hxx>
@@ -1453,7 +1452,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
void SwWW8ImplReader::ImportDop()
{
- // correct the LastPrinted date in DocumentInfo
+ // correct the LastPrinted date in DocumentProperties
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocuProps(
@@ -4561,8 +4560,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
if (mbNewDoc && pStg && !pGloss) /*meaningless for a glossary, cmc*/
{
mpDocShell->SetIsTemplate( pWwFib->fDot ); // point at tgc record
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( mpDocShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentPropertiesSupplier> const
+ xDocPropSupp(mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 6045218..395f684 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -33,7 +33,6 @@
#include "vbavariables.hxx"
#include <com/sun/star/text/XBookmarksSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
@@ -260,8 +259,8 @@ uno::Any SAL_CALL
SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException)
{
uno::Reference< word::XTemplate > xTemplate;
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentPropertiesSupplier> const xDocPropSupp(
+ getModel(), uno::UNO_QUERY_THROW);
uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
rtl::OUString sTemplateUrl = xDocProps->getTemplateURL();
@@ -287,8 +286,8 @@ SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) thr
osl::FileBase::getFileURLFromSystemPath( sTemplate, aURL );
uno::Reference< word::XTemplate > xTemplate;
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentPropertiesSupplier> const xDocPropSupp(
+ getModel(), uno::UNO_QUERY_THROW );
uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
xDocProps->setTemplateURL( aURL );
}
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index 8cd8b4b..80a06f2 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -28,7 +28,7 @@
#include "vbadocumentproperties.hxx"
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
@@ -73,17 +73,22 @@ class PropertGetSetHelper
{
protected:
uno::Reference< frame::XModel > m_xModel;
- uno::Reference< beans::XPropertySet > mxProps;
+ uno::Reference<document::XDocumentProperties> m_xDocProps;
public:
PropertGetSetHelper( const uno::Reference< frame::XModel >& xModel ):m_xModel( xModel )
{
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( m_xModel, uno::UNO_QUERY_THROW );
- mxProps.set( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentPropertiesSupplier> const
+ xDocPropSupp(m_xModel, uno::UNO_QUERY_THROW);
+ m_xDocProps.set(xDocPropSupp->getDocumentProperties(),
+ uno::UNO_SET_THROW);
}
virtual ~PropertGetSetHelper() {}
virtual uno::Any getPropertyValue( const rtl::OUString& rPropName ) = 0;
virtual void setPropertyValue( const rtl::OUString& rPropName, const uno::Any& aValue ) = 0;
- virtual uno::Reference< beans::XPropertySet > getUnoProperties() { return mxProps; }
+ virtual uno::Reference< beans::XPropertySet > getUserDefinedProperties() {
+ return uno::Reference<beans::XPropertySet>(
+ m_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
+ }
};
@@ -97,15 +102,174 @@ public:
{
if ( rPropName == "EditingDuration" )
{
- sal_Int32 nSecs = 0;
- mxProps->getPropertyValue( rPropName ) >>= nSecs;
+ sal_Int32 const nSecs = m_xDocProps->getEditingDuration();
return uno::makeAny( nSecs/60 ); // minutes
}
- return mxProps->getPropertyValue( rPropName );
+ else if ("Title" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getTitle());
+ }
+ else if ("Subject" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getSubject());
+ }
+ else if ("Author" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getAuthor());
+ }
+ else if ("Keywords" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getKeywords());
+ }
+ else if ("Description" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getDescription());
+ }
+ else if ("Template" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getTemplateName());
+ }
+ else if ("ModifiedBy" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getModifiedBy());
+ }
+ else if ("Generator" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getGenerator());
+ }
+ else if ("PrintDate" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getPrintDate());
+ }
+ else if ("CreationDate" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getCreationDate());
+ }
+ else if ("ModifyDate" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getModificationDate());
+ }
+ else if ("AutoloadURL" == rPropName)
+ {
+ return uno::makeAny(m_xDocProps->getAutoloadURL());
+ }
+ else
+ {
+ // fall back to user-defined properties
+ return getUserDefinedProperties()->getPropertyValue(rPropName);
+ }
}
virtual void setPropertyValue( const rtl::OUString& rPropName, const uno::Any& aValue )
{
- mxProps->setPropertyValue( rPropName, aValue );
+ if ("EditingDuration" == rPropName)
+ {
+ sal_Int32 nMins = 0;
+ if (aValue >>= nMins)
+ {
+ m_xDocProps->setEditingDuration(nMins * 60); // convert minutes
+ }
+ }
+ else if ("Title" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setTitle(str);
+ }
+ }
+ else if ("Subject" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setSubject(str);
+ }
+ }
+ else if ("Author" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setAuthor(str);
+ }
+ }
+ else if ("Keywords" == rPropName)
+ {
+ uno::Sequence<OUString> keywords;
+ if (aValue >>= keywords)
+ {
+ m_xDocProps->setKeywords(keywords);
+ }
+ }
+ else if ("Description" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setDescription(str);
+ }
+ }
+ else if ("Template" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setTemplateName(str);
+ }
+ }
+ else if ("ModifiedBy" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setModifiedBy(str);
+ }
+ }
+ else if ("Generator" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ return m_xDocProps->setGenerator(str);
+ }
+ }
+ else if ("PrintDate" == rPropName)
+ {
+ util::DateTime dt;
+ if (aValue >>= dt)
+ {
+ m_xDocProps->setPrintDate(dt);
+ }
+ }
+ else if ("CreationDate" == rPropName)
+ {
+ util::DateTime dt;
+ if (aValue >>= dt)
+ {
+ m_xDocProps->setCreationDate(dt);
+ }
+ }
+ else if ("ModifyDate" == rPropName)
+ {
+ util::DateTime dt;
+ if (aValue >>= dt)
+ {
+ m_xDocProps->setModificationDate(dt);
+ }
+ }
+ else if ("AutoloadURL" == rPropName)
+ {
+ OUString str;
+ if (aValue >>= str)
+ {
+ m_xDocProps->setAutoloadURL(str);
+ }
+ }
+ else
+ {
+ // fall back to user-defined properties
+ getUserDefinedProperties()->setPropertyValue(rPropName, aValue);
+ }
}
};
@@ -114,11 +278,18 @@ class CustomPropertyGetSetHelper : public BuiltinPropertyGetSetHelper
public:
CustomPropertyGetSetHelper( const uno::Reference< frame::XModel >& xModel ) :BuiltinPropertyGetSetHelper( xModel )
{
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( mxProps, uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProp( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- mxProps.set( xDocProp->getUserDefinedProperties(), uno::UNO_QUERY_THROW );
+ }
+ virtual uno::Any getPropertyValue( const rtl::OUString& rPropName )
+ {
+ return getUserDefinedProperties()->getPropertyValue(rPropName);
+ }
+ virtual void setPropertyValue(
+ const rtl::OUString& rPropName, const uno::Any& rValue)
+ {
+ return getUserDefinedProperties()->setPropertyValue(rPropName, rValue);
}
};
+
class StatisticPropertyGetSetHelper : public PropertGetSetHelper
{
SwDocShell* mpDocShell;
@@ -131,7 +302,6 @@ public:
}
virtual uno::Any getPropertyValue( const rtl::OUString& rPropName )
{
- uno::Sequence< beans::NamedValue > stats;
try
{
// Characters, ParagraphCount & WordCount are available from
@@ -156,8 +326,8 @@ public:
}
else
{
- mxModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphCount") ) ) >>= stats;
- mxProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DocumentStatistic") ) ) >>= stats;
+ uno::Sequence< beans::NamedValue > const stats(
+ m_xDocProps->getDocumentStatistics());
sal_Int32 nLen = stats.getLength();
bool bFound = false;
@@ -177,9 +347,8 @@ public:
virtual void setPropertyValue( const rtl::OUString& rPropName, const uno::Any& aValue )
{
-
- uno::Sequence< beans::NamedValue > stats;
- mxProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DocumentStatistic") ) ) >>= stats;
+ uno::Sequence< beans::NamedValue > stats(
+ m_xDocProps->getDocumentStatistics());
sal_Int32 nLen = stats.getLength();
for ( sal_Int32 index = 0; index < nLen; ++index )
@@ -187,7 +356,7 @@ public:
if ( rPropName.equals( stats[ index ].Name ) )
{
stats[ index ].Value = aValue;
- mxProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DocumentStatistic") ), uno::makeAny( stats ) );
+ m_xDocProps->setDocumentStatistics(stats);
break;
}
}
@@ -225,12 +394,11 @@ public:
if ( mpPropGetSetHelper.get() )
mpPropGetSetHelper->setPropertyValue( msOOOPropName, rValue );
}
- uno::Reference< beans::XPropertySet > getUnoProperties()
+ uno::Reference< beans::XPropertySet > getUserDefinedProperties()
{
-
uno::Reference< beans::XPropertySet > xProps;
if ( mpPropGetSetHelper.get() )
- return mpPropGetSetHelper->getUnoProperties();
+ return mpPropGetSetHelper->getUserDefinedProperties();
return xProps;
}
};
@@ -376,7 +544,8 @@ SwVbaCustomDocumentProperty::setType( ::sal_Int8 /*Type*/ ) throw (script::Basic
void SAL_CALL
SwVbaCustomDocumentProperty::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- uno::Reference< beans::XPropertyContainer > xContainer( mPropInfo.getUnoProperties(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertyContainer > xContainer(
+ mPropInfo.getUserDefinedProperties(), uno::UNO_QUERY_THROW);
xContainer->removeProperty( getName() );
}
@@ -512,7 +681,6 @@ protected:
uno::Reference< XHelperInterface > m_xParent;
uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< frame::XModel > m_xModel;
- uno::Reference< document::XDocumentInfo > m_xOOOBuiltIns;
DocProps mDocProps;
DocPropsByName mNamedDocProps;
@@ -643,11 +811,9 @@ public:
CustomPropertiesImpl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : m_xParent( xParent ), m_xContext( xContext ), m_xModel( xModel )
{
// suck in the document( custom ) properties
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( m_xModel, uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProp( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- mxUserDefinedProp.set( xDocProp->getUserDefinedProperties(), uno::UNO_QUERY_THROW );
mpPropGetSetHelper.reset( new CustomPropertyGetSetHelper( m_xModel ) );
+ mxUserDefinedProp.set(mpPropGetSetHelper->getUserDefinedProperties(),
+ uno::UNO_SET_THROW);
};
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index c9a4595..9601579 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -32,7 +32,8 @@ import com.sun.star.container.XContainerQuery;
import com.sun.star.container.XEnumeration;
import com.sun.star.container.XNameAccess;
import com.sun.star.container.XNameContainer;
-import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.frame.XModel;
import com.sun.star.frame.XModuleManager;
import com.sun.star.io.XInputStream;
@@ -462,37 +463,18 @@ public class Helper
protected static String GetDocTitle( XModel xDoc )
{
- String sTitle = "";
- XDocumentInfoSupplier xDocInfoSup = ( XDocumentInfoSupplier ) UnoRuntime.queryInterface( XDocumentInfoSupplier.class, xDoc );
- XPropertySet xPropSet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xDocInfoSup.getDocumentInfo() );
- try
- {
- sTitle = ( String ) xPropSet.getPropertyValue( "Title" );
- } catch ( Exception ex )
- {
- ex.printStackTrace();
- }
- return sTitle;
+ XDocumentPropertiesSupplier xDocPropSup =
+ UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xDoc);
+ XDocumentProperties xDocProps = xDocPropSup.getDocumentProperties();
+ return xDocProps.getTitle();
}
protected static void SetDocTitle( XModel xDoc, String sTitle )
{
- XDocumentInfoSupplier xDocInfoSup = ( XDocumentInfoSupplier ) UnoRuntime.queryInterface( XDocumentInfoSupplier.class, xDoc );
- if ( xDocInfoSup != null )
- {
- XPropertySet xPropSet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xDocInfoSup.getDocumentInfo() );
- if ( xPropSet != null )
- {
- try
- {
- xPropSet.setPropertyValue( "Title", sTitle );
- }
- catch ( Exception ex )
- {
- ex.printStackTrace();
- }
- }
- }
+ XDocumentPropertiesSupplier xDocPropSup =
+ UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xDoc);
+ XDocumentProperties xDocProps = xDocPropSup.getDocumentProperties();
+ xDocProps.setTitle(sTitle);
}
protected static String GetDocServiceName( XComponentContext xContext, XModel xModel )
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index abdbe10..d64cf1a 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
More information about the Libreoffice-commits
mailing list