merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / utlui / attrdesc.cxx
blobae8df6cde961272af3f7f553920f39855cda2a65
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: attrdesc.cxx,v $
10 * $Revision: 1.24 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
35 #include <svtools/itemiter.hxx>
36 #include <vcl/svapp.hxx>
37 #include <svx/itemtype.hxx>
38 #include <goodies/grfmgr.hxx>
39 #include <unotools/intlwrapper.hxx>
40 #include <comphelper/processfactory.hxx>
41 #include <fmtanchr.hxx>
42 #include <fmtfsize.hxx>
43 #include <fmtinfmt.hxx>
44 #include <fchrfmt.hxx>
45 #include <fmtautofmt.hxx>
46 #include <fmtsrnd.hxx>
47 #include <fmtornt.hxx>
48 #include <fmtlsplt.hxx>
49 #include <fmtrowsplt.hxx>
50 #include <fmtpdsc.hxx>
51 #include <fmtclds.hxx>
52 #include <fmteiro.hxx>
53 #include <fmturl.hxx>
54 #include <fmthdft.hxx>
55 #include <fmtcnct.hxx>
56 #ifndef _FMTLINE_HXX
57 #include <fmtline.hxx>
58 #endif
59 #include <tgrditem.hxx>
60 #include <hfspacingitem.hxx>
61 #include <fmtruby.hxx>
62 #include <paratr.hxx>
63 #include <grfatr.hxx>
64 #include <pagedesc.hxx>
65 #include <charfmt.hxx>
66 #include <fmtcol.hxx>
67 #include <tox.hxx>
68 #ifndef _ATTRDESC_HRC
69 #include <attrdesc.hrc>
70 #endif
71 #include <fmtftntx.hxx>
72 #include <fmtfollowtextflow.hxx>
75 using namespace com::sun::star;
78 TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient);
80 // erfrage die Attribut-Beschreibung
81 void SwAttrSet::GetPresentation(
82 SfxItemPresentation ePres,
83 SfxMapUnit eCoreMetric,
84 SfxMapUnit ePresMetric,
85 String &rText ) const
87 static sal_Char __READONLY_DATA sKomma[] = ", ";
89 rText.Erase();
90 String aStr;
91 if( Count() )
93 SfxItemIter aIter( *this );
94 const IntlWrapper rInt( ::comphelper::getProcessServiceFactory(),
95 GetAppLanguage() );
96 while( TRUE )
98 aIter.GetCurItem()->GetPresentation( ePres, eCoreMetric,
99 ePresMetric, aStr,
100 &rInt );
101 if( rText.Len() && aStr.Len() )
102 rText += String::CreateFromAscii(sKomma);
103 rText += aStr;
104 if( aIter.IsAtEnd() )
105 break;
106 aIter.NextItem();
111 // ATT_CHARFMT *********************************************
114 SfxItemPresentation SwFmtCharFmt::GetPresentation
116 SfxItemPresentation ePres,
117 SfxMapUnit eCoreUnit,
118 SfxMapUnit ePresUnit,
119 String& rText,
120 const IntlWrapper* /*pIntl*/
121 ) const
123 switch ( ePres )
125 case SFX_ITEM_PRESENTATION_NONE:
126 rText.Erase();
127 break;
128 case SFX_ITEM_PRESENTATION_NAMELESS:
129 case SFX_ITEM_PRESENTATION_COMPLETE:
131 const SwCharFmt *pCharFmt = GetCharFmt();
132 if ( pCharFmt )
134 String aStr;
135 rText = SW_RESSTR(STR_CHARFMT );
136 pCharFmt->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr );
137 rText += '(';
138 rText += aStr;
139 rText += ')';
141 else
142 rText = SW_RESSTR( STR_NO_CHARFMT );
143 return ePres;
145 default:;//prevent warning
147 return SFX_ITEM_PRESENTATION_NONE;
150 // ATT_AUTOFMT *********************************************
153 SfxItemPresentation SwFmtAutoFmt::GetPresentation
155 SfxItemPresentation ePres,
156 SfxMapUnit /*eCoreUnit*/,
157 SfxMapUnit /*ePresUnit*/,
158 String& rText,
159 const IntlWrapper* /*pIntl*/
160 ) const
162 switch ( ePres )
164 case SFX_ITEM_PRESENTATION_NONE:
165 rText.Erase();
166 break;
167 case SFX_ITEM_PRESENTATION_NAMELESS:
168 case SFX_ITEM_PRESENTATION_COMPLETE:
170 rText.Erase(); //TODO
171 return ePres;
173 default:;//prevent warning
175 return SFX_ITEM_PRESENTATION_NONE;
178 // ATT_INETFMT *********************************************
181 SfxItemPresentation SwFmtINetFmt::GetPresentation
183 SfxItemPresentation ePres,
184 SfxMapUnit /*eCoreUnit*/,
185 SfxMapUnit /*ePresUnit*/,
186 String& rText,
187 const IntlWrapper* /*pIntl*/
188 ) const
190 switch ( ePres )
192 case SFX_ITEM_PRESENTATION_NONE:
193 rText.Erase();
194 break;
195 case SFX_ITEM_PRESENTATION_NAMELESS:
196 case SFX_ITEM_PRESENTATION_COMPLETE:
198 rText = GetValue();
199 return ePres;
201 default:;//prevent warning
203 return SFX_ITEM_PRESENTATION_NONE;
206 SfxItemPresentation SwFmtRuby::GetPresentation( SfxItemPresentation ePres,
207 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
208 String &rText, const IntlWrapper* /*pIntl*/ ) const
210 switch ( ePres )
212 case SFX_ITEM_PRESENTATION_NONE:
213 rText.Erase();
214 break;
215 case SFX_ITEM_PRESENTATION_NAMELESS:
216 case SFX_ITEM_PRESENTATION_COMPLETE:
218 rText = aEmptyStr;
219 return ePres;
221 default:;//prevent warning
223 return SFX_ITEM_PRESENTATION_NONE;
226 /*************************************************************************
227 |* class SwFmtDrop
228 *************************************************************************/
231 SfxItemPresentation SwFmtDrop::GetPresentation
233 SfxItemPresentation ePres,
234 SfxMapUnit /*eCoreUnit*/,
235 SfxMapUnit /*ePresUnit*/,
236 String& rText,
237 const IntlWrapper* /*pIntl*/
238 ) const
240 rText.Erase();
241 switch ( ePres )
243 case SFX_ITEM_PRESENTATION_NONE:
244 break;
245 case SFX_ITEM_PRESENTATION_NAMELESS:
246 case SFX_ITEM_PRESENTATION_COMPLETE:
248 if ( GetLines() > 1 )
250 if ( GetChars() > 1 )
252 rText = String::CreateFromInt32( GetChars() );
253 rText += ' ';
255 rText += SW_RESSTR( STR_DROP_OVER );
256 rText += ' ';
257 rText += String::CreateFromInt32( GetLines() );
258 rText += ' ';
259 rText += SW_RESSTR( STR_DROP_LINES );
261 else
262 rText = SW_RESSTR( STR_NO_DROP_LINES );
263 return ePres;
265 default:;//prevent warning
267 return SFX_ITEM_PRESENTATION_NONE;
270 /*************************************************************************
271 |* class SwRegisterItem
272 *************************************************************************/
275 SfxItemPresentation SwRegisterItem::GetPresentation
277 SfxItemPresentation ePres,
278 SfxMapUnit /*eCoreUnit*/,
279 SfxMapUnit /*ePresUnit*/,
280 XubString& rText,
281 const IntlWrapper* /*pIntl*/
282 ) const
284 switch ( ePres )
286 case SFX_ITEM_PRESENTATION_NONE:
287 rText.Erase();
288 return SFX_ITEM_PRESENTATION_NONE;
289 case SFX_ITEM_PRESENTATION_NAMELESS:
290 case SFX_ITEM_PRESENTATION_COMPLETE:
292 USHORT nId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF;
293 rText = SW_RESSTR( nId );
294 return ePres;
296 default:;//prevent warning
298 return SFX_ITEM_PRESENTATION_NONE;
301 /*************************************************************************
302 |* class SwNumRuleItem
303 *************************************************************************/
306 SfxItemPresentation SwNumRuleItem::GetPresentation
308 SfxItemPresentation ePres,
309 SfxMapUnit /*eCoreUnit*/,
310 SfxMapUnit /*ePresUnit*/,
311 XubString& rText,
312 const IntlWrapper* /*pIntl*/
313 ) const
315 switch ( ePres )
317 case SFX_ITEM_PRESENTATION_NONE:
318 rText.Erase();
319 return SFX_ITEM_PRESENTATION_NONE;
320 case SFX_ITEM_PRESENTATION_NAMELESS:
321 case SFX_ITEM_PRESENTATION_COMPLETE:
323 if( GetValue().Len() )
324 (((rText = SW_RESSTR( STR_NUMRULE_ON )) +=
325 '(' ) += GetValue() ) += ')';
326 else
327 rText = SW_RESSTR( STR_NUMRULE_OFF );
328 return ePres;
330 default:;//prevent warning
332 return SFX_ITEM_PRESENTATION_NONE;
334 /*************************************************************************
335 |* class SwParaConnectBorderItem
336 *************************************************************************/
338 SfxItemPresentation SwParaConnectBorderItem::GetPresentation
340 SfxItemPresentation ePres,
341 SfxMapUnit /*eCoreUnit*/,
342 SfxMapUnit /*ePresUnit*/,
343 XubString& rText,
344 const IntlWrapper* /*pIntl*/
345 ) const
347 switch ( ePres )
349 case SFX_ITEM_PRESENTATION_NONE:
350 rText.Erase();
351 return SFX_ITEM_PRESENTATION_NONE;
352 case SFX_ITEM_PRESENTATION_NAMELESS:
353 case SFX_ITEM_PRESENTATION_COMPLETE:
355 USHORT nId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF;
356 rText = SW_RESSTR( nId );
357 return ePres;
359 default:;//prevent warning
361 return SFX_ITEM_PRESENTATION_NONE;
366 /******************************************************************************
367 * Frame-Attribute:
368 ******************************************************************************/
371 SfxItemPresentation SwFmtFrmSize::GetPresentation
373 SfxItemPresentation ePres,
374 SfxMapUnit eCoreUnit,
375 SfxMapUnit ePresUnit,
376 String& rText,
377 const IntlWrapper* pIntl
378 ) const
380 switch ( ePres )
382 case SFX_ITEM_PRESENTATION_NONE:
384 rText.Erase();
385 break;
387 case SFX_ITEM_PRESENTATION_NAMELESS:
388 case SFX_ITEM_PRESENTATION_COMPLETE:
390 rText = SW_RESSTR( STR_FRM_WIDTH );
391 rText += ' ';
392 if ( GetWidthPercent() )
394 rText += String::CreateFromInt32(GetWidthPercent());
395 rText += '%';
397 else
399 rText += ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl );
400 rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
402 if ( ATT_VAR_SIZE != GetHeightSizeType() )
404 rText += ',';
405 rText += ' ';
406 const USHORT nId = ATT_FIX_SIZE == eFrmHeightType ?
407 STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT;
408 rText += SW_RESSTR( nId );
409 rText += ' ';
410 if ( GetHeightPercent() )
412 rText += String::CreateFromInt32(GetHeightPercent());
413 rText += '%';
415 else
417 rText += ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl );
418 rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
421 return ePres;
423 default:;//prevent warning
425 return SFX_ITEM_PRESENTATION_NONE;
428 //Kopfzeile, fuer Seitenformate
429 //Client von FrmFmt das den Header beschreibt.
432 SfxItemPresentation SwFmtHeader::GetPresentation
434 SfxItemPresentation ePres,
435 SfxMapUnit /*eCoreUnit*/,
436 SfxMapUnit /*ePresUnit*/,
437 String& rText,
438 const IntlWrapper* /*pIntl*/
439 ) const
441 switch ( ePres )
443 case SFX_ITEM_PRESENTATION_NONE:
444 rText.Erase();
445 break;
446 case SFX_ITEM_PRESENTATION_NAMELESS:
447 case SFX_ITEM_PRESENTATION_COMPLETE:
449 const USHORT nId = GetHeaderFmt() ? STR_HEADER : STR_NO_HEADER;
450 rText = SW_RESSTR( nId );
451 return ePres;
453 default:;//prevent warning
455 return SFX_ITEM_PRESENTATION_NONE;
458 //Fusszeile, fuer Seitenformate
459 //Client von FrmFmt das den Footer beschreibt.
462 SfxItemPresentation SwFmtFooter::GetPresentation
464 SfxItemPresentation ePres,
465 SfxMapUnit /*eCoreUnit*/,
466 SfxMapUnit /*ePresUnit*/,
467 String& rText,
468 const IntlWrapper* /*pIntl*/
469 ) const
471 switch ( ePres )
473 case SFX_ITEM_PRESENTATION_NONE:
474 rText.Erase();
475 break;
476 case SFX_ITEM_PRESENTATION_NAMELESS:
477 case SFX_ITEM_PRESENTATION_COMPLETE:
479 const USHORT nId = GetFooterFmt() ? STR_FOOTER : STR_NO_FOOTER;
480 rText = SW_RESSTR( nId );
481 return ePres;
483 default:;//prevent warning
485 return SFX_ITEM_PRESENTATION_NONE;
489 SfxItemPresentation SwFmtSurround::GetPresentation
491 SfxItemPresentation ePres,
492 SfxMapUnit /*eCoreUnit*/,
493 SfxMapUnit /*ePresUnit*/,
494 String& rText,
495 const IntlWrapper* /*pIntl*/
496 ) const
498 switch ( ePres )
500 case SFX_ITEM_PRESENTATION_NONE:
501 rText.Erase();
502 break;
503 case SFX_ITEM_PRESENTATION_NAMELESS:
504 case SFX_ITEM_PRESENTATION_COMPLETE:
506 USHORT nId = 0;
507 switch ( (SwSurround)GetValue() )
509 case SURROUND_NONE:
510 nId = STR_SURROUND_NONE;
511 break;
512 case SURROUND_THROUGHT:
513 nId = STR_SURROUND_THROUGHT;
514 break;
515 case SURROUND_PARALLEL:
516 nId = STR_SURROUND_PARALLEL;
517 break;
518 case SURROUND_IDEAL:
519 nId = STR_SURROUND_IDEAL;
520 break;
521 case SURROUND_LEFT:
522 nId = STR_SURROUND_LEFT;
523 break;
524 case SURROUND_RIGHT:
525 nId = STR_SURROUND_RIGHT;
526 break;
527 default:;//prevent warning
529 if ( nId )
530 rText = SW_RESSTR( nId );
532 if ( IsAnchorOnly() )
534 rText += ' ';
535 rText += SW_RESSTR( STR_SURROUND_ANCHORONLY );
537 return ePres;
539 default:;//prevent warning
541 return SFX_ITEM_PRESENTATION_NONE;
545 //VertOrientation, wie und woran orientiert --
546 // sich der FlyFrm in der Vertikalen -----------
549 SfxItemPresentation SwFmtVertOrient::GetPresentation
551 SfxItemPresentation ePres,
552 SfxMapUnit eCoreUnit,
553 SfxMapUnit ePresUnit,
554 String& rText,
555 const IntlWrapper* pIntl
556 ) const
558 switch ( ePres )
560 case SFX_ITEM_PRESENTATION_NONE:
561 rText.Erase();
562 break;
563 case SFX_ITEM_PRESENTATION_NAMELESS:
564 case SFX_ITEM_PRESENTATION_COMPLETE:
566 USHORT nId = 0;
567 switch ( GetVertOrient() )
569 case text::VertOrientation::NONE:
571 rText += SW_RESSTR( STR_POS_Y );
572 rText += ' ';
573 rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
574 rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
576 break;
577 case text::VertOrientation::TOP:
578 nId = STR_VERT_TOP;
579 break;
580 case text::VertOrientation::CENTER:
581 nId = STR_VERT_CENTER;
582 break;
583 case text::VertOrientation::BOTTOM:
584 nId = STR_VERT_BOTTOM;
585 break;
586 case text::VertOrientation::LINE_TOP:
587 nId = STR_LINE_TOP;
588 break;
589 case text::VertOrientation::LINE_CENTER:
590 nId = STR_LINE_CENTER;
591 break;
592 case text::VertOrientation::LINE_BOTTOM:
593 nId = STR_LINE_BOTTOM;
594 break;
595 default:;//prevent warning
597 if ( nId )
598 rText += SW_RESSTR( nId );
599 return ePres;
601 default:;//prevent warning
603 return SFX_ITEM_PRESENTATION_NONE;
606 //HoriOrientation, wie und woran orientiert --
607 // sich der FlyFrm in der Hoizontalen ----------
610 SfxItemPresentation SwFmtHoriOrient::GetPresentation
612 SfxItemPresentation ePres,
613 SfxMapUnit eCoreUnit,
614 SfxMapUnit ePresUnit,
615 String& rText,
616 const IntlWrapper* pIntl
617 ) const
619 switch ( ePres )
621 case SFX_ITEM_PRESENTATION_NONE:
622 rText.Erase();
623 break;
624 case SFX_ITEM_PRESENTATION_NAMELESS:
625 case SFX_ITEM_PRESENTATION_COMPLETE:
627 USHORT nId = 0;
628 switch ( GetHoriOrient() )
630 case text::HoriOrientation::NONE:
632 rText += SW_RESSTR( STR_POS_X );
633 rText += ' ';
634 rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
635 rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
637 break;
638 case text::HoriOrientation::RIGHT:
639 nId = STR_HORI_RIGHT;
640 break;
641 case text::HoriOrientation::CENTER:
642 nId = STR_HORI_CENTER;
643 break;
644 case text::HoriOrientation::LEFT:
645 nId = STR_HORI_LEFT;
646 break;
647 case text::HoriOrientation::INSIDE:
648 nId = STR_HORI_INSIDE;
649 break;
650 case text::HoriOrientation::OUTSIDE:
651 nId = STR_HORI_OUTSIDE;
652 break;
653 case text::HoriOrientation::FULL:
654 nId = STR_HORI_FULL;
655 break;
656 default:;//prevent warning
658 if ( nId )
659 rText += SW_RESSTR( nId );
660 return ePres;
662 default:;//prevent warning
664 return SFX_ITEM_PRESENTATION_NONE;
667 //FlyAnchor, Anker des Freifliegenden Rahmen ----
670 SfxItemPresentation SwFmtAnchor::GetPresentation
672 SfxItemPresentation ePres,
673 SfxMapUnit /*eCoreUnit*/,
674 SfxMapUnit /*ePresUnit*/,
675 String& rText,
676 const IntlWrapper* /*pIntl*/
677 ) const
679 switch ( ePres )
681 case SFX_ITEM_PRESENTATION_NONE:
682 rText.Erase();
683 break;
684 case SFX_ITEM_PRESENTATION_NAMELESS:
685 case SFX_ITEM_PRESENTATION_COMPLETE:
687 USHORT nId = 0;
688 switch ( GetAnchorId() )
690 case FLY_AT_CNTNT: //Absatzgebundener Rahmen
691 nId = STR_FLY_AT_CNTNT;
692 break;
693 case FLY_IN_CNTNT: //Zeichengebundener Rahmen
694 nId = STR_FLY_IN_CNTNT;
695 break;
696 case FLY_PAGE: //Seitengebundener Rahmen
697 nId = STR_FLY_PAGE;
698 break;
699 default:;//prevent warning
701 if ( nId )
702 rText += SW_RESSTR( nId );
703 return ePres;
705 default:;//prevent warning
707 return SFX_ITEM_PRESENTATION_NONE;
711 SfxItemPresentation SwFmtPageDesc::GetPresentation
713 SfxItemPresentation ePres,
714 SfxMapUnit /*eCoreUnit*/,
715 SfxMapUnit /*ePresUnit*/,
716 String& rText,
717 const IntlWrapper* /*pIntl*/
718 ) const
720 switch ( ePres )
722 case SFX_ITEM_PRESENTATION_NONE:
723 rText.Erase();
724 break;
725 case SFX_ITEM_PRESENTATION_NAMELESS:
726 case SFX_ITEM_PRESENTATION_COMPLETE:
728 const SwPageDesc *pPageDesc = GetPageDesc();
729 if ( pPageDesc )
730 rText = pPageDesc->GetName();
731 else
732 rText = SW_RESSTR( STR_NO_PAGEDESC );
733 return ePres;
735 default:;//prevent warning
737 return SFX_ITEM_PRESENTATION_NONE;
740 //Der ColumnDescriptor --------------------------
743 SfxItemPresentation SwFmtCol::GetPresentation
745 SfxItemPresentation ePres,
746 SfxMapUnit eCoreUnit,
747 SfxMapUnit /*ePresUnit*/,
748 String& rText,
749 const IntlWrapper* pIntl
750 ) const
752 switch ( ePres )
754 case SFX_ITEM_PRESENTATION_NONE:
755 rText.Erase();
756 break;
757 case SFX_ITEM_PRESENTATION_NAMELESS:
758 case SFX_ITEM_PRESENTATION_COMPLETE:
760 USHORT nCnt = GetNumCols();
761 if ( nCnt > 1 )
763 rText = String::CreateFromInt32(nCnt);
764 rText += ' ';
765 rText += SW_RESSTR( STR_COLUMNS );
766 if ( COLADJ_NONE != GetLineAdj() )
768 USHORT nWdth = USHORT(GetLineWidth());
769 rText += ' ';
770 rText += SW_RESSTR( STR_LINE_WIDTH );
771 rText += ' ';
772 rText += ::GetMetricText( nWdth, eCoreUnit,
773 SFX_MAPUNIT_POINT, pIntl );
776 else
777 rText.Erase();
778 return ePres;
780 default:;//prevent warning
782 return SFX_ITEM_PRESENTATION_NONE;
785 //URL's und Maps
788 SfxItemPresentation SwFmtURL::GetPresentation
790 SfxItemPresentation ePres,
791 SfxMapUnit /*eCoreUnit*/,
792 SfxMapUnit /*ePresUnit*/,
793 String& rText,
794 const IntlWrapper* /*pIntl*/
795 ) const
797 rText.Erase();
798 switch ( ePres )
800 case SFX_ITEM_PRESENTATION_NONE:
801 break;
802 case SFX_ITEM_PRESENTATION_NAMELESS:
803 case SFX_ITEM_PRESENTATION_COMPLETE:
805 if ( pMap )
806 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM("Client-Map"));
807 if ( sURL.Len() )
809 if ( pMap )
810 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" - "));
811 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM("URL: "));
812 rText += sURL;
813 if ( bIsServerMap )
814 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" (Server-Map)"));
816 if ( sTargetFrameName.Len() )
818 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(", Target: "));
819 rText += sTargetFrameName;
821 return ePres;
823 default:;//prevent warning
825 return SFX_ITEM_PRESENTATION_NONE;
829 //SwFmtEditInReadonly
832 SfxItemPresentation SwFmtEditInReadonly::GetPresentation
834 SfxItemPresentation ePres,
835 SfxMapUnit /*eCoreUnit*/,
836 SfxMapUnit /*ePresUnit*/,
837 String& rText,
838 const IntlWrapper* /*pIntl*/
839 ) const
841 rText.Erase();
842 switch ( ePres )
844 case SFX_ITEM_PRESENTATION_NONE:
845 rText.Erase();
846 break;
847 case SFX_ITEM_PRESENTATION_NAMELESS:
848 case SFX_ITEM_PRESENTATION_COMPLETE:
850 if ( GetValue() )
851 rText = SW_RESSTR(STR_EDIT_IN_READONLY);
852 return ePres;
854 default:;//prevent warning
856 return SFX_ITEM_PRESENTATION_NONE;
860 SfxItemPresentation SwFmtLayoutSplit::GetPresentation
862 SfxItemPresentation ePres,
863 SfxMapUnit /*eCoreUnit*/,
864 SfxMapUnit /*ePresUnit*/,
865 String& rText,
866 const IntlWrapper* /*pIntl*/
867 ) const
869 switch ( ePres )
871 case SFX_ITEM_PRESENTATION_NONE:
872 rText.Erase();
873 return SFX_ITEM_PRESENTATION_NONE;
874 case SFX_ITEM_PRESENTATION_NAMELESS:
875 case SFX_ITEM_PRESENTATION_COMPLETE:
877 if ( GetValue() )
878 rText = SW_RESSTR(STR_LAYOUT_SPLIT);
879 return ePres;
881 default:;//prevent warning
883 return SFX_ITEM_PRESENTATION_NONE;
886 SfxItemPresentation SwFmtRowSplit::GetPresentation
888 SfxItemPresentation /*ePres*/,
889 SfxMapUnit /*eCoreUnit*/,
890 SfxMapUnit /*ePresUnit*/,
891 String& /*rText*/,
892 const IntlWrapper* /*pIntl*/
893 ) const
895 return SFX_ITEM_PRESENTATION_NONE;
899 SfxItemPresentation SwFmtFtnEndAtTxtEnd::GetPresentation
901 SfxItemPresentation ePres,
902 SfxMapUnit /*eCoreUnit*/,
903 SfxMapUnit /*ePresUnit*/,
904 String& rText,
905 const IntlWrapper* /*pIntl*/
906 ) const
908 switch ( ePres )
910 case SFX_ITEM_PRESENTATION_NONE:
911 rText.Erase();
912 break;
914 case SFX_ITEM_PRESENTATION_NAMELESS:
915 case SFX_ITEM_PRESENTATION_COMPLETE:
917 switch( GetValue() )
919 case FTNEND_ATPGORDOCEND:
920 // rText = SW_RESSTR( STR_LAYOUT_FTN );
921 break;
923 case FTNEND_ATTXTEND:
924 break;
926 case FTNEND_ATTXTEND_OWNNUMSEQ:
928 // String sPrefix;
929 // String sSuffix;
930 // SvxNumberType aFmt;
931 // USHORT nOffset;
932 // rText +=
934 break;
937 break;
939 default:
940 ePres = SFX_ITEM_PRESENTATION_NONE;
941 break;
943 return ePres;
946 SfxItemPresentation SwFmtChain::GetPresentation
948 SfxItemPresentation ePres,
949 SfxMapUnit /*eCoreUnit*/,
950 SfxMapUnit /*ePresUnit*/,
951 String& rText,
952 const IntlWrapper* /*pIntl*/
953 ) const
955 switch ( ePres )
957 case SFX_ITEM_PRESENTATION_NONE:
958 rText.Erase();
959 return SFX_ITEM_PRESENTATION_NONE;
960 case SFX_ITEM_PRESENTATION_NAMELESS:
961 case SFX_ITEM_PRESENTATION_COMPLETE:
963 if ( GetPrev() || GetNext() )
965 rText = SW_RESSTR(STR_CONNECT1);
966 if ( GetPrev() )
968 rText += GetPrev()->GetName();
969 if ( GetNext() )
970 rText += SW_RESSTR(STR_CONNECT2);
972 if ( GetNext() )
973 rText += GetNext()->GetName();
975 return ePres;
977 default:;//prevent warning
979 return SFX_ITEM_PRESENTATION_NONE;
983 SfxItemPresentation SwFmtLineNumber::GetPresentation
985 SfxItemPresentation ePres,
986 SfxMapUnit /*eCoreUnit*/,
987 SfxMapUnit /*ePresUnit*/,
988 String& rText,
989 const IntlWrapper* /*pIntl*/
990 ) const
992 switch ( ePres )
994 case SFX_ITEM_PRESENTATION_NONE:
995 rText.Erase();
996 return SFX_ITEM_PRESENTATION_NONE;
997 case SFX_ITEM_PRESENTATION_NAMELESS:
998 case SFX_ITEM_PRESENTATION_COMPLETE:
1000 if ( IsCount() )
1001 rText += SW_RESSTR(STR_LINECOUNT);
1002 else
1003 rText += SW_RESSTR(STR_DONTLINECOUNT);
1004 if ( GetStartValue() )
1006 rText += ' ';
1007 rText += SW_RESSTR(STR_LINCOUNT_START);
1008 rText += String::CreateFromInt32(GetStartValue());
1010 return ePres;
1012 default:;//prevent warning
1014 return SFX_ITEM_PRESENTATION_NONE;
1017 SfxItemPresentation SwTextGridItem::GetPresentation
1019 SfxItemPresentation ePres,
1020 SfxMapUnit /*eCoreUnit*/,
1021 SfxMapUnit /*ePresUnit*/,
1022 String& rText,
1023 const IntlWrapper* /*pIntl*/
1024 ) const
1026 switch ( ePres )
1028 case SFX_ITEM_PRESENTATION_NONE:
1029 rText.Erase();
1030 return SFX_ITEM_PRESENTATION_NONE;
1031 case SFX_ITEM_PRESENTATION_NAMELESS:
1032 case SFX_ITEM_PRESENTATION_COMPLETE:
1034 USHORT nId = 0;
1036 switch ( GetGridType() )
1038 case GRID_NONE :
1039 nId = STR_GRID_NONE;
1040 break;
1041 case GRID_LINES_ONLY :
1042 nId = STR_GRID_LINES_ONLY;
1043 break;
1044 case GRID_LINES_CHARS :
1045 nId = STR_GRID_LINES_CHARS;
1046 break;
1048 if ( nId )
1049 rText += SW_RESSTR( nId );
1050 return ePres;
1052 default:;//prevent warning
1055 return SFX_ITEM_PRESENTATION_NONE;
1059 //SwHeaderAndFooterEatSpacingItem
1062 SfxItemPresentation SwHeaderAndFooterEatSpacingItem::GetPresentation
1064 SfxItemPresentation /*ePres*/,
1065 SfxMapUnit /*eCoreUnit*/,
1066 SfxMapUnit /*ePresUnit*/,
1067 String& /*rText*/,
1068 const IntlWrapper* /*pIntl*/
1069 ) const
1071 // rText.Erase();
1072 // switch ( ePres )
1073 // {
1074 // case SFX_ITEM_PRESENTATION_NONE:
1075 // rText.Erase();
1076 // break;
1077 // case SFX_ITEM_PRESENTATION_NAMELESS:
1078 // case SFX_ITEM_PRESENTATION_COMPLETE:
1079 // {
1080 // if ( GetValue() )
1081 // rText = SW_RESSTR(STR_EDIT_IN_READONLY);
1082 // return ePres;
1083 // }
1084 // }
1085 return SFX_ITEM_PRESENTATION_NONE;
1089 // ---------------------- Grafik-Attribute --------------------------
1091 SfxItemPresentation SwMirrorGrf::GetPresentation(
1092 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1093 String& rText, const IntlWrapper* /*pIntl*/ ) const
1095 switch ( ePres )
1097 case SFX_ITEM_PRESENTATION_NAMELESS:
1098 case SFX_ITEM_PRESENTATION_COMPLETE:
1100 USHORT nId;
1101 switch( GetValue() )
1103 case RES_MIRROR_GRAPH_DONT: nId = STR_NO_MIRROR; break;
1104 case RES_MIRROR_GRAPH_VERT: nId = STR_VERT_MIRROR; break;
1105 case RES_MIRROR_GRAPH_HOR: nId = STR_HORI_MIRROR; break;
1106 case RES_MIRROR_GRAPH_BOTH: nId = STR_BOTH_MIRROR; break;
1107 default: nId = 0; break;
1109 if ( nId )
1111 rText = SW_RESSTR( nId );
1112 if (bGrfToggle)
1113 rText += SW_RESSTR( STR_MIRROR_TOGGLE );
1116 break;
1117 default:
1118 ePres = SFX_ITEM_PRESENTATION_NONE;
1119 rText.Erase();
1120 break;
1122 return ePres;
1126 SfxItemPresentation SwRotationGrf::GetPresentation(
1127 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1128 String &rText, const IntlWrapper* /*pIntl*/) const
1130 switch( ePres )
1132 case SFX_ITEM_PRESENTATION_NAMELESS:
1133 case SFX_ITEM_PRESENTATION_COMPLETE:
1134 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1135 rText = SW_RESSTR( STR_ROTATION );
1136 else if( rText.Len() )
1137 rText.Erase();
1138 ( rText += UniString::CreateFromInt32( GetValue() )) += '\xB0';
1139 break;
1141 default:
1142 ePres = SFX_ITEM_PRESENTATION_NONE;
1143 rText.Erase();
1144 break;
1146 return ePres;
1149 SfxItemPresentation SwLuminanceGrf::GetPresentation(
1150 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1151 String &rText, const IntlWrapper* /*pIntl*/) const
1153 switch( ePres )
1155 case SFX_ITEM_PRESENTATION_NAMELESS:
1156 case SFX_ITEM_PRESENTATION_COMPLETE:
1157 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1158 rText = SW_RESSTR( STR_LUMINANCE );
1159 else if( rText.Len() )
1160 rText.Erase();
1161 ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1162 break;
1164 default:
1165 ePres = SFX_ITEM_PRESENTATION_NONE;
1166 rText.Erase();
1167 break;
1169 return ePres;
1172 SfxItemPresentation SwContrastGrf::GetPresentation(
1173 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1174 String &rText, const IntlWrapper* /*pIntl*/) const
1176 switch( ePres )
1178 case SFX_ITEM_PRESENTATION_NAMELESS:
1179 case SFX_ITEM_PRESENTATION_COMPLETE:
1180 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1181 rText = SW_RESSTR( STR_CONTRAST );
1182 else if( rText.Len() )
1183 rText.Erase();
1184 ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1185 break;
1187 default:
1188 ePres = SFX_ITEM_PRESENTATION_NONE;
1189 rText.Erase();
1190 break;
1192 return ePres;
1195 SfxItemPresentation SwChannelGrf::GetPresentation(
1196 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1197 String &rText, const IntlWrapper* /*pIntl*/) const
1199 switch( ePres )
1201 case SFX_ITEM_PRESENTATION_NAMELESS:
1202 case SFX_ITEM_PRESENTATION_COMPLETE:
1203 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1205 USHORT nId;
1206 switch ( Which() )
1208 case RES_GRFATR_CHANNELR: nId = STR_CHANNELR; break;
1209 case RES_GRFATR_CHANNELG: nId = STR_CHANNELG; break;
1210 case RES_GRFATR_CHANNELB: nId = STR_CHANNELB; break;
1211 default: nId = 0; break;
1213 if( nId )
1214 rText = SW_RESSTR( nId );
1215 else if( rText.Len() )
1216 rText.Erase();
1218 else if( rText.Len() )
1219 rText.Erase();
1220 ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1221 break;
1223 default:
1224 ePres = SFX_ITEM_PRESENTATION_NONE;
1225 rText.Erase();
1226 break;
1228 return ePres;
1231 SfxItemPresentation SwGammaGrf::GetPresentation(
1232 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1233 String &rText, const IntlWrapper* /*pIntl*/) const
1235 switch( ePres )
1237 case SFX_ITEM_PRESENTATION_NAMELESS:
1238 case SFX_ITEM_PRESENTATION_COMPLETE:
1239 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1240 rText = SW_RESSTR( STR_GAMMA );
1241 else if( rText.Len() )
1242 rText.Erase();
1243 ( rText += UniString::CreateFromDouble( GetValue() )) += '%';
1244 break;
1246 default:
1247 ePres = SFX_ITEM_PRESENTATION_NONE;
1248 rText.Erase();
1249 break;
1251 return ePres;
1254 SfxItemPresentation SwInvertGrf::GetPresentation(
1255 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1256 String &rText, const IntlWrapper* /*pIntl*/) const
1258 rText.Erase();
1259 switch( ePres )
1261 case SFX_ITEM_PRESENTATION_NAMELESS:
1262 case SFX_ITEM_PRESENTATION_COMPLETE:
1263 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1265 USHORT nId = 0 != GetValue() ? STR_INVERT : STR_INVERT_NOT;
1266 rText = SW_RESSTR( nId );
1268 break;
1270 default:
1271 ePres = SFX_ITEM_PRESENTATION_NONE;
1272 break;
1274 return ePres;
1277 SfxItemPresentation SwTransparencyGrf::GetPresentation(
1278 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1279 String &rText, const IntlWrapper* /*pIntl*/) const
1281 switch( ePres )
1283 case SFX_ITEM_PRESENTATION_NAMELESS:
1284 case SFX_ITEM_PRESENTATION_COMPLETE:
1285 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1286 rText = SW_RESSTR( STR_TRANSPARENCY );
1287 else if( rText.Len() )
1288 rText.Erase();
1289 ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1290 break;
1292 default:
1293 ePres = SFX_ITEM_PRESENTATION_NONE;
1294 rText.Erase();
1295 break;
1297 return ePres;
1300 SfxItemPresentation SwDrawModeGrf::GetPresentation(
1301 SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1302 String &rText, const IntlWrapper* /*pIntl*/) const
1304 rText.Erase();
1305 switch( ePres )
1307 case SFX_ITEM_PRESENTATION_NAMELESS:
1308 case SFX_ITEM_PRESENTATION_COMPLETE:
1309 if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1311 USHORT nId;
1312 switch ( GetValue() )
1315 case GRAPHICDRAWMODE_GREYS: nId = STR_DRAWMODE_GREY; break;
1316 case GRAPHICDRAWMODE_MONO: nId = STR_DRAWMODE_BLACKWHITE; break;
1317 case GRAPHICDRAWMODE_WATERMARK: nId = STR_DRAWMODE_WATERMARK; break;
1318 default: nId = STR_DRAWMODE_STD; break;
1320 (rText = SW_RESSTR( STR_DRAWMODE ) ) += SW_RESSTR( nId );
1322 break;
1324 default:
1325 ePres = SFX_ITEM_PRESENTATION_NONE;
1326 break;
1328 return ePres;
1331 SfxItemPresentation SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation ePres,
1332 SfxMapUnit /*eCoreMetric*/,
1333 SfxMapUnit /*ePresMetric*/,
1334 String &rText,
1335 const IntlWrapper* /*pIntl*/ ) const
1337 rText.Erase();
1338 switch( ePres )
1340 case SFX_ITEM_PRESENTATION_NAMELESS:
1341 break;
1342 case SFX_ITEM_PRESENTATION_COMPLETE:
1344 USHORT nId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW;
1345 rText = SW_RESSTR( nId );
1347 break;
1349 default:
1350 ePres = SFX_ITEM_PRESENTATION_NONE;
1351 break;
1353 return ePres;