xref: /trunk/main/xmloff/source/style/xmlaustp.cxx (revision 374d2a96ae566b372972bbe678cb4ee5a157bf83)
163bba73cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
363bba73cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
463bba73cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
563bba73cSAndrew Rist  * distributed with this work for additional information
663bba73cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
763bba73cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
863bba73cSAndrew Rist  * "License"); you may not use this file except in compliance
963bba73cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1163bba73cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1363bba73cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1463bba73cSAndrew Rist  * software distributed under the License is distributed on an
1563bba73cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1663bba73cSAndrew Rist  * KIND, either express or implied.  See the License for the
1763bba73cSAndrew Rist  * specific language governing permissions and limitations
1863bba73cSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2063bba73cSAndrew Rist  *************************************************************/
2163bba73cSAndrew Rist 
2263bba73cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <com/sun/star/container/XIndexReplace.hpp>
29cdf0e10cSrcweir #include <tools/debug.hxx>
30cdf0e10cSrcweir #include "impastpl.hxx"
31cdf0e10cSrcweir #include <xmloff/xmlaustp.hxx>
32cdf0e10cSrcweir #include <xmloff/families.hxx>
33cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx"
34cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
35cdf0e10cSrcweir #include <xmloff/xmlexp.hxx>
36cdf0e10cSrcweir #include "xmloff/XMLTextListAutoStylePool.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
39cdf0e10cSrcweir #include <xmloff/PageMasterStyleMap.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #include "PageMasterExportPropMapper.hxx"
42cdf0e10cSrcweir #include "XMLBackgroundImageExport.hxx"
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 
45cdf0e10cSrcweir using namespace ::std;
46cdf0e10cSrcweir using ::rtl::OUString;
47cdf0e10cSrcweir using ::rtl::OUStringBuffer;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir using namespace ::com::sun::star;
50cdf0e10cSrcweir using namespace ::xmloff::token;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 
53cdf0e10cSrcweir namespace
54cdf0e10cSrcweir {
lcl_exportDataStyle(SvXMLExport & _rExport,const UniReference<XMLPropertySetMapper> & _rxMapper,const XMLPropertyState & _rProperty)55cdf0e10cSrcweir     static void lcl_exportDataStyle( SvXMLExport& _rExport, const UniReference< XMLPropertySetMapper >& _rxMapper,
56cdf0e10cSrcweir         const XMLPropertyState& _rProperty )
57cdf0e10cSrcweir     {
58cdf0e10cSrcweir         DBG_ASSERT( _rxMapper.is(), "xmloff::lcl_exportDataStyle: invalid property mapper!" );
59cdf0e10cSrcweir         // obtain the data style name
60cdf0e10cSrcweir         ::rtl::OUString sDataStyleName;
61cdf0e10cSrcweir         _rProperty.maValue >>= sDataStyleName;
62cdf0e10cSrcweir         DBG_ASSERT( sDataStyleName.getLength(), "xmloff::lcl_exportDataStyle: invalid property value for the data style name!" );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir         // add the attribute
65cdf0e10cSrcweir         _rExport.AddAttribute(
66cdf0e10cSrcweir             _rxMapper->GetEntryNameSpace( _rProperty.mnIndex ),
67cdf0e10cSrcweir             _rxMapper->GetEntryXMLName( _rProperty.mnIndex ),
68cdf0e10cSrcweir             sDataStyleName );
69cdf0e10cSrcweir     }
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
exportStyleAttributes(SvXMLAttributeList &,sal_Int32 nFamily,const vector<XMLPropertyState> & rProperties,const SvXMLExportPropertyMapper & rPropExp,const SvXMLUnitConverter &,const SvXMLNamespaceMap &) const72cdf0e10cSrcweir void SvXMLAutoStylePoolP::exportStyleAttributes(
73cdf0e10cSrcweir         SvXMLAttributeList&,
74cdf0e10cSrcweir         sal_Int32 nFamily,
75cdf0e10cSrcweir         const vector< XMLPropertyState >& rProperties,
76cdf0e10cSrcweir         const SvXMLExportPropertyMapper& rPropExp,
77cdf0e10cSrcweir         const SvXMLUnitConverter&,
78cdf0e10cSrcweir         const SvXMLNamespaceMap&
79cdf0e10cSrcweir         ) const
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     if ( XML_STYLE_FAMILY_CONTROL_ID == nFamily )
82cdf0e10cSrcweir     {   // it's a control-related style
83cdf0e10cSrcweir         UniReference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
84cdf0e10cSrcweir 
85cdf0e10cSrcweir         for (   vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
86cdf0e10cSrcweir                 pProp != rProperties.end();
87cdf0e10cSrcweir                 ++pProp
88cdf0e10cSrcweir             )
89cdf0e10cSrcweir         {
90cdf0e10cSrcweir             if  (   ( pProp->mnIndex > -1 )
91cdf0e10cSrcweir                 &&  ( CTF_FORMS_DATA_STYLE == aPropertyMapper->GetEntryContextId( pProp->mnIndex ) )
92cdf0e10cSrcweir                 )
93cdf0e10cSrcweir             {   // it's the data-style for a grid column
94cdf0e10cSrcweir                 lcl_exportDataStyle( GetExport(), aPropertyMapper, *pProp );
95cdf0e10cSrcweir             }
96cdf0e10cSrcweir         }
97cdf0e10cSrcweir     }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     if( (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily) || (XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily) )
100cdf0e10cSrcweir     {   // it's a graphics style
101cdf0e10cSrcweir         UniReference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
102cdf0e10cSrcweir         DBG_ASSERT(aPropertyMapper.is(), "SvXMLAutoStylePoolP::exportStyleAttributes: invalid property set mapper!");
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         sal_Bool bFoundControlShapeDataStyle = sal_False;
105cdf0e10cSrcweir         sal_Bool bFoundNumberingRulesName = sal_False;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         for (   vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
108cdf0e10cSrcweir                 pProp != rProperties.end();
109cdf0e10cSrcweir                 ++pProp
110cdf0e10cSrcweir             )
111cdf0e10cSrcweir         {
112cdf0e10cSrcweir             if (pProp->mnIndex > -1)
113cdf0e10cSrcweir             {   // it's a valid property
114cdf0e10cSrcweir                 switch( aPropertyMapper->GetEntryContextId(pProp->mnIndex) )
115cdf0e10cSrcweir                 {
116cdf0e10cSrcweir                 case CTF_SD_CONTROL_SHAPE_DATA_STYLE:
117cdf0e10cSrcweir                     {   // it's the control shape data style property
118cdf0e10cSrcweir 
119cdf0e10cSrcweir                         if (bFoundControlShapeDataStyle)
120cdf0e10cSrcweir                         {
121cdf0e10cSrcweir                             DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!");
12286e1cf34SPedro Giffuni                             // already added the attribute for the first occurrence
123cdf0e10cSrcweir                             break;
124cdf0e10cSrcweir                         }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir                         lcl_exportDataStyle( GetExport(), aPropertyMapper, *pProp );
127cdf0e10cSrcweir 
128cdf0e10cSrcweir                         // check if there is another property with the special context id we're handling here
129cdf0e10cSrcweir                         bFoundControlShapeDataStyle = sal_True;
130cdf0e10cSrcweir                         break;
131cdf0e10cSrcweir                     }
132cdf0e10cSrcweir                 case CTF_SD_NUMBERINGRULES_NAME:
133cdf0e10cSrcweir                     {
134cdf0e10cSrcweir                         if (bFoundNumberingRulesName)
135cdf0e10cSrcweir                         {
136cdf0e10cSrcweir                             DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!");
13786e1cf34SPedro Giffuni                             // already added the attribute for the first occurrence
138cdf0e10cSrcweir                             break;
139cdf0e10cSrcweir                         }
140cdf0e10cSrcweir 
141cdf0e10cSrcweir                         uno::Reference< container::XIndexReplace > xNumRule;
142cdf0e10cSrcweir                         pProp->maValue >>= xNumRule;
143cdf0e10cSrcweir                         if( xNumRule.is() && (xNumRule->getCount() > 0 ) )
144cdf0e10cSrcweir                         {
145cdf0e10cSrcweir                             const OUString sName(((XMLTextListAutoStylePool*)&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
146cdf0e10cSrcweir 
147cdf0e10cSrcweir                             GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, GetExport().EncodeStyleName( sName ) );
148cdf0e10cSrcweir                         }
149cdf0e10cSrcweir 
150cdf0e10cSrcweir                         bFoundNumberingRulesName = sal_True;
151cdf0e10cSrcweir                         break;
152cdf0e10cSrcweir                     }
153cdf0e10cSrcweir                 }
154cdf0e10cSrcweir             }
155cdf0e10cSrcweir         }
156cdf0e10cSrcweir     }
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER )
159cdf0e10cSrcweir     {
160cdf0e10cSrcweir         for( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin(); pProp != rProperties.end(); pProp++ )
161cdf0e10cSrcweir         {
162cdf0e10cSrcweir             if (pProp->mnIndex > -1)
163cdf0e10cSrcweir             {
164cdf0e10cSrcweir                 UniReference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
165cdf0e10cSrcweir                 sal_Int32 nIndex = pProp->mnIndex;
166cdf0e10cSrcweir                 sal_Int16 nContextID = aPropMapper->GetEntryContextId( nIndex );
167cdf0e10cSrcweir                 switch( nContextID )
168cdf0e10cSrcweir                 {
169cdf0e10cSrcweir                     case CTF_PM_PAGEUSAGE:
170cdf0e10cSrcweir                     {
171cdf0e10cSrcweir                         OUString sValue;
172cdf0e10cSrcweir                         const XMLPropertyHandler* pPropHdl = aPropMapper->GetPropertyHandler( nIndex );
173cdf0e10cSrcweir                         if( pPropHdl &&
174cdf0e10cSrcweir                             pPropHdl->exportXML( sValue, pProp->maValue,
175cdf0e10cSrcweir                                                  GetExport().GetMM100UnitConverter() ) &&
176cdf0e10cSrcweir                             ( ! IsXMLToken( sValue, XML_ALL ) ) )
177cdf0e10cSrcweir                         {
178cdf0e10cSrcweir                             GetExport().AddAttribute( aPropMapper->GetEntryNameSpace( nIndex ), aPropMapper->GetEntryXMLName( nIndex ), sValue );
179cdf0e10cSrcweir                         }
180cdf0e10cSrcweir                     }
181cdf0e10cSrcweir                     break;
182cdf0e10cSrcweir                 }
183cdf0e10cSrcweir             }
184cdf0e10cSrcweir         }
185cdf0e10cSrcweir     }
186cdf0e10cSrcweir }
187cdf0e10cSrcweir 
exportStyleContent(const::com::sun::star::uno::Reference<::com::sun::star::xml::sax::XDocumentHandler> &,sal_Int32 nFamily,const vector<XMLPropertyState> & rProperties,const SvXMLExportPropertyMapper & rPropExp,const SvXMLUnitConverter &,const SvXMLNamespaceMap &) const188cdf0e10cSrcweir void SvXMLAutoStylePoolP::exportStyleContent(
189cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > &,
190cdf0e10cSrcweir         sal_Int32 nFamily,
191cdf0e10cSrcweir         const vector< XMLPropertyState >& rProperties,
192cdf0e10cSrcweir         const SvXMLExportPropertyMapper& rPropExp,
193cdf0e10cSrcweir         const SvXMLUnitConverter&,
194cdf0e10cSrcweir         const SvXMLNamespaceMap&
195cdf0e10cSrcweir         ) const
196cdf0e10cSrcweir {
197cdf0e10cSrcweir     if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER )
198cdf0e10cSrcweir     {
199cdf0e10cSrcweir         OUString sWS( GetXMLToken(XML_WS) );
200cdf0e10cSrcweir 
201cdf0e10cSrcweir         sal_Int32       nHeaderStartIndex(-1);
202cdf0e10cSrcweir         sal_Int32       nHeaderEndIndex(-1);
203cdf0e10cSrcweir         sal_Int32       nFooterStartIndex(-1);
204cdf0e10cSrcweir         sal_Int32       nFooterEndIndex(-1);
205cdf0e10cSrcweir         sal_Bool        bHeaderStartIndex(sal_False);
206cdf0e10cSrcweir         sal_Bool        bHeaderEndIndex(sal_False);
207cdf0e10cSrcweir         sal_Bool        bFooterStartIndex(sal_False);
208cdf0e10cSrcweir         sal_Bool        bFooterEndIndex(sal_False);
209cdf0e10cSrcweir 
210cdf0e10cSrcweir         UniReference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
211cdf0e10cSrcweir 
212cdf0e10cSrcweir         sal_Int32 nIndex(0);
213cdf0e10cSrcweir         while(nIndex < aPropMapper->GetEntryCount())
214cdf0e10cSrcweir         {
215cdf0e10cSrcweir             switch( aPropMapper->GetEntryContextId( nIndex ) & CTF_PM_FLAGMASK )
216cdf0e10cSrcweir             {
217cdf0e10cSrcweir                 case CTF_PM_HEADERFLAG:
218cdf0e10cSrcweir                 {
219cdf0e10cSrcweir                     if (!bHeaderStartIndex)
220cdf0e10cSrcweir                     {
221cdf0e10cSrcweir                         nHeaderStartIndex = nIndex;
222cdf0e10cSrcweir                         bHeaderStartIndex = sal_True;
223cdf0e10cSrcweir                     }
224cdf0e10cSrcweir                     if (bFooterStartIndex && !bFooterEndIndex)
225cdf0e10cSrcweir                     {
226cdf0e10cSrcweir                         nFooterEndIndex = nIndex;
227cdf0e10cSrcweir                         bFooterEndIndex = sal_True;
228cdf0e10cSrcweir                     }
229cdf0e10cSrcweir                 }
230cdf0e10cSrcweir                 break;
231cdf0e10cSrcweir                 case CTF_PM_FOOTERFLAG:
232cdf0e10cSrcweir                 {
233cdf0e10cSrcweir                     if (!bFooterStartIndex)
234cdf0e10cSrcweir                     {
235cdf0e10cSrcweir                         nFooterStartIndex = nIndex;
236cdf0e10cSrcweir                         bFooterStartIndex = sal_True;
237cdf0e10cSrcweir                     }
238cdf0e10cSrcweir                     if (bHeaderStartIndex && !bHeaderEndIndex)
239cdf0e10cSrcweir                     {
240cdf0e10cSrcweir                         nHeaderEndIndex = nIndex;
241cdf0e10cSrcweir                         bHeaderEndIndex = sal_True;
242cdf0e10cSrcweir                     }
243cdf0e10cSrcweir                 }
244cdf0e10cSrcweir                 break;
245cdf0e10cSrcweir             }
246cdf0e10cSrcweir             nIndex++;
247cdf0e10cSrcweir         }
248cdf0e10cSrcweir         if (!bHeaderEndIndex)
249cdf0e10cSrcweir             nHeaderEndIndex = nIndex;
250cdf0e10cSrcweir         if (!bFooterEndIndex)
251cdf0e10cSrcweir             nFooterEndIndex = nIndex;
252cdf0e10cSrcweir 
253cdf0e10cSrcweir         // export header style element
254cdf0e10cSrcweir         {
255cdf0e10cSrcweir             SvXMLElementExport aElem(
256cdf0e10cSrcweir                 GetExport(), XML_NAMESPACE_STYLE, XML_HEADER_STYLE,
257cdf0e10cSrcweir                 sal_True, sal_True );
258cdf0e10cSrcweir 
259cdf0e10cSrcweir             rPropExp.exportXML(
260cdf0e10cSrcweir                 GetExport(), rProperties,
261cdf0e10cSrcweir                 nHeaderStartIndex, nHeaderEndIndex, XML_EXPORT_FLAG_IGN_WS);
262cdf0e10cSrcweir         }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir         // export footer style
265cdf0e10cSrcweir         {
266cdf0e10cSrcweir             SvXMLElementExport aElem(
267cdf0e10cSrcweir                 GetExport(), XML_NAMESPACE_STYLE, XML_FOOTER_STYLE,
268cdf0e10cSrcweir                 sal_True, sal_True );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir             rPropExp.exportXML(
271cdf0e10cSrcweir                 GetExport(), rProperties,
272cdf0e10cSrcweir                 nFooterStartIndex, nFooterEndIndex, XML_EXPORT_FLAG_IGN_WS);
273cdf0e10cSrcweir         }
274cdf0e10cSrcweir     }
275cdf0e10cSrcweir }
276cdf0e10cSrcweir 
SvXMLAutoStylePoolP()277cdf0e10cSrcweir SvXMLAutoStylePoolP::SvXMLAutoStylePoolP()
278cdf0e10cSrcweir {
279cdf0e10cSrcweir     DBG_ERROR("This constuctor is obsoleted and should not be used!");
280cdf0e10cSrcweir     pImpl = NULL;
281cdf0e10cSrcweir }
282cdf0e10cSrcweir 
SvXMLAutoStylePoolP(SvXMLExport & rExport)283cdf0e10cSrcweir SvXMLAutoStylePoolP::SvXMLAutoStylePoolP( SvXMLExport& rExport )
284cdf0e10cSrcweir {
285cdf0e10cSrcweir     pImpl = new SvXMLAutoStylePoolP_Impl( rExport );
286cdf0e10cSrcweir }
287cdf0e10cSrcweir 
~SvXMLAutoStylePoolP()288cdf0e10cSrcweir SvXMLAutoStylePoolP::~SvXMLAutoStylePoolP()
289cdf0e10cSrcweir {
290cdf0e10cSrcweir     delete pImpl;
291cdf0e10cSrcweir }
292cdf0e10cSrcweir 
GetExport() const293cdf0e10cSrcweir SvXMLExport& SvXMLAutoStylePoolP::GetExport() const
294cdf0e10cSrcweir {
295cdf0e10cSrcweir     return pImpl->GetExport();
296cdf0e10cSrcweir }
297cdf0e10cSrcweir 
298*374d2a96SJohn Bampton // TODO: remove this
AddFamily(sal_Int32 nFamily,const OUString & rStrName,SvXMLExportPropertyMapper * pMapper,OUString aStrPrefix,sal_Bool bAsFamily)299cdf0e10cSrcweir void SvXMLAutoStylePoolP::AddFamily(
300cdf0e10cSrcweir         sal_Int32 nFamily,
301cdf0e10cSrcweir         const OUString& rStrName,
302cdf0e10cSrcweir         SvXMLExportPropertyMapper* pMapper,
303cdf0e10cSrcweir         OUString aStrPrefix,
304cdf0e10cSrcweir         sal_Bool bAsFamily )
305cdf0e10cSrcweir {
306cdf0e10cSrcweir     UniReference <SvXMLExportPropertyMapper> xTmp = pMapper;
307cdf0e10cSrcweir     AddFamily( nFamily, rStrName, xTmp, aStrPrefix, bAsFamily );
308cdf0e10cSrcweir }
309cdf0e10cSrcweir 
AddFamily(sal_Int32 nFamily,const OUString & rStrName,const UniReference<SvXMLExportPropertyMapper> & rMapper,const OUString & rStrPrefix,sal_Bool bAsFamily)310cdf0e10cSrcweir void SvXMLAutoStylePoolP::AddFamily(
311cdf0e10cSrcweir         sal_Int32 nFamily,
312cdf0e10cSrcweir         const OUString& rStrName,
313cdf0e10cSrcweir         const UniReference < SvXMLExportPropertyMapper > & rMapper,
314cdf0e10cSrcweir         const OUString& rStrPrefix,
315cdf0e10cSrcweir         sal_Bool bAsFamily )
316cdf0e10cSrcweir {
317cdf0e10cSrcweir     pImpl->AddFamily( nFamily, rStrName, rMapper, rStrPrefix, bAsFamily );
318cdf0e10cSrcweir }
319cdf0e10cSrcweir 
RegisterName(sal_Int32 nFamily,const OUString & rName)320cdf0e10cSrcweir void SvXMLAutoStylePoolP::RegisterName( sal_Int32 nFamily,
321cdf0e10cSrcweir                                        const OUString& rName )
322cdf0e10cSrcweir {
323cdf0e10cSrcweir     pImpl->RegisterName( nFamily, rName );
324cdf0e10cSrcweir }
325cdf0e10cSrcweir 
GetRegisteredNames(uno::Sequence<sal_Int32> & rFamilies,uno::Sequence<OUString> & rNames)326cdf0e10cSrcweir void SvXMLAutoStylePoolP::GetRegisteredNames(
327cdf0e10cSrcweir     uno::Sequence<sal_Int32>& rFamilies,
328cdf0e10cSrcweir     uno::Sequence<OUString>& rNames )
329cdf0e10cSrcweir {
330cdf0e10cSrcweir     pImpl->GetRegisteredNames( rFamilies, rNames );
331cdf0e10cSrcweir }
332cdf0e10cSrcweir 
RegisterNames(uno::Sequence<sal_Int32> & aFamilies,uno::Sequence<OUString> & aNames)333cdf0e10cSrcweir void SvXMLAutoStylePoolP::RegisterNames(
334cdf0e10cSrcweir     uno::Sequence<sal_Int32>& aFamilies,
335cdf0e10cSrcweir     uno::Sequence<OUString>& aNames )
336cdf0e10cSrcweir {
337cdf0e10cSrcweir     DBG_ASSERT( aFamilies.getLength() == aNames.getLength(),
338cdf0e10cSrcweir                 "aFamilies != aNames" );
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     // iterate over sequence(s) and call RegisterName(..) for each pair
341cdf0e10cSrcweir     const sal_Int32* pFamilies = aFamilies.getConstArray();
342cdf0e10cSrcweir     const OUString* pNames = aNames.getConstArray();
343cdf0e10cSrcweir     sal_Int32 nCount = min( aFamilies.getLength(), aNames.getLength() );
344cdf0e10cSrcweir     for( sal_Int32 n = 0; n < nCount; n++ )
345cdf0e10cSrcweir         RegisterName( pFamilies[n], pNames[n] );
346cdf0e10cSrcweir }
347cdf0e10cSrcweir 
Add(sal_Int32 nFamily,const vector<XMLPropertyState> & rProperties)348cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
349cdf0e10cSrcweir                                   const vector< XMLPropertyState >& rProperties )
350cdf0e10cSrcweir {
351cdf0e10cSrcweir     OUString sEmpty;
352cdf0e10cSrcweir     OUString sName;
353cdf0e10cSrcweir     pImpl->Add(sName, nFamily, sEmpty, rProperties );
354cdf0e10cSrcweir     return sName;
355cdf0e10cSrcweir }
356cdf0e10cSrcweir 
Add(sal_Int32 nFamily,const OUString & rParent,const vector<XMLPropertyState> & rProperties,bool bDontSeek)357cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
358cdf0e10cSrcweir                                   const OUString& rParent,
359cdf0e10cSrcweir                                   const vector< XMLPropertyState >& rProperties, bool bDontSeek )
360cdf0e10cSrcweir {
361cdf0e10cSrcweir     OUString sName;
362cdf0e10cSrcweir     pImpl->Add(sName, nFamily, rParent, rProperties, sal_False, bDontSeek );
363cdf0e10cSrcweir     return sName;
364cdf0e10cSrcweir }
365cdf0e10cSrcweir 
Add(OUString & rName,sal_Int32 nFamily,const::std::vector<XMLPropertyState> & rProperties)366cdf0e10cSrcweir sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties )
367cdf0e10cSrcweir {
368cdf0e10cSrcweir     OUString sEmpty;
369cdf0e10cSrcweir     return pImpl->Add(rName, nFamily, sEmpty, rProperties);
370cdf0e10cSrcweir }
371cdf0e10cSrcweir 
Add(OUString & rName,sal_Int32 nFamily,const OUString & rParent,const::std::vector<XMLPropertyState> & rProperties)372cdf0e10cSrcweir sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties )
373cdf0e10cSrcweir {
374cdf0e10cSrcweir     return pImpl->Add(rName, nFamily, rParent, rProperties);
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
AddNamed(const OUString & rName,sal_Int32 nFamily,const OUString & rParent,const::std::vector<XMLPropertyState> & rProperties)377cdf0e10cSrcweir sal_Bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent,
378cdf0e10cSrcweir                                         const ::std::vector< XMLPropertyState >& rProperties )
379cdf0e10cSrcweir 
380cdf0e10cSrcweir {
381cdf0e10cSrcweir     return pImpl->AddNamed(rName, nFamily, rParent, rProperties);
382cdf0e10cSrcweir }
383cdf0e10cSrcweir 
AddAndCache(sal_Int32 nFamily,const vector<XMLPropertyState> & rProperties)384cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
385cdf0e10cSrcweir                                   const vector< XMLPropertyState >& rProperties )
386cdf0e10cSrcweir {
387cdf0e10cSrcweir     OUString sEmpty;
388cdf0e10cSrcweir     OUString sName;
389cdf0e10cSrcweir     pImpl->Add(sName, nFamily, sEmpty, rProperties, sal_True );
390cdf0e10cSrcweir     return sName;
391cdf0e10cSrcweir }
392cdf0e10cSrcweir 
AddAndCache(sal_Int32 nFamily,const OUString & rParent,const vector<XMLPropertyState> & rProperties)393cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
394cdf0e10cSrcweir                                   const OUString& rParent,
395cdf0e10cSrcweir                                   const vector< XMLPropertyState >& rProperties )
396cdf0e10cSrcweir {
397cdf0e10cSrcweir     OUString sName;
398cdf0e10cSrcweir     pImpl->Add(sName, nFamily, rParent, rProperties, sal_True );
399cdf0e10cSrcweir     return sName;
400cdf0e10cSrcweir }
401cdf0e10cSrcweir 
AddAndCache(sal_Int32 nFamily,const OUString & rParent)402cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
403cdf0e10cSrcweir                                   const OUString& rParent )
404cdf0e10cSrcweir {
405cdf0e10cSrcweir     return pImpl->AddToCache( nFamily, rParent );
406cdf0e10cSrcweir }
407cdf0e10cSrcweir 
Find(sal_Int32 nFamily,const vector<XMLPropertyState> & rProperties) const408cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily,
409cdf0e10cSrcweir                                    const vector< XMLPropertyState >& rProperties ) const
410cdf0e10cSrcweir {
411cdf0e10cSrcweir     OUString sEmpty;
412cdf0e10cSrcweir     return pImpl->Find( nFamily, sEmpty, rProperties );
413cdf0e10cSrcweir }
414cdf0e10cSrcweir 
Find(sal_Int32 nFamily,const OUString & rParent,const vector<XMLPropertyState> & rProperties) const415cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily,
416cdf0e10cSrcweir                                    const OUString& rParent,
417cdf0e10cSrcweir                                    const vector< XMLPropertyState >& rProperties ) const
418cdf0e10cSrcweir {
419cdf0e10cSrcweir     return pImpl->Find( nFamily, rParent, rProperties );
420cdf0e10cSrcweir }
421cdf0e10cSrcweir 
FindAndRemoveCached(sal_Int32 nFamily) const422cdf0e10cSrcweir OUString SvXMLAutoStylePoolP::FindAndRemoveCached( sal_Int32 nFamily ) const
423cdf0e10cSrcweir {
424cdf0e10cSrcweir     return pImpl->FindAndRemoveCached( nFamily );
425cdf0e10cSrcweir }
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 
exportXML(sal_Int32 nFamily,const uno::Reference<::com::sun::star::xml::sax::XDocumentHandler> &,const SvXMLUnitConverter &,const SvXMLNamespaceMap &) const428cdf0e10cSrcweir void SvXMLAutoStylePoolP::exportXML( sal_Int32 nFamily,
429cdf0e10cSrcweir     const uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > &,
430cdf0e10cSrcweir     const SvXMLUnitConverter&,
431cdf0e10cSrcweir     const SvXMLNamespaceMap&
432cdf0e10cSrcweir     ) const
433cdf0e10cSrcweir {
434cdf0e10cSrcweir     pImpl->exportXML( nFamily,
435cdf0e10cSrcweir                       GetExport().GetDocHandler(),
436cdf0e10cSrcweir                       GetExport().GetMM100UnitConverter(),
437cdf0e10cSrcweir                       GetExport().GetNamespaceMap(),
438cdf0e10cSrcweir                       this);
439cdf0e10cSrcweir }
440cdf0e10cSrcweir 
ClearEntries()441cdf0e10cSrcweir void SvXMLAutoStylePoolP::ClearEntries()
442cdf0e10cSrcweir {
443cdf0e10cSrcweir     pImpl->ClearEntries();
444cdf0e10cSrcweir }
445