LibreOffice Module xmloff (master)  1
xmlexppr.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <optional>
22 #include <string_view>
23 #include <com/sun/star/container/XNameContainer.hpp>
24 #include <com/sun/star/xml/AttributeData.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/beans/XPropertyState.hpp>
27 #include <com/sun/star/beans/XMultiPropertySet.hpp>
28 #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
29 #include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
30 #include <rtl/ustrbuf.hxx>
32 #include <cppuhelper/weakref.hxx>
33 #include <osl/diagnose.h>
34 #include <list>
35 #include <map>
36 #include <o3tl/sorted_vector.hxx>
37 
38 #include <xmloff/xmlexppr.hxx>
39 #include <xmloff/xmltoken.hxx>
40 #include <xmloff/attrlist.hxx>
41 #include <xmloff/namespacemap.hxx>
42 #include <xmloff/xmlnamespace.hxx>
43 #include <xmloff/xmlexp.hxx>
44 #include <xmloff/xmlprmap.hxx>
45 #include <xmloff/maptype.hxx>
46 #include <xmloff/xmltypes.hxx>
47 #include <xmloff/xmlprhdl.hxx>
48 
49 using namespace ::std;
50 using namespace ::com::sun::star;
51 using namespace ::com::sun::star::beans;
52 using namespace ::com::sun::star::uno;
53 using namespace ::com::sun::star::lang;
54 using namespace ::xmloff::token;
55 
56 #define GET_PROP_TYPE( f ) static_cast<sal_uInt16>((f & XML_TYPE_PROP_MASK) >> XML_TYPE_PROP_SHIFT)
57 #define ENTRY(t) { GET_PROP_TYPE(XML_TYPE_PROP_##t), XML_##t##_PROPERTIES }
58 
59 namespace {
60 
61 struct XMLPropTokens_Impl
62 {
63  sal_uInt16 nType;
65 };
66 
67 const sal_uInt16 MAX_PROP_TYPES =
70 
71 XMLPropTokens_Impl const aPropTokens[MAX_PROP_TYPES] =
72 {
73  ENTRY(CHART),
74  ENTRY(GRAPHIC),
75  ENTRY(TABLE),
79  ENTRY(LIST_LEVEL),
81  ENTRY(TEXT),
83  ENTRY(PAGE_LAYOUT),
85  ENTRY(RUBY),
86  ENTRY(SECTION)
87 };
88 
89 // public methods
90 
91 // Take all properties of the XPropertySet which are also found in the
92 // XMLPropertyMapEntry-array and which are not set to their default-value,
93 // if a state is available.
94 // After that I call the method 'ContextFilter'.
95 
96 struct ComparePropertyState
97 {
98  bool operator()(XMLPropertyState const& lhs, XMLPropertyState const& rhs)
99  {
100  return lhs.mnIndex < rhs.mnIndex;
101  }
102 };
103 class XMLPropertyStates_Impl
104 {
106 public:
107  XMLPropertyStates_Impl();
108  void AddPropertyState(const XMLPropertyState& rPropState);
109  void FillPropertyStateVector(std::vector<XMLPropertyState>& rVector);
110 };
111 
112 XMLPropertyStates_Impl::XMLPropertyStates_Impl()
113 {
114 }
115 
116 void XMLPropertyStates_Impl::AddPropertyState(
117  const XMLPropertyState& rPropState)
118 {
119  aPropStates.insert(rPropState);
120 }
121 
122 void XMLPropertyStates_Impl::FillPropertyStateVector(
123  std::vector<XMLPropertyState>& rVector)
124 {
125  rVector.insert( rVector.begin(), aPropStates.begin(), aPropStates.end() );
126 }
127 
128 class FilterPropertyInfo_Impl
129 {
130  OUString msApiName;
131  std::vector<sal_uInt32> maIndexes;
132 
133 public:
134 
135  FilterPropertyInfo_Impl( const OUString& rApiName,
136  const sal_uInt32 nIndex);
137 
138  const OUString& GetApiName() const { return msApiName; }
139  std::vector<sal_uInt32>& GetIndexes() { return maIndexes; }
140 
141  // for sort
142  bool operator< ( const FilterPropertyInfo_Impl& rArg ) const
143  {
144  return (GetApiName() < rArg.GetApiName());
145  }
146 };
147 
148 FilterPropertyInfo_Impl::FilterPropertyInfo_Impl(
149  const OUString& rApiName,
150  const sal_uInt32 nIndex ) :
151  msApiName( rApiName )
152 {
153  maIndexes.push_back(nIndex);
154 }
155 
156 typedef std::list<FilterPropertyInfo_Impl> FilterPropertyInfoList_Impl;
157 
158 class FilterPropertiesInfo_Impl
159 {
160  FilterPropertyInfoList_Impl aPropInfos;
161 
162  std::optional<Sequence<OUString>> mxApiNames;
163 
164 public:
165  FilterPropertiesInfo_Impl();
166 
167  void AddProperty(const OUString& rApiName, const sal_uInt32 nIndex);
168  const uno::Sequence<OUString>& GetApiNames();
169  void FillPropertyStateArray(
170  vector< XMLPropertyState >& rPropStates,
171  const Reference< XPropertySet >& xPropSet,
172  const rtl::Reference< XMLPropertySetMapper >& maPropMapper,
173  const bool bDefault);
174  sal_uInt32 GetPropertyCount() const { return aPropInfos.size(); }
175 };
176 
177 FilterPropertiesInfo_Impl::FilterPropertiesInfo_Impl()
178 {
179 }
180 
181 void FilterPropertiesInfo_Impl::AddProperty(
182  const OUString& rApiName, const sal_uInt32 nIndex)
183 {
184  aPropInfos.emplace_back(rApiName, nIndex);
185 
186  OSL_ENSURE( !mxApiNames, "performance warning: API names already retrieved" );
187  mxApiNames.reset();
188 }
189 
190 const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
191 {
192  if( !mxApiNames )
193  {
194  // we have to do three things:
195  // 1) sort API names,
196  // 2) merge duplicates,
197  // 3) construct sequence
198 
199  // sort names
200  aPropInfos.sort();
201 
202  // merge duplicates
203  if ( aPropInfos.size() > 1 )
204  {
205  FilterPropertyInfoList_Impl::iterator aOld = aPropInfos.begin();
206  FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
207  FilterPropertyInfoList_Impl::iterator aCurrent = aOld;
208  ++aCurrent;
209 
210  while ( aCurrent != aEnd )
211  {
212  // equal to next element?
213  if ( aOld->GetApiName() == aCurrent->GetApiName() )
214  {
215  // if equal: merge index lists
216  std::vector<sal_uInt32> aMerged;
217  std::merge(aOld->GetIndexes().begin(), aOld->GetIndexes().end(),
218  aCurrent->GetIndexes().begin(), aCurrent->GetIndexes().end(),
219  std::back_inserter(aMerged));
220  aOld->GetIndexes() = std::move(aMerged);
221  aCurrent->GetIndexes().clear();
222  // erase element, and continue with next
223  aCurrent = aPropInfos.erase( aCurrent );
224  }
225  else
226  {
227  // remember old element and continue with next
228  aOld = aCurrent;
229  ++aCurrent;
230  }
231  }
232  }
233 
234  // construct sequence
235  mxApiNames.emplace( aPropInfos.size() );
236  OUString *pNames = mxApiNames->getArray();
237 
238  for (auto const& propInfo : aPropInfos)
239  {
240  *pNames = propInfo.GetApiName();
241  ++pNames;
242  }
243  }
244 
245  return *mxApiNames;
246 }
247 
248 void FilterPropertiesInfo_Impl::FillPropertyStateArray(
249  vector< XMLPropertyState >& rPropStates,
250  const Reference< XPropertySet >& rPropSet,
251  const rtl::Reference< XMLPropertySetMapper >& rPropMapper,
252  const bool bDefault )
253 {
254  XMLPropertyStates_Impl aPropStates;
255 
256  const uno::Sequence<OUString>& rApiNames = GetApiNames();
257 
258  Reference < XTolerantMultiPropertySet > xTolPropSet( rPropSet, UNO_QUERY );
259  if (xTolPropSet.is())
260  {
261  if (!bDefault)
262  {
263  Sequence < beans::GetDirectPropertyTolerantResult > aResults(xTolPropSet->getDirectPropertyValuesTolerant(rApiNames));
264  sal_Int32 nResultCount(aResults.getLength());
265  if (nResultCount > 0)
266  {
267  const beans::GetDirectPropertyTolerantResult *pResults = aResults.getConstArray();
268  FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
269  XMLPropertyState aNewProperty( -1 );
270  while (nResultCount > 0 && aPropIter != aPropInfos.end())
271  {
272  if (pResults->Name == aPropIter->GetApiName())
273  {
274  aNewProperty.mnIndex = -1;
275  aNewProperty.maValue = pResults->Value;
276 
277  for (auto const& index : aPropIter->GetIndexes())
278  {
279  aNewProperty.mnIndex = index;
280  aPropStates.AddPropertyState( aNewProperty );
281  }
282  ++pResults;
283  --nResultCount;
284  }
285  ++aPropIter;
286  }
287  }
288  }
289  else
290  {
291  const Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames));
292  OSL_ENSURE( rApiNames.getLength() == aResults.getLength(), "wrong implemented XTolerantMultiPropertySet" );
293  FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
294  XMLPropertyState aNewProperty( -1 );
295  OSL_ENSURE( aPropInfos.size() == static_cast<sal_uInt32>(aResults.getLength()), "wrong implemented XTolerantMultiPropertySet??" );
296  for( const auto& rResult : aResults )
297  {
298  if ((rResult.Result == beans::TolerantPropertySetResultType::SUCCESS) &&
299  ((rResult.State == PropertyState_DIRECT_VALUE) || (rResult.State == PropertyState_DEFAULT_VALUE)))
300  {
301  aNewProperty.mnIndex = -1;
302  aNewProperty.maValue = rResult.Value;
303 
304  for (auto const& index : aPropIter->GetIndexes())
305  {
306  aNewProperty.mnIndex = index;
307  aPropStates.AddPropertyState( aNewProperty );
308  }
309  }
310  ++aPropIter;
311  }
312  }
313  }
314  else
315  {
316  Sequence < PropertyState > aStates;
317  const PropertyState *pStates = nullptr;
318  Reference< XPropertyState > xPropState( rPropSet, UNO_QUERY );
319  if( xPropState.is() )
320  {
321  aStates = xPropState->getPropertyStates( rApiNames );
322  pStates = aStates.getConstArray();
323  }
324 
325  Reference < XMultiPropertySet > xMultiPropSet( rPropSet, UNO_QUERY );
326  if( xMultiPropSet.is() && !bDefault )
327  {
328  Sequence < Any > aValues;
329  if( pStates )
330  {
331  // step 1: get value count
332  sal_uInt32 nValueCount = 0;
333 
334  for (size_t i = 0; i < aPropInfos.size(); ++i, ++pStates)
335  {
336  if( *pStates == PropertyState_DIRECT_VALUE )
337  nValueCount++;
338  }
339 
340  if( nValueCount )
341  {
342  // step 2: collect property names
343  Sequence < OUString > aAPINames( nValueCount );
344  OUString *pAPINames = aAPINames.getArray();
345 
346  ::std::vector< FilterPropertyInfoList_Impl::iterator > aPropIters;
347  aPropIters.reserve( nValueCount );
348 
349  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
350  OSL_ENSURE(aItr != aPropInfos.end(),"Invalid iterator!");
351 
352  pStates = aStates.getConstArray();
353  sal_uInt32 i = 0;
354  while( i < nValueCount )
355  {
356  if( *pStates == PropertyState_DIRECT_VALUE )
357  {
358  *pAPINames++ = aItr->GetApiName();
359  aPropIters.push_back( aItr );
360  ++i;
361  }
362  ++aItr;
363  ++pStates;
364  }
365 
366  aValues = xMultiPropSet->getPropertyValues( aAPINames );
367  const Any *pValues = aValues.getConstArray();
368 
369  ::std::vector< FilterPropertyInfoList_Impl::iterator >::const_iterator
370  pPropIter = aPropIters.begin();
371 
372  XMLPropertyState aNewProperty( -1 );
373  for( i = 0; i < nValueCount; ++i )
374  {
375  aNewProperty.mnIndex = -1;
376  aNewProperty.maValue = *pValues;
377 
378  for (auto const& index : (*pPropIter)->GetIndexes())
379  {
380  aNewProperty.mnIndex = index;
381  aPropStates.AddPropertyState( aNewProperty );
382  }
383 
384  ++pPropIter;
385  ++pValues;
386  }
387  }
388  }
389  else
390  {
391  aValues = xMultiPropSet->getPropertyValues( rApiNames );
392  const Any *pValues = aValues.getConstArray();
393 
394  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
395  for (size_t i = 0; i < aPropInfos.size(); ++i)
396  {
397  // The value is stored in the PropertySet itself, add to list.
398  XMLPropertyState aNewProperty( -1 );
399  aNewProperty.maValue = *pValues;
400  ++pValues;
401  for (auto const& index : aItr->GetIndexes())
402  {
403  aNewProperty.mnIndex = index;
404  aPropStates.AddPropertyState( aNewProperty );
405  }
406  ++aItr;
407  }
408  }
409  }
410  else
411  {
412  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
413  for (size_t i = 0; i < aPropInfos.size(); ++i)
414  {
415  bool bDirectValue =
416  !pStates || *pStates == PropertyState_DIRECT_VALUE;
417  if( bDirectValue || bDefault )
418  {
419  // The value is stored in the PropertySet itself, add to list.
420  bool bGotValue = false;
421  XMLPropertyState aNewProperty( -1 );
422  for (auto const& index : aItr->GetIndexes())
423  {
424  if( bDirectValue ||
425  (rPropMapper->GetEntryFlags(index) &
427  {
428  try
429  {
430  if( !bGotValue )
431  {
432  aNewProperty.maValue =
433  rPropSet->getPropertyValue( aItr->GetApiName() );
434  bGotValue = true;
435  }
436  aNewProperty.mnIndex = index;
437  aPropStates.AddPropertyState( aNewProperty );
438  }
439  catch( UnknownPropertyException& )
440  {
441  // might be a problem of getImplementationId
442  OSL_ENSURE( false, "unknown property in getPropertyValue" );
443  }
444 
445  }
446  }
447  }
448 
449  ++aItr;
450  if( pStates )
451  ++pStates;
452  }
453  }
454  }
455  aPropStates.FillPropertyStateVector(rPropStates);
456 }
457 
458 }
459 
461 {
462  typedef std::map<css::uno::Reference<css::beans::XPropertySetInfo>, std::unique_ptr<FilterPropertiesInfo_Impl>> CacheType;
463  CacheType maCache;
464 
467 
468  OUString maStyleName;
469 };
470 
471 // ctor/dtor , class SvXMLExportPropertyMapper
472 
474  const rtl::Reference< XMLPropertySetMapper >& rMapper ) :
475  mpImpl(new Impl)
476 {
477  mpImpl->mxPropMapper = rMapper;
478 }
479 
481 {
482 }
483 
486 {
487  // add map entries from rMapper to current map
488  mpImpl->mxPropMapper->AddMapperEntry( rMapper->getPropertySetMapper() );
489  // rMapper uses the same map as 'this'
490  rMapper->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
491 
492  // set rMapper as last mapper in current chain
494  if( xNext.is())
495  {
496  while (xNext->mpImpl->mxNextMapper.is())
497  xNext = xNext->mpImpl->mxNextMapper;
498  xNext->mpImpl->mxNextMapper = rMapper;
499  }
500  else
501  mpImpl->mxNextMapper = rMapper;
502 
503  // if rMapper was already chained, correct
504  // map pointer of successors
505  xNext = rMapper;
506 
507  while (xNext->mpImpl->mxNextMapper.is())
508  {
509  xNext = xNext->mpImpl->mxNextMapper;
510  xNext->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
511  }
512 }
513 
514 std::vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter(
515  SvXMLExport const& rExport,
516  const uno::Reference<beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily ) const
517 {
518  return Filter_(rExport, rPropSet, false, bEnableFoFontFamily);
519 }
520 
521 std::vector<XMLPropertyState> SvXMLExportPropertyMapper::FilterDefaults(
522  SvXMLExport const& rExport,
523  const uno::Reference<beans::XPropertySet>& rPropSet ) const
524 {
525  return Filter_(rExport, rPropSet, true, false/*bEnableFoFontFamily*/);
526 }
527 
528 vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
529  SvXMLExport const& rExport,
530  const Reference<XPropertySet>& xPropSet, bool bDefault, bool bEnableFoFontFamily ) const
531 {
532  vector< XMLPropertyState > aPropStateArray;
533 
534  // Retrieve XPropertySetInfo and XPropertyState
535  Reference< XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
536  if( !xInfo.is() )
537  return aPropStateArray;
538 
539  sal_Int32 nProps = mpImpl->mxPropMapper->GetEntryCount();
540 
541  FilterPropertiesInfo_Impl *pFilterInfo = nullptr;
542 
543  Impl::CacheType::iterator aIter = mpImpl->maCache.find(xInfo);
544  if (aIter != mpImpl->maCache.end())
545  pFilterInfo = (*aIter).second.get();
546 
547  bool bDelInfo = false;
548  if( !pFilterInfo )
549  {
551  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(rExport.getSaneDefaultVersion());
552  pFilterInfo = new FilterPropertiesInfo_Impl;
553  for( sal_Int32 i=0; i < nProps; i++ )
554  {
555  // Are we allowed to ask for the property? (MID_FLAG_NO_PROP..)
556  // Does the PropertySet contain name of mpEntries-array ?
557  const OUString& rAPIName = mpImpl->mxPropMapper->GetEntryAPIName( i );
558  const sal_Int32 nFlags = mpImpl->mxPropMapper->GetEntryFlags( i );
559  if( (0 == (nFlags & MID_FLAG_NO_PROPERTY_EXPORT)) &&
560  ( (0 != (nFlags & MID_FLAG_MUST_EXIST)) ||
561  xInfo->hasPropertyByName( rAPIName ) ) )
562  {
563  const SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport(
564  mpImpl->mxPropMapper->GetEarliestODFVersionForExport(i));
565  // note: only standard ODF versions are allowed here,
566  // only exception is the unknown future
567  assert((nEarliestODFVersionForExport & SvtSaveOptions::ODFSVER_EXTENDED) == 0
568  || nEarliestODFVersionForExport == SvtSaveOptions::ODFSVER_FUTURE_EXTENDED);
571  static sal_uInt16 s_OdfNs[] = {
597  };
598  static bool s_Assert(false);
599  if (!s_Assert)
600  {
601  assert(std::is_sorted(std::begin(s_OdfNs), std::end(s_OdfNs)));
602  s_Assert = true;
603  }
604  //static_assert(std::is_sorted(std::begin(s_OdfNs), std::end(s_OdfNs)));
605  auto const ns(mpImpl->mxPropMapper->GetEntryNameSpace(i));
606  auto const iter(std::lower_bound(std::begin(s_OdfNs), std::end(s_OdfNs),
607  ns));
608  bool const isExtension(iter == std::end(s_OdfNs) || *iter != ns
609  // FIXME: very special hack to suppress style:hyperlink
610  || (ns == XML_NAMESPACE_STYLE
611  && mpImpl->mxPropMapper->GetEntryXMLName(i) == GetXMLToken(XML_HYPERLINK)));
612  if (isExtension
613  ? ((nCurrentVersion & SvtSaveOptions::ODFSVER_EXTENDED)
614  // if it's in standard ODF, don't export extension
615  && (nCurrentVersion < nEarliestODFVersionForExport))
616  : (nEarliestODFVersionForExport <= nCurrentVersion))
617  {
618  pFilterInfo->AddProperty(rAPIName, i);
619  }
620  }
621  }
622 
623  // Check whether the property set info is destroyed if it is assigned to
624  // a weak reference only; If it is destroyed, then every instance of
625  // getPropertySetInfo returns a new object; such property set infos must
626  // not be cached:
627  WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
628  xInfo.clear();
629  xInfo = xWeakInfo;
630  if( xInfo.is() )
631  {
632  mpImpl->maCache.emplace(xInfo, std::unique_ptr<FilterPropertiesInfo_Impl>(pFilterInfo));
633  }
634  else
635  bDelInfo = true;
636  }
637 
638  if( pFilterInfo->GetPropertyCount() )
639  {
640  try
641  {
642  pFilterInfo->FillPropertyStateArray(
643  aPropStateArray, xPropSet, mpImpl->mxPropMapper, bDefault);
644  }
645  catch( UnknownPropertyException& )
646  {
647  // might be a problem of getImplementationId
648  OSL_ENSURE( false, "unknown property in getPropertyStates" );
649  }
650  }
651 
652  // Call context-filter
653  if( !aPropStateArray.empty() )
654  ContextFilter(bEnableFoFontFamily, aPropStateArray, xPropSet);
655 
656  // Have to do if we change from a vector to a list or something like that
657 
658  if( bDelInfo )
659  delete pFilterInfo;
660 
661  return aPropStateArray;
662 }
663 
665  bool bEnableFoFontFamily,
666  vector< XMLPropertyState >& rProperties,
667  const Reference< XPropertySet >& rPropSet ) const
668 {
669  // Derived class could implement this.
670  if (mpImpl->mxNextMapper.is())
671  mpImpl->mxNextMapper->ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
672 }
673 
674 // Compares two Sequences of XMLPropertyState:
675 // 1.Number of elements equal ?
676 // 2.Index of each element equal ? (So I know whether the propertynames are the same)
677 // 3.Value of each element equal ?
679  const vector< XMLPropertyState >& aProperties1,
680  const vector< XMLPropertyState >& aProperties2 ) const
681 {
682  if (aProperties1.size() < aProperties2.size())
683  return true;
684  if (aProperties1.size() > aProperties2.size())
685  return false;
686 
687  sal_uInt32 nCount = aProperties1.size();
688 
689  for (sal_uInt32 nIndex = 0; nIndex < nCount; ++nIndex)
690  {
691  const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
692  const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
693 
694  // Compare index. If equal, compare value
695  if( rProp1.mnIndex < rProp2.mnIndex )
696  return true;
697  if( rProp1.mnIndex > rProp2.mnIndex )
698  return false;
699 
700  if( rProp1.mnIndex != -1 )
701  {
702  // Now compare values
703  if ( (mpImpl->mxPropMapper->GetEntryType( rProp1.mnIndex ) &
704  XML_TYPE_BUILDIN_CMP ) != 0 )
705  {
706  // simple type ( binary compare )
707  if ( rProp1.maValue != rProp2.maValue)
708  return false;
709  }
710  else
711  {
712  // complex type ( ask for compare-function )
713  if (!mpImpl->mxPropMapper->GetPropertyHandler(
714  rProp1.mnIndex )->equals( rProp1.maValue,
715  rProp2.maValue ))
716  return false;
717  }
718  }
719  }
720 
721  return true;
722 }
723 
724 // Compares two Sequences of XMLPropertyState:
725 // 1.Number of elements equal ?
726 // 2.Index of each element equal ? (So I know whether the propertynames are the same)
727 // 3.Value of each element equal ?
729  const vector< XMLPropertyState >& aProperties1,
730  const vector< XMLPropertyState >& aProperties2 ) const
731 {
732  if (aProperties1.size() < aProperties2.size())
733  return true;
734  if (aProperties1.size() > aProperties2.size())
735  return false;
736 
737  sal_uInt32 nCount = aProperties1.size();
738 
739  for (sal_uInt32 nIndex = 0; nIndex < nCount; ++nIndex)
740  {
741  const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
742  const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
743 
744  // Compare index. If equal, compare value
745  if( rProp1.mnIndex < rProp2.mnIndex )
746  return true;
747  if( rProp1.mnIndex > rProp2.mnIndex )
748  return false;
749 
750  if( rProp1.mnIndex != -1 )
751  {
752  // Now compare values
753  if ( (mpImpl->mxPropMapper->GetEntryType( rProp1.mnIndex ) &
754  XML_TYPE_BUILDIN_CMP ) != 0 )
755  {
756  // simple type ( binary compare )
757  if ( comphelper::anyLess(rProp1.maValue, rProp2.maValue) )
758  return true;
759  if ( comphelper::anyLess(rProp2.maValue, rProp1.maValue ) )
760  return false;
761  }
762  }
763  }
764 
765  return false;
766 }
767 
792  SvXMLExport& rExport,
793  const ::std::vector< XMLPropertyState >& rProperties,
794  SvXmlExportFlags nFlags,
795  bool bUseExtensionNamespaceForGraphicProperties) const
796 {
797  exportXML(rExport, rProperties, -1, -1, nFlags, bUseExtensionNamespaceForGraphicProperties);
798 }
799 
800 
802  SvXMLExport& rExport,
803  const ::std::vector< XMLPropertyState >& rProperties,
804  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
805  SvXmlExportFlags nFlags, bool bUseExtensionNamespaceForGraphicProperties) const
806 {
807  sal_uInt16 nPropTypeFlags = 0;
808  for( sal_uInt16 i=0; i<MAX_PROP_TYPES; ++i )
809  {
810  sal_uInt16 nPropType = aPropTokens[i].nType;
811  if( 0==i || (nPropTypeFlags & (1 << nPropType)) != 0 )
812  {
813  sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
814  if (bUseExtensionNamespaceForGraphicProperties &&
816  {
817  nNamespace = XML_NAMESPACE_LO_EXT;
819  {
820  continue; // don't write for ODF <= 1.2
821  }
822  }
823 
824  std::vector<sal_uInt16> aIndexArray;
825 
826  _exportXML( nPropType, nPropTypeFlags,
827  rExport.GetAttrList(), rProperties,
828  rExport.GetMM100UnitConverter(),
829  rExport.GetNamespaceMap(),
830  &aIndexArray,
831  nPropMapStartIdx, nPropMapEndIdx );
832 
833  if( rExport.GetAttrList().getLength() > 0 ||
834  !aIndexArray.empty() )
835  {
836  SvXMLElementExport aElem( rExport, nNamespace,
838  bool(nFlags & SvXmlExportFlags::IGN_WS),
839  false );
840 
841  exportElementItems( rExport, rProperties, nFlags, aIndexArray );
842  }
843  }
844  }
845 }
846 
850  SvXMLAttributeList& rAttrList,
851  const XMLPropertyState& rProperty,
852  const SvXMLUnitConverter& rUnitConverter,
853  const SvXMLNamespaceMap& rNamespaceMap,
854  const ::std::vector< XMLPropertyState > *pProperties,
855  sal_uInt32 nIdx ) const
856 {
857  OSL_ENSURE(mpImpl->mxNextMapper.is(), "special item not handled in xml export");
858  if (mpImpl->mxNextMapper.is())
859  mpImpl->mxNextMapper->handleSpecialItem(
860  rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx);
861 }
862 
866  SvXMLExport& rExport,
867  const XMLPropertyState& rProperty,
868  SvXmlExportFlags nFlags,
869  const ::std::vector< XMLPropertyState > *pProperties,
870  sal_uInt32 nIdx ) const
871 {
872  OSL_ENSURE(mpImpl->mxNextMapper.is(), "element item not handled in xml export");
873  if (mpImpl->mxNextMapper.is())
874  mpImpl->mxNextMapper->handleElementItem(rExport, rProperty, nFlags, pProperties, nIdx);
875 }
876 
877 // protected methods
878 
881  sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
882  SvXMLAttributeList& rAttrList,
883  const ::std::vector< XMLPropertyState >& rProperties,
884  const SvXMLUnitConverter& rUnitConverter,
885  const SvXMLNamespaceMap& rNamespaceMap,
886  std::vector<sal_uInt16>* pIndexArray,
887  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const
888 {
889  const sal_uInt32 nCount = rProperties.size();
890  sal_uInt32 nIndex = 0;
891 
892  if( -1 == nPropMapStartIdx )
893  nPropMapStartIdx = 0;
894  if( -1 == nPropMapEndIdx )
895  nPropMapEndIdx = mpImpl->mxPropMapper->GetEntryCount();
896 
897  while( nIndex < nCount )
898  {
899  sal_Int32 nPropMapIdx = rProperties[nIndex].mnIndex;
900  if( nPropMapIdx >= nPropMapStartIdx &&
901  nPropMapIdx < nPropMapEndIdx )// valid entry?
902  {
903  sal_uInt32 nEFlags = mpImpl->mxPropMapper->GetEntryFlags(nPropMapIdx);
904  sal_uInt16 nEPType = GET_PROP_TYPE(nEFlags);
905  OSL_ENSURE(nEPType >= (XML_TYPE_PROP_START >> XML_TYPE_PROP_SHIFT),
906  "no prop type specified");
907  rPropTypeFlags |= (1 << nEPType);
908  if( nEPType == nPropType )
909  {
910  // we have a valid map entry here, so lets use it...
911  if( ( nEFlags & MID_FLAG_ELEMENT_ITEM_EXPORT ) != 0 )
912  {
913  // element items do not add any properties,
914  // we export it later
915  if( pIndexArray )
916  {
917  pIndexArray->push_back( static_cast<sal_uInt16>(nIndex) );
918  }
919  }
920  else
921  {
922  _exportXML( rAttrList, rProperties[nIndex], rUnitConverter,
923  rNamespaceMap, &rProperties, nIndex );
924  }
925  }
926  }
927 
928  nIndex++;
929  }
930 }
931 
933  SvXMLAttributeList& rAttrList,
934  const XMLPropertyState& rProperty,
935  const SvXMLUnitConverter& rUnitConverter,
936  const SvXMLNamespaceMap& rNamespaceMap,
937  const ::std::vector< XMLPropertyState > *pProperties,
938  sal_uInt32 nIdx ) const
939 {
940  if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_SPECIAL_ITEM_EXPORT) != 0)
941  {
942  uno::Reference< container::XNameContainer > xAttrContainer;
943  if( (rProperty.maValue >>= xAttrContainer) && xAttrContainer.is() )
944  {
945  std::unique_ptr<SvXMLNamespaceMap> pNewNamespaceMap;
946  const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
947 
948  const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
949 
950  OUStringBuffer sNameBuffer;
951  xml::AttributeData aData;
952  for( const auto& rAttribName : aAttribNames )
953  {
954  xAttrContainer->getByName( rAttribName ) >>= aData;
955  OUString sAttribName( rAttribName );
956 
957  // extract namespace prefix from attribute name if it exists
958  OUString sPrefix;
959  const sal_Int32 nColonPos =
960  rAttribName.indexOf( ':' );
961  if( nColonPos != -1 )
962  sPrefix = rAttribName.copy( 0, nColonPos );
963 
964  if( !sPrefix.isEmpty() )
965  {
966  OUString sNamespace( aData.Namespace );
967 
968  // if the prefix isn't defined yet or has another meaning,
969  // we have to redefine it now.
970  sal_uInt16 nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
971  if( USHRT_MAX == nKey || pNamespaceMap->GetNameByKey( nKey ) != sNamespace )
972  {
973  bool bAddNamespace = false;
974  if( USHRT_MAX == nKey )
975  {
976  // The prefix is unused, so it is sufficient
977  // to add it to the namespace map.
978  bAddNamespace = true;
979  }
980  else
981  {
982  // check if there is a prefix registered for the
983  // namespace URI
984  nKey = pNamespaceMap->GetKeyByName( sNamespace );
985  if( XML_NAMESPACE_UNKNOWN == nKey )
986  {
987  // There is no prefix for the namespace, so
988  // we have to generate one and have to add it.
989  sal_Int32 n=0;
990  OUString sOrigPrefix( sPrefix );
991  do
992  {
993  sNameBuffer.append( sOrigPrefix );
994  sNameBuffer.append( ++n );
995  sPrefix = sNameBuffer.makeStringAndClear();
996  nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
997  }
998  while( nKey != USHRT_MAX );
999 
1000  bAddNamespace = true;
1001  }
1002  else
1003  {
1004  // If there is a prefix for the namespace,
1005  // we reuse that.
1006  sPrefix = pNamespaceMap->GetPrefixByKey( nKey );
1007  }
1008  // In any case, the attribute name has to be adapted.
1009  sNameBuffer.append(sPrefix + ":" + rAttribName.subView(nColonPos+1));
1010  sAttribName = sNameBuffer.makeStringAndClear();
1011  }
1012 
1013  if( bAddNamespace )
1014  {
1015  if( !pNewNamespaceMap )
1016  {
1017  pNewNamespaceMap.reset(new SvXMLNamespaceMap( rNamespaceMap ));
1018  pNamespaceMap = pNewNamespaceMap.get();
1019  }
1020  pNewNamespaceMap->Add( sPrefix, sNamespace );
1021  OUString sAttr = GetXMLToken(XML_XMLNS) + ":" + sPrefix;
1022  rAttrList.AddAttribute( sAttr, sNamespace );
1023  }
1024  }
1025  }
1026  OUString sOldValue( rAttrList.getValueByName( sAttribName ) );
1027  OSL_ENSURE( sOldValue.isEmpty(), "alien attribute exists already" );
1028  OSL_ENSURE(aData.Type == GetXMLToken(XML_CDATA), "different type to our default type which should be written out");
1029  if( sOldValue.isEmpty() )
1030  rAttrList.AddAttribute( sAttribName, aData.Value );
1031  }
1032  }
1033  else
1034  {
1035  handleSpecialItem( rAttrList, rProperty, rUnitConverter,
1036  rNamespaceMap, pProperties, nIdx );
1037  }
1038  }
1039  else if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_ELEMENT_ITEM_EXPORT ) == 0)
1040  {
1041  OUString aValue;
1042  OUString sName = rNamespaceMap.GetQNameByKey(
1043  mpImpl->mxPropMapper->GetEntryNameSpace(rProperty.mnIndex),
1044  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1045 
1046  bool bRemove = false;
1047  if ((mpImpl->mxPropMapper->GetEntryFlags( rProperty.mnIndex ) & MID_FLAG_MERGE_ATTRIBUTE) != 0)
1048  {
1049  aValue = rAttrList.getValueByName( sName );
1050  bRemove = true;
1051  }
1052 
1053  if (mpImpl->mxPropMapper->exportXML(aValue, rProperty, rUnitConverter))
1054  {
1055  if( bRemove )
1056  rAttrList.RemoveAttribute( sName );
1057 
1058  // We don't seem to have a generic mechanism to write an attribute in the extension
1059  // namespace in case of certain attribute values only, so do this manually.
1060  if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_WRITING_MODE))
1061  {
1062  if (IsXMLToken(aValue, XML_BT_LR))
1063  {
1064  sName = rNamespaceMap.GetQNameByKey(
1066  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1067  }
1068  }
1069  else if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_VERTICAL_REL))
1070  {
1071  if (IsXMLToken(aValue, XML_PAGE_CONTENT_BOTTOM))
1072  {
1073  sName = rNamespaceMap.GetQNameByKey(
1075  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1076  }
1077  if (IsXMLToken(aValue, XML_PAGE_CONTENT_TOP))
1078  {
1079  sName = rNamespaceMap.GetQNameByKey(
1081  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1082  }
1083  }
1084 
1085  rAttrList.AddAttribute( sName, aValue );
1086  }
1087  }
1088 }
1089 
1091  SvXMLExport& rExport,
1092  const ::std::vector< XMLPropertyState >& rProperties,
1093  SvXmlExportFlags nFlags,
1094  const std::vector<sal_uInt16>& rIndexArray ) const
1095 {
1096  bool bItemsExported = false;
1097  for (const sal_uInt16 nElement : rIndexArray)
1098  {
1099  OSL_ENSURE( 0 != (mpImpl->mxPropMapper->GetEntryFlags(
1100  rProperties[nElement].mnIndex ) & MID_FLAG_ELEMENT_ITEM_EXPORT),
1101  "wrong mid flag!" );
1102 
1103  rExport.IgnorableWhitespace();
1104  handleElementItem( rExport, rProperties[nElement],
1105  nFlags, &rProperties, nElement );
1106  bItemsExported = true;
1107  }
1108 
1109  if( bItemsExported )
1110  rExport.IgnorableWhitespace();
1111 }
1112 
1114 {
1115  return mpImpl->mxPropMapper;
1116 }
1117 
1118 void SvXMLExportPropertyMapper::SetStyleName( const OUString& rStyleName )
1119 {
1120  mpImpl->maStyleName = rStyleName;
1121 }
1122 
1124 {
1125  return mpImpl->maStyleName;
1126 }
1127 
1128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void exportElementItems(SvXMLExport &rExport, const ::std::vector< XMLPropertyState > &rProperties, SvXmlExportFlags nFlags, const std::vector< sal_uInt16 > &rIndexArray) const
Definition: xmlexppr.cxx:1090
constexpr sal_uInt16 XML_NAMESPACE_MATH
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION
sal_uInt16 GetKeyByPrefix(const OUString &rPrefix) const
sal_Int32 nIndex
#define MID_FLAG_ELEMENT_ITEM_EXPORT
Definition: xmltypes.hxx:67
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
virtual void handleElementItem(SvXMLExport &rExport, const XMLPropertyState &rProperty, SvXmlExportFlags nFlags, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const
this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set ...
Definition: xmlexppr.cxx:865
bool operator<(const tSchXMLIndexWithPart &rFirst, const tSchXMLIndexWithPart &rSecond)
bool LessPartial(const ::std::vector< XMLPropertyState > &aProperties1, const ::std::vector< XMLPropertyState > &aProperties2) const
Provides a partial ordering over two arrays of XMLPropertyState, Partial because implementing a full ...
Definition: xmlexppr.cxx:728
constexpr sal_uInt16 XML_NAMESPACE_XFORMS
tuple ns
constexpr sal_uInt16 XML_NAMESPACE_CHART
constexpr sal_uInt16 XML_NAMESPACE_DR3D
const OUString & GetStyleName() const
Definition: xmlexppr.cxx:1123
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:82
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT
virtual OUString SAL_CALL getValueByName(const OUString &aName) override
Definition: attrlist.cxx:80
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlexp.hxx:396
void exportXML(SvXMLExport &rExport, const ::std::vector< XMLPropertyState > &rProperties, SvXmlExportFlags nFlags, bool bUseExtensionNamespaceForGraphicProperties=false) const
fills the given attribute list with the items in the given set void SvXMLExportPropertyMapper::export...
Definition: xmlexppr.cxx:791
sal_Int64 n
constexpr sal_uInt16 XML_NAMESPACE_XLINK
sal_Int32 mnIndex
Definition: maptype.hxx:124
#define XML_TYPE_PROP_END
Definition: xmltypes.hxx:108
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3510
virtual void handleSpecialItem(SvXMLAttributeList &rAttrList, const XMLPropertyState &rProperty, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set ...
Definition: xmlexppr.cxx:849
constexpr sal_uInt16 XML_NAMESPACE_DB
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
const sal_uInt16 XML_NAMESPACE_UNKNOWN
#define MID_FLAG_MERGE_ATTRIBUTE
Definition: xmltypes.hxx:57
SvXMLAttributeList & GetAttrList()
Definition: xmlexp.hxx:379
bool anyLess(css::uno::Any const &lhs, css::uno::Any const &rhs)
SvXMLExportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper)
Definition: xmlexppr.cxx:473
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
Definition: xmlexppr.cxx:664
std::vector< XMLPropertyState > Filter(SvXMLExport const &rExport, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bEnableFoFontFamily=false) const
Filter all properties we don't want to export: Take all properties of the XPropertySet which are also...
Definition: xmlexppr.cxx:514
int nCount
constexpr sal_uInt16 XML_NAMESPACE_FORM
virtual ~SvXMLExportPropertyMapper() override
Definition: xmlexppr.cxx:480
const XMLTokenEnum aPropTokens[XML_PROP_TYPE_END]
constexpr sal_uInt16 XML_NAMESPACE_DRAW
const char * sName
constexpr OUStringLiteral aData
SvtSaveOptions::ODFDefaultVersion GetODFDefaultVersion()
constexpr sal_uInt16 XML_NAMESPACE_CONFIG
rtl::Reference< SvXMLExportPropertyMapper > mxNextMapper
Definition: xmlexppr.cxx:465
std::vector< XMLPropertyState > Filter_(SvXMLExport const &rExport, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bDefault, bool bDisableFoFontFamily) const
Filter all properties we don't want to export: Take all properties of the XPropertySet which are also...
Definition: xmlexppr.cxx:528
constexpr sal_uInt16 XML_NAMESPACE_XML
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2271
OUString sPrefix
rtl::Reference< XMLPropertySetMapper > mxPropMapper
Definition: xmlexppr.cxx:466
bool Equals(const ::std::vector< XMLPropertyState > &aProperties1, const ::std::vector< XMLPropertyState > &aProperties2) const
Compare two arrays of XMLPropertyState.
Definition: xmlexppr.cxx:678
#define XML_TYPE_PROP_SHIFT
Definition: xmltypes.hxx:90
constexpr sal_uInt16 XML_NAMESPACE_SVG
void RemoveAttribute(const OUString &sName)
Definition: attrlist.cxx:123
constexpr sal_uInt16 XML_NAMESPACE_FO
#define MID_FLAG_SPECIAL_ITEM_EXPORT
Definition: xmltypes.hxx:86
int i
constexpr sal_uInt16 XML_NAMESPACE_TEXT
#define GET_PROP_TYPE(f)
Definition: xmlexppr.cxx:56
void SetStyleName(const OUString &rStyleName)
Definition: xmlexppr.cxx:1118
virtual sal_Int16 SAL_CALL getLength() override
Definition: attrlist.cxx:34
std::unique_ptr< Impl > mpImpl
Definition: xmlexppr.hxx:55
std::map< css::uno::Reference< css::beans::XPropertySetInfo >, std::unique_ptr< FilterPropertiesInfo_Impl > > CacheType
Definition: xmlexppr.cxx:462
#define MID_FLAG_NO_PROPERTY_EXPORT
Definition: xmltypes.hxx:73
constexpr sal_uInt16 XML_NAMESPACE_GRDDL
constexpr sal_uInt16 XML_NAMESPACE_XHTML
const sal_uInt16 MAX_PROP_TYPES
#define MID_FLAG_DEFAULT_ITEM_EXPORT
Definition: xmltypes.hxx:48
tuple index
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
constexpr sal_uInt16 XML_NAMESPACE_DC
#define ENTRY(t)
Definition: xmlexppr.cxx:57
void ChainExportMapper(const rtl::Reference< SvXMLExportPropertyMapper > &rMapper)
Definition: xmlexppr.cxx:484
const SvXMLNamespaceMap & GetNamespaceMap() const
Definition: xmlexp.hxx:390
const OUString & GetNameByKey(sal_uInt16 nKey) const
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
void IgnorableWhitespace()
Definition: xmlexp.cxx:2194
const PropertyValue * pValues
#define XML_TYPE_BUILDIN_CMP
Definition: xmltypes.hxx:122
css::uno::Any maValue
Definition: maptype.hxx:125
constexpr sal_uInt16 XML_NAMESPACE_TABLE
SvXmlExportFlags
Definition: xmlexppr.hxx:39
DRAWING_PAGE
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3454
constexpr sal_uInt16 XML_NAMESPACE_SMIL
Handling of tokens in XML:
OReadImagesDocumentHandler::Image_XML_Namespace nNamespace
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
QPRO_FUNC_TYPE nType
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
TABLE
#define XML_TYPE_PROP_START
Definition: xmltypes.hxx:93
sal_uInt16 GetKeyByName(const OUString &rName) const
void AddAttribute(const OUString &sName, const OUString &sValue)
Definition: attrlist.cxx:110
std::vector< XMLPropertyState > FilterDefaults(SvXMLExport const &rExport, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Like Filter(), except that:
Definition: xmlexppr.cxx:521
XMLTokenEnum eToken
Definition: xmltoken.cxx:40
constexpr sal_uInt16 XML_NAMESPACE_META
#define MID_FLAG_MUST_EXIST
Definition: xmltypes.hxx:52
const OUString & GetPrefixByKey(sal_uInt16 nKey) const
TEXT
void _exportXML(sal_uInt16 nPropType, sal_uInt16 &rPropTypeFlags, SvXMLAttributeList &rAttrList, const ::std::vector< XMLPropertyState > &rProperties, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, std::vector< sal_uInt16 > *pIndexArray, sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx) const
fills the given attribute list with the items in the given set
Definition: xmlexppr.cxx:880
constexpr sal_uInt16 XML_NAMESPACE_STYLE
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1113