LibreOffice Module xmloff (master)  1
txtprhdl.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 <sal/config.h>
21 
22 #include <o3tl/any.hxx>
23 #include <osl/diagnose.h>
24 #include <rtl/ustrbuf.hxx>
25 #include <sal/log.hxx>
26 #include <com/sun/star/uno/Any.hxx>
27 #include <com/sun/star/drawing/FillStyle.hpp>
28 #include <com/sun/star/style/DropCapFormat.hpp>
29 #include <com/sun/star/text/FontRelief.hpp>
30 #include <com/sun/star/text/WrapTextMode.hpp>
31 #include <com/sun/star/text/XTextColumns.hpp>
32 #include <com/sun/star/text/TextColumn.hpp>
33 #include <com/sun/star/text/RelOrientation.hpp>
34 #include <com/sun/star/text/HoriOrientation.hpp>
35 #include <com/sun/star/text/VertOrientation.hpp>
36 #include <com/sun/star/text/RubyAdjust.hpp>
37 #include <com/sun/star/text/RubyPosition.hpp>
38 #include <com/sun/star/text/FontEmphasis.hpp>
39 #include <com/sun/star/text/ParagraphVertAlign.hpp>
40 #include <com/sun/star/graphic/XGraphic.hpp>
41 #include <sax/tools/converter.hxx>
42 #include <xmloff/xmltypes.hxx>
43 #include <xmloff/xmluconv.hxx>
44 #include <xmloff/xmltoken.hxx>
45 #include <xmloff/xmlement.hxx>
46 #include "XMLAnchorTypePropHdl.hxx"
47 #include <enummaps.hxx>
52 #include "txtprhdl.hxx"
53 #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
54 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
59 #include <vcl/graph.hxx>
60 
61 using namespace ::com::sun::star;
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::style;
64 using namespace ::com::sun::star::text;
65 using namespace ::xmloff::token;
66 using namespace ::com::sun::star::drawing;
67 
69 {
70  { XML_FROM_LEFT, HoriOrientation::NONE },
71  { XML_FROM_INSIDE, HoriOrientation::NONE }, // import only
72  { XML_LEFT, HoriOrientation::LEFT },
73  { XML_INSIDE, HoriOrientation::LEFT }, // import only
74  { XML_CENTER, HoriOrientation::CENTER },
75  { XML_RIGHT, HoriOrientation::RIGHT },
76  { XML_OUTSIDE, HoriOrientation::RIGHT }, // import only
77  { XML_TOKEN_INVALID, 0 }
78 };
79 
81 {
82  { XML_FROM_INSIDE, HoriOrientation::NONE },
83  { XML_INSIDE, HoriOrientation::LEFT },
84  { XML_CENTER, HoriOrientation::CENTER },
85  { XML_OUTSIDE, HoriOrientation::RIGHT },
86  { XML_TOKEN_INVALID, 0 }
87 };
88 
90 {
91  { XML_PARAGRAPH, RelOrientation::FRAME },
92  { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA },
93  { XML_PAGE, RelOrientation::PAGE_FRAME },
94  { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
95  { XML_PARAGRAPH_START_MARGIN, RelOrientation::FRAME_LEFT },
96  { XML_PARAGRAPH_END_MARGIN, RelOrientation::FRAME_RIGHT },
97  { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT },
98  { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT },
99  { XML_CHAR, RelOrientation::CHAR },
100  { XML_FRAME, RelOrientation::FRAME }, // import only
101  { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only
102  { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT }, // import only
103  { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT }, // import only
104  { XML_TOKEN_INVALID, 0 }
105 };
106 
108 {
109  { XML_FRAME, RelOrientation::FRAME },
110  { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA },
111  { XML_PAGE, RelOrientation::PAGE_FRAME },
112  { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
113  { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT },
114  { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT },
115  { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT },
116  { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT },
117  { XML_CHAR, RelOrientation::CHAR },
118  { XML_TOKEN_INVALID, 0 }
119 };
120 
122 {
123  { XML_FROM_LEFT, false },
124  { XML_FROM_INSIDE, true },
125  { XML_LEFT, false },
126  { XML_INSIDE, true },
127  { XML_CENTER, false },
128  { XML_RIGHT, false },
129  { XML_OUTSIDE, true },
130  { XML_TOKEN_INVALID, false }
131 };
132 
134 {
135  { XML_FROM_TOP, VertOrientation::NONE },
136  { XML_TOP, VertOrientation::TOP },
137  { XML_TOP, VertOrientation::CHAR_TOP }, // export only
138  { XML_TOP, VertOrientation::LINE_TOP }, // export only
139  { XML_MIDDLE, VertOrientation::CENTER },
140  { XML_MIDDLE, VertOrientation::CHAR_CENTER }, // export only
141  { XML_MIDDLE, VertOrientation::LINE_CENTER }, // export only
142  { XML_BOTTOM, VertOrientation::BOTTOM },
143  { XML_BELOW, VertOrientation::CHAR_BOTTOM }, // export only
144  { XML_BOTTOM, VertOrientation::LINE_BOTTOM }, // export only
145  { XML_TOKEN_INVALID, 0 }
146 };
147 
149 {
150  { XML_PARAGRAPH, RelOrientation::FRAME },
151  { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA },
152  { XML_CHAR, RelOrientation::CHAR },
153  // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
154  { XML_PAGE, RelOrientation::PAGE_FRAME },
155  { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
156  { XML_PAGE_CONTENT_TOP, RelOrientation::PAGE_PRINT_AREA_TOP },
157  { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM },
158  { XML_FRAME, RelOrientation::FRAME }, // import only
159  { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only
160  // OD 13.11.2003 #i22341# - new vertical alignment at top of line
161  { XML_LINE, RelOrientation::TEXT_LINE },
162  { XML_TOKEN_INVALID, 0 }
163 };
164 
166 {
167  { XML_PAGE, RelOrientation::FRAME },
168  { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA },
169  { XML_PAGE, RelOrientation::PAGE_FRAME },
170  { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
171  { XML_PAGE_CONTENT_TOP, RelOrientation::PAGE_PRINT_AREA_TOP },
172  { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM },
173  { XML_TOKEN_INVALID, 0 }
174 };
175 
177 {
178  { XML_FRAME, RelOrientation::FRAME },
179  { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA },
180  { XML_TOKEN_INVALID, 0 }
181 };
182 
184 {
185  { XML_BASELINE, VertOrientation::TOP },
186  { XML_BASELINE, VertOrientation::CENTER }, // export only
187  { XML_BASELINE, VertOrientation::BOTTOM }, // export only
188  { XML_TEXT, VertOrientation::CHAR_TOP },
189  { XML_TEXT, VertOrientation::CHAR_CENTER }, // export only
190  { XML_TEXT, VertOrientation::CHAR_BOTTOM }, // export only
191  { XML_LINE, VertOrientation::LINE_TOP },
192  { XML_LINE, VertOrientation::LINE_CENTER }, // export only
193  { XML_LINE, VertOrientation::LINE_BOTTOM }, // export only
194  { XML_TOKEN_INVALID, 0 }
195 };
196 
198 {
199  { XML_LEFT, RubyAdjust_LEFT },
200  { XML_CENTER, RubyAdjust_CENTER },
201  { XML_RIGHT, RubyAdjust_RIGHT },
202  { XML_DISTRIBUTE_LETTER, RubyAdjust_BLOCK },
203  { XML_DISTRIBUTE_SPACE, RubyAdjust_INDENT_BLOCK },
204  { XML_TOKEN_INVALID, RubyAdjust(0) }
205 };
206 
208 {
209  { XML_ABOVE, RubyPosition::ABOVE},
210  { XML_BELOW, RubyPosition::BELOW},
211  { XML_INTER_CHARACTER, RubyPosition::INTER_CHARACTER},
212  { XML_TOKEN_INVALID, 0 }
213 };
214 
216 {
217  { XML_NONE, FontRelief::NONE },
218  { XML_ENGRAVED, FontRelief::ENGRAVED },
219  { XML_EMBOSSED, FontRelief::EMBOSSED },
220  { XML_TOKEN_INVALID, 0 }
221 };
222 
224 {
225  { XML_TOP, ParagraphVertAlign::TOP },
226  { XML_MIDDLE, ParagraphVertAlign::CENTER },
227  { XML_BOTTOM, ParagraphVertAlign::BOTTOM },
228  { XML_BASELINE, ParagraphVertAlign::BASELINE },
229  { XML_AUTO, ParagraphVertAlign::AUTOMATIC },
230  { XML_TOKEN_INVALID, 0 }
231 };
232 
233 // OD 2004-05-05 #i28701#
235 {
236  // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
237  { XML_ONCE_SUCCESSIVE, WrapInfluenceOnPosition::ONCE_SUCCESSIVE },
238  { XML_ONCE_CONCURRENT, WrapInfluenceOnPosition::ONCE_CONCURRENT },
239  { XML_ITERATIVE, WrapInfluenceOnPosition::ITERATIVE },
240  { XML_TOKEN_INVALID, 0 }
241 };
242 
244 {
245  { XML_TOP, drawing::TextVerticalAdjust_TOP },
246  { XML_MIDDLE, drawing::TextVerticalAdjust_CENTER },
247  { XML_BOTTOM, drawing::TextVerticalAdjust_BOTTOM },
248  { XML_JUSTIFY, drawing::TextVerticalAdjust_BLOCK },
249  { XML_TOKEN_INVALID, drawing::TextVerticalAdjust(0) }
250 };
251 
253 {
254  { XML_DK1, 0 },
255  { XML_LT1, 1 },
256  { XML_DK2, 2 },
257  { XML_LT2, 3 },
258  { XML_ACCENT1, 4 },
259  { XML_ACCENT2, 5 },
260  { XML_ACCENT3, 6 },
261  { XML_ACCENT4, 7 },
262  { XML_ACCENT5, 8 },
263  { XML_ACCENT6, 9 },
264  { XML_HLINK, 10 },
265  { XML_FOLHLINK, 11 },
266  { XML_TOKEN_INVALID, 0 }
267 };
268 
269 namespace {
270 
271 class XMLDropCapPropHdl_Impl : public XMLPropertyHandler
272 {
273 public:
274  virtual bool equals(
275  const css::uno::Any& r1,
276  const css::uno::Any& r2 ) const override;
277 
279  virtual bool importXML(
280  const OUString& rStrImpValue,
281  css::uno::Any& rValue,
282  const SvXMLUnitConverter& ) const override;
283  virtual bool exportXML(
284  OUString& rStrExpValue,
285  const css::uno::Any& rValue,
286  const SvXMLUnitConverter& ) const override;
287 };
288 
289 }
290 
291 bool XMLDropCapPropHdl_Impl::equals(
292  const Any& r1,
293  const Any& r2 ) const
294 {
295  DropCapFormat aFormat1, aFormat2;
296  r1 >>= aFormat1;
297  r2 >>= aFormat2;
298 
299  return (aFormat1.Lines <=1 && aFormat2.Lines <=1) ||
300  (aFormat1.Lines == aFormat2.Lines &&
301  aFormat1.Count == aFormat2.Count &&
302  aFormat1.Distance == aFormat2.Distance);
303 }
304 
306  const OUString&,
307  Any&,
308  const SvXMLUnitConverter& ) const
309 {
310  SAL_WARN( "xmloff", "drop caps are an element import property" );
311  return false;
312 }
313 
315  OUString&,
316  const Any&,
317  const SvXMLUnitConverter& ) const
318 {
319  SAL_WARN( "xmloff", "drop caps are an element export property" );
320  return false;
321 }
322 
323 namespace {
324 
325 class XMLOpaquePropHdl_Impl : public XMLPropertyHandler
326 {
327 public:
328  virtual bool importXML(
329  const OUString& rStrImpValue,
330  css::uno::Any& rValue,
331  const SvXMLUnitConverter& ) const override;
332  virtual bool exportXML(
333  OUString& rStrExpValue,
334  const css::uno::Any& rValue,
335  const SvXMLUnitConverter& ) const override;
336 };
337 
338 }
339 
341  const OUString& rStrImpValue,
342  Any& rValue,
343  const SvXMLUnitConverter& ) const
344 {
345  bool bRet = true;
346  bool bVal = false;
347  if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) )
348  bVal = true;
349  else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) )
350  bRet = false;
351 
352  if( bRet )
353  rValue <<= bVal;
354 
355  return bRet;
356 }
357 
359  OUString& rStrExpValue,
360  const Any& rValue,
361  const SvXMLUnitConverter& ) const
362 {
363  if( *o3tl::doAccess<bool>(rValue) )
364  rStrExpValue = GetXMLToken( XML_FOREGROUND );
365  else
366  rStrExpValue = GetXMLToken( XML_BACKGROUND );
367 
368  return true;
369 }
370 
371 namespace {
372 
373 class XMLContourModePropHdl_Impl : public XMLPropertyHandler
374 {
375 public:
376  virtual bool importXML(
377  const OUString& rStrImpValue,
378  css::uno::Any& rValue,
379  const SvXMLUnitConverter& ) const override;
380  virtual bool exportXML(
381  OUString& rStrExpValue,
382  const css::uno::Any& rValue,
383  const SvXMLUnitConverter& ) const override;
384 };
385 
386 }
387 
389  const OUString& rStrImpValue,
390  Any& rValue,
391  const SvXMLUnitConverter& ) const
392 {
393  bool bRet = true;
394  bool bVal = false;
395  if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) )
396  bVal = true;
397  else if( ! IsXMLToken( rStrImpValue, XML_FULL ) )
398  bRet = false;
399 
400  if( bRet )
401  rValue <<= bVal;
402 
403  return bRet;
404 }
405 
407  OUString& rStrExpValue,
408  const Any& rValue,
409  const SvXMLUnitConverter& ) const
410 {
411  if( *o3tl::doAccess<bool>(rValue) )
412  rStrExpValue = GetXMLToken( XML_OUTSIDE );
413  else
414  rStrExpValue = GetXMLToken( XML_FULL );
415 
416  return true;
417 }
418 
419 namespace {
420 
421 class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler
422 {
423 public:
424  virtual bool importXML(
425  const OUString& rStrImpValue,
426  css::uno::Any& rValue,
427  const SvXMLUnitConverter& ) const override;
428  virtual bool exportXML(
429  OUString& rStrExpValue,
430  const css::uno::Any& rValue,
431  const SvXMLUnitConverter& ) const override;
432 };
433 
434 }
435 
437  const OUString& rStrImpValue,
438  Any& rValue,
439  const SvXMLUnitConverter& ) const
440 {
441  bool bRet = true;
442  bool bVal = false;
443 
444  if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) )
445  {
446  sal_Int32 nValue = 0;
447  bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
448  bVal = 1 == nValue;
449  }
450 
451  if( bRet )
452  rValue <<= bVal;
453 
454  return bRet;
455 }
456 
458  OUString& rStrExpValue,
459  const Any& rValue,
460  const SvXMLUnitConverter& ) const
461 {
462  if( *o3tl::doAccess<bool>(rValue) )
463  rStrExpValue = GetXMLToken( XML_1 );
464  else
465  rStrExpValue = GetXMLToken( XML_NO_LIMIT );
466 
467  return true;
468 }
469 
471 {
472  { XML_NONE, WrapTextMode_NONE },
473  { XML_RUN_THROUGH, WrapTextMode_THROUGH },
474  { XML_PARALLEL, WrapTextMode_PARALLEL },
475  { XML_DYNAMIC, WrapTextMode_DYNAMIC },
476  { XML_LEFT, WrapTextMode_LEFT },
477  { XML_RIGHT, WrapTextMode_RIGHT },
478  { XML_TOKEN_INVALID, WrapTextMode(0) }
479 };
480 
481 namespace {
482 
483 class XMLWrapPropHdl_Impl : public XMLPropertyHandler
484 {
485 public:
486  virtual bool importXML(
487  const OUString& rStrImpValue,
488  css::uno::Any& rValue,
489  const SvXMLUnitConverter& ) const override;
490  virtual bool exportXML(
491  OUString& rStrExpValue,
492  const css::uno::Any& rValue,
493  const SvXMLUnitConverter& ) const override;
494 };
495 
496 }
497 
499  const OUString& rStrImpValue,
500  Any& rValue,
501  const SvXMLUnitConverter& ) const
502 {
503  WrapTextMode nWrap;
504  bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue,
505  pXML_Wrap_Enum );
506 
507  if( bRet )
508  rValue <<= nWrap;
509 
510  return bRet;
511 }
512 
514  OUString& rStrExpValue,
515  const Any& rValue,
516  const SvXMLUnitConverter& ) const
517 {
518  OUStringBuffer aOut;
519  WrapTextMode eVal;
520 
521  rValue >>= eVal;
522 
523  bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE );
524 
525  rStrExpValue = aOut.makeStringAndClear();
526 
527  return bRet;
528 }
529 
530 namespace {
531 
532 class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler
533 {
534  const OUString sVal;
535 public:
536  explicit XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) :
537  sVal( GetXMLToken(eVal) ) {}
538 
539  virtual bool importXML(
540  const OUString& rStrImpValue,
541  css::uno::Any& rValue,
542  const SvXMLUnitConverter& ) const override;
543  virtual bool exportXML(
544  OUString& rStrExpValue,
545  const css::uno::Any& rValue,
546  const SvXMLUnitConverter& ) const override;
547 };
548 
549 }
550 
552  const OUString& rStrImpValue,
553  Any& rValue,
554  const SvXMLUnitConverter& ) const
555 {
556  bool bRet = true;
557  bool bVal = false;
558  if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
559  {
560  bRet = false;
561  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
562  std::u16string_view aToken;
563  while( aTokenEnum.getNextToken( aToken ) )
564  {
565  bRet = true;
566  if( aToken == sVal )
567  {
568  bVal = true;
569  break;
570  }
571  }
572  }
573 
574  if( bRet )
575  rValue <<= bVal;
576 
577  return bRet;
578 }
579 
581  OUString& rStrExpValue,
582  const Any& rValue,
583  const SvXMLUnitConverter& ) const
584 {
585  if( *o3tl::doAccess<bool>(rValue) )
586  {
587  if( rStrExpValue.isEmpty() ||
588  IsXMLToken( rStrExpValue, XML_NONE ) )
589  {
590  rStrExpValue = sVal;
591  }
592  else
593  {
594  rStrExpValue += " " + sVal;
595  }
596  }
597  else if( rStrExpValue.isEmpty() )
598  {
599  rStrExpValue = GetXMLToken( XML_NONE );
600  }
601 
602  return true;
603 }
604 
606 {
607  { XML_CHAR, TextContentAnchorType_AT_CHARACTER },
608  { XML_PAGE, TextContentAnchorType_AT_PAGE },
609  { XML_FRAME, TextContentAnchorType_AT_FRAME },
610  { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH },
611  { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER },
612  { XML_TOKEN_INVALID, TextContentAnchorType(0) }
613 };
614 
616  const OUString& rStrImpValue,
617  Any& rValue,
618  const SvXMLUnitConverter& ) const
619 {
620  TextContentAnchorType nAnchor;
621  bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
622  pXML_Anchor_Enum );
623 
624  if( bRet )
625  rValue <<= nAnchor;
626 
627  return bRet;
628 }
629 
631  OUString& rStrExpValue,
632  const Any& rValue,
633  const SvXMLUnitConverter& ) const
634 {
635  OUStringBuffer aOut;
636  TextContentAnchorType eVal;
637 
638  rValue >>= eVal;
639 
640  bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH );
641 
642  rStrExpValue = aOut.makeStringAndClear();
643 
644  return bRet;
645 }
646 
648 {
649 }
650 
651 bool XMLAnchorTypePropHdl::convert( std::string_view rStrImpValue,
652  TextContentAnchorType& rType )
653 {
654  TextContentAnchorType nAnchor;
655  bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
656  pXML_Anchor_Enum );
657  if( bRet )
658  rType = nAnchor;
659  return bRet;
660 }
661 
663 {
664 }
665 
667  const Any& r1,
668  const Any& r2 ) const
669 {
670  Reference < XTextColumns > xColumns1;
671  r1 >>= xColumns1;
672 
673  Reference < XTextColumns > xColumns2;
674  r2 >>= xColumns2;
675 
676  if (!xColumns1 || !xColumns2)
677  return (!xColumns1 && !xColumns2);
678 
679  if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
680  xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
681  return false;
682 
683  const Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
684  const Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
685 
686  return std::equal(aColumns1.begin(), aColumns1.end(), aColumns2.begin(), aColumns2.end(),
687  [](const TextColumn& a, const TextColumn& b) {
688  return a.Width == b.Width
689  && a.LeftMargin == b.LeftMargin
690  && a.RightMargin == b.RightMargin;
691  });
692 }
693 
695  const OUString&,
696  Any&,
697  const SvXMLUnitConverter& ) const
698 {
699  SAL_WARN( "xmloff", "columns are an element import property" );
700  return false;
701 }
702 
704  OUString&,
705  const Any&,
706  const SvXMLUnitConverter& ) const
707 {
708  SAL_WARN( "xmloff", "columns are an element export property" );
709  return false;
710 }
711 
712 namespace {
713 
714 class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
715 {
716 public:
717  virtual bool importXML(
718  const OUString& rStrImpValue,
719  css::uno::Any& rValue,
720  const SvXMLUnitConverter& ) const override;
721  virtual bool exportXML(
722  OUString& rStrExpValue,
723  const css::uno::Any& rValue,
724  const SvXMLUnitConverter& ) const override;
725 };
726 
727 }
728 
730  const OUString& rStrImpValue,
731  Any& rValue,
732  const SvXMLUnitConverter& ) const
733 {
734  bool nHoriMirror;
735  bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue,
736  pXML_HoriMirror_Enum );
737 
738  if( bRet )
739  {
740  rValue <<= nHoriMirror;
741  }
742 
743  return bRet;
744 }
745 
747  OUString&,
748  const Any&,
749  const SvXMLUnitConverter& ) const
750 {
751  SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
752 
753  return false;
754 }
755 
756 namespace {
757 
758 class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
759 {
760  const OUString sVal;
761  bool bHori;
762 
763 public:
764  XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, bool bH ) :
765  sVal( GetXMLToken( eVal ) ),
766  bHori( bH ) {}
767 
768  virtual bool importXML(
769  const OUString& rStrImpValue,
770  css::uno::Any& rValue,
771  const SvXMLUnitConverter& ) const override;
772  virtual bool exportXML(
773  OUString& rStrExpValue,
774  const css::uno::Any& rValue,
775  const SvXMLUnitConverter& ) const override;
776 };
777 
778 }
779 
781  const OUString& rStrImpValue,
782  Any& rValue,
783  const SvXMLUnitConverter& ) const
784 {
785  bool bRet = true;
786  bool bVal = false;
787  if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
788  {
789  bRet = false;
790  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
791  std::u16string_view aToken;
792  while( aTokenEnum.getNextToken( aToken ) )
793  {
794  bRet = true;
795  if( aToken == sVal ||
796  (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
797  {
798  bVal = true;
799  break;
800  }
801  }
802  }
803 
804  if( bRet )
805  rValue <<= bVal;
806 
807  return bRet;
808 }
809 
811  OUString& rStrExpValue,
812  const Any& rValue,
813  const SvXMLUnitConverter& ) const
814 {
815  if( *o3tl::doAccess<bool>(rValue) )
816  {
817  if( rStrExpValue.isEmpty() ||
818  IsXMLToken( rStrExpValue, XML_NONE ) )
819  {
820  rStrExpValue = sVal;
821  }
822  else if( bHori &&
823  /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
824  are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
825  (#i49139#)
826  */
827  ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) ||
828  IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) ))
829  {
830  rStrExpValue = GetXMLToken( XML_HORIZONTAL );
831  }
832  else
833  {
834  rStrExpValue += " " + sVal;
835  }
836  }
837  else if( rStrExpValue.isEmpty() )
838  {
839  rStrExpValue = GetXMLToken( XML_NONE );
840  }
841 
842  return true;
843 }
844 
846 {
847  { XML_NONE, FontEmphasis::NONE },
848  { XML_DOT, FontEmphasis::DOT_ABOVE },
849  { XML_CIRCLE, FontEmphasis::CIRCLE_ABOVE },
850  { XML_DISC, FontEmphasis::DISK_ABOVE },
851  { XML_ACCENT, FontEmphasis::ACCENT_ABOVE },
852  { XML_TOKEN_INVALID, 0 }
853 };
854 
855 namespace {
856 
857 class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
858 {
859 public:
860  XMLTextEmphasizePropHdl_Impl() {}
861 
862  virtual bool importXML(
863  const OUString& rStrImpValue,
864  css::uno::Any& rValue,
865  const SvXMLUnitConverter& ) const override;
866  virtual bool exportXML(
867  OUString& rStrExpValue,
868  const css::uno::Any& rValue,
869  const SvXMLUnitConverter& ) const override;
870 };
871 
872 }
873 
875  const OUString& rStrImpValue,
876  Any& rValue,
877  const SvXMLUnitConverter& ) const
878 {
879  bool bRet = true;
880  sal_uInt16 nVal = FontEmphasis::NONE;
881  bool bBelow = false;
882  bool bHasPos = false, bHasType = false;
883  std::u16string_view aToken;
884 
885  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
886  while( aTokenEnum.getNextToken( aToken ) )
887  {
888  if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
889  {
890  bBelow = false;
891  bHasPos = true;
892  }
893  else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
894  {
895  bBelow = true;
896  bHasPos = true;
897  }
898  else if( !bHasType &&
899  SvXMLUnitConverter::convertEnum( nVal, aToken,
900  pXML_Emphasize_Enum ))
901  {
902  bHasType = true;
903  }
904  else
905  {
906  bRet = false;
907  break;
908  }
909  }
910 
911  if( bRet )
912  {
913  if( FontEmphasis::NONE != nVal && bBelow )
914  nVal += 10;
915  rValue <<= static_cast<sal_Int16>(nVal);
916  }
917 
918  return bRet;
919 }
920 
922  OUString& rStrExpValue,
923  const Any& rValue,
924  const SvXMLUnitConverter& ) const
925 {
926  OUStringBuffer aOut( 15 );
927  bool bRet = true;
928  sal_uInt16 nType = sal_uInt16();
929  if( rValue >>= nType )
930  {
931  bool bBelow = false;
932  if( nType > 10 )
933  {
934  bBelow = true;
935  nType -= 10;
936  }
937  bRet = SvXMLUnitConverter::convertEnum( aOut, nType,
938  pXML_Emphasize_Enum,
939  XML_DOT );
940  if( bRet )
941  {
942  if( nType != 0 )
943  {
944  enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
945  aOut.append( ' ' );
946  aOut.append( GetXMLToken(ePos) );
947  }
948  rStrExpValue = aOut.makeStringAndClear();
949  }
950  }
951 
952  return bRet;
953 }
954 
955 namespace {
956 
957 class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
958 {
959 public:
960  XMLTextCombineCharPropHdl_Impl() {}
961 
962  virtual bool importXML(
963  const OUString& rStrImpValue,
964  css::uno::Any& rValue,
965  const SvXMLUnitConverter& ) const override;
966  virtual bool exportXML(
967  OUString& rStrExpValue,
968  const css::uno::Any& rValue,
969  const SvXMLUnitConverter& ) const override;
970 };
971 
972 }
973 
975  const OUString& rStrImpValue,
976  Any& rValue,
977  const SvXMLUnitConverter& ) const
978 {
979  if( !rStrImpValue.isEmpty() )
980  rValue <<= rStrImpValue.copy( 0, 1 );
981  else
982  rValue <<= rStrImpValue;
983 
984  return true;
985 }
986 
988  OUString& rStrExpValue,
989  const Any& rValue,
990  const SvXMLUnitConverter& ) const
991 {
992  rValue >>= rStrExpValue;
993 
994  // #i114107# attribute of type "character": export only if length is 1
995  return (1 == rStrExpValue.getLength());
996 }
997 
998 namespace {
999 
1000 class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
1001 {
1002 public:
1003  XMLTextRelWidthHeightPropHdl_Impl() {}
1004 
1005  virtual bool importXML(
1006  const OUString& rStrImpValue,
1007  css::uno::Any& rValue,
1008  const SvXMLUnitConverter& ) const override;
1009  virtual bool exportXML(
1010  OUString& rStrExpValue,
1011  const css::uno::Any& rValue,
1012  const SvXMLUnitConverter& ) const override;
1013 };
1014 
1015 }
1016 
1018  const OUString& rStrImpValue,
1019  Any& rValue,
1020  const SvXMLUnitConverter& ) const
1021 {
1022  sal_Int32 nValue;
1023  bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue );
1024  if( bRet )
1025  rValue <<= static_cast<sal_Int16>(nValue);
1026 
1027  return bRet;
1028 }
1029 
1031  OUString& rStrExpValue,
1032  const Any& rValue,
1033  const SvXMLUnitConverter& ) const
1034 {
1035  bool bRet = false;
1036  sal_Int16 nValue = sal_Int16();
1037  if( (rValue >>= nValue) && nValue > 0 )
1038  {
1039  OUStringBuffer aOut;
1040  ::sax::Converter::convertPercent( aOut, nValue );
1041  rStrExpValue = aOut.makeStringAndClear();
1042 
1043  bRet = true;
1044  }
1045 
1046  return bRet;
1047 }
1048 
1049 namespace {
1050 
1051 class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
1052 {
1053  const OUString sValue;
1054 
1055 public:
1056  explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
1057  sValue( GetXMLToken(eValue) ) {}
1058 
1059  virtual bool importXML(
1060  const OUString& rStrImpValue,
1061  css::uno::Any& rValue,
1062  const SvXMLUnitConverter& ) const override;
1063  virtual bool exportXML(
1064  OUString& rStrExpValue,
1065  const css::uno::Any& rValue,
1066  const SvXMLUnitConverter& ) const override;
1067 };
1068 
1069 }
1070 
1072  const OUString& rStrImpValue,
1073  Any& rValue,
1074  const SvXMLUnitConverter& ) const
1075 {
1076  rValue <<= (rStrImpValue == sValue);
1077 
1078  return true;
1079 }
1080 
1082  OUString& rStrExpValue,
1083  const Any& rValue,
1084  const SvXMLUnitConverter& ) const
1085 {
1086  bool bRet = false;
1087  if( *o3tl::doAccess<bool>(rValue) )
1088  {
1089  rStrExpValue = sValue;
1090  bRet = true;
1091  }
1092 
1093  return bRet;
1094 }
1095 
1096 namespace {
1097 
1098 class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
1099 {
1100 
1101 public:
1102  XMLTextRotationAnglePropHdl_Impl() {}
1103 
1104  virtual bool importXML(
1105  const OUString& rStrImpValue,
1106  css::uno::Any& rValue,
1107  const SvXMLUnitConverter& ) const override;
1108  virtual bool exportXML(
1109  OUString& rStrExpValue,
1110  const css::uno::Any& rValue,
1111  const SvXMLUnitConverter& ) const override;
1112 };
1113 
1114 }
1115 
1117  const OUString& rStrImpValue,
1118  Any& rValue,
1119  const SvXMLUnitConverter& ) const
1120 {
1121  sal_Int32 nValue;
1122  bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
1123  if( bRet )
1124  {
1125  nValue = (nValue % 360 );
1126  if( nValue < 0 )
1127  nValue = 360 + nValue;
1128  sal_Int16 nAngle;
1129  if( nValue < 45 || nValue > 315 )
1130  nAngle = 0;
1131  else if( nValue < 180 )
1132  nAngle = 900;
1133  else /* if nValue <= 315 ) */
1134  nAngle = 2700;
1135  rValue <<= nAngle;
1136  }
1137 
1138  return bRet;
1139 }
1140 
1142  OUString& rStrExpValue,
1143  const Any& rValue,
1144  const SvXMLUnitConverter& ) const
1145 {
1146  sal_Int16 nAngle = sal_Int16();
1147  bool bRet = ( rValue >>= nAngle );
1148  if( bRet )
1149  {
1150  rStrExpValue = OUString::number( nAngle / 10 );
1151  }
1152  OSL_ENSURE( bRet, "illegal rotation angle" );
1153 
1154  return bRet;
1155 }
1156 
1157 namespace {
1158 
1159 class XMLNumber8OneBasedHdl : public XMLPropertyHandler
1160 {
1161 
1162 public:
1163  XMLNumber8OneBasedHdl() {}
1164 
1165  virtual bool importXML(
1166  const OUString& rStrImpValue,
1167  css::uno::Any& rValue,
1168  const SvXMLUnitConverter& ) const override;
1169  virtual bool exportXML(
1170  OUString& rStrExpValue,
1171  const css::uno::Any& rValue,
1172  const SvXMLUnitConverter& ) const override;
1173 };
1174 
1175 }
1176 
1178  const OUString& rStrImpValue,
1179  Any& rValue,
1180  const SvXMLUnitConverter& ) const
1181 {
1182  sal_Int32 nValue = 0;
1183  bool const bRet = ::sax::Converter::convertNumber(nValue, rStrImpValue);
1184  if( bRet )
1185  rValue <<= static_cast<sal_Int8>( nValue - 1 );
1186  return bRet;
1187 }
1188 
1190  OUString& rStrExpValue,
1191  const Any& rValue,
1192  const SvXMLUnitConverter& ) const
1193 {
1194  sal_Int8 nValue = sal_Int8();
1195  bool bRet = ( rValue >>= nValue );
1196  if( bRet )
1197  {
1198  rStrExpValue = OUString::number( nValue + 1 );
1199  }
1200  return bRet;
1201 }
1202 
1203 namespace {
1204 
1205 class XMLGraphicPropertyHandler : public XMLPropertyHandler
1206 {
1207 public:
1208  XMLGraphicPropertyHandler() {}
1209 
1210  virtual bool importXML(const OUString& , uno::Any& , const SvXMLUnitConverter& ) const override
1211  {
1212  SAL_WARN( "xmloff", "drop caps are an element import property" );
1213  return false;
1214  }
1215 
1216  virtual bool exportXML(OUString& , const uno::Any& , const SvXMLUnitConverter& ) const override
1217  {
1218  SAL_WARN( "xmloff", "drop caps are an element import property" );
1219  return false;
1220  }
1221 
1222  virtual bool equals(const css::uno::Any& rAny1, const css::uno::Any& rAny2) const override;
1223 };
1224 
1225 }
1226 
1227 bool XMLGraphicPropertyHandler::equals(const Any& rAny1, const Any& rAny2) const
1228 {
1229  uno::Reference<graphic::XGraphic> xGraphic1;
1230  uno::Reference<graphic::XGraphic> xGraphic2;
1231  rAny1 >>= xGraphic1;
1232  rAny2 >>= xGraphic2;
1233  Graphic aGraphic1(xGraphic1);
1234  Graphic aGraphic2(xGraphic2);
1235 
1236  return aGraphic1 == aGraphic2;
1237 }
1238 
1240  ( sal_Int32 nType )
1241 {
1242  const XMLPropertyHandler* pHdl = nullptr;
1243  switch( nType )
1244  {
1245  case XML_TYPE_TEXT_DROPCAP:
1246  pHdl = new XMLDropCapPropHdl_Impl;
1247  break;
1248  case XML_TYPE_TEXT_WRAP:
1249  pHdl = new XMLWrapPropHdl_Impl;
1250  break;
1252  pHdl = new XMLParagraphOnlyPropHdl_Impl;
1253  break;
1255  pHdl = new XMLContourModePropHdl_Impl;
1256  break;
1257  case XML_TYPE_TEXT_OPAQUE:
1258  pHdl = new XMLOpaquePropHdl_Impl;
1259  break;
1261  pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
1262  break;
1264  pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
1265  break;
1267  pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
1268  break;
1270  pHdl = new XMLAnchorTypePropHdl;
1271  break;
1272  case XML_TYPE_TEXT_COLUMNS:
1273  pHdl = new XMLTextColumnsPropertyHandler;
1274  break;
1276  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
1277  break;
1279  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
1280  break;
1282  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
1283  break;
1285  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
1286  break;
1288  pHdl = new XMLHoriMirrorPropHdl_Impl;
1289  break;
1291  pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
1292  break;
1294  pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
1295  break;
1297  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
1298  break;
1300  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
1301  break;
1303  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
1304  break;
1306  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, false );
1307  break;
1309  // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1310  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, true );
1311  break;
1313  // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1314  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, true );
1315  break;
1316  case XML_TYPE_TEXT_CLIP:
1317  pHdl = new XMLClipPropertyHandler( false );
1318  break;
1319  case XML_TYPE_TEXT_CLIP11:
1320  pHdl = new XMLClipPropertyHandler( true );
1321  break;
1323  pHdl = new XMLTextEmphasizePropHdl_Impl;
1324  break;
1325  case XML_TYPE_TEXT_COMBINE:
1327  GetXMLToken( XML_NONE ) );
1328  break;
1331  GetXMLToken( XML_NONE ) );
1332  break;
1334  pHdl = new XMLTextCombineCharPropHdl_Impl;
1335  break;
1338  GetXMLToken( XML_NONE ) );
1339  break;
1342  GetXMLToken( XML_SIMPLE ) );
1343  break;
1346  GetXMLToken( XML_NORMAL ) );
1347  break;
1349  pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
1350  break;
1352  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
1353  break;
1355  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
1356  break;
1358  pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
1359  break;
1361  pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
1362  break;
1364  pHdl = new XMLTextRotationAnglePropHdl_Impl;
1365  break;
1369  break;
1371  pHdl = new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum, XML_TOKEN_INVALID );
1372  break;
1374  pHdl = new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum, XML_TOKEN_INVALID );
1375  break;
1378  break;
1379  // OD 2004-05-05 #i28701#
1381  pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum,
1383  break;
1384  case XML_TYPE_BORDER_MODEL:
1387  break;
1389  pHdl = new XMLNamedBoolPropertyHdl(
1392  break;
1393  case XML_TYPE_TEXT_KEEP:
1394  pHdl = new XMLNamedBoolPropertyHdl(
1397  break;
1398  case XML_TYPE_TEXT_NKEEP:
1399  pHdl = new XMLNamedBoolPropertyHdl(
1402  break;
1404  pHdl = new XMLNumber8OneBasedHdl();
1405  break;
1407  pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
1408  break;
1409 
1410  case XML_SW_TYPE_FILLSTYLE:
1412  break;
1414  pHdl = new XMLFillBitmapSizePropertyHandler();
1415  break;
1418  break;
1421  break;
1424  break;
1428  break;
1429  case XML_TYPE_GRAPHIC:
1430  pHdl = new XMLGraphicPropertyHandler;
1431  break;
1432  case XML_TYPE_THEME_COLOR:
1433  pHdl = new XMLConstantsPropertyHandler(pXML_ThemeColor_Enum, XML_TOKEN_INVALID);
1434  break;
1435  default:
1436  {
1437  OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1438  break;
1439  }
1440  }
1441 
1442  return pHdl;
1443 }
1444 
1446 {
1447 }
1448 
1450  sal_Int32 nType ) const
1451 {
1452  const XMLPropertyHandler *pHdl =
1454 
1455  if( !pHdl )
1456  {
1457  const XMLPropertyHandler *pNewHdl = ::GetPropertyHandler( nType );
1458 
1459  if( pNewHdl )
1460  PutHdlCache( nType, pNewHdl );
1461 
1462  pHdl = pNewHdl;
1463  }
1464 
1465  return pHdl;
1466 }
1467 
1468 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_TYPE_BORDER_MODEL
Definition: xmltypes.hxx:255
#define XML_TYPE_TEXT_CLIP11
Definition: xmltypes.hxx:218
#define XML_SW_TYPE_FILLBITMAPSIZE
Definition: xmltypes.hxx:286
#define XML_TYPE_VERTICAL_ALIGN
Definition: xmltypes.hxx:283
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another...
Definition: txtprhdl.cxx:694
SvXMLEnumMapEntry< sal_Int16 > const pXML_RubyPosition_Enum[]
Definition: txtprhdl.cxx:207
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const
This method retrieves a PropertyHandler for the given XML-type.
Definition: prhdlfac.cxx:138
SvXMLEnumMapEntry< sal_uInt16 > const pXML_ParaVerticalAlign_Enum[]
Definition: txtprhdl.cxx:223
#define XML_TYPE_TEXT_RUBY_IS_ABOVE
Definition: xmltypes.hxx:293
#define XML_TYPE_TEXT_EMPHASIZE
Definition: xmltypes.hxx:221
SvXMLEnumMapEntry< sal_uInt16 > const pXML_ThemeColor_Enum[]
Definition: txtprhdl.cxx:252
#define XML_SW_TYPE_BITMAP_REFPOINT
Definition: xmltypes.hxx:288
#define XML_TYPE_TEXT_KEEP
Definition: xmltypes.hxx:262
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:82
#define XML_TYPE_TEXT_PROTECT_CONTENT
Definition: xmltypes.hxx:200
signed char sal_Int8
SvXMLEnumMapEntry< drawing::RectanglePoint > const aXML_RefPoint_EnumMap[]
Definition: sdpropls.cxx:557
#define XML_TYPE_TEXT_VERTICAL_REL_PAGE
Definition: xmltypes.hxx:212
SvXMLEnumMapEntry< drawing::TextVerticalAdjust > const pXML_VerticalAlign_Enum[]
Definition: txtprhdl.cxx:243
#define XML_TYPE_TEXT_NKEEP
Definition: xmltypes.hxx:263
PropertyHandler for the XML-data-type:
#define XML_TYPE_TEXT_VERTICAL_ALIGN
Definition: xmltypes.hxx:245
#define XML_TYPE_TEXT_NUMBER8_ONE_BASED
Definition: xmltypes.hxx:266
#define XML_TYPE_TEXT_AUTOSPACE
Definition: xmltypes.hxx:226
#define XML_SW_TYPE_BITMAPREPOFFSETX
Definition: xmltypes.hxx:290
#define XML_SW_TYPE_LOGICAL_SIZE
Definition: xmltypes.hxx:287
#define XML_SW_TYPE_FILLSTYLE
Definition: xmltypes.hxx:285
Abstract base-class for different XML-types.
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3528
PropertyHandler for a named xml bool type:
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriPos_Enum[]
Definition: txtprhdl.cxx:68
css::chart::ChartAxisLabelPosition ePos
#define XML_TYPE_TEXT_RUBY_ADJUST
Definition: xmltypes.hxx:241
#define XML_TYPE_TEXT_VERTICAL_REL_FRAME
Definition: xmltypes.hxx:213
PropertyHandler for a generic xml enumeration type:
SvXMLEnumMapEntry< drawing::FillStyle > const aXML_FillStyle_EnumMap[]
Definition: sdpropls.cxx:411
#define XML_TYPE_TEXT_VERTICAL_REL
Definition: xmltypes.hxx:211
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriPosMirrored_Enum[]
Definition: txtprhdl.cxx:80
#define XML_TYPE_TEXT_ROTATION_SCALE
Definition: xmltypes.hxx:244
#define XML_TYPE_TEXT_DROPCAP
Definition: xmltypes.hxx:193
PropertyHandler for the XML-data-type:
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const override
This method retrieves a PropertyHandler for the given XML-type.
Definition: txtprhdl.cxx:1449
#define XML_TYPE_TEXT_CLIP
Definition: xmltypes.hxx:273
#define XML_SW_TYPE_BITMAPREPOFFSETY
Definition: xmltypes.hxx:291
virtual ~XMLAnchorTypePropHdl() override
Definition: txtprhdl.cxx:647
#define XML_TYPE_TEXT_HORIZONTAL_POS
Definition: xmltypes.hxx:205
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class...
Definition: txtprhdl.cxx:703
SvXMLEnumMapEntry< TextContentAnchorType > const pXML_Anchor_Enum[]
Definition: txtprhdl.cxx:605
#define XML_TYPE_TEXT_LINE_MODE
Definition: xmltypes.hxx:256
#define XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
Definition: xmltypes.hxx:208
#define XML_TYPE_TEXT_WRAP_OUTSIDE
Definition: xmltypes.hxx:198
#define XML_TYPE_TEXT_HORIZONTAL_MIRROR
Definition: xmltypes.hxx:209
#define XML_TYPE_TEXT_PUNCTUATION_WRAP
Definition: xmltypes.hxx:227
XMLOFF_DLLPUBLIC void exportXML(OUString const &rStrName, css::uno::Any const &rValue, SvXMLExport &rExport)
SvXMLEnumMapEntry< sal_uInt16 > const pXML_FontRelief_Enum[]
Definition: txtprhdl.cxx:215
Abstract base-class for different XML-types.
virtual bool equals(const css::uno::Any &r1, const css::uno::Any &r2) const override
Compares two Any's in case of the given XML-data-type.
Definition: txtprhdl.cxx:666
virtual bool equals(const css::uno::Any &r1, const css::uno::Any &r2) const
Compares two Any's in case of the given XML-data-type.
Definition: xmlprhdl.cxx:28
#define XML_TYPE_TEXT_COMBINE
Definition: xmltypes.hxx:222
uno_Any a
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertRelPage_Enum[]
Definition: txtprhdl.cxx:165
#define XML_TYPE_TEXT_MIRROR_VERTICAL
Definition: xmltypes.hxx:215
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriRel_Enum[]
Definition: txtprhdl.cxx:89
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class...
Definition: txtprhdl.cxx:630
#define XML_TYPE_THEME_COLOR
Definition: xmltypes.hxx:297
SvXMLEnumMapEntry< sal_uInt16 > const pXML_WrapInfluenceOnPosition_Enum[]
Definition: txtprhdl.cxx:234
SvXMLEnumMapEntry< bool > const pXML_HoriMirror_Enum[]
Definition: txtprhdl.cxx:121
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const =0
Exports the given value according to the XML-data-type corresponding to the derived class...
#define XML_TYPE_TEXT_PROTECT_SIZE
Definition: xmltypes.hxx:201
#define XML_TYPE_GRAPHIC
Definition: xmltypes.hxx:294
#define XML_SW_TYPE_BITMAP_MODE
Definition: xmltypes.hxx:289
#define XML_TYPE_TEXT_WRAP
Definition: xmltypes.hxx:196
#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
Definition: xmltypes.hxx:235
#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
Definition: xmltypes.hxx:236
#define XML_TYPE_TEXT_COMBINECHAR
Definition: xmltypes.hxx:223
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
Definition: txtprhdl.cxx:615
#define XML_TYPE_TEXT_FONT_RELIEF
Definition: xmltypes.hxx:242
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
XMLOFF_DLLPUBLIC bool importXML(css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, css::uno::Any &rValue, OUString &rStrName, SvXMLImport &rImport)
static bool convert(std::string_view rStrImpValue, css::text::TextContentAnchorType &rType)
Definition: txtprhdl.cxx:651
#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
Definition: xmltypes.hxx:216
#define XML_TYPE_WRAP_INFLUENCE_ON_POSITION
Definition: xmltypes.hxx:264
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriRelFrame_Enum[]
Definition: txtprhdl.cxx:107
SvXMLEnumMapEntry< drawing::BitmapMode > const aXML_BitmapMode_EnumMap[]
Definition: sdpropls.cxx:508
SvXMLEnumMapEntry< sal_uInt16 > const pXML_Emphasize_Enum[]
Definition: txtprhdl.cxx:845
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertRelAsChar_Enum[]
Definition: txtprhdl.cxx:183
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3472
Handling of tokens in XML:
static const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType)
Definition: txtprhdl.cxx:1240
#define XML_TYPE_TEXT_COLUMNS
Definition: xmltypes.hxx:204
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Definition: xmluconv.hxx:145
QPRO_FUNC_TYPE nType
#define XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
Definition: xmltypes.hxx:249
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
Abstract base-class for different XML-types.
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertPosAtChar_Enum[]
Definition: txtprhdl.cxx:133
#define XML_TYPE_TEXT_COMBINE_CHARACTERS
Definition: xmltypes.hxx:237
#define XML_TYPE_TEXT_REL_WIDTH_HEIGHT
Definition: xmltypes.hxx:234
#define XML_TYPE_TEXT_ROTATION_ANGLE
Definition: xmltypes.hxx:243
#define XML_TYPE_TEXT_OPAQUE
Definition: xmltypes.hxx:199
#define SAL_WARN(area, stream)
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const =0
Imports the given value according to the XML-data-type corresponding to the derived class...
#define XML_TYPE_TEXT_LINE_BREAK
Definition: xmltypes.hxx:228
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
Definition: xmltypes.hxx:217
#define XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
Definition: xmltypes.hxx:206
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertRel_Enum[]
Definition: txtprhdl.cxx:148
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertRelFrame_Enum[]
Definition: txtprhdl.cxx:176
SvXMLEnumMapEntry< RubyAdjust > const pXML_RubyAdjust_Enum[]
Definition: txtprhdl.cxx:197
SvXMLEnumMapEntry< WrapTextMode > const pXML_Wrap_Enum[]
Definition: txtprhdl.cxx:470
#define XML_TYPE_TEXT_HORIZONTAL_REL
Definition: xmltypes.hxx:207
#define XML_TYPE_TEXT_ANCHOR_TYPE
Definition: xmltypes.hxx:203
Abstract base-class for different XML-types.
#define XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
Definition: xmltypes.hxx:214
virtual ~XMLTextColumnsPropertyHandler() override
Definition: txtprhdl.cxx:662
#define XML_TYPE_TEXT_RUBY_POSITION
Definition: xmltypes.hxx:248
#define XML_TYPE_TEXT_PARAGRAPH_ONLY
Definition: xmltypes.hxx:197
sal_Int16 nValue
void PutHdlCache(sal_Int32 nType, const XMLPropertyHandler *pHdl) const
Puts a PropertyHandler into the internal cache.
Definition: prhdlfac.cxx:156
#define XML_TYPE_TEXT_PROTECT_POSITION
Definition: xmltypes.hxx:202
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)