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