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