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