LibreOffice Module sw (master)  1
attrdesc.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 <i18nutil/unicode.hxx>
21 #include <svl/itemiter.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/settings.hxx>
24 #include <vcl/GraphicObject.hxx>
25 
26 #include <editeng/itemtype.hxx>
27 #include <editeng/eerdll.hxx>
28 #include <unotools/intlwrapper.hxx>
29 #include <unotools/syslocale.hxx>
30 #include <rtl/ustrbuf.hxx>
31 #include <fmtanchr.hxx>
32 #include <fmtfsize.hxx>
33 #include <fmtinfmt.hxx>
34 #include <fchrfmt.hxx>
35 #include <fmtautofmt.hxx>
36 #include <fmtsrnd.hxx>
37 #include <fmtornt.hxx>
38 #include <fmtlsplt.hxx>
39 #include <fmtrowsplt.hxx>
40 #include <fmtpdsc.hxx>
41 #include <fmtclds.hxx>
42 #include <fmteiro.hxx>
43 #include <fmturl.hxx>
44 #include <fmthdft.hxx>
45 #include <fmtcnct.hxx>
46 #include <fmtline.hxx>
47 #include <tgrditem.hxx>
48 #include <hfspacingitem.hxx>
49 #include <fmtruby.hxx>
50 #include <paratr.hxx>
51 #include <grfatr.hxx>
52 #include <pagedesc.hxx>
53 #include <charfmt.hxx>
54 #include <fmtcol.hxx>
55 #include <tox.hxx>
56 #include <strings.hrc>
57 #include <fmtftntx.hxx>
58 #include <fmtfollowtextflow.hxx>
59 #include <libxml/xmlwriter.h>
60 
61 using namespace com::sun::star;
62 
63 
64 // query the attribute descriptions
66  SfxItemPresentation ePres,
67  MapUnit eCoreMetric,
68  MapUnit ePresMetric,
69  OUString &rText ) const
70 {
71  rText.clear();
72  OUString aStr;
73  if( Count() )
74  {
75  SfxItemIter aIter( *this );
76  const SfxPoolItem* pItem = aIter.GetCurItem();
77  const IntlWrapper aInt(SvtSysLocale().GetUILanguageTag());
78  do
79  {
80  pItem->GetPresentation(ePres, eCoreMetric, ePresMetric, aStr, aInt);
81  if( rText.getLength() && aStr.getLength() )
82  rText += ", ";
83  rText += aStr;
84  pItem = aIter.NextItem();
85  } while (pItem);
86  }
87 }
88 
90 (
91  SfxItemPresentation ePres,
92  MapUnit eCoreUnit,
93  MapUnit ePresUnit,
94  OUString& rText,
95  const IntlWrapper& /*rIntl*/
96 ) const
97 {
98  const SwCharFormat *pCharFormat = GetCharFormat();
99  if ( pCharFormat )
100  {
101  OUString aStr;
102  pCharFormat->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr );
103  rText = SwResId( STR_CHARFMT ) + "(" + aStr + ")";
104  }
105  else
106  rText = SwResId( STR_NO_CHARFMT );
107  return true;
108 }
109 
111 (
112  SfxItemPresentation /*ePres*/,
113  MapUnit /*eCoreUnit*/,
114  MapUnit /*ePresUnit*/,
115  OUString& rText,
116  const IntlWrapper& /*rIntl*/
117 ) const
118 {
119  rText.clear(); //TODO
120  return true;
121 }
122 
124 (
125  SfxItemPresentation /*ePres*/,
126  MapUnit /*eCoreUnit*/,
127  MapUnit /*ePresUnit*/,
128  OUString& rText,
129  const IntlWrapper& /*rIntl*/
130 ) const
131 {
132  rText = GetValue();
133  return true;
134 }
135 
137  MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
138  OUString &rText, const IntlWrapper& /*rIntl*/ ) const
139 {
140  rText.clear();
141  return true;
142 }
143 
145 (
146  SfxItemPresentation /*ePres*/,
147  MapUnit /*eCoreUnit*/,
148  MapUnit /*ePresUnit*/,
149  OUString& rText,
150  const IntlWrapper& /*rIntl*/
151 ) const
152 {
153  rText.clear();
154  if ( GetLines() > 1 )
155  {
156  if ( GetChars() > 1 )
157  {
158  rText = OUString::number( GetChars() ) + " ";
159  }
160  rText += SwResId( STR_DROP_OVER ) +
161  " " +
162  OUString::number( GetLines() ) +
163  " " +
164  SwResId( STR_DROP_LINES );
165  }
166  else
167  rText = SwResId( STR_NO_DROP_LINES );
168  return true;
169 }
170 
172 (
173  SfxItemPresentation /*ePres*/,
174  MapUnit /*eCoreUnit*/,
175  MapUnit /*ePresUnit*/,
176  OUString& rText,
177  const IntlWrapper& /*rIntl*/
178 ) const
179 {
180  const char* pId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF;
181  rText = SwResId(pId);
182  return true;
183 }
184 
186 (
187  SfxItemPresentation /*ePres*/,
188  MapUnit /*eCoreUnit*/,
189  MapUnit /*ePresUnit*/,
190  OUString& rText,
191  const IntlWrapper& /*rIntl*/
192 ) const
193 {
194  if( !GetValue().isEmpty() )
195  rText = SwResId( STR_NUMRULE_ON ) +
196  "(" + GetValue() + ")";
197  else
198  rText = SwResId( STR_NUMRULE_OFF );
199  return true;
200 }
201 
203 (
204  SfxItemPresentation /*ePres*/,
205  MapUnit /*eCoreUnit*/,
206  MapUnit /*ePresUnit*/,
207  OUString& rText,
208  const IntlWrapper& /*rIntl*/
209 ) const
210 {
211  const char* pId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF;
212  rText = SwResId(pId);
213  return true;
214 }
215 
216 // Frame attribute
217 
219 (
220  SfxItemPresentation /*ePres*/,
221  MapUnit eCoreUnit,
222  MapUnit ePresUnit,
223  OUString& rText,
224  const IntlWrapper& rIntl
225 ) const
226 {
227  rText = SwResId( STR_FRM_WIDTH ) + " ";
228  if ( GetWidthPercent() )
229  {
230  rText += unicode::formatPercent(GetWidthPercent(),
231  Application::GetSettings().GetUILanguageTag());
232  }
233  else
234  {
235  rText += ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, &rIntl ) +
236  " " + ::EditResId( ::GetMetricId( ePresUnit ) );
237  }
238  if ( ATT_VAR_SIZE != GetHeightSizeType() )
239  {
240  const char* pId = ATT_FIX_SIZE == m_eFrameHeightType ?
241  STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT;
242  rText += ", " + SwResId(pId) + " ";
243  if ( GetHeightPercent() )
244  {
245  rText += unicode::formatPercent(GetHeightPercent(),
246  Application::GetSettings().GetUILanguageTag());
247  }
248  else
249  {
250  rText = ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, &rIntl ) +
251  " " + EditResId( ::GetMetricId( ePresUnit ) );
252  }
253  }
254  return true;
255 }
256 
257 //Header for page formats.
258 //Client of FrameFormat which describes the header.
259 
261 (
262  SfxItemPresentation /*ePres*/,
263  MapUnit /*eCoreUnit*/,
264  MapUnit /*ePresUnit*/,
265  OUString& rText,
266  const IntlWrapper& /*rIntl*/
267 ) const
268 {
269  const char* pId = GetHeaderFormat() ? STR_HEADER : STR_NO_HEADER;
270  rText = SwResId(pId);
271  return true;
272 }
273 
274 //Footer for page formats.
275 //Client of FrameFormat which describes the footer.
276 
278 (
279  SfxItemPresentation /*ePres*/,
280  MapUnit /*eCoreUnit*/,
281  MapUnit /*ePresUnit*/,
282  OUString& rText,
283  const IntlWrapper& /*rIntl*/
284 ) const
285 {
286  const char* pId = GetFooterFormat() ? STR_FOOTER : STR_NO_FOOTER;
287  rText = SwResId(pId);
288  return true;
289 }
290 
292 (
293  SfxItemPresentation /*ePres*/,
294  MapUnit /*eCoreUnit*/,
295  MapUnit /*ePresUnit*/,
296  OUString& rText,
297  const IntlWrapper& /*rIntl*/
298 ) const
299 {
300  const char* pId = nullptr;
301  switch ( GetValue() )
302  {
303  case css::text::WrapTextMode_NONE:
304  pId = STR_SURROUND_NONE;
305  break;
306  case css::text::WrapTextMode_THROUGH:
307  pId = STR_SURROUND_THROUGH;
308  break;
309  case css::text::WrapTextMode_PARALLEL:
310  pId = STR_SURROUND_PARALLEL;
311  break;
312  case css::text::WrapTextMode_DYNAMIC:
313  pId = STR_SURROUND_IDEAL;
314  break;
315  case css::text::WrapTextMode_LEFT:
316  pId = STR_SURROUND_LEFT;
317  break;
318  case css::text::WrapTextMode_RIGHT:
319  pId = STR_SURROUND_RIGHT;
320  break;
321  default:;//prevent warning
322  }
323  if (pId)
324  rText = SwResId(pId);
325 
326  if ( IsAnchorOnly() )
327  {
328  rText += " " + SwResId( STR_SURROUND_ANCHORONLY );
329  }
330  return true;
331 }
332 
333 //VertOrientation, how and by what orientate the FlyFrame in the vertical?
334 
336 (
337  SfxItemPresentation /*ePres*/,
338  MapUnit eCoreUnit,
339  MapUnit ePresUnit,
340  OUString& rText,
341  const IntlWrapper& rIntl
342 ) const
343 {
344  const char* pId = nullptr;
345  switch ( GetVertOrient() )
346  {
348  {
349  rText += SwResId( STR_POS_Y ) + " " +
350  ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, &rIntl ) +
351  " " + EditResId( ::GetMetricId( ePresUnit ) );
352  }
353  break;
354  case text::VertOrientation::TOP:
355  pId = STR_VERT_TOP;
356  break;
357  case text::VertOrientation::CENTER:
358  pId = STR_VERT_CENTER;
359  break;
360  case text::VertOrientation::BOTTOM:
361  pId = STR_VERT_BOTTOM;
362  break;
363  case text::VertOrientation::LINE_TOP:
364  pId = STR_LINE_TOP;
365  break;
366  case text::VertOrientation::LINE_CENTER:
367  pId = STR_LINE_CENTER;
368  break;
369  case text::VertOrientation::LINE_BOTTOM:
370  pId = STR_LINE_BOTTOM;
371  break;
372  default:;//prevent warning
373  }
374  if (pId)
375  rText += SwResId(pId);
376  return true;
377 }
378 
379 //HoriOrientation, how and by what orientate the FlyFrame in the horizontal?
380 
382 (
383  SfxItemPresentation /*ePres*/,
384  MapUnit eCoreUnit,
385  MapUnit ePresUnit,
386  OUString& rText,
387  const IntlWrapper& rIntl
388 ) const
389 {
390  const char* pId = nullptr;
391  switch ( GetHoriOrient() )
392  {
394  {
395  rText += SwResId( STR_POS_X ) + " " +
396  ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, &rIntl ) +
397  " " + EditResId( ::GetMetricId( ePresUnit ) );
398  }
399  break;
400  case text::HoriOrientation::RIGHT:
401  pId = STR_HORI_RIGHT;
402  break;
403  case text::HoriOrientation::CENTER:
404  pId = STR_HORI_CENTER;
405  break;
406  case text::HoriOrientation::LEFT:
407  pId = STR_HORI_LEFT;
408  break;
409  case text::HoriOrientation::INSIDE:
410  pId = STR_HORI_INSIDE;
411  break;
412  case text::HoriOrientation::OUTSIDE:
413  pId = STR_HORI_OUTSIDE;
414  break;
415  case text::HoriOrientation::FULL:
416  pId = STR_HORI_FULL;
417  break;
418  default:;//prevent warning
419  }
420  if (pId)
421  rText += SwResId(pId);
422  return true;
423 }
424 
425 // FlyAnchor, Anchor of the free-flying frame
426 
428 (
429  SfxItemPresentation /*ePres*/,
430  MapUnit /*eCoreUnit*/,
431  MapUnit /*ePresUnit*/,
432  OUString& rText,
433  const IntlWrapper& /*rIntl*/
434 ) const
435 {
436  const char* pId = nullptr;
437  switch ( GetAnchorId() )
438  {
439  case RndStdIds::FLY_AT_PARA:
440  pId = STR_FLY_AT_PARA;
441  break;
442  case RndStdIds::FLY_AS_CHAR:
443  pId = STR_FLY_AS_CHAR;
444  break;
445  case RndStdIds::FLY_AT_PAGE:
446  pId = STR_FLY_AT_PAGE;
447  break;
448  default:;//prevent warning
449  }
450  if (pId)
451  rText += SwResId(pId);
452  return true;
453 }
454 
456 (
457  SfxItemPresentation /*ePres*/,
458  MapUnit /*eCoreUnit*/,
459  MapUnit /*ePresUnit*/,
460  OUString& rText,
461  const IntlWrapper& /*rIntl*/
462 ) const
463 {
464  const SwPageDesc *pPageDesc = GetPageDesc();
465  if ( pPageDesc )
466  rText = pPageDesc->GetName();
467  else
468  rText = SwResId( STR_NO_PAGEDESC );
469  return true;
470 }
471 
472 //The ColumnDescriptor
473 
475 (
476  SfxItemPresentation /*ePres*/,
477  MapUnit eCoreUnit,
478  MapUnit /*ePresUnit*/,
479  OUString& rText,
480  const IntlWrapper& rIntl
481 ) const
482 {
483  sal_uInt16 nCnt = GetNumCols();
484  if ( nCnt > 1 )
485  {
486  rText = OUString::number(nCnt) + " " + SwResId( STR_COLUMNS );
487  if ( COLADJ_NONE != GetLineAdj() )
488  {
489  const long nWdth = static_cast<long>(GetLineWidth());
490  rText += " " + SwResId( STR_LINE_WIDTH ) + " " +
491  ::GetMetricText( nWdth, eCoreUnit,
492  MapUnit::MapPoint, &rIntl );
493  }
494  }
495  else
496  rText.clear();
497  return true;
498 }
499 
500 //URL's and maps
501 
503 (
504  SfxItemPresentation /*ePres*/,
505  MapUnit /*eCoreUnit*/,
506  MapUnit /*ePresUnit*/,
507  OUString& rText,
508  const IntlWrapper& /*rIntl*/
509 ) const
510 {
511  rText.clear();
512  if ( m_pMap )
513  rText += "Client-Map";
514  if ( !m_sURL.isEmpty() )
515  {
516  if ( m_pMap )
517  rText += " - ";
518  rText += "URL: " + m_sURL;
519  if ( m_bIsServerMap )
520  rText += " (Server-Map)";
521  }
522  if ( !m_sTargetFrameName.isEmpty() )
523  {
524  rText += ", Target: " + m_sTargetFrameName;
525  }
526  return true;
527 }
528 
530 (
531  SfxItemPresentation /*ePres*/,
532  MapUnit /*eCoreUnit*/,
533  MapUnit /*ePresUnit*/,
534  OUString& rText,
535  const IntlWrapper& /*rIntl*/
536 ) const
537 {
538  rText.clear();
539  if ( GetValue() )
540  rText = SwResId(STR_EDIT_IN_READONLY);
541  return true;
542 }
543 
545 {
546  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatEditInReadonly"));
547  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
548  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
549  xmlTextWriterEndElement(pWriter);
550 }
551 
553 (
554  SfxItemPresentation /*ePres*/,
555  MapUnit /*eCoreUnit*/,
556  MapUnit /*ePresUnit*/,
557  OUString& rText,
558  const IntlWrapper& /*rIntl*/
559 ) const
560 {
561  if ( GetValue() )
562  rText = SwResId(STR_LAYOUT_SPLIT);
563  return true;
564 }
565 
567 (
568  SfxItemPresentation /*ePres*/,
569  MapUnit /*eCoreUnit*/,
570  MapUnit /*ePresUnit*/,
571  OUString& /*rText*/,
572  const IntlWrapper& /*rIntl*/
573 ) const
574 {
575  return false;
576 }
577 
579 (
580  SfxItemPresentation /*ePres*/,
581  MapUnit /*eCoreUnit*/,
582  MapUnit /*ePresUnit*/,
583  OUString& /*rText*/,
584  const IntlWrapper& /*rIntl*/
585 ) const
586 {
587  return true;
588 }
589 
591 (
592  SfxItemPresentation /*ePres*/,
593  MapUnit /*eCoreUnit*/,
594  MapUnit /*ePresUnit*/,
595  OUString& rText,
596  const IntlWrapper& /*rIntl*/
597 ) const
598 {
599  if ( GetPrev() || GetNext() )
600  {
601  rText = SwResId(STR_CONNECT1);
602  if ( GetPrev() )
603  {
604  rText += GetPrev()->GetName();
605  if ( GetNext() )
606  rText += SwResId(STR_CONNECT2);
607  }
608  if ( GetNext() )
609  rText += GetNext()->GetName();
610  }
611  return true;
612 }
613 
615 (
616  SfxItemPresentation /*ePres*/,
617  MapUnit /*eCoreUnit*/,
618  MapUnit /*ePresUnit*/,
619  OUString& rText,
620  const IntlWrapper& /*rIntl*/
621 ) const
622 {
623  if ( IsCount() )
624  rText += SwResId(STR_LINECOUNT);
625  else
626  rText += SwResId(STR_DONTLINECOUNT);
627  if ( GetStartValue() )
628  {
629  rText += " " + SwResId(STR_LINCOUNT_START) +
630  OUString::number( GetStartValue() );
631  }
632  return true;
633 }
634 
636 (
637  SfxItemPresentation /*ePres*/,
638  MapUnit /*eCoreUnit*/,
639  MapUnit /*ePresUnit*/,
640  OUString& rText,
641  const IntlWrapper& /*rIntl*/
642 ) const
643 {
644  const char* pId = nullptr;
645 
646  switch ( GetGridType() )
647  {
648  case GRID_NONE :
649  pId = STR_GRID_NONE;
650  break;
651  case GRID_LINES_ONLY :
652  pId = STR_GRID_LINES_ONLY;
653  break;
654  case GRID_LINES_CHARS :
655  pId = STR_GRID_LINES_CHARS;
656  break;
657  }
658  if (pId)
659  rText += SwResId(pId);
660  return true;
661 }
662 
664 (
665  SfxItemPresentation /*ePres*/,
666  MapUnit /*eCoreUnit*/,
667  MapUnit /*ePresUnit*/,
668  OUString& /*rText*/,
669  const IntlWrapper& /*rIntl*/
670 ) const
671 {
672  return false;
673 }
674 
675 // Graphic attributes
676 
678  SfxItemPresentation /*ePres*/, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
679  OUString& rText, const IntlWrapper& /*rIntl*/ ) const
680 {
681  const char* pId;
682  switch( GetValue() )
683  {
684  case MirrorGraph::Dont: pId = STR_NO_MIRROR; break;
685  case MirrorGraph::Vertical: pId = STR_VERT_MIRROR; break;
686  case MirrorGraph::Horizontal: pId = STR_HORI_MIRROR; break;
687  case MirrorGraph::Both: pId = STR_BOTH_MIRROR; break;
688  default: pId = nullptr; break;
689  }
690  if (pId)
691  {
692  rText = SwResId(pId);
693  if (m_bGrfToggle)
694  rText += SwResId( STR_MIRROR_TOGGLE );
695  }
696  return true;
697 }
698 
700  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
701  OUString &rText, const IntlWrapper& /*rIntl*/) const
702 {
703  if( SfxItemPresentation::Complete == ePres )
704  rText = SwResId( STR_ROTATION );
705  else if( rText.getLength() )
706  rText.clear();
707  rText += OUString::number( GetValue() ) + "\xB0";
708  return true;
709 }
710 
712  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
713  OUString &rText, const IntlWrapper& /*rIntl*/) const
714 {
715  if( SfxItemPresentation::Complete == ePres )
716  rText = SwResId( STR_LUMINANCE );
717  else if( rText.getLength() )
718  rText.clear();
719  rText += unicode::formatPercent(GetValue(),
720  Application::GetSettings().GetUILanguageTag());
721  return true;
722 }
723 
725  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
726  OUString &rText, const IntlWrapper& /*rIntl*/) const
727 {
728  if( SfxItemPresentation::Complete == ePres )
729  rText = SwResId( STR_CONTRAST );
730  else if( rText.getLength() )
731  rText.clear();
732  rText += unicode::formatPercent(GetValue(),
733  Application::GetSettings().GetUILanguageTag());
734  return true;
735 }
736 
738  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
739  OUString &rText, const IntlWrapper& /*rIntl*/) const
740 {
741  if( SfxItemPresentation::Complete == ePres )
742  {
743  const char* pId;
744  switch ( Which() )
745  {
746  case RES_GRFATR_CHANNELR: pId = STR_CHANNELR; break;
747  case RES_GRFATR_CHANNELG: pId = STR_CHANNELG; break;
748  case RES_GRFATR_CHANNELB: pId = STR_CHANNELB; break;
749  default: pId = nullptr; break;
750  }
751  if (pId)
752  rText = SwResId(pId);
753  else if( rText.getLength() )
754  rText.clear();
755  }
756  else if( rText.getLength() )
757  rText.clear();
758  rText += unicode::formatPercent(GetValue(),
759  Application::GetSettings().GetUILanguageTag());
760  return true;
761 }
762 
764  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
765  OUString &rText, const IntlWrapper& /*rIntl*/) const
766 {
767  OUStringBuffer aText;
768  if( SfxItemPresentation::Complete == ePres )
769  aText.append(SwResId(STR_GAMMA));
770  aText.append(unicode::formatPercent(GetValue(),
771  Application::GetSettings().GetUILanguageTag()));
772  rText = aText.makeStringAndClear();
773  return true;
774 }
775 
777  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
778  OUString &rText, const IntlWrapper& /*rIntl*/) const
779 {
780  rText.clear();
781  if( SfxItemPresentation::Complete == ePres )
782  {
783  const char* pId = GetValue() ? STR_INVERT : STR_INVERT_NOT;
784  rText = SwResId(pId);
785  }
786  return true;
787 }
788 
790  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
791  OUString &rText, const IntlWrapper& /*rIntl*/) const
792 {
793  if( SfxItemPresentation::Complete == ePres )
794  rText = SwResId( STR_TRANSPARENCY );
795  else if( rText.getLength() )
796  rText.clear();
797  rText += unicode::formatPercent(GetValue(),
798  Application::GetSettings().GetUILanguageTag());
799  return true;
800 }
801 
803  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
804  OUString &rText, const IntlWrapper& /*rIntl*/) const
805 {
806  rText.clear();
807  if( SfxItemPresentation::Complete == ePres )
808  {
809  const char* pId;
810  switch ( GetValue() )
811  {
812 
813  case GraphicDrawMode::Greys: pId = STR_DRAWMODE_GREY; break;
814  case GraphicDrawMode::Mono: pId = STR_DRAWMODE_BLACKWHITE; break;
815  case GraphicDrawMode::Watermark: pId = STR_DRAWMODE_WATERMARK; break;
816  default: pId = STR_DRAWMODE_STD; break;
817  }
818  rText = SwResId( STR_DRAWMODE ) + SwResId(pId);
819  }
820  return true;
821 }
822 
824  MapUnit /*eCoreMetric*/,
825  MapUnit /*ePresMetric*/,
826  OUString &rText,
827  const IntlWrapper& /*rIntl*/ ) const
828 {
829  rText.clear();
830  if( SfxItemPresentation::Complete == ePres )
831  {
832  const char* pId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW;
833  rText = SwResId(pId);
834  }
835  return true;
836 }
837 
839 {
840  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFollowTextFlow"));
841  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
842  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
843  xmlTextWriterEndElement(pWriter);
844 }
845 
846 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:428
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:111
std::string GetValue
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:567
static const AllSettings & GetSettings()
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:124
#define RES_GRFATR_CHANNELB
Definition: hintids.hxx:249
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:172
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:711
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:802
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:579
const OUString & GetName() const
Definition: pagedesc.hxx:187
const SfxPoolItem * NextItem()
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:261
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:475
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:553
OUString m_sURL
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:530
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:591
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:145
struct _xmlTextWriter * xmlTextWriterPtr
SfxItemPresentation
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:382
#define RES_GRFATR_CHANNELG
Definition: hintids.hxx:248
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:737
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:823
Count
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrdesc.cxx:838
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:503
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:636
void GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText) const
Get attribute-description. Returns passed string.
Definition: format.hxx:153
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:456
const char * GetMetricId(MapUnit eUnit)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:219
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:615
void GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText) const
Definition: attrdesc.cxx:65
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:789
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:203
OUString EditResId(const char *pId)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:724
#define RES_GRFATR_CHANNELR
Definition: hintids.hxx:247
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:186
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:90
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:278
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:763
MapUnit
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:677
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:664
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:136
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrdesc.cxx:544
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:292
Frame is variable in Var-direction.
Definition: fmtfsize.hxx:37
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:699
aStr
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:776
const SfxPoolItem * GetCurItem() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:336