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