Kaydet (Commit) cb2bff8e authored tarafından Daniel Vogelheim's avatar Daniel Vogelheim

#87526# on export, now bibliography field master only gets used if already present

        previously, it would always get constructed.
üst a25b3363
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: XMLSectionExport.cxx,v $ * $RCSfile: XMLSectionExport.cxx,v $
* *
* $Revision: 1.17 $ * $Revision: 1.18 $
* *
* last change: $Author: dvo $ $Date: 2001-05-29 12:32:58 $ * last change: $Author: dvo $ $Date: 2001-05-29 15:21:22 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -118,12 +118,12 @@ ...@@ -118,12 +118,12 @@
#include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/container/XNamed.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEX_HPP_ #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEX_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/XDocumentIndex.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_ #ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_
...@@ -134,6 +134,10 @@ ...@@ -134,6 +134,10 @@
#include <com/sun/star/text/BibliographyDataField.hpp> #include <com/sun/star/text/BibliographyDataField.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_TEXT_XTEXTFIELDSSUPPLIER_HPP_
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#endif
#ifndef _XMLOFF_XMLKYWD_HXX #ifndef _XMLOFF_XMLKYWD_HXX
#include "xmlkywd.hxx" #include "xmlkywd.hxx"
#endif #endif
...@@ -182,9 +186,9 @@ using ::com::sun::star::beans::PropertyValue; ...@@ -182,9 +186,9 @@ using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::beans::PropertyValues; using ::com::sun::star::beans::PropertyValues;
using ::com::sun::star::beans::PropertyState; using ::com::sun::star::beans::PropertyState;
using ::com::sun::star::container::XIndexReplace; using ::com::sun::star::container::XIndexReplace;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::container::XNamed; using ::com::sun::star::container::XNamed;
using ::com::sun::star::lang::XServiceInfo; using ::com::sun::star::lang::XServiceInfo;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::XInterface;
...@@ -1610,32 +1614,37 @@ const sal_Char sAPI_IsSortAscending[] = "IsSortAscending"; ...@@ -1610,32 +1614,37 @@ const sal_Char sAPI_IsSortAscending[] = "IsSortAscending";
void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport) void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
{ {
// first: get field master // first: get field master (via text field supplier)
// (we'll create one, and get the only master for this type) Reference<XTextFieldsSupplier> xTextFieldsSupp( rExport.GetModel(),
Reference<XMultiServiceFactory> xFactory(rExport.GetModel(),UNO_QUERY); UNO_QUERY );
if( xFactory.is() ) if ( xTextFieldsSupp.is() )
{ {
const OUString sFieldMaster_Bibliography( const OUString sFieldMaster_Bibliography(
RTL_CONSTASCII_USTRINGPARAM(sAPI_FieldMaster_Bibliography)); RTL_CONSTASCII_USTRINGPARAM(sAPI_FieldMaster_Bibliography));
const OUString sBracketBefore( // get bibliography field master
RTL_CONSTASCII_USTRINGPARAM("BracketBefore")); Reference<XNameAccess> xMasters =
const OUString sBracketAfter( xTextFieldsSupp->getTextFieldMasters();
RTL_CONSTASCII_USTRINGPARAM("BracketAfter")); if ( xMasters->hasByName(sFieldMaster_Bibliography) )
const OUString sIsNumberEntries(
RTL_CONSTASCII_USTRINGPARAM("IsNumberEntries"));
const OUString sIsSortByPosition(
RTL_CONSTASCII_USTRINGPARAM("IsSortByPosition"));
const OUString sSortKeys(
RTL_CONSTASCII_USTRINGPARAM("SortKeys"));
Reference<XInterface> xIfc =
xFactory->createInstance(sFieldMaster_Bibliography);
if( xIfc.is() )
{ {
Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY ); Any aAny =
xMasters->getByName(sFieldMaster_Bibliography);
Reference<XPropertySet> xPropSet;
aAny >>= xPropSet;
DBG_ASSERT( xPropSet.is(), "field master must have XPropSet" );
const OUString sBracketBefore(
RTL_CONSTASCII_USTRINGPARAM("BracketBefore"));
const OUString sBracketAfter(
RTL_CONSTASCII_USTRINGPARAM("BracketAfter"));
const OUString sIsNumberEntries(
RTL_CONSTASCII_USTRINGPARAM("IsNumberEntries"));
const OUString sIsSortByPosition(
RTL_CONSTASCII_USTRINGPARAM("IsSortByPosition"));
const OUString sSortKeys(
RTL_CONSTASCII_USTRINGPARAM("SortKeys"));
Any aAny;
OUString sTmp; OUString sTmp;
aAny = xPropSet->getPropertyValue(sBracketBefore); aAny = xPropSet->getPropertyValue(sBracketBefore);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment