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