bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / utlui / attrdesc.cxx
blob4c2e5d57206631a3bc03addc02e58b5b210af512
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svl/itemiter.hxx>
21 #include <vcl/svapp.hxx>
22 #include <editeng/itemtype.hxx>
23 #include <svtools/grfmgr.hxx>
24 #include <unotools/intlwrapper.hxx>
25 #include <comphelper/processfactory.hxx>
26 #include <rtl/ustrbuf.hxx>
27 #include <fmtanchr.hxx>
28 #include <fmtfsize.hxx>
29 #include <fmtinfmt.hxx>
30 #include <fchrfmt.hxx>
31 #include <fmtautofmt.hxx>
32 #include <fmtsrnd.hxx>
33 #include <fmtornt.hxx>
34 #include <fmtlsplt.hxx>
35 #include <fmtrowsplt.hxx>
36 #include <fmtpdsc.hxx>
37 #include <fmtclds.hxx>
38 #include <fmteiro.hxx>
39 #include <fmturl.hxx>
40 #include <fmthdft.hxx>
41 #include <fmtcnct.hxx>
42 #include <fmtline.hxx>
43 #include <tgrditem.hxx>
44 #include <hfspacingitem.hxx>
45 #include <fmtruby.hxx>
46 #include <paratr.hxx>
47 #include <grfatr.hxx>
48 #include <pagedesc.hxx>
49 #include <charfmt.hxx>
50 #include <fmtcol.hxx>
51 #include <tox.hxx>
52 #include <attrdesc.hrc>
53 #include <fmtftntx.hxx>
54 #include <fmtfollowtextflow.hxx>
56 using namespace com::sun::star;
58 TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient);
60 // query the attribute descriptions
61 void SwAttrSet::GetPresentation(
62 SfxItemPresentation ePres,
63 SfxMapUnit eCoreMetric,
64 SfxMapUnit ePresMetric,
65 OUString &rText ) const
67 static sal_Char const sComma[] = ", ";
69 rText = OUString();
70 OUString aStr;
71 if( Count() )
73 SfxItemIter aIter( *this );
74 const IntlWrapper rInt( ::comphelper::getProcessComponentContext(),
75 GetAppLanguageTag() );
76 while( true )
78 aIter.GetCurItem()->GetPresentation( ePres, eCoreMetric,
79 ePresMetric, aStr,
80 &rInt );
81 if( rText.getLength() && aStr.getLength() )
82 rText += OUString(sComma);
83 rText += aStr;
84 if( aIter.IsAtEnd() )
85 break;
86 aIter.NextItem();
91 SfxItemPresentation SwFmtCharFmt::GetPresentation
93 SfxItemPresentation ePres,
94 SfxMapUnit eCoreUnit,
95 SfxMapUnit ePresUnit,
96 OUString& rText,
97 const IntlWrapper* /*pIntl*/
98 ) const
100 switch ( ePres )
102 case SFX_ITEM_PRESENTATION_NONE:
103 rText = OUString();
104 break;
105 case SFX_ITEM_PRESENTATION_NAMELESS:
106 case SFX_ITEM_PRESENTATION_COMPLETE:
108 const SwCharFmt *pCharFmt = GetCharFmt();
109 if ( pCharFmt )
111 OUString aStr;
112 rText = OUString( SW_RESSTR( STR_CHARFMT ) );
113 pCharFmt->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr );
114 rText = rText + "(" + aStr + ")";
116 else
117 rText = OUString( SW_RESSTR( STR_NO_CHARFMT ) );
118 return ePres;
120 default:;//prevent warning
122 return SFX_ITEM_PRESENTATION_NONE;
125 SfxItemPresentation SwFmtAutoFmt::GetPresentation
127 SfxItemPresentation ePres,
128 SfxMapUnit /*eCoreUnit*/,
129 SfxMapUnit /*ePresUnit*/,
130 OUString& rText,
131 const IntlWrapper* /*pIntl*/
132 ) const
134 switch ( ePres )
136 case SFX_ITEM_PRESENTATION_NONE:
137 rText = OUString();
138 break;
139 case SFX_ITEM_PRESENTATION_NAMELESS:
140 case SFX_ITEM_PRESENTATION_COMPLETE:
142 rText = OUString(); //TODO
143 return ePres;
145 default:;//prevent warning
147 return SFX_ITEM_PRESENTATION_NONE;
150 SfxItemPresentation SwFmtINetFmt::GetPresentation
152 SfxItemPresentation ePres,
153 SfxMapUnit /*eCoreUnit*/,
154 SfxMapUnit /*ePresUnit*/,
155 OUString& rText,
156 const IntlWrapper* /*pIntl*/
157 ) const
159 switch ( ePres )
161 case SFX_ITEM_PRESENTATION_NONE:
162 rText = OUString();
163 break;
164 case SFX_ITEM_PRESENTATION_NAMELESS:
165 case SFX_ITEM_PRESENTATION_COMPLETE:
167 rText = GetValue();
168 return ePres;
170 default:;//prevent warning
172 return SFX_ITEM_PRESENTATION_NONE;
175 SfxItemPresentation SwFmtRuby::GetPresentation( SfxItemPresentation ePres,
176 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
177 OUString &rText, const IntlWrapper* /*pIntl*/ ) const
179 switch ( ePres )
181 case SFX_ITEM_PRESENTATION_NONE:
182 rText = OUString();
183 break;
184 case SFX_ITEM_PRESENTATION_NAMELESS:
185 case SFX_ITEM_PRESENTATION_COMPLETE:
187 rText = aEmptyStr;
188 return ePres;
190 default:;//prevent warning
192 return SFX_ITEM_PRESENTATION_NONE;
195 SfxItemPresentation SwFmtDrop::GetPresentation
197 SfxItemPresentation ePres,
198 SfxMapUnit /*eCoreUnit*/,
199 SfxMapUnit /*ePresUnit*/,
200 OUString& rText,
201 const IntlWrapper* /*pIntl*/
202 ) const
204 rText = OUString();
205 switch ( ePres )
207 case SFX_ITEM_PRESENTATION_NONE:
208 break;
209 case SFX_ITEM_PRESENTATION_NAMELESS:
210 case SFX_ITEM_PRESENTATION_COMPLETE:
212 if ( GetLines() > 1 )
214 if ( GetChars() > 1 )
216 rText = OUString::valueOf( GetChars() ) + " ";
218 rText = rText +
219 OUString( SW_RESSTR( STR_DROP_OVER ) ) +
220 " " +
221 OUString::valueOf( GetLines() ) +
222 " " +
223 OUString( SW_RESSTR( STR_DROP_LINES ) );
225 else
226 rText = SW_RESSTR( STR_NO_DROP_LINES );
227 return ePres;
229 default:;//prevent warning
231 return SFX_ITEM_PRESENTATION_NONE;
234 SfxItemPresentation SwRegisterItem::GetPresentation
236 SfxItemPresentation ePres,
237 SfxMapUnit /*eCoreUnit*/,
238 SfxMapUnit /*ePresUnit*/,
239 OUString& rText,
240 const IntlWrapper* /*pIntl*/
241 ) const
243 switch ( ePres )
245 case SFX_ITEM_PRESENTATION_NONE:
246 rText = OUString();
247 return SFX_ITEM_PRESENTATION_NONE;
248 case SFX_ITEM_PRESENTATION_NAMELESS:
249 case SFX_ITEM_PRESENTATION_COMPLETE:
251 sal_uInt16 nId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF;
252 rText = SW_RESSTR( nId );
253 return ePres;
255 default:;//prevent warning
257 return SFX_ITEM_PRESENTATION_NONE;
260 SfxItemPresentation SwNumRuleItem::GetPresentation
262 SfxItemPresentation ePres,
263 SfxMapUnit /*eCoreUnit*/,
264 SfxMapUnit /*ePresUnit*/,
265 OUString& rText,
266 const IntlWrapper* /*pIntl*/
267 ) const
269 switch ( ePres )
271 case SFX_ITEM_PRESENTATION_NONE:
272 rText = OUString();
273 return SFX_ITEM_PRESENTATION_NONE;
274 case SFX_ITEM_PRESENTATION_NAMELESS:
275 case SFX_ITEM_PRESENTATION_COMPLETE:
277 if( !GetValue().isEmpty() )
278 rText = SW_RESSTR( STR_NUMRULE_ON ) +
279 "(" + GetValue() + ")";
280 else
281 rText = SW_RESSTR( STR_NUMRULE_OFF );
282 return ePres;
284 default:;//prevent warning
286 return SFX_ITEM_PRESENTATION_NONE;
289 SfxItemPresentation SwParaConnectBorderItem::GetPresentation
291 SfxItemPresentation ePres,
292 SfxMapUnit /*eCoreUnit*/,
293 SfxMapUnit /*ePresUnit*/,
294 OUString& rText,
295 const IntlWrapper* /*pIntl*/
296 ) const
298 switch ( ePres )
300 case SFX_ITEM_PRESENTATION_NONE:
301 rText = OUString();
302 return SFX_ITEM_PRESENTATION_NONE;
303 case SFX_ITEM_PRESENTATION_NAMELESS:
304 case SFX_ITEM_PRESENTATION_COMPLETE:
306 sal_uInt16 nId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF;
307 rText = SW_RESSTR( nId );
308 return ePres;
310 default:;//prevent warning
312 return SFX_ITEM_PRESENTATION_NONE;
315 // Frame attribute
317 SfxItemPresentation SwFmtFrmSize::GetPresentation
319 SfxItemPresentation ePres,
320 SfxMapUnit eCoreUnit,
321 SfxMapUnit ePresUnit,
322 OUString& rText,
323 const IntlWrapper* pIntl
324 ) const
326 switch ( ePres )
328 case SFX_ITEM_PRESENTATION_NONE:
330 rText = OUString();
331 break;
333 case SFX_ITEM_PRESENTATION_NAMELESS:
334 case SFX_ITEM_PRESENTATION_COMPLETE:
336 rText = SW_RESSTR( STR_FRM_WIDTH ) + " ";
337 if ( GetWidthPercent() )
339 rText = rText + OUString::valueOf(GetWidthPercent()) + "%";
341 else
343 rText = rText + ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl ) + ::GetSvxString( ::GetMetricId( ePresUnit ) );
345 if ( ATT_VAR_SIZE != GetHeightSizeType() )
347 const sal_uInt16 nId = ATT_FIX_SIZE == eFrmHeightType ?
348 STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT;
349 rText = rText + ", " + SW_RESSTR( nId ) + " ";
350 if ( GetHeightPercent() )
352 rText = rText + OUString::valueOf(GetHeightPercent()) + "%";
354 else
356 rText = OUString( ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl ) ) +
357 ::GetSvxString( ::GetMetricId( ePresUnit ) );
360 return ePres;
362 default:;//prevent warning
364 return SFX_ITEM_PRESENTATION_NONE;
367 //Header for page formats.
368 //Client of FrmFmt which describes the header.
370 SfxItemPresentation SwFmtHeader::GetPresentation
372 SfxItemPresentation ePres,
373 SfxMapUnit /*eCoreUnit*/,
374 SfxMapUnit /*ePresUnit*/,
375 OUString& rText,
376 const IntlWrapper* /*pIntl*/
377 ) const
379 switch ( ePres )
381 case SFX_ITEM_PRESENTATION_NONE:
382 rText = OUString();
383 break;
384 case SFX_ITEM_PRESENTATION_NAMELESS:
385 case SFX_ITEM_PRESENTATION_COMPLETE:
387 const sal_uInt16 nId = GetHeaderFmt() ? STR_HEADER : STR_NO_HEADER;
388 rText = SW_RESSTR( nId );
389 return ePres;
391 default:;//prevent warning
393 return SFX_ITEM_PRESENTATION_NONE;
396 //Footer for page formats.
397 //Client of FrmFmt which describes the footer.
399 SfxItemPresentation SwFmtFooter::GetPresentation
401 SfxItemPresentation ePres,
402 SfxMapUnit /*eCoreUnit*/,
403 SfxMapUnit /*ePresUnit*/,
404 OUString& rText,
405 const IntlWrapper* /*pIntl*/
406 ) const
408 switch ( ePres )
410 case SFX_ITEM_PRESENTATION_NONE:
411 rText = OUString();
412 break;
413 case SFX_ITEM_PRESENTATION_NAMELESS:
414 case SFX_ITEM_PRESENTATION_COMPLETE:
416 const sal_uInt16 nId = GetFooterFmt() ? STR_FOOTER : STR_NO_FOOTER;
417 rText = SW_RESSTR( nId );
418 return ePres;
420 default:;//prevent warning
422 return SFX_ITEM_PRESENTATION_NONE;
425 SfxItemPresentation SwFmtSurround::GetPresentation
427 SfxItemPresentation ePres,
428 SfxMapUnit /*eCoreUnit*/,
429 SfxMapUnit /*ePresUnit*/,
430 OUString& rText,
431 const IntlWrapper* /*pIntl*/
432 ) const
434 switch ( ePres )
436 case SFX_ITEM_PRESENTATION_NONE:
437 rText = OUString();
438 break;
439 case SFX_ITEM_PRESENTATION_NAMELESS:
440 case SFX_ITEM_PRESENTATION_COMPLETE:
442 sal_uInt16 nId = 0;
443 switch ( (SwSurround)GetValue() )
445 case SURROUND_NONE:
446 nId = STR_SURROUND_NONE;
447 break;
448 case SURROUND_THROUGHT:
449 nId = STR_SURROUND_THROUGHT;
450 break;
451 case SURROUND_PARALLEL:
452 nId = STR_SURROUND_PARALLEL;
453 break;
454 case SURROUND_IDEAL:
455 nId = STR_SURROUND_IDEAL;
456 break;
457 case SURROUND_LEFT:
458 nId = STR_SURROUND_LEFT;
459 break;
460 case SURROUND_RIGHT:
461 nId = STR_SURROUND_RIGHT;
462 break;
463 default:;//prevent warning
465 if ( nId )
466 rText = SW_RESSTR( nId );
468 if ( IsAnchorOnly() )
470 rText = rText + " " + SW_RESSTR( STR_SURROUND_ANCHORONLY );
472 return ePres;
474 default:;//prevent warning
476 return SFX_ITEM_PRESENTATION_NONE;
479 //VertOrientation, how and by what orientate the FlyFrm in the vertical?
481 SfxItemPresentation SwFmtVertOrient::GetPresentation
483 SfxItemPresentation ePres,
484 SfxMapUnit eCoreUnit,
485 SfxMapUnit ePresUnit,
486 OUString& rText,
487 const IntlWrapper* pIntl
488 ) const
490 switch ( ePres )
492 case SFX_ITEM_PRESENTATION_NONE:
493 rText = OUString();
494 break;
495 case SFX_ITEM_PRESENTATION_NAMELESS:
496 case SFX_ITEM_PRESENTATION_COMPLETE:
498 sal_uInt16 nId = 0;
499 switch ( GetVertOrient() )
501 case text::VertOrientation::NONE:
503 rText = rText + SW_RESSTR( STR_POS_Y ) + " " +
504 ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) +
505 ::GetSvxString( ::GetMetricId( ePresUnit ) );
507 break;
508 case text::VertOrientation::TOP:
509 nId = STR_VERT_TOP;
510 break;
511 case text::VertOrientation::CENTER:
512 nId = STR_VERT_CENTER;
513 break;
514 case text::VertOrientation::BOTTOM:
515 nId = STR_VERT_BOTTOM;
516 break;
517 case text::VertOrientation::LINE_TOP:
518 nId = STR_LINE_TOP;
519 break;
520 case text::VertOrientation::LINE_CENTER:
521 nId = STR_LINE_CENTER;
522 break;
523 case text::VertOrientation::LINE_BOTTOM:
524 nId = STR_LINE_BOTTOM;
525 break;
526 default:;//prevent warning
528 if ( nId )
529 rText += SW_RESSTR( nId );
530 return ePres;
532 default:;//prevent warning
534 return SFX_ITEM_PRESENTATION_NONE;
537 //HoriOrientation, how and by what orientate the FlyFrm in the horizontal?
539 SfxItemPresentation SwFmtHoriOrient::GetPresentation
541 SfxItemPresentation ePres,
542 SfxMapUnit eCoreUnit,
543 SfxMapUnit ePresUnit,
544 OUString& rText,
545 const IntlWrapper* pIntl
546 ) const
548 switch ( ePres )
550 case SFX_ITEM_PRESENTATION_NONE:
551 rText = OUString();
552 break;
553 case SFX_ITEM_PRESENTATION_NAMELESS:
554 case SFX_ITEM_PRESENTATION_COMPLETE:
556 sal_uInt16 nId = 0;
557 switch ( GetHoriOrient() )
559 case text::HoriOrientation::NONE:
561 rText = rText + SW_RESSTR( STR_POS_X ) + " " +
562 ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) +
563 ::GetSvxString( ::GetMetricId( ePresUnit ) );
565 break;
566 case text::HoriOrientation::RIGHT:
567 nId = STR_HORI_RIGHT;
568 break;
569 case text::HoriOrientation::CENTER:
570 nId = STR_HORI_CENTER;
571 break;
572 case text::HoriOrientation::LEFT:
573 nId = STR_HORI_LEFT;
574 break;
575 case text::HoriOrientation::INSIDE:
576 nId = STR_HORI_INSIDE;
577 break;
578 case text::HoriOrientation::OUTSIDE:
579 nId = STR_HORI_OUTSIDE;
580 break;
581 case text::HoriOrientation::FULL:
582 nId = STR_HORI_FULL;
583 break;
584 default:;//prevent warning
586 if ( nId )
587 rText += SW_RESSTR( nId );
588 return ePres;
590 default:;//prevent warning
592 return SFX_ITEM_PRESENTATION_NONE;
595 // FlyAnchor, Anchor of the free-flying frame
597 SfxItemPresentation SwFmtAnchor::GetPresentation
599 SfxItemPresentation ePres,
600 SfxMapUnit /*eCoreUnit*/,
601 SfxMapUnit /*ePresUnit*/,
602 OUString& rText,
603 const IntlWrapper* /*pIntl*/
604 ) const
606 switch ( ePres )
608 case SFX_ITEM_PRESENTATION_NONE:
609 rText = OUString();
610 break;
611 case SFX_ITEM_PRESENTATION_NAMELESS:
612 case SFX_ITEM_PRESENTATION_COMPLETE:
614 sal_uInt16 nId = 0;
615 switch ( GetAnchorId() )
617 case FLY_AT_PARA:
618 nId = STR_FLY_AT_PARA;
619 break;
620 case FLY_AS_CHAR:
621 nId = STR_FLY_AS_CHAR;
622 break;
623 case FLY_AT_PAGE:
624 nId = STR_FLY_AT_PAGE;
625 break;
626 default:;//prevent warning
628 if ( nId )
629 rText += SW_RESSTR( nId );
630 return ePres;
632 default:;//prevent warning
634 return SFX_ITEM_PRESENTATION_NONE;
637 SfxItemPresentation SwFmtPageDesc::GetPresentation
639 SfxItemPresentation ePres,
640 SfxMapUnit /*eCoreUnit*/,
641 SfxMapUnit /*ePresUnit*/,
642 OUString& rText,
643 const IntlWrapper* /*pIntl*/
644 ) const
646 switch ( ePres )
648 case SFX_ITEM_PRESENTATION_NONE:
649 rText = OUString();
650 break;
651 case SFX_ITEM_PRESENTATION_NAMELESS:
652 case SFX_ITEM_PRESENTATION_COMPLETE:
654 const SwPageDesc *pPageDesc = GetPageDesc();
655 if ( pPageDesc )
656 rText = pPageDesc->GetName();
657 else
658 rText = SW_RESSTR( STR_NO_PAGEDESC );
659 return ePres;
661 default:;//prevent warning
663 return SFX_ITEM_PRESENTATION_NONE;
666 //The ColumnDescriptor
668 SfxItemPresentation SwFmtCol::GetPresentation
670 SfxItemPresentation ePres,
671 SfxMapUnit eCoreUnit,
672 SfxMapUnit /*ePresUnit*/,
673 OUString& rText,
674 const IntlWrapper* pIntl
675 ) const
677 switch ( ePres )
679 case SFX_ITEM_PRESENTATION_NONE:
680 rText = OUString();
681 break;
682 case SFX_ITEM_PRESENTATION_NAMELESS:
683 case SFX_ITEM_PRESENTATION_COMPLETE:
685 sal_uInt16 nCnt = GetNumCols();
686 if ( nCnt > 1 )
688 rText = OUString::valueOf(nCnt) + " " + SW_RESSTR( STR_COLUMNS );
689 if ( COLADJ_NONE != GetLineAdj() )
691 sal_uInt16 nWdth = sal_uInt16(GetLineWidth());
692 rText = rText + " " + SW_RESSTR( STR_LINE_WIDTH ) + " " +
693 ::GetMetricText( nWdth, eCoreUnit,
694 SFX_MAPUNIT_POINT, pIntl );
697 else
698 rText = OUString();
699 return ePres;
701 default:;//prevent warning
703 return SFX_ITEM_PRESENTATION_NONE;
706 //URL's and maps
708 SfxItemPresentation SwFmtURL::GetPresentation
710 SfxItemPresentation ePres,
711 SfxMapUnit /*eCoreUnit*/,
712 SfxMapUnit /*ePresUnit*/,
713 OUString& rText,
714 const IntlWrapper* /*pIntl*/
715 ) const
717 rText = OUString();
718 switch ( ePres )
720 case SFX_ITEM_PRESENTATION_NONE:
721 break;
722 case SFX_ITEM_PRESENTATION_NAMELESS:
723 case SFX_ITEM_PRESENTATION_COMPLETE:
725 if ( pMap )
726 rText += "Client-Map";
727 if ( sURL.Len() )
729 if ( pMap )
730 rText += " - ";
731 rText = rText + "URL: " + sURL;
732 if ( bIsServerMap )
733 rText += " (Server-Map)";
735 if ( sTargetFrameName.Len() )
737 rText = rText + ", Target: " + sTargetFrameName;
739 return ePres;
741 default:;//prevent warning
743 return SFX_ITEM_PRESENTATION_NONE;
746 SfxItemPresentation SwFmtEditInReadonly::GetPresentation
748 SfxItemPresentation ePres,
749 SfxMapUnit /*eCoreUnit*/,
750 SfxMapUnit /*ePresUnit*/,
751 OUString& rText,
752 const IntlWrapper* /*pIntl*/
753 ) const
755 rText = OUString();
756 switch ( ePres )
758 case SFX_ITEM_PRESENTATION_NONE:
759 rText = OUString();
760 break;
761 case SFX_ITEM_PRESENTATION_NAMELESS:
762 case SFX_ITEM_PRESENTATION_COMPLETE:
764 if ( GetValue() )
765 rText = SW_RESSTR(STR_EDIT_IN_READONLY);
766 return ePres;
768 default:;//prevent warning
770 return SFX_ITEM_PRESENTATION_NONE;
773 SfxItemPresentation SwFmtLayoutSplit::GetPresentation
775 SfxItemPresentation ePres,
776 SfxMapUnit /*eCoreUnit*/,
777 SfxMapUnit /*ePresUnit*/,
778 OUString& rText,
779 const IntlWrapper* /*pIntl*/
780 ) const
782 switch ( ePres )
784 case SFX_ITEM_PRESENTATION_NONE:
785 rText = OUString();
786 return SFX_ITEM_PRESENTATION_NONE;
787 case SFX_ITEM_PRESENTATION_NAMELESS:
788 case SFX_ITEM_PRESENTATION_COMPLETE:
790 if ( GetValue() )
791 rText = SW_RESSTR(STR_LAYOUT_SPLIT);
792 return ePres;
794 default:;//prevent warning
796 return SFX_ITEM_PRESENTATION_NONE;
799 SfxItemPresentation SwFmtRowSplit::GetPresentation
801 SfxItemPresentation /*ePres*/,
802 SfxMapUnit /*eCoreUnit*/,
803 SfxMapUnit /*ePresUnit*/,
804 OUString& /*rText*/,
805 const IntlWrapper* /*pIntl*/
806 ) const
808 return SFX_ITEM_PRESENTATION_NONE;
812 SfxItemPresentation SwFmtFtnEndAtTxtEnd::GetPresentation
814 SfxItemPresentation ePres,
815 SfxMapUnit /*eCoreUnit*/,
816 SfxMapUnit /*ePresUnit*/,
817 OUString& rText,
818 const IntlWrapper* /*pIntl*/
819 ) const
821 switch ( ePres )
823 case SFX_ITEM_PRESENTATION_NONE:
824 rText = OUString();
825 break;
827 case SFX_ITEM_PRESENTATION_NAMELESS:
828 case SFX_ITEM_PRESENTATION_COMPLETE:
830 switch( GetValue() )
832 case FTNEND_ATPGORDOCEND:
833 break;
835 case FTNEND_ATTXTEND:
836 break;
838 case FTNEND_ATTXTEND_OWNNUMSEQ:
839 break;
842 break;
844 default:
845 ePres = SFX_ITEM_PRESENTATION_NONE;
846 break;
848 return ePres;
851 SfxItemPresentation SwFmtChain::GetPresentation
853 SfxItemPresentation ePres,
854 SfxMapUnit /*eCoreUnit*/,
855 SfxMapUnit /*ePresUnit*/,
856 OUString& rText,
857 const IntlWrapper* /*pIntl*/
858 ) const
860 switch ( ePres )
862 case SFX_ITEM_PRESENTATION_NONE:
863 rText = OUString();
864 return SFX_ITEM_PRESENTATION_NONE;
865 case SFX_ITEM_PRESENTATION_NAMELESS:
866 case SFX_ITEM_PRESENTATION_COMPLETE:
868 if ( GetPrev() || GetNext() )
870 rText = SW_RESSTR(STR_CONNECT1);
871 if ( GetPrev() )
873 rText += GetPrev()->GetName();
874 if ( GetNext() )
875 rText += SW_RESSTR(STR_CONNECT2);
877 if ( GetNext() )
878 rText += GetNext()->GetName();
880 return ePres;
882 default:;//prevent warning
884 return SFX_ITEM_PRESENTATION_NONE;
887 SfxItemPresentation SwFmtLineNumber::GetPresentation
889 SfxItemPresentation ePres,
890 SfxMapUnit /*eCoreUnit*/,
891 SfxMapUnit /*ePresUnit*/,
892 OUString& rText,
893 const IntlWrapper* /*pIntl*/
894 ) const
896 switch ( ePres )
898 case SFX_ITEM_PRESENTATION_NONE:
899 rText = OUString();
900 return SFX_ITEM_PRESENTATION_NONE;
901 case SFX_ITEM_PRESENTATION_NAMELESS:
902 case SFX_ITEM_PRESENTATION_COMPLETE:
904 if ( IsCount() )
905 rText += SW_RESSTR(STR_LINECOUNT);
906 else
907 rText += SW_RESSTR(STR_DONTLINECOUNT);
908 if ( GetStartValue() )
910 rText = rText + " " + SW_RESSTR(STR_LINCOUNT_START) +
911 OUString::number( GetStartValue() );
913 return ePres;
915 default:;//prevent warning
917 return SFX_ITEM_PRESENTATION_NONE;
920 SfxItemPresentation SwTextGridItem::GetPresentation
922 SfxItemPresentation ePres,
923 SfxMapUnit /*eCoreUnit*/,
924 SfxMapUnit /*ePresUnit*/,
925 OUString& rText,
926 const IntlWrapper* /*pIntl*/
927 ) const
929 switch ( ePres )
931 case SFX_ITEM_PRESENTATION_NONE:
932 rText = OUString();
933 return SFX_ITEM_PRESENTATION_NONE;
934 case SFX_ITEM_PRESENTATION_NAMELESS:
935 case SFX_ITEM_PRESENTATION_COMPLETE:
937 sal_uInt16 nId = 0;
939 switch ( GetGridType() )
941 case GRID_NONE :
942 nId = STR_GRID_NONE;
943 break;
944 case GRID_LINES_ONLY :
945 nId = STR_GRID_LINES_ONLY;
946 break;
947 case GRID_LINES_CHARS :
948 nId = STR_GRID_LINES_CHARS;
949 break;
951 if ( nId )
952 rText += SW_RESSTR( nId );
953 return ePres;
955 default:;//prevent warning
958 return SFX_ITEM_PRESENTATION_NONE;
961 SfxItemPresentation SwHeaderAndFooterEatSpacingItem::GetPresentation
963 SfxItemPresentation /*ePres*/,
964 SfxMapUnit /*eCoreUnit*/,
965 SfxMapUnit /*ePresUnit*/,
966 OUString& /*rText*/,
967 const IntlWrapper* /*pIntl*/
968 ) const
970 return SFX_ITEM_PRESENTATION_NONE;
973 // Graphic attributes
975 SfxItemPresentation SwMirrorGrf::GetPresentation(
976 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
977 OUString& rText, const IntlWrapper* /*pIntl*/ ) const
979 switch ( ePres )
981 case SFX_ITEM_PRESENTATION_NAMELESS:
982 case SFX_ITEM_PRESENTATION_COMPLETE:
984 sal_uInt16 nId;
985 switch( GetValue() )
987 case RES_MIRROR_GRAPH_DONT: nId = STR_NO_MIRROR; break;
988 case RES_MIRROR_GRAPH_VERT: nId = STR_VERT_MIRROR; break;
989 case RES_MIRROR_GRAPH_HOR: nId = STR_HORI_MIRROR; break;
990 case RES_MIRROR_GRAPH_BOTH: nId = STR_BOTH_MIRROR; break;
991 default: nId = 0; break;
993 if ( nId )
995 rText = SW_RESSTR( nId );
996 if (bGrfToggle)
997 rText += SW_RESSTR( STR_MIRROR_TOGGLE );
1000 break;
1001 default:
1002 ePres = SFX_ITEM_PRESENTATION_NONE;
1003 rText = OUString();
1004 break;
1006 return ePres;
1009 SfxItemPresentation SwRotationGrf::GetPresentation(
1010 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1011 OUString &rText, const IntlWrapper* /*pIntl*/) const
1013 switch( ePres )
1015 case SFX_ITEM_PRESENTATION_NAMELESS:
1016 case SFX_ITEM_PRESENTATION_COMPLETE:
1017 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1018 rText = SW_RESSTR( STR_ROTATION );
1019 else if( rText.getLength() )
1020 rText = OUString();
1021 rText = rText + OUString::number( GetValue() ) + "\xB0";
1022 break;
1024 default:
1025 ePres = SFX_ITEM_PRESENTATION_NONE;
1026 rText = OUString();
1027 break;
1029 return ePres;
1032 SfxItemPresentation SwLuminanceGrf::GetPresentation(
1033 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1034 OUString &rText, const IntlWrapper* /*pIntl*/) const
1036 switch( ePres )
1038 case SFX_ITEM_PRESENTATION_NAMELESS:
1039 case SFX_ITEM_PRESENTATION_COMPLETE:
1040 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1041 rText = SW_RESSTR( STR_LUMINANCE );
1042 else if( rText.getLength() )
1043 rText = OUString();
1044 rText = rText + OUString::number( GetValue() ) + "%";
1045 break;
1047 default:
1048 ePres = SFX_ITEM_PRESENTATION_NONE;
1049 rText = OUString();
1050 break;
1052 return ePres;
1055 SfxItemPresentation SwContrastGrf::GetPresentation(
1056 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1057 OUString &rText, const IntlWrapper* /*pIntl*/) const
1059 switch( ePres )
1061 case SFX_ITEM_PRESENTATION_NAMELESS:
1062 case SFX_ITEM_PRESENTATION_COMPLETE:
1063 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1064 rText = SW_RESSTR( STR_CONTRAST );
1065 else if( rText.getLength() )
1066 rText = OUString();
1067 rText = rText + OUString::number( GetValue() ) + "%";
1068 break;
1070 default:
1071 ePres = SFX_ITEM_PRESENTATION_NONE;
1072 rText = OUString();
1073 break;
1075 return ePres;
1078 SfxItemPresentation SwChannelGrf::GetPresentation(
1079 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1080 OUString &rText, const IntlWrapper* /*pIntl*/) const
1082 switch( ePres )
1084 case SFX_ITEM_PRESENTATION_NAMELESS:
1085 case SFX_ITEM_PRESENTATION_COMPLETE:
1086 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1088 sal_uInt16 nId;
1089 switch ( Which() )
1091 case RES_GRFATR_CHANNELR: nId = STR_CHANNELR; break;
1092 case RES_GRFATR_CHANNELG: nId = STR_CHANNELG; break;
1093 case RES_GRFATR_CHANNELB: nId = STR_CHANNELB; break;
1094 default: nId = 0; break;
1096 if( nId )
1097 rText = SW_RESSTR( nId );
1098 else if( rText.getLength() )
1099 rText = OUString();
1101 else if( rText.getLength() )
1102 rText = OUString();
1103 rText = rText + OUString::number( GetValue() ) + "%";
1104 break;
1106 default:
1107 ePres = SFX_ITEM_PRESENTATION_NONE;
1108 rText = OUString();
1109 break;
1111 return ePres;
1114 SfxItemPresentation SwGammaGrf::GetPresentation(
1115 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1116 OUString &rText, const IntlWrapper* /*pIntl*/) const
1118 OUStringBuffer aText;
1119 switch( ePres )
1121 case SFX_ITEM_PRESENTATION_NAMELESS:
1122 case SFX_ITEM_PRESENTATION_COMPLETE:
1123 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1124 aText.append(SW_RESSTR(STR_GAMMA));
1125 aText.append(GetValue()).append(static_cast<sal_Unicode>('%'));
1126 break;
1128 default:
1129 ePres = SFX_ITEM_PRESENTATION_NONE;
1130 break;
1132 rText = aText.makeStringAndClear();
1133 return ePres;
1136 SfxItemPresentation SwInvertGrf::GetPresentation(
1137 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1138 OUString &rText, const IntlWrapper* /*pIntl*/) const
1140 rText = OUString();
1141 switch( ePres )
1143 case SFX_ITEM_PRESENTATION_NAMELESS:
1144 case SFX_ITEM_PRESENTATION_COMPLETE:
1145 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1147 sal_uInt16 nId = 0 != GetValue() ? STR_INVERT : STR_INVERT_NOT;
1148 rText = SW_RESSTR( nId );
1150 break;
1152 default:
1153 ePres = SFX_ITEM_PRESENTATION_NONE;
1154 break;
1156 return ePres;
1159 SfxItemPresentation SwTransparencyGrf::GetPresentation(
1160 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1161 OUString &rText, const IntlWrapper* /*pIntl*/) const
1163 switch( ePres )
1165 case SFX_ITEM_PRESENTATION_NAMELESS:
1166 case SFX_ITEM_PRESENTATION_COMPLETE:
1167 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1168 rText = SW_RESSTR( STR_TRANSPARENCY );
1169 else if( rText.getLength() )
1170 rText = OUString();
1171 rText = rText + OUString::number( GetValue() ) + "%";
1172 break;
1174 default:
1175 ePres = SFX_ITEM_PRESENTATION_NONE;
1176 rText = OUString();
1177 break;
1179 return ePres;
1182 SfxItemPresentation SwDrawModeGrf::GetPresentation(
1183 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1184 OUString &rText, const IntlWrapper* /*pIntl*/) const
1186 rText = OUString();
1187 switch( ePres )
1189 case SFX_ITEM_PRESENTATION_NAMELESS:
1190 case SFX_ITEM_PRESENTATION_COMPLETE:
1191 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1193 sal_uInt16 nId;
1194 switch ( GetValue() )
1197 case GRAPHICDRAWMODE_GREYS: nId = STR_DRAWMODE_GREY; break;
1198 case GRAPHICDRAWMODE_MONO: nId = STR_DRAWMODE_BLACKWHITE; break;
1199 case GRAPHICDRAWMODE_WATERMARK: nId = STR_DRAWMODE_WATERMARK; break;
1200 default: nId = STR_DRAWMODE_STD; break;
1202 rText = SW_RESSTR( STR_DRAWMODE ) + SW_RESSTR( nId );
1204 break;
1206 default:
1207 ePres = SFX_ITEM_PRESENTATION_NONE;
1208 break;
1210 return ePres;
1213 SfxItemPresentation SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation ePres,
1214 SfxMapUnit /*eCoreMetric*/,
1215 SfxMapUnit /*ePresMetric*/,
1216 OUString &rText,
1217 const IntlWrapper* /*pIntl*/ ) const
1219 rText = OUString();
1220 switch( ePres )
1222 case SFX_ITEM_PRESENTATION_NAMELESS:
1223 break;
1224 case SFX_ITEM_PRESENTATION_COMPLETE:
1226 sal_uInt16 nId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW;
1227 rText = SW_RESSTR( nId );
1229 break;
1231 default:
1232 ePres = SFX_ITEM_PRESENTATION_NONE;
1233 break;
1235 return ePres;
1238 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */