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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 || !xColumns2)
660  return (!xColumns1 && !xColumns2);
661 
662  if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
663  xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
664  return false;
665 
666  Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
667  Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
668 
669  return std::equal(aColumns1.begin(), aColumns1.end(), aColumns2.begin(), aColumns2.end(),
670  [](const TextColumn& a, const TextColumn& b) {
671  return a.Width == b.Width
672  && a.LeftMargin == b.LeftMargin
673  && a.RightMargin == b.RightMargin;
674  });
675 }
676 
678  const OUString&,
679  Any&,
680  const SvXMLUnitConverter& ) const
681 {
682  SAL_WARN( "xmloff", "columns are an element import property" );
683  return false;
684 }
685 
687  OUString&,
688  const Any&,
689  const SvXMLUnitConverter& ) const
690 {
691  SAL_WARN( "xmloff", "columns are an element export property" );
692  return false;
693 }
694 
695 namespace {
696 
697 class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
698 {
699 public:
700  virtual bool importXML(
701  const OUString& rStrImpValue,
702  css::uno::Any& rValue,
703  const SvXMLUnitConverter& ) const override;
704  virtual bool exportXML(
705  OUString& rStrExpValue,
706  const css::uno::Any& rValue,
707  const SvXMLUnitConverter& ) const override;
708 };
709 
710 }
711 
713  const OUString& rStrImpValue,
714  Any& rValue,
715  const SvXMLUnitConverter& ) const
716 {
717  bool nHoriMirror;
718  bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue,
719  pXML_HoriMirror_Enum );
720 
721  if( bRet )
722  {
723  rValue <<= nHoriMirror;
724  }
725 
726  return bRet;
727 }
728 
730  OUString&,
731  const Any&,
732  const SvXMLUnitConverter& ) const
733 {
734  SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
735 
736  return false;
737 }
738 
739 namespace {
740 
741 class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
742 {
743  const OUString sVal;
744  bool bHori;
745 
746 public:
747  XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, bool bH ) :
748  sVal( GetXMLToken( eVal ) ),
749  bHori( bH ) {}
750 
751  virtual bool importXML(
752  const OUString& rStrImpValue,
753  css::uno::Any& rValue,
754  const SvXMLUnitConverter& ) const override;
755  virtual bool exportXML(
756  OUString& rStrExpValue,
757  const css::uno::Any& rValue,
758  const SvXMLUnitConverter& ) const override;
759 };
760 
761 }
762 
764  const OUString& rStrImpValue,
765  Any& rValue,
766  const SvXMLUnitConverter& ) const
767 {
768  bool bRet = true;
769  bool bVal = false;
770  if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
771  {
772  bRet = false;
773  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
774  std::u16string_view aToken;
775  while( aTokenEnum.getNextToken( aToken ) )
776  {
777  bRet = true;
778  if( aToken == sVal ||
779  (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
780  {
781  bVal = true;
782  break;
783  }
784  }
785  }
786 
787  if( bRet )
788  rValue <<= bVal;
789 
790  return bRet;
791 }
792 
794  OUString& rStrExpValue,
795  const Any& rValue,
796  const SvXMLUnitConverter& ) const
797 {
798  if( *o3tl::doAccess<bool>(rValue) )
799  {
800  if( rStrExpValue.isEmpty() ||
801  IsXMLToken( rStrExpValue, XML_NONE ) )
802  {
803  rStrExpValue = sVal;
804  }
805  else if( bHori &&
806  /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
807  are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
808  (#i49139#)
809  */
810  ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) ||
811  IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) ))
812  {
813  rStrExpValue = GetXMLToken( XML_HORIZONTAL );
814  }
815  else
816  {
817  rStrExpValue += " " + sVal;
818  }
819  }
820  else if( rStrExpValue.isEmpty() )
821  {
822  rStrExpValue = GetXMLToken( XML_NONE );
823  }
824 
825  return true;
826 }
827 
829 {
830  { XML_NONE, FontEmphasis::NONE },
831  { XML_DOT, FontEmphasis::DOT_ABOVE },
832  { XML_CIRCLE, FontEmphasis::CIRCLE_ABOVE },
833  { XML_DISC, FontEmphasis::DISK_ABOVE },
834  { XML_ACCENT, FontEmphasis::ACCENT_ABOVE },
835  { XML_TOKEN_INVALID, 0 }
836 };
837 
838 namespace {
839 
840 class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
841 {
842 public:
843  XMLTextEmphasizePropHdl_Impl() {}
844 
845  virtual bool importXML(
846  const OUString& rStrImpValue,
847  css::uno::Any& rValue,
848  const SvXMLUnitConverter& ) const override;
849  virtual bool exportXML(
850  OUString& rStrExpValue,
851  const css::uno::Any& rValue,
852  const SvXMLUnitConverter& ) const override;
853 };
854 
855 }
856 
858  const OUString& rStrImpValue,
859  Any& rValue,
860  const SvXMLUnitConverter& ) const
861 {
862  bool bRet = true;
863  sal_uInt16 nVal = FontEmphasis::NONE;
864  bool bBelow = false;
865  bool bHasPos = false, bHasType = false;
866  std::u16string_view aToken;
867 
868  SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
869  while( aTokenEnum.getNextToken( aToken ) )
870  {
871  if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
872  {
873  bBelow = false;
874  bHasPos = true;
875  }
876  else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
877  {
878  bBelow = true;
879  bHasPos = true;
880  }
881  else if( !bHasType &&
882  SvXMLUnitConverter::convertEnum( nVal, aToken,
883  pXML_Emphasize_Enum ))
884  {
885  bHasType = true;
886  }
887  else
888  {
889  bRet = false;
890  break;
891  }
892  }
893 
894  if( bRet )
895  {
896  if( FontEmphasis::NONE != nVal && bBelow )
897  nVal += 10;
898  rValue <<= static_cast<sal_Int16>(nVal);
899  }
900 
901  return bRet;
902 }
903 
905  OUString& rStrExpValue,
906  const Any& rValue,
907  const SvXMLUnitConverter& ) const
908 {
909  OUStringBuffer aOut( 15 );
910  bool bRet = true;
911  sal_uInt16 nType = sal_uInt16();
912  if( rValue >>= nType )
913  {
914  bool bBelow = false;
915  if( nType > 10 )
916  {
917  bBelow = true;
918  nType -= 10;
919  }
920  bRet = SvXMLUnitConverter::convertEnum( aOut, nType,
921  pXML_Emphasize_Enum,
922  XML_DOT );
923  if( bRet )
924  {
925  if( nType != 0 )
926  {
927  enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
928  aOut.append( ' ' );
929  aOut.append( GetXMLToken(ePos) );
930  }
931  rStrExpValue = aOut.makeStringAndClear();
932  }
933  }
934 
935  return bRet;
936 }
937 
938 namespace {
939 
940 class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
941 {
942 public:
943  XMLTextCombineCharPropHdl_Impl() {}
944 
945  virtual bool importXML(
946  const OUString& rStrImpValue,
947  css::uno::Any& rValue,
948  const SvXMLUnitConverter& ) const override;
949  virtual bool exportXML(
950  OUString& rStrExpValue,
951  const css::uno::Any& rValue,
952  const SvXMLUnitConverter& ) const override;
953 };
954 
955 }
956 
958  const OUString& rStrImpValue,
959  Any& rValue,
960  const SvXMLUnitConverter& ) const
961 {
962  if( !rStrImpValue.isEmpty() )
963  rValue <<= rStrImpValue.copy( 0, 1 );
964  else
965  rValue <<= rStrImpValue;
966 
967  return true;
968 }
969 
971  OUString& rStrExpValue,
972  const Any& rValue,
973  const SvXMLUnitConverter& ) const
974 {
975  rValue >>= rStrExpValue;
976 
977  // #i114107# attribute of type "character": export only if length is 1
978  return (1 == rStrExpValue.getLength());
979 }
980 
981 namespace {
982 
983 class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
984 {
985 public:
986  XMLTextRelWidthHeightPropHdl_Impl() {}
987 
988  virtual bool importXML(
989  const OUString& rStrImpValue,
990  css::uno::Any& rValue,
991  const SvXMLUnitConverter& ) const override;
992  virtual bool exportXML(
993  OUString& rStrExpValue,
994  const css::uno::Any& rValue,
995  const SvXMLUnitConverter& ) const override;
996 };
997 
998 }
999 
1001  const OUString& rStrImpValue,
1002  Any& rValue,
1003  const SvXMLUnitConverter& ) const
1004 {
1005  sal_Int32 nValue;
1006  bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue );
1007  if( bRet )
1008  rValue <<= static_cast<sal_Int16>(nValue);
1009 
1010  return bRet;
1011 }
1012 
1014  OUString& rStrExpValue,
1015  const Any& rValue,
1016  const SvXMLUnitConverter& ) const
1017 {
1018  bool bRet = false;
1019  sal_Int16 nValue = sal_Int16();
1020  if( (rValue >>= nValue) && nValue > 0 )
1021  {
1022  OUStringBuffer aOut;
1023  ::sax::Converter::convertPercent( aOut, nValue );
1024  rStrExpValue = aOut.makeStringAndClear();
1025 
1026  bRet = true;
1027  }
1028 
1029  return bRet;
1030 }
1031 
1032 namespace {
1033 
1034 class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
1035 {
1036  const OUString sValue;
1037 
1038 public:
1039  explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
1040  sValue( GetXMLToken(eValue) ) {}
1041 
1042  virtual bool importXML(
1043  const OUString& rStrImpValue,
1044  css::uno::Any& rValue,
1045  const SvXMLUnitConverter& ) const override;
1046  virtual bool exportXML(
1047  OUString& rStrExpValue,
1048  const css::uno::Any& rValue,
1049  const SvXMLUnitConverter& ) const override;
1050 };
1051 
1052 }
1053 
1055  const OUString& rStrImpValue,
1056  Any& rValue,
1057  const SvXMLUnitConverter& ) const
1058 {
1059  rValue <<= (rStrImpValue == sValue);
1060 
1061  return true;
1062 }
1063 
1065  OUString& rStrExpValue,
1066  const Any& rValue,
1067  const SvXMLUnitConverter& ) const
1068 {
1069  bool bRet = false;
1070  if( *o3tl::doAccess<bool>(rValue) )
1071  {
1072  rStrExpValue = sValue;
1073  bRet = true;
1074  }
1075 
1076  return bRet;
1077 }
1078 
1079 namespace {
1080 
1081 class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
1082 {
1083 
1084 public:
1085  XMLTextRotationAnglePropHdl_Impl() {}
1086 
1087  virtual bool importXML(
1088  const OUString& rStrImpValue,
1089  css::uno::Any& rValue,
1090  const SvXMLUnitConverter& ) const override;
1091  virtual bool exportXML(
1092  OUString& rStrExpValue,
1093  const css::uno::Any& rValue,
1094  const SvXMLUnitConverter& ) const override;
1095 };
1096 
1097 }
1098 
1100  const OUString& rStrImpValue,
1101  Any& rValue,
1102  const SvXMLUnitConverter& ) const
1103 {
1104  sal_Int32 nValue;
1105  bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
1106  if( bRet )
1107  {
1108  nValue = (nValue % 360 );
1109  if( nValue < 0 )
1110  nValue = 360 + nValue;
1111  sal_Int16 nAngle;
1112  if( nValue < 45 || nValue > 315 )
1113  nAngle = 0;
1114  else if( nValue < 180 )
1115  nAngle = 900;
1116  else /* if nValue <= 315 ) */
1117  nAngle = 2700;
1118  rValue <<= nAngle;
1119  }
1120 
1121  return bRet;
1122 }
1123 
1125  OUString& rStrExpValue,
1126  const Any& rValue,
1127  const SvXMLUnitConverter& ) const
1128 {
1129  sal_Int16 nAngle = sal_Int16();
1130  bool bRet = ( rValue >>= nAngle );
1131  if( bRet )
1132  {
1133  rStrExpValue = OUString::number( nAngle / 10 );
1134  }
1135  OSL_ENSURE( bRet, "illegal rotation angle" );
1136 
1137  return bRet;
1138 }
1139 
1140 namespace {
1141 
1142 class XMLNumber8OneBasedHdl : public XMLPropertyHandler
1143 {
1144 
1145 public:
1146  XMLNumber8OneBasedHdl() {}
1147 
1148  virtual bool importXML(
1149  const OUString& rStrImpValue,
1150  css::uno::Any& rValue,
1151  const SvXMLUnitConverter& ) const override;
1152  virtual bool exportXML(
1153  OUString& rStrExpValue,
1154  const css::uno::Any& rValue,
1155  const SvXMLUnitConverter& ) const override;
1156 };
1157 
1158 }
1159 
1161  const OUString& rStrImpValue,
1162  Any& rValue,
1163  const SvXMLUnitConverter& ) const
1164 {
1165  sal_Int32 nValue = 0;
1166  bool const bRet = ::sax::Converter::convertNumber(nValue, rStrImpValue);
1167  if( bRet )
1168  rValue <<= static_cast<sal_Int8>( nValue - 1 );
1169  return bRet;
1170 }
1171 
1173  OUString& rStrExpValue,
1174  const Any& rValue,
1175  const SvXMLUnitConverter& ) const
1176 {
1177  sal_Int8 nValue = sal_Int8();
1178  bool bRet = ( rValue >>= nValue );
1179  if( bRet )
1180  {
1181  rStrExpValue = OUString::number( nValue + 1 );
1182  }
1183  return bRet;
1184 }
1185 
1186 namespace {
1187 
1188 class XMLGraphicPropertyHandler : public XMLPropertyHandler
1189 {
1190 public:
1191  XMLGraphicPropertyHandler() {}
1192 
1193  virtual bool importXML(const OUString& , uno::Any& , const SvXMLUnitConverter& ) const override
1194  {
1195  SAL_WARN( "xmloff", "drop caps are an element import property" );
1196  return false;
1197  }
1198 
1199  virtual bool exportXML(OUString& , const uno::Any& , const SvXMLUnitConverter& ) const override
1200  {
1201  SAL_WARN( "xmloff", "drop caps are an element import property" );
1202  return false;
1203  }
1204 
1205  virtual bool equals(const css::uno::Any& rAny1, const css::uno::Any& rAny2) const override;
1206 };
1207 
1208 }
1209 
1210 bool XMLGraphicPropertyHandler::equals(const Any& rAny1, const Any& rAny2) const
1211 {
1212  uno::Reference<graphic::XGraphic> xGraphic1;
1213  uno::Reference<graphic::XGraphic> xGraphic2;
1214  rAny1 >>= xGraphic1;
1215  rAny2 >>= xGraphic2;
1216  Graphic aGraphic1(xGraphic1);
1217  Graphic aGraphic2(xGraphic2);
1218 
1219  return aGraphic1 == aGraphic2;
1220 }
1221 
1223  ( sal_Int32 nType )
1224 {
1225  const XMLPropertyHandler* pHdl = nullptr;
1226  switch( nType )
1227  {
1228  case XML_TYPE_TEXT_DROPCAP:
1229  pHdl = new XMLDropCapPropHdl_Impl;
1230  break;
1231  case XML_TYPE_TEXT_WRAP:
1232  pHdl = new XMLWrapPropHdl_Impl;
1233  break;
1235  pHdl = new XMLParagraphOnlyPropHdl_Impl;
1236  break;
1238  pHdl = new XMLContourModePropHdl_Impl;
1239  break;
1240  case XML_TYPE_TEXT_OPAQUE:
1241  pHdl = new XMLOpaquePropHdl_Impl;
1242  break;
1244  pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
1245  break;
1247  pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
1248  break;
1250  pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
1251  break;
1253  pHdl = new XMLAnchorTypePropHdl;
1254  break;
1255  case XML_TYPE_TEXT_COLUMNS:
1256  pHdl = new XMLTextColumnsPropertyHandler;
1257  break;
1259  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
1260  break;
1262  pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
1263  break;
1265  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
1266  break;
1268  pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
1269  break;
1271  pHdl = new XMLHoriMirrorPropHdl_Impl;
1272  break;
1274  pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
1275  break;
1277  pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
1278  break;
1280  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
1281  break;
1283  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
1284  break;
1286  pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
1287  break;
1289  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, false );
1290  break;
1292  // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1293  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, true );
1294  break;
1296  // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1297  pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, true );
1298  break;
1299  case XML_TYPE_TEXT_CLIP:
1300  pHdl = new XMLClipPropertyHandler( false );
1301  break;
1302  case XML_TYPE_TEXT_CLIP11:
1303  pHdl = new XMLClipPropertyHandler( true );
1304  break;
1306  pHdl = new XMLTextEmphasizePropHdl_Impl;
1307  break;
1308  case XML_TYPE_TEXT_COMBINE:
1310  GetXMLToken( XML_NONE ) );
1311  break;
1314  GetXMLToken( XML_NONE ) );
1315  break;
1317  pHdl = new XMLTextCombineCharPropHdl_Impl;
1318  break;
1321  GetXMLToken( XML_NONE ) );
1322  break;
1325  GetXMLToken( XML_SIMPLE ) );
1326  break;
1329  GetXMLToken( XML_NORMAL ) );
1330  break;
1332  pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
1333  break;
1335  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
1336  break;
1338  pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
1339  break;
1341  pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
1342  break;
1344  pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
1345  break;
1347  pHdl = new XMLTextRotationAnglePropHdl_Impl;
1348  break;
1352  break;
1354  pHdl = new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum, XML_TOKEN_INVALID );
1355  break;
1357  pHdl = new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum, XML_TOKEN_INVALID );
1358  break;
1361  break;
1362  // OD 2004-05-05 #i28701#
1364  pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum,
1366  break;
1367  case XML_TYPE_BORDER_MODEL:
1370  break;
1372  pHdl = new XMLNamedBoolPropertyHdl(
1375  break;
1376  case XML_TYPE_TEXT_KEEP:
1377  pHdl = new XMLNamedBoolPropertyHdl(
1380  break;
1381  case XML_TYPE_TEXT_NKEEP:
1382  pHdl = new XMLNamedBoolPropertyHdl(
1385  break;
1387  pHdl = new XMLNumber8OneBasedHdl();
1388  break;
1390  pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
1391  break;
1392 
1393  case XML_SW_TYPE_FILLSTYLE:
1395  break;
1397  pHdl = new XMLFillBitmapSizePropertyHandler();
1398  break;
1401  break;
1404  break;
1407  break;
1411  break;
1412  case XML_TYPE_GRAPHIC:
1413  pHdl = new XMLGraphicPropertyHandler;
1414  break;
1415  default:
1416  {
1417  OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1418  break;
1419  }
1420  }
1421 
1422  return pHdl;
1423 }
1424 
1426 {
1427 }
1428 
1430  sal_Int32 nType ) const
1431 {
1432  const XMLPropertyHandler *pHdl =
1434 
1435  if( !pHdl )
1436  {
1437  const XMLPropertyHandler *pNewHdl = ::GetPropertyHandler( nType );
1438 
1439  if( pNewHdl )
1440  PutHdlCache( nType, pNewHdl );
1441 
1442  pHdl = pNewHdl;
1443  }
1444 
1445  return pHdl;
1446 }
1447 
1448 /* 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:677
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:82
#define XML_TYPE_TEXT_PROTECT_CONTENT
Definition: xmltypes.hxx:199
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: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:3510
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:
SvXMLEnumMapEntry< drawing::FillStyle > const aXML_FillStyle_EnumMap[]
Definition: sdpropls.cxx:411
#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:1429
#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:686
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
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: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)
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: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:508
SvXMLEnumMapEntry< sal_uInt16 > const pXML_Emphasize_Enum[]
Definition: txtprhdl.cxx:828
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:3454
Handling of tokens in XML:
static const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType)
Definition: txtprhdl.cxx:1223
#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:145
QPRO_FUNC_TYPE nType
#define XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
Definition: xmltypes.hxx:248
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: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)