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 
252 namespace {
253 
254 class XMLDropCapPropHdl_Impl : public XMLPropertyHandler
255 {
256 public:
257  virtual bool equals(
258  const css::uno::Any& r1,
259  const css::uno::Any& r2 ) const override;
260 
262  virtual bool importXML(
263  const OUString& rStrImpValue,
264  css::uno::Any& rValue,
265  const SvXMLUnitConverter& ) const override;
266  virtual bool exportXML(
267  OUString& rStrExpValue,
268  const css::uno::Any& rValue,
269  const SvXMLUnitConverter& ) const override;
270 };
271 
272 }
273 
274 bool XMLDropCapPropHdl_Impl::equals(
275  const Any& r1,
276  const Any& r2 ) const
277 {
278  DropCapFormat aFormat1, aFormat2;
279  r1 >>= aFormat1;
280  r2 >>= aFormat2;
281 
282  return (aFormat1.Lines <=1 && aFormat2.Lines <=1) ||
283  (aFormat1.Lines == aFormat2.Lines &&
284  aFormat1.Count == aFormat2.Count &&
285  aFormat1.Distance == aFormat2.Distance);
286 }
287 
288 bool XMLDropCapPropHdl_Impl::importXML(
289  const OUString&,
290  Any&,
291  const SvXMLUnitConverter& ) const
292 {
293  SAL_WARN( "xmloff", "drop caps are an element import property" );
294  return false;
295 }
296 
297 bool XMLDropCapPropHdl_Impl::exportXML(
298  OUString&,
299  const Any&,
300  const SvXMLUnitConverter& ) const
301 {
302  SAL_WARN( "xmloff", "drop caps are an element export property" );
303  return false;
304 }
305 
306 namespace {
307 
308 class XMLOpaquePropHdl_Impl : public XMLPropertyHandler
309 {
310 public:
311  virtual bool importXML(
312  const OUString& rStrImpValue,
313  css::uno::Any& rValue,
314  const SvXMLUnitConverter& ) const override;
315  virtual bool exportXML(
316  OUString& rStrExpValue,
317  const css::uno::Any& rValue,
318  const SvXMLUnitConverter& ) const override;
319 };
320 
321 }
322 
323 bool XMLOpaquePropHdl_Impl::importXML(
324  const OUString& rStrImpValue,
325  Any& rValue,
326  const SvXMLUnitConverter& ) const
327 {
328  bool bRet = true;
329  bool bVal = false;
330  if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) )
331  bVal = true;
332  else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) )
333  bRet = false;
334 
335  if( bRet )
336  rValue <<= bVal;
337 
338  return bRet;
339 }
340 
341 bool XMLOpaquePropHdl_Impl::exportXML(
342  OUString& rStrExpValue,
343  const Any& rValue,
344  const SvXMLUnitConverter& ) const
345 {
346  if( *o3tl::doAccess<bool>(rValue) )
347  rStrExpValue = GetXMLToken( XML_FOREGROUND );
348  else
349  rStrExpValue = GetXMLToken( XML_BACKGROUND );
350 
351  return true;
352 }
353 
354 namespace {
355 
356 class XMLContourModePropHdl_Impl : public XMLPropertyHandler
357 {
358 public:
359  virtual bool importXML(
360  const OUString& rStrImpValue,
361  css::uno::Any& rValue,
362  const SvXMLUnitConverter& ) const override;
363  virtual bool exportXML(
364  OUString& rStrExpValue,
365  const css::uno::Any& rValue,
366  const SvXMLUnitConverter& ) const override;
367 };
368 
369 }
370 
371 bool XMLContourModePropHdl_Impl::importXML(
372  const OUString& rStrImpValue,
373  Any& rValue,
374  const SvXMLUnitConverter& ) const
375 {
376  bool bRet = true;
377  bool bVal = false;
378  if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) )
379  bVal = true;
380  else if( ! IsXMLToken( rStrImpValue, XML_FULL ) )
381  bRet = false;
382 
383  if( bRet )
384  rValue <<= bVal;
385 
386  return bRet;
387 }
388 
389 bool XMLContourModePropHdl_Impl::exportXML(
390  OUString& rStrExpValue,
391  const Any& rValue,
392  const SvXMLUnitConverter& ) const
393 {
394  if( *o3tl::doAccess<bool>(rValue) )
395  rStrExpValue = GetXMLToken( XML_OUTSIDE );
396  else
397  rStrExpValue = GetXMLToken( XML_FULL );
398 
399  return true;
400 }
401 
402 namespace {
403 
404 class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler
405 {
406 public:
407  virtual bool importXML(
408  const OUString& rStrImpValue,
409  css::uno::Any& rValue,
410  const SvXMLUnitConverter& ) const override;
411  virtual bool exportXML(
412  OUString& rStrExpValue,
413  const css::uno::Any& rValue,
414  const SvXMLUnitConverter& ) const override;
415 };
416 
417 }
418 
419 bool XMLParagraphOnlyPropHdl_Impl::importXML(
420  const OUString& rStrImpValue,
421  Any& rValue,
422  const SvXMLUnitConverter& ) const
423 {
424  bool bRet = true;
425  bool bVal = false;
426 
427  if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) )
428  {
429  sal_Int32 nValue = 0;
430  bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
431  bVal = 1 == nValue;
432  }
433 
434  if( bRet )
435  rValue <<= bVal;
436 
437  return bRet;
438 }
439 
440 bool XMLParagraphOnlyPropHdl_Impl::exportXML(
441  OUString& rStrExpValue,
442  const Any& rValue,
443  const SvXMLUnitConverter& ) const
444 {
445  if( *o3tl::doAccess<bool>(rValue) )
446  rStrExpValue = GetXMLToken( XML_1 );
447  else
448  rStrExpValue = GetXMLToken( XML_NO_LIMIT );
449 
450  return true;
451 }
452 
454 {
455  { XML_NONE, WrapTextMode_NONE },
456  { XML_RUN_THROUGH, WrapTextMode_THROUGH },
457  { XML_PARALLEL, WrapTextMode_PARALLEL },
458  { XML_DYNAMIC, WrapTextMode_DYNAMIC },
459  { XML_LEFT, WrapTextMode_LEFT },
460  { XML_RIGHT, WrapTextMode_RIGHT },
461  { XML_TOKEN_INVALID, WrapTextMode(0) }
462 };
463 
464 namespace {
465 
466 class XMLWrapPropHdl_Impl : public XMLPropertyHandler
467 {
468 public:
469  virtual bool importXML(
470  const OUString& rStrImpValue,
471  css::uno::Any& rValue,
472  const SvXMLUnitConverter& ) const override;
473  virtual bool exportXML(
474  OUString& rStrExpValue,
475  const css::uno::Any& rValue,
476  const SvXMLUnitConverter& ) const override;
477 };
478 
479 }
480 
481 bool XMLWrapPropHdl_Impl::importXML(
482  const OUString& rStrImpValue,
483  Any& rValue,
484  const SvXMLUnitConverter& ) const
485 {
486  WrapTextMode nWrap;
487  bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue,
488  pXML_Wrap_Enum );
489 
490  if( bRet )
491  rValue <<= nWrap;
492 
493  return bRet;
494 }
495 
496 bool XMLWrapPropHdl_Impl::exportXML(
497  OUString& rStrExpValue,
498  const Any& rValue,
499  const SvXMLUnitConverter& ) const
500 {
501  OUStringBuffer aOut;
502  WrapTextMode eVal;
503 
504  rValue >>= eVal;
505 
506  bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE );
507 
508  rStrExpValue = aOut.makeStringAndClear();
509 
510  return bRet;
511 }
512 
513 namespace {
514 
515 class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler
516 {
517  const OUString sVal;
518 public:
519  explicit XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) :
520  sVal( GetXMLToken(eVal) ) {}
521 
522  virtual bool importXML(
523  const OUString& rStrImpValue,
524  css::uno::Any& rValue,
525  const SvXMLUnitConverter& ) const override;
526  virtual bool exportXML(
527  OUString& rStrExpValue,
528  const css::uno::Any& rValue,
529  const SvXMLUnitConverter& ) const override;
530 };
531 
532 }
533 
534 bool XMLFrameProtectPropHdl_Impl::importXML(
535  const OUString& rStrImpValue,
536  Any& rValue,
537  const SvXMLUnitConverter& ) const
538 {
539  bool bRet = true;
540  bool bVal = false;
541  if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
542  {
543  bRet = false;
544  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
545  std::u16string_view aToken;
546  while( aTokenEnum.getNextToken( aToken ) )
547  {
548  bRet = true;
549  if( aToken == sVal )
550  {
551  bVal = true;
552  break;
553  }
554  }
555  }
556 
557  if( bRet )
558  rValue <<= bVal;
559 
560  return bRet;
561 }
562 
563 bool XMLFrameProtectPropHdl_Impl::exportXML(
564  OUString& rStrExpValue,
565  const Any& rValue,
566  const SvXMLUnitConverter& ) const
567 {
568  if( *o3tl::doAccess<bool>(rValue) )
569  {
570  if( rStrExpValue.isEmpty() ||
571  IsXMLToken( rStrExpValue, XML_NONE ) )
572  {
573  rStrExpValue = sVal;
574  }
575  else
576  {
577  rStrExpValue += " " + sVal;
578  }
579  }
580  else if( rStrExpValue.isEmpty() )
581  {
582  rStrExpValue = GetXMLToken( XML_NONE );
583  }
584 
585  return true;
586 }
587 
589 {
590  { XML_CHAR, TextContentAnchorType_AT_CHARACTER },
591  { XML_PAGE, TextContentAnchorType_AT_PAGE },
592  { XML_FRAME, TextContentAnchorType_AT_FRAME },
593  { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH },
594  { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER },
595  { XML_TOKEN_INVALID, TextContentAnchorType(0) }
596 };
597 
599  const OUString& rStrImpValue,
600  Any& rValue,
601  const SvXMLUnitConverter& ) const
602 {
603  TextContentAnchorType nAnchor;
604  bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
605  pXML_Anchor_Enum );
606 
607  if( bRet )
608  rValue <<= nAnchor;
609 
610  return bRet;
611 }
612 
614  OUString& rStrExpValue,
615  const Any& rValue,
616  const SvXMLUnitConverter& ) const
617 {
618  OUStringBuffer aOut;
619  TextContentAnchorType eVal;
620 
621  rValue >>= eVal;
622 
623  bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH );
624 
625  rStrExpValue = aOut.makeStringAndClear();
626 
627  return bRet;
628 }
629 
631 {
632 }
633 
634 bool XMLAnchorTypePropHdl::convert( std::string_view rStrImpValue,
635  TextContentAnchorType& rType )
636 {
637  TextContentAnchorType nAnchor;
638  bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
639  pXML_Anchor_Enum );
640  if( bRet )
641  rType = nAnchor;
642  return bRet;
643 }
644 
646 {
647 }
648 
650  const Any& r1,
651  const Any& r2 ) const
652 {
653  Reference < XTextColumns > xColumns1;
654  r1 >>= xColumns1;
655 
656  Reference < XTextColumns > xColumns2;
657  r2 >>= xColumns2;
658 
659  if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
660  xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
661  return false;
662 
663  Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
664  Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
665 
666  return std::equal(aColumns1.begin(), aColumns1.end(), aColumns2.begin(), aColumns2.end(),
667  [](const TextColumn& a, const TextColumn& b) {
668  return a.Width == b.Width
669  && a.LeftMargin == b.LeftMargin
670  && a.RightMargin == b.RightMargin;
671  });
672 }
673 
675  const OUString&,
676  Any&,
677  const SvXMLUnitConverter& ) const
678 {
679  SAL_WARN( "xmloff", "columns are an element import property" );
680  return false;
681 }
682 
684  OUString&,
685  const Any&,
686  const SvXMLUnitConverter& ) const
687 {
688  SAL_WARN( "xmloff", "columns are an element export property" );
689  return false;
690 }
691 
692 namespace {
693 
694 class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
695 {
696 public:
697  virtual bool importXML(
698  const OUString& rStrImpValue,
699  css::uno::Any& rValue,
700  const SvXMLUnitConverter& ) const override;
701  virtual bool exportXML(
702  OUString& rStrExpValue,
703  const css::uno::Any& rValue,
704  const SvXMLUnitConverter& ) const override;
705 };
706 
707 }
708 
709 bool XMLHoriMirrorPropHdl_Impl::importXML(
710  const OUString& rStrImpValue,
711  Any& rValue,
712  const SvXMLUnitConverter& ) const
713 {
714  bool nHoriMirror;
715  bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue,
716  pXML_HoriMirror_Enum );
717 
718  if( bRet )
719  {
720  rValue <<= nHoriMirror;
721  }
722 
723  return bRet;
724 }
725 
726 bool XMLHoriMirrorPropHdl_Impl::exportXML(
727  OUString&,
728  const Any&,
729  const SvXMLUnitConverter& ) const
730 {
731  SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
732 
733  return false;
734 }
735 
736 namespace {
737 
738 class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
739 {
740  const OUString sVal;
741  bool bHori;
742 
743 public:
744  XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, bool bH ) :
745  sVal( GetXMLToken( eVal ) ),
746  bHori( bH ) {}
747 
748  virtual bool importXML(
749  const OUString& rStrImpValue,
750  css::uno::Any& rValue,
751  const SvXMLUnitConverter& ) const override;
752  virtual bool exportXML(
753  OUString& rStrExpValue,
754  const css::uno::Any& rValue,
755  const SvXMLUnitConverter& ) const override;
756 };
757 
758 }
759 
760 bool XMLGrfMirrorPropHdl_Impl::importXML(
761  const OUString& rStrImpValue,
762  Any& rValue,
763  const SvXMLUnitConverter& ) const
764 {
765  bool bRet = true;
766  bool bVal = false;
767  if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
768  {
769  bRet = false;
770  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
771  std::u16string_view aToken;
772  while( aTokenEnum.getNextToken( aToken ) )
773  {
774  bRet = true;
775  if( aToken == sVal ||
776  (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
777  {
778  bVal = true;
779  break;
780  }
781  }
782  }
783 
784  if( bRet )
785  rValue <<= bVal;
786 
787  return bRet;
788 }
789 
790 bool XMLGrfMirrorPropHdl_Impl::exportXML(
791  OUString& rStrExpValue,
792  const Any& rValue,
793  const SvXMLUnitConverter& ) const
794 {
795  if( *o3tl::doAccess<bool>(rValue) )
796  {
797  if( rStrExpValue.isEmpty() ||
798  IsXMLToken( rStrExpValue, XML_NONE ) )
799  {
800  rStrExpValue = sVal;
801  }
802  else if( bHori &&
803  /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
804  are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
805  (#i49139#)
806  */
807  ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) ||
808  IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) ))
809  {
810  rStrExpValue = GetXMLToken( XML_HORIZONTAL );
811  }
812  else
813  {
814  rStrExpValue += " " + sVal;
815  }
816  }
817  else if( rStrExpValue.isEmpty() )
818  {
819  rStrExpValue = GetXMLToken( XML_NONE );
820  }
821 
822  return true;
823 }
824 
826 {
827  { XML_NONE, FontEmphasis::NONE },
828  { XML_DOT, FontEmphasis::DOT_ABOVE },
829  { XML_CIRCLE, FontEmphasis::CIRCLE_ABOVE },
830  { XML_DISC, FontEmphasis::DISK_ABOVE },
831  { XML_ACCENT, FontEmphasis::ACCENT_ABOVE },
832  { XML_TOKEN_INVALID, 0 }
833 };
834 
835 namespace {
836 
837 class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
838 {
839 public:
840  XMLTextEmphasizePropHdl_Impl() {}
841 
842  virtual bool importXML(
843  const OUString& rStrImpValue,
844  css::uno::Any& rValue,
845  const SvXMLUnitConverter& ) const override;
846  virtual bool exportXML(
847  OUString& rStrExpValue,
848  const css::uno::Any& rValue,
849  const SvXMLUnitConverter& ) const override;
850 };
851 
852 }
853 
854 bool XMLTextEmphasizePropHdl_Impl::importXML(
855  const OUString& rStrImpValue,
856  Any& rValue,
857  const SvXMLUnitConverter& ) const
858 {
859  bool bRet = true;
860  sal_uInt16 nVal = FontEmphasis::NONE;
861  bool bBelow = false;
862  bool bHasPos = false, bHasType = false;
863  std::u16string_view aToken;
864 
865  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
866  while( aTokenEnum.getNextToken( aToken ) )
867  {
868  if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
869  {
870  bBelow = false;
871  bHasPos = true;
872  }
873  else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
874  {
875  bBelow = true;
876  bHasPos = true;
877  }
878  else if( !bHasType &&
879  SvXMLUnitConverter::convertEnum( nVal, aToken,
880  pXML_Emphasize_Enum ))
881  {
882  bHasType = true;
883  }
884  else
885  {
886  bRet = false;
887  break;
888  }
889  }
890 
891  if( bRet )
892  {
893  if( FontEmphasis::NONE != nVal && bBelow )
894  nVal += 10;
895  rValue <<= static_cast<sal_Int16>(nVal);
896  }
897 
898  return bRet;
899 }
900 
901 bool XMLTextEmphasizePropHdl_Impl::exportXML(
902  OUString& rStrExpValue,
903  const Any& rValue,
904  const SvXMLUnitConverter& ) const
905 {
906  OUStringBuffer aOut( 15 );
907  bool bRet = true;
908  sal_uInt16 nType = sal_uInt16();
909  if( rValue >>= nType )
910  {
911  bool bBelow = false;
912  if( nType > 10 )
913  {
914  bBelow = true;
915  nType -= 10;
916  }
917  bRet = SvXMLUnitConverter::convertEnum( aOut, nType,
918  pXML_Emphasize_Enum,
919  XML_DOT );
920  if( bRet )
921  {
922  if( nType != 0 )
923  {
924  enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
925  aOut.append( ' ' );
926  aOut.append( GetXMLToken(ePos) );
927  }
928  rStrExpValue = aOut.makeStringAndClear();
929  }
930  }
931 
932  return bRet;
933 }
934 
935 namespace {
936 
937 class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
938 {
939 public:
940  XMLTextCombineCharPropHdl_Impl() {}
941 
942  virtual bool importXML(
943  const OUString& rStrImpValue,
944  css::uno::Any& rValue,
945  const SvXMLUnitConverter& ) const override;
946  virtual bool exportXML(
947  OUString& rStrExpValue,
948  const css::uno::Any& rValue,
949  const SvXMLUnitConverter& ) const override;
950 };
951 
952 }
953 
954 bool XMLTextCombineCharPropHdl_Impl::importXML(
955  const OUString& rStrImpValue,
956  Any& rValue,
957  const SvXMLUnitConverter& ) const
958 {
959  if( !rStrImpValue.isEmpty() )
960  rValue <<= rStrImpValue.copy( 0, 1 );
961  else
962  rValue <<= rStrImpValue;
963 
964  return true;
965 }
966 
967 bool XMLTextCombineCharPropHdl_Impl::exportXML(
968  OUString& rStrExpValue,
969  const Any& rValue,
970  const SvXMLUnitConverter& ) const
971 {
972  rValue >>= rStrExpValue;
973 
974  // #i114107# attribute of type "character": export only if length is 1
975  return (1 == rStrExpValue.getLength());
976 }
977 
978 namespace {
979 
980 class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
981 {
982 public:
983  XMLTextRelWidthHeightPropHdl_Impl() {}
984 
985  virtual bool importXML(
986  const OUString& rStrImpValue,
987  css::uno::Any& rValue,
988  const SvXMLUnitConverter& ) const override;
989  virtual bool exportXML(
990  OUString& rStrExpValue,
991  const css::uno::Any& rValue,
992  const SvXMLUnitConverter& ) const override;
993 };
994 
995 }
996 
997 bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
998  const OUString& rStrImpValue,
999  Any& rValue,
1000  const SvXMLUnitConverter& ) const
1001 {
1002  sal_Int32 nValue;
1003  bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue );
1004  if( bRet )
1005  rValue <<= static_cast<sal_Int16>(nValue);
1006 
1007  return bRet;
1008 }
1009 
1010 bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1011  OUString& rStrExpValue,
1012  const Any& rValue,
1013  const SvXMLUnitConverter& ) const
1014 {
1015  bool bRet = false;
1016  sal_Int16 nValue = sal_Int16();
1017  if( (rValue >>= nValue) && nValue > 0 )
1018  {
1019  OUStringBuffer aOut;
1020  ::sax::Converter::convertPercent( aOut, nValue );
1021  rStrExpValue = aOut.makeStringAndClear();
1022 
1023  bRet = true;
1024  }
1025 
1026  return bRet;
1027 }
1028 
1029 namespace {
1030 
1031 class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
1032 {
1033  const OUString sValue;
1034 
1035 public:
1036  explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
1037  sValue( GetXMLToken(eValue) ) {}
1038 
1039  virtual bool importXML(
1040  const OUString& rStrImpValue,
1041  css::uno::Any& rValue,
1042  const SvXMLUnitConverter& ) const override;
1043  virtual bool exportXML(
1044  OUString& rStrExpValue,
1045  const css::uno::Any& rValue,
1046  const SvXMLUnitConverter& ) const override;
1047 };
1048 
1049 }
1050 
1051 bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1052  const OUString& rStrImpValue,
1053  Any& rValue,
1054  const SvXMLUnitConverter& ) const
1055 {
1056  rValue <<= (rStrImpValue == sValue);
1057 
1058  return true;
1059 }
1060 
1061 bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1062  OUString& rStrExpValue,
1063  const Any& rValue,
1064  const SvXMLUnitConverter& ) const
1065 {
1066  bool bRet = false;
1067  if( *o3tl::doAccess<bool>(rValue) )
1068  {
1069  rStrExpValue = sValue;
1070  bRet = true;
1071  }
1072 
1073  return bRet;
1074 }
1075 
1076 namespace {
1077 
1078 class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
1079 {
1080 
1081 public:
1082  XMLTextRotationAnglePropHdl_Impl() {}
1083 
1084  virtual bool importXML(
1085  const OUString& rStrImpValue,
1086  css::uno::Any& rValue,
1087  const SvXMLUnitConverter& ) const override;
1088  virtual bool exportXML(
1089  OUString& rStrExpValue,
1090  const css::uno::Any& rValue,
1091  const SvXMLUnitConverter& ) const override;
1092 };
1093 
1094 }
1095 
1096 bool XMLTextRotationAnglePropHdl_Impl::importXML(
1097  const OUString& rStrImpValue,
1098  Any& rValue,
1099  const SvXMLUnitConverter& ) const
1100 {
1101  sal_Int32 nValue;
1102  bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
1103  if( bRet )
1104  {
1105  nValue = (nValue % 360 );
1106  if( nValue < 0 )
1107  nValue = 360 + nValue;
1108  sal_Int16 nAngle;
1109  if( nValue < 45 || nValue > 315 )
1110  nAngle = 0;
1111  else if( nValue < 180 )
1112  nAngle = 900;
1113  else /* if nValue <= 315 ) */
1114  nAngle = 2700;
1115  rValue <<= nAngle;
1116  }
1117 
1118  return bRet;
1119 }
1120 
1121 bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1122  OUString& rStrExpValue,
1123  const Any& rValue,
1124  const SvXMLUnitConverter& ) const
1125 {
1126  sal_Int16 nAngle = sal_Int16();
1127  bool bRet = ( rValue >>= nAngle );
1128  if( bRet )
1129  {
1130  rStrExpValue = OUString::number( nAngle / 10 );
1131  }
1132  OSL_ENSURE( bRet, "illegal rotation angle" );
1133 
1134  return bRet;
1135 }
1136 
1137 namespace {
1138 
1139 class XMLNumber8OneBasedHdl : public XMLPropertyHandler
1140 {
1141 
1142 public:
1143  XMLNumber8OneBasedHdl() {}
1144 
1145  virtual bool importXML(
1146  const OUString& rStrImpValue,
1147  css::uno::Any& rValue,
1148  const SvXMLUnitConverter& ) const override;
1149  virtual bool exportXML(
1150  OUString& rStrExpValue,
1151  const css::uno::Any& rValue,
1152  const SvXMLUnitConverter& ) const override;
1153 };
1154 
1155 }
1156 
1157 bool XMLNumber8OneBasedHdl::importXML(
1158  const OUString& rStrImpValue,
1159  Any& rValue,
1160  const SvXMLUnitConverter& ) const
1161 {
1162  sal_Int32 nValue = 0;
1163  bool const bRet = ::sax::Converter::convertNumber(nValue, rStrImpValue);
1164  if( bRet )
1165  rValue <<= static_cast<sal_Int8>( nValue - 1 );
1166  return bRet;
1167 }
1168 
1169 bool XMLNumber8OneBasedHdl::exportXML(
1170  OUString& rStrExpValue,
1171  const Any& rValue,
1172  const SvXMLUnitConverter& ) const
1173 {
1174  sal_Int8 nValue = sal_Int8();
1175  bool bRet = ( rValue >>= nValue );
1176  if( bRet )
1177  {
1178  rStrExpValue = OUString::number( nValue + 1 );
1179  }
1180  return bRet;
1181 }
1182 
1183 namespace {
1184 
1185 class XMLGraphicPropertyHandler : public XMLPropertyHandler
1186 {
1187 public:
1188  XMLGraphicPropertyHandler() {}
1189 
1190  virtual bool importXML(const OUString& , uno::Any& , const SvXMLUnitConverter& ) const override
1191  {
1192  SAL_WARN( "xmloff", "drop caps are an element import property" );
1193  return false;
1194  }
1195 
1196  virtual bool exportXML(OUString& , const uno::Any& , const SvXMLUnitConverter& ) const override
1197  {
1198  SAL_WARN( "xmloff", "drop caps are an element import property" );
1199  return false;
1200  }
1201 
1202  virtual bool equals(const css::uno::Any& rAny1, const css::uno::Any& rAny2) const override;
1203 };
1204 
1205 }
1206 
1207 bool XMLGraphicPropertyHandler::equals(const Any& rAny1, const Any& rAny2) const
1208 {
1209  uno::Reference<graphic::XGraphic> xGraphic1;
1210  uno::Reference<graphic::XGraphic> xGraphic2;
1211  rAny1 >>= xGraphic1;
1212  rAny2 >>= xGraphic2;
1213  Graphic aGraphic1(xGraphic1);
1214  Graphic aGraphic2(xGraphic2);
1215 
1216  return aGraphic1 == aGraphic2;
1217 }
1218 
1220  ( sal_Int32 nType )
1221 {
1222  const XMLPropertyHandler* pHdl = nullptr;
1223  switch( nType )
1224  {
1225  case XML_TYPE_TEXT_DROPCAP:
1226  pHdl = new XMLDropCapPropHdl_Impl;
1227  break;
1228  case XML_TYPE_TEXT_WRAP:
1229  pHdl = new XMLWrapPropHdl_Impl;
1230  break;
1232  pHdl = new XMLParagraphOnlyPropHdl_Impl;
1233  break;
1235  pHdl = new XMLContourModePropHdl_Impl;
1236  break;
1237  case XML_TYPE_TEXT_OPAQUE:
1238  pHdl = new XMLOpaquePropHdl_Impl;
1239  break;
1241  pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
1242  break;
1244  pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
1245  break;
1247  pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
1248  break;
1250  pHdl = new XMLAnchorTypePropHdl;
1251  break;
1252  case XML_TYPE_TEXT_COLUMNS:
1253  pHdl = new XMLTextColumnsPropertyHandler;
1254  break;
1256  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
1257  break;
1259  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
1260  break;
1262  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
1263  break;
1265  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
1266  break;
1268  pHdl = new XMLHoriMirrorPropHdl_Impl;
1269  break;
1271  pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
1272  break;
1274  pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
1275  break;
1277  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
1278  break;
1280  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
1281  break;
1283  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
1284  break;
1286  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, false );
1287  break;
1289  // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1290  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, true );
1291  break;
1293  // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1294  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, true );
1295  break;
1296  case XML_TYPE_TEXT_CLIP:
1297  pHdl = new XMLClipPropertyHandler( false );
1298  break;
1299  case XML_TYPE_TEXT_CLIP11:
1300  pHdl = new XMLClipPropertyHandler( true );
1301  break;
1303  pHdl = new XMLTextEmphasizePropHdl_Impl;
1304  break;
1305  case XML_TYPE_TEXT_COMBINE:
1307  GetXMLToken( XML_NONE ) );
1308  break;
1311  GetXMLToken( XML_NONE ) );
1312  break;
1314  pHdl = new XMLTextCombineCharPropHdl_Impl;
1315  break;
1318  GetXMLToken( XML_NONE ) );
1319  break;
1322  GetXMLToken( XML_SIMPLE ) );
1323  break;
1326  GetXMLToken( XML_NORMAL ) );
1327  break;
1329  pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
1330  break;
1332  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
1333  break;
1335  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
1336  break;
1338  pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
1339  break;
1341  pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
1342  break;
1344  pHdl = new XMLTextRotationAnglePropHdl_Impl;
1345  break;
1349  break;
1351  pHdl = new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum, XML_TOKEN_INVALID );
1352  break;
1354  pHdl = new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum, XML_TOKEN_INVALID );
1355  break;
1358  break;
1359  // OD 2004-05-05 #i28701#
1361  pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum,
1363  break;
1364  case XML_TYPE_BORDER_MODEL:
1367  break;
1369  pHdl = new XMLNamedBoolPropertyHdl(
1372  break;
1373  case XML_TYPE_TEXT_KEEP:
1374  pHdl = new XMLNamedBoolPropertyHdl(
1377  break;
1378  case XML_TYPE_TEXT_NKEEP:
1379  pHdl = new XMLNamedBoolPropertyHdl(
1382  break;
1384  pHdl = new XMLNumber8OneBasedHdl();
1385  break;
1387  pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
1388  break;
1389 
1390  case XML_SW_TYPE_FILLSTYLE:
1392  break;
1394  pHdl = new XMLFillBitmapSizePropertyHandler();
1395  break;
1398  break;
1401  break;
1404  break;
1408  break;
1409  case XML_TYPE_GRAPHIC:
1410  pHdl = new XMLGraphicPropertyHandler;
1411  break;
1412  default:
1413  {
1414  OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1415  break;
1416  }
1417  }
1418 
1419  return pHdl;
1420 }
1421 
1424 {
1425 }
1426 
1428  sal_Int32 nType ) const
1429 {
1430  const XMLPropertyHandler *pHdl =
1432 
1433  if( !pHdl )
1434  {
1435  const XMLPropertyHandler *pNewHdl = ::GetPropertyHandler( nType );
1436 
1437  if( pNewHdl )
1438  PutHdlCache( nType, pNewHdl );
1439 
1440  pHdl = pNewHdl;
1441  }
1442 
1443  return pHdl;
1444 }
1445 
1446 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_TYPE_BORDER_MODEL
Definition: xmltypes.hxx:254
#define XML_TYPE_TEXT_CLIP11
Definition: xmltypes.hxx:217
#define XML_SW_TYPE_FILLBITMAPSIZE
Definition: xmltypes.hxx:285
#define XML_TYPE_VERTICAL_ALIGN
Definition: xmltypes.hxx:282
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:674
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:292
#define XML_TYPE_TEXT_EMPHASIZE
Definition: xmltypes.hxx:220
#define XML_SW_TYPE_BITMAP_REFPOINT
Definition: xmltypes.hxx:287
#define XML_TYPE_TEXT_KEEP
Definition: xmltypes.hxx:261
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:80
#define XML_TYPE_TEXT_PROTECT_CONTENT
Definition: xmltypes.hxx:199
signed char sal_Int8
SvXMLEnumMapEntry< drawing::RectanglePoint > const aXML_RefPoint_EnumMap[]
Definition: sdpropls.cxx:564
#define XML_TYPE_TEXT_VERTICAL_REL_PAGE
Definition: xmltypes.hxx:211
SvXMLEnumMapEntry< drawing::TextVerticalAdjust > const pXML_VerticalAlign_Enum[]
Definition: txtprhdl.cxx:243
#define XML_TYPE_TEXT_NKEEP
Definition: xmltypes.hxx:262
PropertyHandler for the XML-data-type:
#define XML_TYPE_TEXT_VERTICAL_ALIGN
Definition: xmltypes.hxx:244
#define XML_TYPE_TEXT_NUMBER8_ONE_BASED
Definition: xmltypes.hxx:265
#define XML_TYPE_TEXT_AUTOSPACE
Definition: xmltypes.hxx:225
#define XML_SW_TYPE_BITMAPREPOFFSETX
Definition: xmltypes.hxx:289
#define XML_SW_TYPE_LOGICAL_SIZE
Definition: xmltypes.hxx:286
#define XML_SW_TYPE_FILLSTYLE
Definition: xmltypes.hxx:284
Abstract base-class for different XML-types.
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3462
This class is a base-class to create XMLPropertyHandler.
Definition: prhdlfac.hxx:40
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:240
#define XML_TYPE_TEXT_VERTICAL_REL_FRAME
Definition: xmltypes.hxx:212
PropertyHandler for a generic xml enumeration type:
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
SvXMLEnumMapEntry< drawing::FillStyle > const aXML_FillStyle_EnumMap[]
Definition: sdpropls.cxx:418
#define XML_TYPE_TEXT_VERTICAL_REL
Definition: xmltypes.hxx:210
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriPosMirrored_Enum[]
Definition: txtprhdl.cxx:80
#define XML_TYPE_TEXT_ROTATION_SCALE
Definition: xmltypes.hxx:243
#define XML_TYPE_TEXT_DROPCAP
Definition: xmltypes.hxx:192
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:1427
#define XML_TYPE_TEXT_CLIP
Definition: xmltypes.hxx:272
#define XML_SW_TYPE_BITMAPREPOFFSETY
Definition: xmltypes.hxx:290
virtual ~XMLAnchorTypePropHdl() override
Definition: txtprhdl.cxx:630
#define XML_TYPE_TEXT_HORIZONTAL_POS
Definition: xmltypes.hxx:204
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:683
SvXMLEnumMapEntry< TextContentAnchorType > const pXML_Anchor_Enum[]
Definition: txtprhdl.cxx:588
#define XML_TYPE_TEXT_LINE_MODE
Definition: xmltypes.hxx:255
#define XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
Definition: xmltypes.hxx:207
#define XML_TYPE_TEXT_WRAP_OUTSIDE
Definition: xmltypes.hxx:197
#define XML_TYPE_TEXT_HORIZONTAL_MIRROR
Definition: xmltypes.hxx:208
#define XML_TYPE_TEXT_PUNCTUATION_WRAP
Definition: xmltypes.hxx:226
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
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:649
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:221
uno_Any a
SvXMLEnumMapEntry< sal_uInt16 > const pXML_VertRelPage_Enum[]
Definition: txtprhdl.cxx:165
#define XML_TYPE_TEXT_MIRROR_VERTICAL
Definition: xmltypes.hxx:214
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:613
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:200
#define XML_TYPE_GRAPHIC
Definition: xmltypes.hxx:293
#define XML_SW_TYPE_BITMAP_MODE
Definition: xmltypes.hxx:288
#define XML_TYPE_TEXT_WRAP
Definition: xmltypes.hxx:195
#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
Definition: xmltypes.hxx:234
#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
Definition: xmltypes.hxx:235
#define XML_TYPE_TEXT_COMBINECHAR
Definition: xmltypes.hxx:222
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:598
#define XML_TYPE_TEXT_FONT_RELIEF
Definition: xmltypes.hxx:241
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static bool convert(std::string_view rStrImpValue, css::text::TextContentAnchorType &rType)
Definition: txtprhdl.cxx:634
#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
Definition: xmltypes.hxx:215
#define XML_TYPE_WRAP_INFLUENCE_ON_POSITION
Definition: xmltypes.hxx:263
SvXMLEnumMapEntry< sal_uInt16 > const pXML_HoriRelFrame_Enum[]
Definition: txtprhdl.cxx:107
SvXMLEnumMapEntry< drawing::BitmapMode > const aXML_BitmapMode_EnumMap[]
Definition: sdpropls.cxx:515
SvXMLEnumMapEntry< sal_uInt16 > const pXML_Emphasize_Enum[]
Definition: txtprhdl.cxx:825
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:3406
Handling of tokens in XML:
static const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType)
Definition: txtprhdl.cxx:1220
#define XML_TYPE_TEXT_COLUMNS
Definition: xmltypes.hxx:203
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:138
QPRO_FUNC_TYPE nType
#define XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
Definition: xmltypes.hxx:248
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:236
#define XML_TYPE_TEXT_REL_WIDTH_HEIGHT
Definition: xmltypes.hxx:233
#define XML_TYPE_TEXT_ROTATION_ANGLE
Definition: xmltypes.hxx:242
#define XML_TYPE_TEXT_OPAQUE
Definition: xmltypes.hxx:198
#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:227
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
Definition: xmltypes.hxx:216
#define XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
Definition: xmltypes.hxx:205
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:453
#define XML_TYPE_TEXT_HORIZONTAL_REL
Definition: xmltypes.hxx:206
#define XML_TYPE_TEXT_ANCHOR_TYPE
Definition: xmltypes.hxx:202
Abstract base-class for different XML-types.
#define XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
Definition: xmltypes.hxx:213
virtual ~XMLTextColumnsPropertyHandler() override
Definition: txtprhdl.cxx:645
#define XML_TYPE_TEXT_RUBY_POSITION
Definition: xmltypes.hxx:247
#define XML_TYPE_TEXT_PARAGRAPH_ONLY
Definition: xmltypes.hxx:196
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:201
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)