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 <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 ) +
194  "(" + GetValue() + ")";
195  else
196  rText = SwResId( STR_NUMRULE_OFF );
197  return true;
198 }
199 
201 (
202  SfxItemPresentation /*ePres*/,
203  MapUnit /*eCoreUnit*/,
204  MapUnit /*ePresUnit*/,
205  OUString& rText,
206  const IntlWrapper& /*rIntl*/
207 ) const
208 {
209  const char* pId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF;
210  rText = SwResId(pId);
211  return true;
212 }
213 
214 // Frame attribute
215 
217 (
218  SfxItemPresentation /*ePres*/,
219  MapUnit eCoreUnit,
220  MapUnit ePresUnit,
221  OUString& rText,
222  const IntlWrapper& rIntl
223 ) const
224 {
225  rText = SwResId( STR_FRM_WIDTH ) + " ";
226  if ( GetWidthPercent() )
227  {
228  rText += unicode::formatPercent(GetWidthPercent(),
229  Application::GetSettings().GetUILanguageTag());
230  }
231  else
232  {
233  rText += ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, &rIntl ) +
234  " " + ::EditResId( ::GetMetricId( ePresUnit ) );
235  }
236  if ( SwFrameSize::Variable != GetHeightSizeType() )
237  {
238  const char* pId = SwFrameSize::Fixed == m_eFrameHeightType ?
239  STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT;
240  rText += ", " + SwResId(pId) + " ";
241  if ( GetHeightPercent() )
242  {
243  rText += unicode::formatPercent(GetHeightPercent(),
244  Application::GetSettings().GetUILanguageTag());
245  }
246  else
247  {
248  rText = ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, &rIntl ) +
249  " " + EditResId( ::GetMetricId( ePresUnit ) );
250  }
251  }
252  return true;
253 }
254 
255 //Header for page formats.
256 //Client of FrameFormat which describes the header.
257 
259 (
260  SfxItemPresentation /*ePres*/,
261  MapUnit /*eCoreUnit*/,
262  MapUnit /*ePresUnit*/,
263  OUString& rText,
264  const IntlWrapper& /*rIntl*/
265 ) const
266 {
267  const char* pId = GetHeaderFormat() ? STR_HEADER : STR_NO_HEADER;
268  rText = SwResId(pId);
269  return true;
270 }
271 
272 //Footer for page formats.
273 //Client of FrameFormat which describes the footer.
274 
276 (
277  SfxItemPresentation /*ePres*/,
278  MapUnit /*eCoreUnit*/,
279  MapUnit /*ePresUnit*/,
280  OUString& rText,
281  const IntlWrapper& /*rIntl*/
282 ) const
283 {
284  const char* pId = GetFooterFormat() ? STR_FOOTER : STR_NO_FOOTER;
285  rText = SwResId(pId);
286  return true;
287 }
288 
290 (
291  SfxItemPresentation /*ePres*/,
292  MapUnit /*eCoreUnit*/,
293  MapUnit /*ePresUnit*/,
294  OUString& rText,
295  const IntlWrapper& /*rIntl*/
296 ) const
297 {
298  const char* pId = nullptr;
299  switch ( GetValue() )
300  {
301  case css::text::WrapTextMode_NONE:
302  pId = STR_SURROUND_NONE;
303  break;
304  case css::text::WrapTextMode_THROUGH:
305  pId = STR_SURROUND_THROUGH;
306  break;
307  case css::text::WrapTextMode_PARALLEL:
308  pId = STR_SURROUND_PARALLEL;
309  break;
310  case css::text::WrapTextMode_DYNAMIC:
311  pId = STR_SURROUND_IDEAL;
312  break;
313  case css::text::WrapTextMode_LEFT:
314  pId = STR_SURROUND_LEFT;
315  break;
316  case css::text::WrapTextMode_RIGHT:
317  pId = STR_SURROUND_RIGHT;
318  break;
319  default:;//prevent warning
320  }
321  if (pId)
322  rText = SwResId(pId);
323 
324  if ( IsAnchorOnly() )
325  {
326  rText += " " + SwResId( STR_SURROUND_ANCHORONLY );
327  }
328  return true;
329 }
330 
331 //VertOrientation, how and by what orientate the FlyFrame in the vertical?
332 
334 (
335  SfxItemPresentation /*ePres*/,
336  MapUnit eCoreUnit,
337  MapUnit ePresUnit,
338  OUString& rText,
339  const IntlWrapper& rIntl
340 ) const
341 {
342  const char* pId = nullptr;
343  switch ( GetVertOrient() )
344  {
346  {
347  rText += SwResId( STR_POS_Y ) + " " +
348  ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, &rIntl ) +
349  " " + EditResId( ::GetMetricId( ePresUnit ) );
350  }
351  break;
352  case text::VertOrientation::TOP:
353  pId = STR_VERT_TOP;
354  break;
355  case text::VertOrientation::CENTER:
356  pId = STR_VERT_CENTER;
357  break;
358  case text::VertOrientation::BOTTOM:
359  pId = STR_VERT_BOTTOM;
360  break;
361  case text::VertOrientation::LINE_TOP:
362  pId = STR_LINE_TOP;
363  break;
364  case text::VertOrientation::LINE_CENTER:
365  pId = STR_LINE_CENTER;
366  break;
367  case text::VertOrientation::LINE_BOTTOM:
368  pId = STR_LINE_BOTTOM;
369  break;
370  default:;//prevent warning
371  }
372  if (pId)
373  rText += SwResId(pId);
374  return true;
375 }
376 
377 //HoriOrientation, how and by what orientate the FlyFrame in the horizontal?
378 
380 (
381  SfxItemPresentation /*ePres*/,
382  MapUnit eCoreUnit,
383  MapUnit ePresUnit,
384  OUString& rText,
385  const IntlWrapper& rIntl
386 ) const
387 {
388  const char* pId = nullptr;
389  switch ( GetHoriOrient() )
390  {
392  {
393  rText += SwResId( STR_POS_X ) + " " +
394  ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, &rIntl ) +
395  " " + EditResId( ::GetMetricId( ePresUnit ) );
396  }
397  break;
398  case text::HoriOrientation::RIGHT:
399  pId = STR_HORI_RIGHT;
400  break;
401  case text::HoriOrientation::CENTER:
402  pId = STR_HORI_CENTER;
403  break;
404  case text::HoriOrientation::LEFT:
405  pId = STR_HORI_LEFT;
406  break;
407  case text::HoriOrientation::INSIDE:
408  pId = STR_HORI_INSIDE;
409  break;
410  case text::HoriOrientation::OUTSIDE:
411  pId = STR_HORI_OUTSIDE;
412  break;
413  case text::HoriOrientation::FULL:
414  pId = STR_HORI_FULL;
415  break;
416  default:;//prevent warning
417  }
418  if (pId)
419  rText += SwResId(pId);
420  return true;
421 }
422 
423 // FlyAnchor, Anchor of the free-flying frame
424 
426 (
427  SfxItemPresentation /*ePres*/,
428  MapUnit /*eCoreUnit*/,
429  MapUnit /*ePresUnit*/,
430  OUString& rText,
431  const IntlWrapper& /*rIntl*/
432 ) const
433 {
434  const char* pId = nullptr;
435  switch ( GetAnchorId() )
436  {
437  case RndStdIds::FLY_AT_PARA:
438  pId = STR_FLY_AT_PARA;
439  break;
440  case RndStdIds::FLY_AS_CHAR:
441  pId = STR_FLY_AS_CHAR;
442  break;
443  case RndStdIds::FLY_AT_PAGE:
444  pId = STR_FLY_AT_PAGE;
445  break;
446  default:;//prevent warning
447  }
448  if (pId)
449  rText += SwResId(pId);
450  return true;
451 }
452 
454 (
455  SfxItemPresentation /*ePres*/,
456  MapUnit /*eCoreUnit*/,
457  MapUnit /*ePresUnit*/,
458  OUString& rText,
459  const IntlWrapper& /*rIntl*/
460 ) const
461 {
462  const SwPageDesc *pPageDesc = GetPageDesc();
463  if ( pPageDesc )
464  rText = pPageDesc->GetName();
465  else
466  rText = SwResId( STR_NO_PAGEDESC );
467  return true;
468 }
469 
470 //The ColumnDescriptor
471 
473 (
474  SfxItemPresentation /*ePres*/,
475  MapUnit eCoreUnit,
476  MapUnit /*ePresUnit*/,
477  OUString& rText,
478  const IntlWrapper& rIntl
479 ) const
480 {
481  sal_uInt16 nCnt = GetNumCols();
482  if ( nCnt > 1 )
483  {
484  rText = OUString::number(nCnt) + " " + SwResId( STR_COLUMNS );
485  if ( COLADJ_NONE != GetLineAdj() )
486  {
487  const tools::Long nWdth = static_cast<tools::Long>(GetLineWidth());
488  rText += " " + SwResId( STR_LINE_WIDTH ) + " " +
489  ::GetMetricText( nWdth, eCoreUnit,
490  MapUnit::MapPoint, &rIntl );
491  }
492  }
493  else
494  rText.clear();
495  return true;
496 }
497 
498 //URL's and maps
499 
501 (
502  SfxItemPresentation /*ePres*/,
503  MapUnit /*eCoreUnit*/,
504  MapUnit /*ePresUnit*/,
505  OUString& rText,
506  const IntlWrapper& /*rIntl*/
507 ) const
508 {
509  rText.clear();
510  if ( m_pMap )
511  rText += "Client-Map";
512  if ( !m_sURL.isEmpty() )
513  {
514  if ( m_pMap )
515  rText += " - ";
516  rText += "URL: " + m_sURL;
517  if ( m_bIsServerMap )
518  rText += " (Server-Map)";
519  }
520  if ( !m_sTargetFrameName.isEmpty() )
521  {
522  rText += ", Target: " + m_sTargetFrameName;
523  }
524  return true;
525 }
526 
528 (
529  SfxItemPresentation /*ePres*/,
530  MapUnit /*eCoreUnit*/,
531  MapUnit /*ePresUnit*/,
532  OUString& rText,
533  const IntlWrapper& /*rIntl*/
534 ) const
535 {
536  rText.clear();
537  if ( GetValue() )
538  rText = SwResId(STR_EDIT_IN_READONLY);
539  return true;
540 }
541 
543 {
544  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatEditInReadonly"));
545  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
546  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
547  xmlTextWriterEndElement(pWriter);
548 }
549 
551 (
552  SfxItemPresentation /*ePres*/,
553  MapUnit /*eCoreUnit*/,
554  MapUnit /*ePresUnit*/,
555  OUString& rText,
556  const IntlWrapper& /*rIntl*/
557 ) const
558 {
559  if ( GetValue() )
560  rText = SwResId(STR_LAYOUT_SPLIT);
561  return true;
562 }
563 
565 (
566  SfxItemPresentation /*ePres*/,
567  MapUnit /*eCoreUnit*/,
568  MapUnit /*ePresUnit*/,
569  OUString& /*rText*/,
570  const IntlWrapper& /*rIntl*/
571 ) const
572 {
573  return false;
574 }
575 
577 (
578  SfxItemPresentation /*ePres*/,
579  MapUnit /*eCoreUnit*/,
580  MapUnit /*ePresUnit*/,
581  OUString& /*rText*/,
582  const IntlWrapper& /*rIntl*/
583 ) const
584 {
585  return true;
586 }
587 
589 (
590  SfxItemPresentation /*ePres*/,
591  MapUnit /*eCoreUnit*/,
592  MapUnit /*ePresUnit*/,
593  OUString& rText,
594  const IntlWrapper& /*rIntl*/
595 ) const
596 {
597  if ( GetPrev() || GetNext() )
598  {
599  rText = SwResId(STR_CONNECT1);
600  if ( GetPrev() )
601  {
602  rText += GetPrev()->GetName();
603  if ( GetNext() )
604  rText += SwResId(STR_CONNECT2);
605  }
606  if ( GetNext() )
607  rText += GetNext()->GetName();
608  }
609  return true;
610 }
611 
613 (
614  SfxItemPresentation /*ePres*/,
615  MapUnit /*eCoreUnit*/,
616  MapUnit /*ePresUnit*/,
617  OUString& rText,
618  const IntlWrapper& /*rIntl*/
619 ) const
620 {
621  if ( IsCount() )
622  rText += SwResId(STR_LINECOUNT);
623  else
624  rText += SwResId(STR_DONTLINECOUNT);
625  if ( GetStartValue() )
626  {
627  rText += " " + SwResId(STR_LINCOUNT_START) +
628  OUString::number( GetStartValue() );
629  }
630  return true;
631 }
632 
634 (
635  SfxItemPresentation /*ePres*/,
636  MapUnit /*eCoreUnit*/,
637  MapUnit /*ePresUnit*/,
638  OUString& rText,
639  const IntlWrapper& /*rIntl*/
640 ) const
641 {
642  const char* pId = nullptr;
643 
644  switch ( GetGridType() )
645  {
646  case GRID_NONE :
647  pId = STR_GRID_NONE;
648  break;
649  case GRID_LINES_ONLY :
650  pId = STR_GRID_LINES_ONLY;
651  break;
652  case GRID_LINES_CHARS :
653  pId = STR_GRID_LINES_CHARS;
654  break;
655  }
656  if (pId)
657  rText += SwResId(pId);
658  return true;
659 }
660 
662 (
663  SfxItemPresentation /*ePres*/,
664  MapUnit /*eCoreUnit*/,
665  MapUnit /*ePresUnit*/,
666  OUString& /*rText*/,
667  const IntlWrapper& /*rIntl*/
668 ) const
669 {
670  return false;
671 }
672 
673 // Graphic attributes
674 
676  SfxItemPresentation /*ePres*/, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
677  OUString& rText, const IntlWrapper& /*rIntl*/ ) const
678 {
679  const char* pId;
680  switch( GetValue() )
681  {
682  case MirrorGraph::Dont: pId = STR_NO_MIRROR; break;
683  case MirrorGraph::Vertical: pId = STR_VERT_MIRROR; break;
684  case MirrorGraph::Horizontal: pId = STR_HORI_MIRROR; break;
685  case MirrorGraph::Both: pId = STR_BOTH_MIRROR; break;
686  default: pId = nullptr; break;
687  }
688  if (pId)
689  {
690  rText = SwResId(pId);
691  if (m_bGrfToggle)
692  rText += SwResId( STR_MIRROR_TOGGLE );
693  }
694  return true;
695 }
696 
698  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
699  OUString &rText, const IntlWrapper& /*rIntl*/) const
700 {
701  if( SfxItemPresentation::Complete == ePres )
702  rText = SwResId( STR_ROTATION );
703  else if( rText.getLength() )
704  rText.clear();
705  rText += OUString::number( GetValue() ) + "\xB0";
706  return true;
707 }
708 
710  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
711  OUString &rText, const IntlWrapper& /*rIntl*/) const
712 {
713  if( SfxItemPresentation::Complete == ePres )
714  rText = SwResId( STR_LUMINANCE );
715  else if( rText.getLength() )
716  rText.clear();
717  rText += unicode::formatPercent(GetValue(),
718  Application::GetSettings().GetUILanguageTag());
719  return true;
720 }
721 
723  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
724  OUString &rText, const IntlWrapper& /*rIntl*/) const
725 {
726  if( SfxItemPresentation::Complete == ePres )
727  rText = SwResId( STR_CONTRAST );
728  else if( rText.getLength() )
729  rText.clear();
730  rText += unicode::formatPercent(GetValue(),
731  Application::GetSettings().GetUILanguageTag());
732  return true;
733 }
734 
736  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
737  OUString &rText, const IntlWrapper& /*rIntl*/) const
738 {
739  if( SfxItemPresentation::Complete == ePres )
740  {
741  const char* pId;
742  switch ( Which() )
743  {
744  case RES_GRFATR_CHANNELR: pId = STR_CHANNELR; break;
745  case RES_GRFATR_CHANNELG: pId = STR_CHANNELG; break;
746  case RES_GRFATR_CHANNELB: pId = STR_CHANNELB; break;
747  default: pId = nullptr; break;
748  }
749  if (pId)
750  rText = SwResId(pId);
751  else if( rText.getLength() )
752  rText.clear();
753  }
754  else if( rText.getLength() )
755  rText.clear();
756  rText += unicode::formatPercent(GetValue(),
757  Application::GetSettings().GetUILanguageTag());
758  return true;
759 }
760 
762  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
763  OUString &rText, const IntlWrapper& /*rIntl*/) const
764 {
765  OUStringBuffer aText;
766  if( SfxItemPresentation::Complete == ePres )
767  aText.append(SwResId(STR_GAMMA));
768  aText.append(unicode::formatPercent(GetValue(),
769  Application::GetSettings().GetUILanguageTag()));
770  rText = aText.makeStringAndClear();
771  return true;
772 }
773 
775  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
776  OUString &rText, const IntlWrapper& /*rIntl*/) const
777 {
778  rText.clear();
779  if( SfxItemPresentation::Complete == ePres )
780  {
781  const char* pId = GetValue() ? STR_INVERT : STR_INVERT_NOT;
782  rText = SwResId(pId);
783  }
784  return true;
785 }
786 
788  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
789  OUString &rText, const IntlWrapper& /*rIntl*/) const
790 {
791  if( SfxItemPresentation::Complete == ePres )
792  rText = SwResId( STR_TRANSPARENCY );
793  else if( rText.getLength() )
794  rText.clear();
795  rText += unicode::formatPercent(GetValue(),
796  Application::GetSettings().GetUILanguageTag());
797  return true;
798 }
799 
801  SfxItemPresentation ePres, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
802  OUString &rText, const IntlWrapper& /*rIntl*/) const
803 {
804  rText.clear();
805  if( SfxItemPresentation::Complete == ePres )
806  {
807  const char* pId;
808  switch ( GetValue() )
809  {
810 
811  case GraphicDrawMode::Greys: pId = STR_DRAWMODE_GREY; break;
812  case GraphicDrawMode::Mono: pId = STR_DRAWMODE_BLACKWHITE; break;
813  case GraphicDrawMode::Watermark: pId = STR_DRAWMODE_WATERMARK; break;
814  default: pId = STR_DRAWMODE_STD; break;
815  }
816  rText = SwResId( STR_DRAWMODE ) + SwResId(pId);
817  }
818  return true;
819 }
820 
822  MapUnit /*eCoreMetric*/,
823  MapUnit /*ePresMetric*/,
824  OUString &rText,
825  const IntlWrapper& /*rIntl*/ ) const
826 {
827  rText.clear();
828  if( SfxItemPresentation::Complete == ePres )
829  {
830  const char* pId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW;
831  rText = SwResId(pId);
832  }
833  return true;
834 }
835 
837 {
838  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFollowTextFlow"));
839  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
840  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
841  xmlTextWriterEndElement(pWriter);
842 }
843 
844 /* 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:426
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:565
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
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:709
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:800
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:577
const OUString & GetName() const
Definition: pagedesc.hxx:186
constexpr TypedWhichId< SwChannelBGrf > RES_GRFATR_CHANNELB(138)
const SfxPoolItem * NextItem()
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:259
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:473
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:551
OUString m_sURL
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:528
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:589
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:143
struct _xmlTextWriter * xmlTextWriterPtr
SfxItemPresentation
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:380
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:735
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:821
Count
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrdesc.cxx:836
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:501
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:634
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:165
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:454
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:217
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:613
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:787
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:201
constexpr TypedWhichId< SwChannelRGrf > RES_GRFATR_CHANNELR(136)
OUString EditResId(const char *pId)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:722
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:276
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:761
constexpr TypedWhichId< SwChannelGGrf > RES_GRFATR_CHANNELG(137)
MapUnit
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:675
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:662
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:542
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:290
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:697
aStr
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:774
const SfxPoolItem * GetCurItem() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:334