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  aPropInfos()
179 {
180 }
181 
182 void FilterPropertiesInfo_Impl::AddProperty(
183  const OUString& rApiName, const sal_uInt32 nIndex)
184 {
185  aPropInfos.emplace_back(rApiName, nIndex);
186 
187  OSL_ENSURE( !mxApiNames, "performance warning: API names already retrieved" );
188  mxApiNames.reset();
189 }
190 
191 const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
192 {
193  if( !mxApiNames )
194  {
195  // we have to do three things:
196  // 1) sort API names,
197  // 2) merge duplicates,
198  // 3) construct sequence
199 
200  // sort names
201  aPropInfos.sort();
202 
203  // merge duplicates
204  if ( aPropInfos.size() > 1 )
205  {
206  FilterPropertyInfoList_Impl::iterator aOld = aPropInfos.begin();
207  FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
208  FilterPropertyInfoList_Impl::iterator aCurrent = aOld;
209  ++aCurrent;
210 
211  while ( aCurrent != aEnd )
212  {
213  // equal to next element?
214  if ( aOld->GetApiName() == aCurrent->GetApiName() )
215  {
216  // if equal: merge index lists
217  std::vector<sal_uInt32> aMerged;
218  std::merge(aOld->GetIndexes().begin(), aOld->GetIndexes().end(),
219  aCurrent->GetIndexes().begin(), aCurrent->GetIndexes().end(),
220  std::back_inserter(aMerged));
221  aOld->GetIndexes() = std::move(aMerged);
222  aCurrent->GetIndexes().clear();
223  // erase element, and continue with next
224  aCurrent = aPropInfos.erase( aCurrent );
225  }
226  else
227  {
228  // remember old element and continue with next
229  aOld = aCurrent;
230  ++aCurrent;
231  }
232  }
233  }
234 
235  // construct sequence
236  mxApiNames.emplace( aPropInfos.size() );
237  OUString *pNames = mxApiNames->getArray();
238 
239  for (auto const& propInfo : aPropInfos)
240  {
241  *pNames = propInfo.GetApiName();
242  ++pNames;
243  }
244  }
245 
246  return *mxApiNames;
247 }
248 
249 void FilterPropertiesInfo_Impl::FillPropertyStateArray(
250  vector< XMLPropertyState >& rPropStates,
251  const Reference< XPropertySet >& rPropSet,
252  const rtl::Reference< XMLPropertySetMapper >& rPropMapper,
253  const bool bDefault )
254 {
255  XMLPropertyStates_Impl aPropStates;
256 
257  const uno::Sequence<OUString>& rApiNames = GetApiNames();
258 
259  Reference < XTolerantMultiPropertySet > xTolPropSet( rPropSet, UNO_QUERY );
260  if (xTolPropSet.is())
261  {
262  if (!bDefault)
263  {
264  Sequence < beans::GetDirectPropertyTolerantResult > aResults(xTolPropSet->getDirectPropertyValuesTolerant(rApiNames));
265  sal_Int32 nResultCount(aResults.getLength());
266  if (nResultCount > 0)
267  {
268  const beans::GetDirectPropertyTolerantResult *pResults = aResults.getConstArray();
269  FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
270  XMLPropertyState aNewProperty( -1 );
271  while (nResultCount > 0 && aPropIter != aPropInfos.end())
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  }
288  }
289  }
290  else
291  {
292  const Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames));
293  OSL_ENSURE( rApiNames.getLength() == aResults.getLength(), "wrong implemented XTolerantMultiPropertySet" );
294  FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
295  XMLPropertyState aNewProperty( -1 );
296  OSL_ENSURE( aPropInfos.size() == static_cast<sal_uInt32>(aResults.getLength()), "wrong implemented XTolerantMultiPropertySet??" );
297  for( const auto& rResult : aResults )
298  {
299  if ((rResult.Result == beans::TolerantPropertySetResultType::SUCCESS) &&
300  ((rResult.State == PropertyState_DIRECT_VALUE) || (rResult.State == PropertyState_DEFAULT_VALUE)))
301  {
302  aNewProperty.mnIndex = -1;
303  aNewProperty.maValue = rResult.Value;
304 
305  for (auto const& index : aPropIter->GetIndexes())
306  {
307  aNewProperty.mnIndex = index;
308  aPropStates.AddPropertyState( aNewProperty );
309  }
310  }
311  ++aPropIter;
312  }
313  }
314  }
315  else
316  {
317  Sequence < PropertyState > aStates;
318  const PropertyState *pStates = nullptr;
319  Reference< XPropertyState > xPropState( rPropSet, UNO_QUERY );
320  if( xPropState.is() )
321  {
322  aStates = xPropState->getPropertyStates( rApiNames );
323  pStates = aStates.getConstArray();
324  }
325 
326  Reference < XMultiPropertySet > xMultiPropSet( rPropSet, UNO_QUERY );
327  if( xMultiPropSet.is() && !bDefault )
328  {
329  Sequence < Any > aValues;
330  if( pStates )
331  {
332  // step 1: get value count
333  sal_uInt32 nValueCount = 0;
334 
335  for (size_t i = 0; i < aPropInfos.size(); ++i, ++pStates)
336  {
337  if( *pStates == PropertyState_DIRECT_VALUE )
338  nValueCount++;
339  }
340 
341  if( nValueCount )
342  {
343  // step 2: collect property names
344  Sequence < OUString > aAPINames( nValueCount );
345  OUString *pAPINames = aAPINames.getArray();
346 
347  ::std::vector< FilterPropertyInfoList_Impl::iterator > aPropIters;
348  aPropIters.reserve( nValueCount );
349 
350  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
351  OSL_ENSURE(aItr != aPropInfos.end(),"Invalid iterator!");
352 
353  pStates = aStates.getConstArray();
354  sal_uInt32 i = 0;
355  while( i < nValueCount )
356  {
357  if( *pStates == PropertyState_DIRECT_VALUE )
358  {
359  *pAPINames++ = aItr->GetApiName();
360  aPropIters.push_back( aItr );
361  ++i;
362  }
363  ++aItr;
364  ++pStates;
365  }
366 
367  aValues = xMultiPropSet->getPropertyValues( aAPINames );
368  const Any *pValues = aValues.getConstArray();
369 
370  ::std::vector< FilterPropertyInfoList_Impl::iterator >::const_iterator
371  pPropIter = aPropIters.begin();
372 
373  XMLPropertyState aNewProperty( -1 );
374  for( i = 0; i < nValueCount; ++i )
375  {
376  aNewProperty.mnIndex = -1;
377  aNewProperty.maValue = *pValues;
378 
379  for (auto const& index : (*pPropIter)->GetIndexes())
380  {
381  aNewProperty.mnIndex = index;
382  aPropStates.AddPropertyState( aNewProperty );
383  }
384 
385  ++pPropIter;
386  ++pValues;
387  }
388  }
389  }
390  else
391  {
392  aValues = xMultiPropSet->getPropertyValues( rApiNames );
393  const Any *pValues = aValues.getConstArray();
394 
395  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
396  for (size_t i = 0; i < aPropInfos.size(); ++i)
397  {
398  // The value is stored in the PropertySet itself, add to list.
399  XMLPropertyState aNewProperty( -1 );
400  aNewProperty.maValue = *pValues;
401  ++pValues;
402  for (auto const& index : aItr->GetIndexes())
403  {
404  aNewProperty.mnIndex = index;
405  aPropStates.AddPropertyState( aNewProperty );
406  }
407  ++aItr;
408  }
409  }
410  }
411  else
412  {
413  FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
414  for (size_t i = 0; i < aPropInfos.size(); ++i)
415  {
416  bool bDirectValue =
417  !pStates || *pStates == PropertyState_DIRECT_VALUE;
418  if( bDirectValue || bDefault )
419  {
420  // The value is stored in the PropertySet itself, add to list.
421  bool bGotValue = false;
422  XMLPropertyState aNewProperty( -1 );
423  for (auto const& index : aItr->GetIndexes())
424  {
425  if( bDirectValue ||
426  (rPropMapper->GetEntryFlags(index) &
428  {
429  try
430  {
431  if( !bGotValue )
432  {
433  aNewProperty.maValue =
434  rPropSet->getPropertyValue( aItr->GetApiName() );
435  bGotValue = true;
436  }
437  aNewProperty.mnIndex = index;
438  aPropStates.AddPropertyState( aNewProperty );
439  }
440  catch( UnknownPropertyException& )
441  {
442  // might be a problem of getImplementationId
443  OSL_ENSURE( false, "unknown property in getPropertyValue" );
444  }
445 
446  }
447  }
448  }
449 
450  ++aItr;
451  if( pStates )
452  ++pStates;
453  }
454  }
455  }
456  aPropStates.FillPropertyStateVector(rPropStates);
457 }
458 
459 }
460 
462 {
463  typedef std::map<css::uno::Reference<css::beans::XPropertySetInfo>, std::unique_ptr<FilterPropertiesInfo_Impl>> CacheType;
464  CacheType maCache;
465 
468 
469  OUString maStyleName;
470 };
471 
472 // ctor/dtor , class SvXMLExportPropertyMapper
473 
475  const rtl::Reference< XMLPropertySetMapper >& rMapper ) :
476  mpImpl(new Impl)
477 {
478  mpImpl->mxPropMapper = rMapper;
479 }
480 
482 {
483 }
484 
487 {
488  // add map entries from rMapper to current map
489  mpImpl->mxPropMapper->AddMapperEntry( rMapper->getPropertySetMapper() );
490  // rMapper uses the same map as 'this'
491  rMapper->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
492 
493  // set rMapper as last mapper in current chain
495  if( xNext.is())
496  {
497  while (xNext->mpImpl->mxNextMapper.is())
498  xNext = xNext->mpImpl->mxNextMapper;
499  xNext->mpImpl->mxNextMapper = rMapper;
500  }
501  else
502  mpImpl->mxNextMapper = rMapper;
503 
504  // if rMapper was already chained, correct
505  // map pointer of successors
506  xNext = rMapper;
507 
508  while (xNext->mpImpl->mxNextMapper.is())
509  {
510  xNext = xNext->mpImpl->mxNextMapper;
511  xNext->mpImpl->mxPropMapper = mpImpl->mxPropMapper;
512  }
513 }
514 
515 std::vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter(
516  SvXMLExport const& rExport,
517  const uno::Reference<beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily ) const
518 {
519  return Filter_(rExport, rPropSet, false, bEnableFoFontFamily);
520 }
521 
522 std::vector<XMLPropertyState> SvXMLExportPropertyMapper::FilterDefaults(
523  SvXMLExport const& rExport,
524  const uno::Reference<beans::XPropertySet>& rPropSet ) const
525 {
526  return Filter_(rExport, rPropSet, true, false/*bEnableFoFontFamily*/);
527 }
528 
529 vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
530  SvXMLExport const& rExport,
531  const Reference<XPropertySet>& xPropSet, bool bDefault, bool bEnableFoFontFamily ) const
532 {
533  vector< XMLPropertyState > aPropStateArray;
534 
535  // Retrieve XPropertySetInfo and XPropertyState
536  Reference< XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
537  if( !xInfo.is() )
538  return aPropStateArray;
539 
540  sal_Int32 nProps = mpImpl->mxPropMapper->GetEntryCount();
541 
542  FilterPropertiesInfo_Impl *pFilterInfo = nullptr;
543 
544  Impl::CacheType::iterator aIter = mpImpl->maCache.find(xInfo);
545  if (aIter != mpImpl->maCache.end())
546  pFilterInfo = (*aIter).second.get();
547 
548  bool bDelInfo = false;
549  if( !pFilterInfo )
550  {
552  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(rExport.getSaneDefaultVersion());
553  pFilterInfo = new FilterPropertiesInfo_Impl;
554  for( sal_Int32 i=0; i < nProps; i++ )
555  {
556  // Are we allowed to ask for the property? (MID_FLAG_NO_PROP..)
557  // Does the PropertySet contain name of mpEntries-array ?
558  const OUString& rAPIName = mpImpl->mxPropMapper->GetEntryAPIName( i );
559  const sal_Int32 nFlags = mpImpl->mxPropMapper->GetEntryFlags( i );
560  if( (0 == (nFlags & MID_FLAG_NO_PROPERTY_EXPORT)) &&
561  ( (0 != (nFlags & MID_FLAG_MUST_EXIST)) ||
562  xInfo->hasPropertyByName( rAPIName ) ) )
563  {
564  const SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport(
565  mpImpl->mxPropMapper->GetEarliestODFVersionForExport(i));
566  // note: only standard ODF versions are allowed here,
567  // only exception is the unknown future
568  assert((nEarliestODFVersionForExport & SvtSaveOptions::ODFSVER_EXTENDED) == 0
569  || nEarliestODFVersionForExport == SvtSaveOptions::ODFSVER_FUTURE_EXTENDED);
572  static sal_uInt16 s_OdfNs[] = {
598  };
599  static bool s_Assert(false);
600  if (!s_Assert)
601  {
602  assert(std::is_sorted(std::begin(s_OdfNs), std::end(s_OdfNs)));
603  s_Assert = true;
604  }
605  //static_assert(std::is_sorted(std::begin(s_OdfNs), std::end(s_OdfNs)));
606  auto const ns(mpImpl->mxPropMapper->GetEntryNameSpace(i));
607  auto const iter(std::lower_bound(std::begin(s_OdfNs), std::end(s_OdfNs),
608  ns));
609  bool const isExtension(iter == std::end(s_OdfNs) || *iter != ns
610  // FIXME: very special hack to suppress style:hyperlink
611  || (ns == XML_NAMESPACE_STYLE
612  && mpImpl->mxPropMapper->GetEntryXMLName(i) == GetXMLToken(XML_HYPERLINK)));
613  if (isExtension
614  ? ((nCurrentVersion & SvtSaveOptions::ODFSVER_EXTENDED)
615  // if it's in standard ODF, don't export extension
616  && (nCurrentVersion < nEarliestODFVersionForExport))
617  : (nEarliestODFVersionForExport <= nCurrentVersion))
618  {
619  pFilterInfo->AddProperty(rAPIName, i);
620  }
621  }
622  }
623 
624  // Check whether the property set info is destroyed if it is assigned to
625  // a weak reference only; If it is destroyed, then every instance of
626  // getPropertySetInfo returns a new object; such property set infos must
627  // not be cached:
628  WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
629  xInfo.clear();
630  xInfo = xWeakInfo;
631  if( xInfo.is() )
632  {
633  mpImpl->maCache.emplace(xInfo, std::unique_ptr<FilterPropertiesInfo_Impl>(pFilterInfo));
634  }
635  else
636  bDelInfo = true;
637  }
638 
639  if( pFilterInfo->GetPropertyCount() )
640  {
641  try
642  {
643  pFilterInfo->FillPropertyStateArray(
644  aPropStateArray, xPropSet, mpImpl->mxPropMapper, bDefault);
645  }
646  catch( UnknownPropertyException& )
647  {
648  // might be a problem of getImplementationId
649  OSL_ENSURE( false, "unknown property in getPropertyStates" );
650  }
651  }
652 
653  // Call context-filter
654  if( !aPropStateArray.empty() )
655  ContextFilter(bEnableFoFontFamily, aPropStateArray, xPropSet);
656 
657  // Have to do if we change from a vector to a list or something like that
658 
659  if( bDelInfo )
660  delete pFilterInfo;
661 
662  return aPropStateArray;
663 }
664 
666  bool bEnableFoFontFamily,
667  vector< XMLPropertyState >& rProperties,
668  const Reference< XPropertySet >& rPropSet ) const
669 {
670  // Derived class could implement this.
671  if (mpImpl->mxNextMapper.is())
672  mpImpl->mxNextMapper->ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
673 }
674 
675 // Compares two Sequences of XMLPropertyState:
676 // 1.Number of elements equal ?
677 // 2.Index of each element equal ? (So I know whether the propertynames are the same)
678 // 3.Value of each element equal ?
680  const vector< XMLPropertyState >& aProperties1,
681  const vector< XMLPropertyState >& aProperties2 ) const
682 {
683  if (aProperties1.size() < aProperties2.size())
684  return true;
685  if (aProperties1.size() > aProperties2.size())
686  return false;
687 
688  sal_uInt32 nCount = aProperties1.size();
689 
690  for (sal_uInt32 nIndex = 0; nIndex < nCount; ++nIndex)
691  {
692  const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
693  const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
694 
695  // Compare index. If equal, compare value
696  if( rProp1.mnIndex < rProp2.mnIndex )
697  return true;
698  if( rProp1.mnIndex > rProp2.mnIndex )
699  return false;
700 
701  if( rProp1.mnIndex != -1 )
702  {
703  // Now compare values
704  if ( (mpImpl->mxPropMapper->GetEntryType( rProp1.mnIndex ) &
705  XML_TYPE_BUILDIN_CMP ) != 0 )
706  {
707  // simple type ( binary compare )
708  if ( rProp1.maValue != rProp2.maValue)
709  return false;
710  }
711  else
712  {
713  // complex type ( ask for compare-function )
714  if (!mpImpl->mxPropMapper->GetPropertyHandler(
715  rProp1.mnIndex )->equals( rProp1.maValue,
716  rProp2.maValue ))
717  return false;
718  }
719  }
720  }
721 
722  return true;
723 }
724 
725 // Compares two Sequences of XMLPropertyState:
726 // 1.Number of elements equal ?
727 // 2.Index of each element equal ? (So I know whether the propertynames are the same)
728 // 3.Value of each element equal ?
730  const vector< XMLPropertyState >& aProperties1,
731  const vector< XMLPropertyState >& aProperties2 ) const
732 {
733  if (aProperties1.size() < aProperties2.size())
734  return true;
735  if (aProperties1.size() > aProperties2.size())
736  return false;
737 
738  sal_uInt32 nCount = aProperties1.size();
739 
740  for (sal_uInt32 nIndex = 0; nIndex < nCount; ++nIndex)
741  {
742  const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
743  const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
744 
745  // Compare index. If equal, compare value
746  if( rProp1.mnIndex < rProp2.mnIndex )
747  return true;
748  if( rProp1.mnIndex > rProp2.mnIndex )
749  return false;
750 
751  if( rProp1.mnIndex != -1 )
752  {
753  // Now compare values
754  if ( (mpImpl->mxPropMapper->GetEntryType( rProp1.mnIndex ) &
755  XML_TYPE_BUILDIN_CMP ) != 0 )
756  {
757  // simple type ( binary compare )
758  if ( comphelper::anyLess(rProp1.maValue, rProp2.maValue) )
759  return true;
760  if ( comphelper::anyLess(rProp2.maValue, rProp1.maValue ) )
761  return false;
762  }
763  }
764  }
765 
766  return false;
767 }
768 
793  SvXMLExport& rExport,
794  const ::std::vector< XMLPropertyState >& rProperties,
795  SvXmlExportFlags nFlags,
796  bool bUseExtensionNamespaceForGraphicProperties) const
797 {
798  exportXML(rExport, rProperties, -1, -1, nFlags, bUseExtensionNamespaceForGraphicProperties);
799 }
800 
801 
803  SvXMLExport& rExport,
804  const ::std::vector< XMLPropertyState >& rProperties,
805  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
806  SvXmlExportFlags nFlags, bool bUseExtensionNamespaceForGraphicProperties) const
807 {
808  sal_uInt16 nPropTypeFlags = 0;
809  for( sal_uInt16 i=0; i<MAX_PROP_TYPES; ++i )
810  {
811  sal_uInt16 nPropType = aPropTokens[i].nType;
812  if( 0==i || (nPropTypeFlags & (1 << nPropType)) != 0 )
813  {
814  sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
815  if (bUseExtensionNamespaceForGraphicProperties &&
817  {
818  nNamespace = XML_NAMESPACE_LO_EXT;
820  {
821  continue; // don't write for ODF <= 1.2
822  }
823  }
824 
825  std::vector<sal_uInt16> aIndexArray;
826 
827  _exportXML( nPropType, nPropTypeFlags,
828  rExport.GetAttrList(), rProperties,
829  rExport.GetMM100UnitConverter(),
830  rExport.GetNamespaceMap(),
831  &aIndexArray,
832  nPropMapStartIdx, nPropMapEndIdx );
833 
834  if( rExport.GetAttrList().getLength() > 0 ||
835  !aIndexArray.empty() )
836  {
837  SvXMLElementExport aElem( rExport, nNamespace,
839  bool(nFlags & SvXmlExportFlags::IGN_WS),
840  false );
841 
842  exportElementItems( rExport, rProperties, nFlags, aIndexArray );
843  }
844  }
845  }
846 }
847 
851  SvXMLAttributeList& rAttrList,
852  const XMLPropertyState& rProperty,
853  const SvXMLUnitConverter& rUnitConverter,
854  const SvXMLNamespaceMap& rNamespaceMap,
855  const ::std::vector< XMLPropertyState > *pProperties,
856  sal_uInt32 nIdx ) const
857 {
858  OSL_ENSURE(mpImpl->mxNextMapper.is(), "special item not handled in xml export");
859  if (mpImpl->mxNextMapper.is())
860  mpImpl->mxNextMapper->handleSpecialItem(
861  rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx);
862 }
863 
867  SvXMLExport& rExport,
868  const XMLPropertyState& rProperty,
869  SvXmlExportFlags nFlags,
870  const ::std::vector< XMLPropertyState > *pProperties,
871  sal_uInt32 nIdx ) const
872 {
873  OSL_ENSURE(mpImpl->mxNextMapper.is(), "element item not handled in xml export");
874  if (mpImpl->mxNextMapper.is())
875  mpImpl->mxNextMapper->handleElementItem(rExport, rProperty, nFlags, pProperties, nIdx);
876 }
877 
878 // protected methods
879 
882  sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
883  SvXMLAttributeList& rAttrList,
884  const ::std::vector< XMLPropertyState >& rProperties,
885  const SvXMLUnitConverter& rUnitConverter,
886  const SvXMLNamespaceMap& rNamespaceMap,
887  std::vector<sal_uInt16>* pIndexArray,
888  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const
889 {
890  const sal_uInt32 nCount = rProperties.size();
891  sal_uInt32 nIndex = 0;
892 
893  if( -1 == nPropMapStartIdx )
894  nPropMapStartIdx = 0;
895  if( -1 == nPropMapEndIdx )
896  nPropMapEndIdx = mpImpl->mxPropMapper->GetEntryCount();
897 
898  while( nIndex < nCount )
899  {
900  sal_Int32 nPropMapIdx = rProperties[nIndex].mnIndex;
901  if( nPropMapIdx >= nPropMapStartIdx &&
902  nPropMapIdx < nPropMapEndIdx )// valid entry?
903  {
904  sal_uInt32 nEFlags = mpImpl->mxPropMapper->GetEntryFlags(nPropMapIdx);
905  sal_uInt16 nEPType = GET_PROP_TYPE(nEFlags);
906  OSL_ENSURE(nEPType >= (XML_TYPE_PROP_START >> XML_TYPE_PROP_SHIFT),
907  "no prop type specified");
908  rPropTypeFlags |= (1 << nEPType);
909  if( nEPType == nPropType )
910  {
911  // we have a valid map entry here, so lets use it...
912  if( ( nEFlags & MID_FLAG_ELEMENT_ITEM_EXPORT ) != 0 )
913  {
914  // element items do not add any properties,
915  // we export it later
916  if( pIndexArray )
917  {
918  pIndexArray->push_back( static_cast<sal_uInt16>(nIndex) );
919  }
920  }
921  else
922  {
923  _exportXML( rAttrList, rProperties[nIndex], rUnitConverter,
924  rNamespaceMap, &rProperties, nIndex );
925  }
926  }
927  }
928 
929  nIndex++;
930  }
931 }
932 
934  SvXMLAttributeList& rAttrList,
935  const XMLPropertyState& rProperty,
936  const SvXMLUnitConverter& rUnitConverter,
937  const SvXMLNamespaceMap& rNamespaceMap,
938  const ::std::vector< XMLPropertyState > *pProperties,
939  sal_uInt32 nIdx ) const
940 {
941  if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_SPECIAL_ITEM_EXPORT) != 0)
942  {
943  uno::Reference< container::XNameContainer > xAttrContainer;
944  if( (rProperty.maValue >>= xAttrContainer) && xAttrContainer.is() )
945  {
946  std::unique_ptr<SvXMLNamespaceMap> pNewNamespaceMap;
947  const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
948 
949  const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
950 
951  OUStringBuffer sNameBuffer;
952  xml::AttributeData aData;
953  for( const auto& rAttribName : aAttribNames )
954  {
955  xAttrContainer->getByName( rAttribName ) >>= aData;
956  OUString sAttribName( rAttribName );
957 
958  // extract namespace prefix from attribute name if it exists
959  OUString sPrefix;
960  const sal_Int32 nColonPos =
961  rAttribName.indexOf( ':' );
962  if( nColonPos != -1 )
963  sPrefix = rAttribName.copy( 0, nColonPos );
964 
965  if( !sPrefix.isEmpty() )
966  {
967  OUString sNamespace( aData.Namespace );
968 
969  // if the prefix isn't defined yet or has another meaning,
970  // we have to redefine it now.
971  sal_uInt16 nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
972  if( USHRT_MAX == nKey || pNamespaceMap->GetNameByKey( nKey ) != sNamespace )
973  {
974  bool bAddNamespace = false;
975  if( USHRT_MAX == nKey )
976  {
977  // The prefix is unused, so it is sufficient
978  // to add it to the namespace map.
979  bAddNamespace = true;
980  }
981  else
982  {
983  // check if there is a prefix registered for the
984  // namespace URI
985  nKey = pNamespaceMap->GetKeyByName( sNamespace );
986  if( XML_NAMESPACE_UNKNOWN == nKey )
987  {
988  // There is no prefix for the namespace, so
989  // we have to generate one and have to add it.
990  sal_Int32 n=0;
991  OUString sOrigPrefix( sPrefix );
992  do
993  {
994  sNameBuffer.append( sOrigPrefix );
995  sNameBuffer.append( ++n );
996  sPrefix = sNameBuffer.makeStringAndClear();
997  nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
998  }
999  while( nKey != USHRT_MAX );
1000 
1001  bAddNamespace = true;
1002  }
1003  else
1004  {
1005  // If there is a prefix for the namespace,
1006  // we reuse that.
1007  sPrefix = pNamespaceMap->GetPrefixByKey( nKey );
1008  }
1009  // In any case, the attribute name has to be adapted.
1010  sNameBuffer.append(sPrefix + ":" + rAttribName.subView(nColonPos+1));
1011  sAttribName = sNameBuffer.makeStringAndClear();
1012  }
1013 
1014  if( bAddNamespace )
1015  {
1016  if( !pNewNamespaceMap )
1017  {
1018  pNewNamespaceMap.reset(new SvXMLNamespaceMap( rNamespaceMap ));
1019  pNamespaceMap = pNewNamespaceMap.get();
1020  }
1021  pNewNamespaceMap->Add( sPrefix, sNamespace );
1022  OUString sAttr = GetXMLToken(XML_XMLNS) + ":" + sPrefix;
1023  rAttrList.AddAttribute( sAttr, sNamespace );
1024  }
1025  }
1026  }
1027  OUString sOldValue( rAttrList.getValueByName( sAttribName ) );
1028  OSL_ENSURE( sOldValue.isEmpty(), "alien attribute exists already" );
1029  OSL_ENSURE(aData.Type == GetXMLToken(XML_CDATA), "different type to our default type which should be written out");
1030  if( sOldValue.isEmpty() )
1031  rAttrList.AddAttribute( sAttribName, aData.Value );
1032  }
1033  }
1034  else
1035  {
1036  handleSpecialItem( rAttrList, rProperty, rUnitConverter,
1037  rNamespaceMap, pProperties, nIdx );
1038  }
1039  }
1040  else if ((mpImpl->mxPropMapper->GetEntryFlags(rProperty.mnIndex) & MID_FLAG_ELEMENT_ITEM_EXPORT ) == 0)
1041  {
1042  OUString aValue;
1043  OUString sName = rNamespaceMap.GetQNameByKey(
1044  mpImpl->mxPropMapper->GetEntryNameSpace(rProperty.mnIndex),
1045  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1046 
1047  bool bRemove = false;
1048  if ((mpImpl->mxPropMapper->GetEntryFlags( rProperty.mnIndex ) & MID_FLAG_MERGE_ATTRIBUTE) != 0)
1049  {
1050  aValue = rAttrList.getValueByName( sName );
1051  bRemove = true;
1052  }
1053 
1054  if (mpImpl->mxPropMapper->exportXML(aValue, rProperty, rUnitConverter))
1055  {
1056  if( bRemove )
1057  rAttrList.RemoveAttribute( sName );
1058 
1059  // We don't seem to have a generic mechanism to write an attribute in the extension
1060  // namespace in case of certain attribute values only, so do this manually.
1061  if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_WRITING_MODE))
1062  {
1063  if (IsXMLToken(aValue, XML_BT_LR))
1064  {
1065  sName = rNamespaceMap.GetQNameByKey(
1067  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1068  }
1069  }
1070  else if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_VERTICAL_REL))
1071  {
1072  if (IsXMLToken(aValue, XML_PAGE_CONTENT_BOTTOM))
1073  {
1074  sName = rNamespaceMap.GetQNameByKey(
1076  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1077  }
1078  if (IsXMLToken(aValue, XML_PAGE_CONTENT_TOP))
1079  {
1080  sName = rNamespaceMap.GetQNameByKey(
1082  mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
1083  }
1084  }
1085 
1086  rAttrList.AddAttribute( sName, aValue );
1087  }
1088  }
1089 }
1090 
1092  SvXMLExport& rExport,
1093  const ::std::vector< XMLPropertyState >& rProperties,
1094  SvXmlExportFlags nFlags,
1095  const std::vector<sal_uInt16>& rIndexArray ) const
1096 {
1097  bool bItemsExported = false;
1098  for (const sal_uInt16 nElement : rIndexArray)
1099  {
1100  OSL_ENSURE( 0 != (mpImpl->mxPropMapper->GetEntryFlags(
1101  rProperties[nElement].mnIndex ) & MID_FLAG_ELEMENT_ITEM_EXPORT),
1102  "wrong mid flag!" );
1103 
1104  rExport.IgnorableWhitespace();
1105  handleElementItem( rExport, rProperties[nElement],
1106  nFlags, &rProperties, nElement );
1107  bItemsExported = true;
1108  }
1109 
1110  if( bItemsExported )
1111  rExport.IgnorableWhitespace();
1112 }
1113 
1115 {
1116  return mpImpl->mxPropMapper;
1117 }
1118 
1119 void SvXMLExportPropertyMapper::SetStyleName( const OUString& rStyleName )
1120 {
1121  mpImpl->maStyleName = rStyleName;
1122 }
1123 
1125 {
1126  return mpImpl->maStyleName;
1127 }
1128 
1129 /* 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:1091
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:866
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:729
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:1124
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:400
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:792
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:3485
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:850
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:383
bool anyLess(css::uno::Any const &lhs, css::uno::Any const &rhs)
SvXMLExportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper)
Definition: xmlexppr.cxx:474
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
Definition: xmlexppr.cxx:665
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:515
int nCount
constexpr sal_uInt16 XML_NAMESPACE_FORM
virtual ~SvXMLExportPropertyMapper() override
Definition: xmlexppr.cxx:481
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
SvtSaveOptions::ODFDefaultVersion GetODFDefaultVersion()
constexpr sal_uInt16 XML_NAMESPACE_CONFIG
rtl::Reference< SvXMLExportPropertyMapper > mxNextMapper
Definition: xmlexppr.cxx:466
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:529
constexpr sal_uInt16 XML_NAMESPACE_XML
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2323
OUString sPrefix
rtl::Reference< XMLPropertySetMapper > mxPropMapper
Definition: xmlexppr.cxx:467
bool Equals(const ::std::vector< XMLPropertyState > &aProperties1, const ::std::vector< XMLPropertyState > &aProperties2) const
Compare two arrays of XMLPropertyState.
Definition: xmlexppr.cxx:679
#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:1119
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:463
#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:485
const SvXMLNamespaceMap & GetNamespaceMap() const
Definition: xmlexp.hxx:394
const OUString & GetNameByKey(sal_uInt16 nKey) const
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
void IgnorableWhitespace()
Definition: xmlexp.cxx:2246
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:3429
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
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:522
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:881
constexpr sal_uInt16 XML_NAMESPACE_STYLE
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1114