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