xref: /AOO41X/main/sw/source/ui/utlui/attrdesc.cxx (revision ff0525f24f03981d56b7579b645949f111420994)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 #include <svl/itemiter.hxx>
29 #include <vcl/svapp.hxx>
30 #include <editeng/itemtype.hxx>
31 #include <svtools/grfmgr.hxx>
32 #include <unotools/intlwrapper.hxx>
33 #include <comphelper/processfactory.hxx>
34 #include <fmtanchr.hxx>
35 #include <fmtfsize.hxx>
36 #include <fmtinfmt.hxx>
37 #include <fchrfmt.hxx>
38 #include <fmtautofmt.hxx>
39 #include <fmtsrnd.hxx>
40 #include <fmtornt.hxx>
41 #include <fmtlsplt.hxx>
42 #include <fmtrowsplt.hxx>
43 #include <fmtpdsc.hxx>
44 #include <fmtclds.hxx>
45 #include <fmteiro.hxx>
46 #include <fmturl.hxx>
47 #include <fmthdft.hxx>
48 #include <fmtcnct.hxx>
49 #include <fmtline.hxx>
50 #include <tgrditem.hxx>
51 #include <hfspacingitem.hxx>
52 #include <fmtruby.hxx>
53 #include <paratr.hxx>
54 #include <grfatr.hxx>
55 #include <pagedesc.hxx>
56 #include <charfmt.hxx>
57 #include <fmtcol.hxx>
58 #include <tox.hxx>
59 #ifndef _ATTRDESC_HRC
60 #include <attrdesc.hrc>
61 #endif
62 #include <fmtftntx.hxx>
63 #include <fmtfollowtextflow.hxx>
64 
65 
66 using namespace com::sun::star;
67 
68 
69 TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient);
70 
71 // erfrage die Attribut-Beschreibung
72 void SwAttrSet::GetPresentation(
73         SfxItemPresentation ePres,
74         SfxMapUnit eCoreMetric,
75         SfxMapUnit ePresMetric,
76         String &rText ) const
77 {
78 static sal_Char __READONLY_DATA sKomma[] = ", ";
79 
80     rText.Erase();
81     String aStr;
82     if( Count() )
83     {
84         SfxItemIter aIter( *this );
85         const IntlWrapper rInt( ::comphelper::getProcessServiceFactory(),
86                                     GetAppLanguage() );
87         while( sal_True )
88         {
89             aIter.GetCurItem()->GetPresentation( ePres, eCoreMetric,
90                                                  ePresMetric, aStr,
91                                                  &rInt );
92             if( rText.Len() && aStr.Len() )
93                 rText += String::CreateFromAscii(sKomma);
94             rText += aStr;
95             if( aIter.IsAtEnd() )
96                 break;
97             aIter.NextItem();
98         }
99     }
100 }
101 
102 // ATT_CHARFMT *********************************************
103 
104 
105 SfxItemPresentation SwFmtCharFmt::GetPresentation
106 (
107     SfxItemPresentation ePres,
108     SfxMapUnit          eCoreUnit,
109     SfxMapUnit          ePresUnit,
110     String&             rText,
111     const IntlWrapper*        /*pIntl*/
112 )   const
113 {
114     switch ( ePres )
115     {
116         case SFX_ITEM_PRESENTATION_NONE:
117             rText.Erase();
118             break;
119         case SFX_ITEM_PRESENTATION_NAMELESS:
120         case SFX_ITEM_PRESENTATION_COMPLETE:
121         {
122             const SwCharFmt *pCharFmt = GetCharFmt();
123             if ( pCharFmt )
124             {
125                 String aStr;
126                 rText = SW_RESSTR(STR_CHARFMT );
127                 pCharFmt->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr );
128                 rText += '(';
129                 rText += aStr;
130                 rText += ')';
131             }
132             else
133                 rText = SW_RESSTR( STR_NO_CHARFMT );
134             return ePres;
135         }
136         default:;//prevent warning
137     }
138     return SFX_ITEM_PRESENTATION_NONE;
139 }
140 
141 // ATT_AUTOFMT *********************************************
142 
143 
144 SfxItemPresentation SwFmtAutoFmt::GetPresentation
145 (
146     SfxItemPresentation ePres,
147     SfxMapUnit          /*eCoreUnit*/,
148     SfxMapUnit          /*ePresUnit*/,
149     String&             rText,
150     const IntlWrapper*        /*pIntl*/
151 )   const
152 {
153     switch ( ePres )
154     {
155         case SFX_ITEM_PRESENTATION_NONE:
156             rText.Erase();
157             break;
158         case SFX_ITEM_PRESENTATION_NAMELESS:
159         case SFX_ITEM_PRESENTATION_COMPLETE:
160         {
161             rText.Erase(); //TODO
162             return ePres;
163         }
164         default:;//prevent warning
165     }
166     return SFX_ITEM_PRESENTATION_NONE;
167 }
168 
169 // ATT_INETFMT *********************************************
170 
171 
172 SfxItemPresentation SwFmtINetFmt::GetPresentation
173 (
174     SfxItemPresentation ePres,
175     SfxMapUnit          /*eCoreUnit*/,
176     SfxMapUnit          /*ePresUnit*/,
177     String&             rText,
178     const IntlWrapper*        /*pIntl*/
179 )   const
180 {
181     switch ( ePres )
182     {
183         case SFX_ITEM_PRESENTATION_NONE:
184             rText.Erase();
185             break;
186         case SFX_ITEM_PRESENTATION_NAMELESS:
187         case SFX_ITEM_PRESENTATION_COMPLETE:
188         {
189             rText = GetValue();
190             return ePres;
191         }
192         default:;//prevent warning
193     }
194     return SFX_ITEM_PRESENTATION_NONE;
195 }
196 
197 SfxItemPresentation SwFmtRuby::GetPresentation( SfxItemPresentation ePres,
198                             SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
199                             String &rText, const IntlWrapper* /*pIntl*/ ) const
200 {
201     switch ( ePres )
202     {
203         case SFX_ITEM_PRESENTATION_NONE:
204             rText.Erase();
205             break;
206         case SFX_ITEM_PRESENTATION_NAMELESS:
207         case SFX_ITEM_PRESENTATION_COMPLETE:
208             {
209                 rText = aEmptyStr;
210                 return ePres;
211             }
212         default:;//prevent warning
213     }
214     return SFX_ITEM_PRESENTATION_NONE;
215 }
216 
217 /*************************************************************************
218 |*    class     SwFmtDrop
219 *************************************************************************/
220 
221 
222 SfxItemPresentation SwFmtDrop::GetPresentation
223 (
224     SfxItemPresentation ePres,
225     SfxMapUnit          /*eCoreUnit*/,
226     SfxMapUnit          /*ePresUnit*/,
227     String&             rText,
228     const IntlWrapper*        /*pIntl*/
229 )   const
230 {
231     rText.Erase();
232     switch ( ePres )
233     {
234         case SFX_ITEM_PRESENTATION_NONE:
235             break;
236         case SFX_ITEM_PRESENTATION_NAMELESS:
237         case SFX_ITEM_PRESENTATION_COMPLETE:
238         {
239             if ( GetLines() > 1 )
240             {
241                 if ( GetChars() > 1 )
242                 {
243                     rText = String::CreateFromInt32( GetChars() );
244                     rText += ' ';
245                 }
246                 rText += SW_RESSTR( STR_DROP_OVER );
247                 rText += ' ';
248                 rText += String::CreateFromInt32( GetLines() );
249                 rText += ' ';
250                 rText += SW_RESSTR( STR_DROP_LINES );
251             }
252             else
253                 rText = SW_RESSTR( STR_NO_DROP_LINES );
254             return ePres;
255         }
256         default:;//prevent warning
257     }
258     return SFX_ITEM_PRESENTATION_NONE;
259 }
260 
261 /*************************************************************************
262 |*    class     SwRegisterItem
263 *************************************************************************/
264 
265 
266 SfxItemPresentation SwRegisterItem::GetPresentation
267 (
268     SfxItemPresentation ePres,
269     SfxMapUnit          /*eCoreUnit*/,
270     SfxMapUnit          /*ePresUnit*/,
271     XubString&          rText,
272     const IntlWrapper*        /*pIntl*/
273 )   const
274 {
275     switch ( ePres )
276     {
277         case SFX_ITEM_PRESENTATION_NONE:
278             rText.Erase();
279             return SFX_ITEM_PRESENTATION_NONE;
280         case SFX_ITEM_PRESENTATION_NAMELESS:
281         case SFX_ITEM_PRESENTATION_COMPLETE:
282         {
283             sal_uInt16 nId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF;
284             rText = SW_RESSTR( nId );
285             return ePres;
286         }
287         default:;//prevent warning
288     }
289     return SFX_ITEM_PRESENTATION_NONE;
290 }
291 
292 /*************************************************************************
293 |*    class     SwNumRuleItem
294 *************************************************************************/
295 
296 
297 SfxItemPresentation SwNumRuleItem::GetPresentation
298 (
299     SfxItemPresentation ePres,
300     SfxMapUnit          /*eCoreUnit*/,
301     SfxMapUnit          /*ePresUnit*/,
302     XubString&          rText,
303     const IntlWrapper*        /*pIntl*/
304 )   const
305 {
306     switch ( ePres )
307     {
308         case SFX_ITEM_PRESENTATION_NONE:
309             rText.Erase();
310             return SFX_ITEM_PRESENTATION_NONE;
311         case SFX_ITEM_PRESENTATION_NAMELESS:
312         case SFX_ITEM_PRESENTATION_COMPLETE:
313         {
314             if( GetValue().Len() )
315                 (((rText = SW_RESSTR( STR_NUMRULE_ON )) +=
316                     '(' ) += GetValue() ) += ')';
317             else
318                 rText = SW_RESSTR( STR_NUMRULE_OFF );
319             return ePres;
320         }
321         default:;//prevent warning
322     }
323     return SFX_ITEM_PRESENTATION_NONE;
324 }
325 /*************************************************************************
326 |*    class     SwParaConnectBorderItem
327 *************************************************************************/
328 
329 SfxItemPresentation SwParaConnectBorderItem::GetPresentation
330 (
331     SfxItemPresentation ePres,
332     SfxMapUnit          /*eCoreUnit*/,
333     SfxMapUnit          /*ePresUnit*/,
334     XubString&          rText,
335     const IntlWrapper*        /*pIntl*/
336 )   const
337 {
338     switch ( ePres )
339     {
340         case SFX_ITEM_PRESENTATION_NONE:
341             rText.Erase();
342             return SFX_ITEM_PRESENTATION_NONE;
343         case SFX_ITEM_PRESENTATION_NAMELESS:
344         case SFX_ITEM_PRESENTATION_COMPLETE:
345         {
346             sal_uInt16 nId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF;
347             rText = SW_RESSTR( nId );
348             return ePres;
349         }
350         default:;//prevent warning
351     }
352     return SFX_ITEM_PRESENTATION_NONE;
353 }
354 
355 
356 
357 /******************************************************************************
358  *  Frame-Attribute:
359  ******************************************************************************/
360 
361 
362 SfxItemPresentation SwFmtFrmSize::GetPresentation
363 (
364     SfxItemPresentation ePres,
365     SfxMapUnit          eCoreUnit,
366     SfxMapUnit          ePresUnit,
367     String&             rText,
368     const IntlWrapper*        pIntl
369 )   const
370 {
371     switch ( ePres )
372     {
373         case SFX_ITEM_PRESENTATION_NONE:
374         {
375             rText.Erase();
376             break;
377         }
378         case SFX_ITEM_PRESENTATION_NAMELESS:
379         case SFX_ITEM_PRESENTATION_COMPLETE:
380         {
381             rText = SW_RESSTR( STR_FRM_WIDTH );
382             rText += ' ';
383             if ( GetWidthPercent() )
384             {
385                 rText += String::CreateFromInt32(GetWidthPercent());
386                 rText += '%';
387             }
388             else
389             {
390                 rText += ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl );
391                 rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
392             }
393             if ( ATT_VAR_SIZE != GetHeightSizeType() )
394             {
395                 rText += ',';
396                 rText += ' ';
397                 const sal_uInt16 nId = ATT_FIX_SIZE == eFrmHeightType ?
398                                         STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT;
399                 rText += SW_RESSTR( nId );
400                 rText += ' ';
401                 if ( GetHeightPercent() )
402                 {
403                     rText += String::CreateFromInt32(GetHeightPercent());
404                     rText += '%';
405                 }
406                 else
407                 {
408                     rText += ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl );
409                     rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
410                 }
411             }
412             return ePres;
413         }
414         default:;//prevent warning
415     }
416     return SFX_ITEM_PRESENTATION_NONE;
417 }
418 
419 //Kopfzeile, fuer Seitenformate
420 //Client von FrmFmt das den Header beschreibt.
421 
422 
423 SfxItemPresentation SwFmtHeader::GetPresentation
424 (
425     SfxItemPresentation ePres,
426     SfxMapUnit          /*eCoreUnit*/,
427     SfxMapUnit          /*ePresUnit*/,
428     String&             rText,
429     const IntlWrapper*        /*pIntl*/
430 )   const
431 {
432     switch ( ePres )
433     {
434         case SFX_ITEM_PRESENTATION_NONE:
435             rText.Erase();
436             break;
437         case SFX_ITEM_PRESENTATION_NAMELESS:
438         case SFX_ITEM_PRESENTATION_COMPLETE:
439         {
440             const sal_uInt16 nId = GetHeaderFmt() ? STR_HEADER : STR_NO_HEADER;
441             rText = SW_RESSTR( nId );
442             return ePres;
443         }
444         default:;//prevent warning
445     }
446     return SFX_ITEM_PRESENTATION_NONE;
447 }
448 
449 //Fusszeile, fuer Seitenformate
450 //Client von FrmFmt das den Footer beschreibt.
451 
452 
453 SfxItemPresentation SwFmtFooter::GetPresentation
454 (
455     SfxItemPresentation ePres,
456     SfxMapUnit          /*eCoreUnit*/,
457     SfxMapUnit          /*ePresUnit*/,
458     String&             rText,
459     const IntlWrapper*        /*pIntl*/
460 )   const
461 {
462     switch ( ePres )
463     {
464         case SFX_ITEM_PRESENTATION_NONE:
465             rText.Erase();
466             break;
467         case SFX_ITEM_PRESENTATION_NAMELESS:
468         case SFX_ITEM_PRESENTATION_COMPLETE:
469         {
470             const sal_uInt16 nId = GetFooterFmt() ? STR_FOOTER : STR_NO_FOOTER;
471             rText = SW_RESSTR( nId );
472             return ePres;
473         }
474         default:;//prevent warning
475     }
476     return SFX_ITEM_PRESENTATION_NONE;
477 }
478 
479 
480 SfxItemPresentation SwFmtSurround::GetPresentation
481 (
482     SfxItemPresentation ePres,
483     SfxMapUnit          /*eCoreUnit*/,
484     SfxMapUnit          /*ePresUnit*/,
485     String&             rText,
486     const IntlWrapper*        /*pIntl*/
487 )   const
488 {
489     switch ( ePres )
490     {
491         case SFX_ITEM_PRESENTATION_NONE:
492             rText.Erase();
493             break;
494         case SFX_ITEM_PRESENTATION_NAMELESS:
495         case SFX_ITEM_PRESENTATION_COMPLETE:
496         {
497             sal_uInt16 nId = 0;
498             switch ( (SwSurround)GetValue() )
499             {
500                 case SURROUND_NONE:
501                     nId = STR_SURROUND_NONE;
502                 break;
503                 case SURROUND_THROUGHT:
504                     nId = STR_SURROUND_THROUGHT;
505                 break;
506                 case SURROUND_PARALLEL:
507                     nId = STR_SURROUND_PARALLEL;
508                 break;
509                 case SURROUND_IDEAL:
510                     nId = STR_SURROUND_IDEAL;
511                 break;
512                 case SURROUND_LEFT:
513                     nId = STR_SURROUND_LEFT;
514                 break;
515                 case SURROUND_RIGHT:
516                     nId = STR_SURROUND_RIGHT;
517                 break;
518                 default:;//prevent warning
519             }
520             if ( nId )
521                 rText = SW_RESSTR( nId );
522 
523             if ( IsAnchorOnly() )
524             {
525                 rText += ' ';
526                 rText += SW_RESSTR( STR_SURROUND_ANCHORONLY );
527             }
528             return ePres;
529         }
530         default:;//prevent warning
531     }
532     return SFX_ITEM_PRESENTATION_NONE;
533 }
534 
535 
536 //VertOrientation, wie und woran orientiert --
537 //  sich der FlyFrm in der Vertikalen -----------
538 
539 
540 SfxItemPresentation SwFmtVertOrient::GetPresentation
541 (
542     SfxItemPresentation ePres,
543     SfxMapUnit          eCoreUnit,
544     SfxMapUnit          ePresUnit,
545     String&             rText,
546     const IntlWrapper*        pIntl
547 )   const
548 {
549     switch ( ePres )
550     {
551         case SFX_ITEM_PRESENTATION_NONE:
552             rText.Erase();
553             break;
554         case SFX_ITEM_PRESENTATION_NAMELESS:
555         case SFX_ITEM_PRESENTATION_COMPLETE:
556         {
557             sal_uInt16 nId = 0;
558             switch ( GetVertOrient() )
559             {
560                 case text::VertOrientation::NONE:
561                 {
562                     rText += SW_RESSTR( STR_POS_Y );
563                     rText += ' ';
564                     rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
565                     rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
566                 }
567                 break;
568                 case text::VertOrientation::TOP:
569                     nId = STR_VERT_TOP;
570                     break;
571                 case text::VertOrientation::CENTER:
572                     nId = STR_VERT_CENTER;
573                     break;
574                 case text::VertOrientation::BOTTOM:
575                     nId = STR_VERT_BOTTOM;
576                     break;
577                 case text::VertOrientation::LINE_TOP:
578                     nId = STR_LINE_TOP;
579                     break;
580                 case text::VertOrientation::LINE_CENTER:
581                     nId = STR_LINE_CENTER;
582                     break;
583                 case text::VertOrientation::LINE_BOTTOM:
584                     nId = STR_LINE_BOTTOM;
585                     break;
586                 default:;//prevent warning
587             }
588             if ( nId )
589                 rText += SW_RESSTR( nId );
590             return ePres;
591         }
592         default:;//prevent warning
593     }
594     return SFX_ITEM_PRESENTATION_NONE;
595 }
596 
597 //HoriOrientation, wie und woran orientiert --
598 //  sich der FlyFrm in der Hoizontalen ----------
599 
600 
601 SfxItemPresentation SwFmtHoriOrient::GetPresentation
602 (
603     SfxItemPresentation ePres,
604     SfxMapUnit          eCoreUnit,
605     SfxMapUnit          ePresUnit,
606     String&             rText,
607     const IntlWrapper*        pIntl
608 )   const
609 {
610     switch ( ePres )
611     {
612         case SFX_ITEM_PRESENTATION_NONE:
613             rText.Erase();
614             break;
615         case SFX_ITEM_PRESENTATION_NAMELESS:
616         case SFX_ITEM_PRESENTATION_COMPLETE:
617         {
618             sal_uInt16 nId = 0;
619             switch ( GetHoriOrient() )
620             {
621                 case text::HoriOrientation::NONE:
622                 {
623                     rText += SW_RESSTR( STR_POS_X );
624                     rText += ' ';
625                     rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
626                     rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
627                 }
628                 break;
629                 case text::HoriOrientation::RIGHT:
630                     nId = STR_HORI_RIGHT;
631                 break;
632                 case text::HoriOrientation::CENTER:
633                     nId = STR_HORI_CENTER;
634                 break;
635                 case text::HoriOrientation::LEFT:
636                     nId = STR_HORI_LEFT;
637                 break;
638                 case text::HoriOrientation::INSIDE:
639                     nId = STR_HORI_INSIDE;
640                 break;
641                 case text::HoriOrientation::OUTSIDE:
642                     nId = STR_HORI_OUTSIDE;
643                 break;
644                 case text::HoriOrientation::FULL:
645                     nId = STR_HORI_FULL;
646                 break;
647                 default:;//prevent warning
648             }
649             if ( nId )
650                 rText += SW_RESSTR( nId );
651             return ePres;
652         }
653         default:;//prevent warning
654     }
655     return SFX_ITEM_PRESENTATION_NONE;
656 }
657 
658 //FlyAnchor, Anker des Freifliegenden Rahmen ----
659 
660 
661 SfxItemPresentation SwFmtAnchor::GetPresentation
662 (
663     SfxItemPresentation ePres,
664     SfxMapUnit          /*eCoreUnit*/,
665     SfxMapUnit          /*ePresUnit*/,
666     String&             rText,
667     const IntlWrapper*        /*pIntl*/
668 )   const
669 {
670     switch ( ePres )
671     {
672         case SFX_ITEM_PRESENTATION_NONE:
673             rText.Erase();
674             break;
675         case SFX_ITEM_PRESENTATION_NAMELESS:
676         case SFX_ITEM_PRESENTATION_COMPLETE:
677         {
678             sal_uInt16 nId = 0;
679             switch ( GetAnchorId() )
680             {
681                 case FLY_AT_PARA:
682                     nId = STR_FLY_AT_PARA;
683                     break;
684                 case FLY_AS_CHAR:
685                     nId = STR_FLY_AS_CHAR;
686                     break;
687                 case FLY_AT_PAGE:
688                     nId = STR_FLY_AT_PAGE;
689                     break;
690                 default:;//prevent warning
691             }
692             if ( nId )
693                 rText += SW_RESSTR( nId );
694             return ePres;
695         }
696         default:;//prevent warning
697     }
698     return SFX_ITEM_PRESENTATION_NONE;
699 }
700 
701 
702 SfxItemPresentation SwFmtPageDesc::GetPresentation
703 (
704     SfxItemPresentation ePres,
705     SfxMapUnit          /*eCoreUnit*/,
706     SfxMapUnit          /*ePresUnit*/,
707     String&             rText,
708     const IntlWrapper*        /*pIntl*/
709 )   const
710 {
711     switch ( ePres )
712     {
713         case SFX_ITEM_PRESENTATION_NONE:
714             rText.Erase();
715             break;
716         case SFX_ITEM_PRESENTATION_NAMELESS:
717         case SFX_ITEM_PRESENTATION_COMPLETE:
718         {
719             const SwPageDesc *pPageDesc = GetPageDesc();
720             if ( pPageDesc )
721                 rText = pPageDesc->GetName();
722             else
723                 rText = SW_RESSTR( STR_NO_PAGEDESC );
724             return ePres;
725         }
726         default:;//prevent warning
727     }
728     return SFX_ITEM_PRESENTATION_NONE;
729 }
730 
731 //Der ColumnDescriptor --------------------------
732 
733 
734 SfxItemPresentation SwFmtCol::GetPresentation
735 (
736     SfxItemPresentation ePres,
737     SfxMapUnit          eCoreUnit,
738     SfxMapUnit          /*ePresUnit*/,
739     String&             rText,
740     const IntlWrapper*        pIntl
741 )   const
742 {
743     switch ( ePres )
744     {
745         case SFX_ITEM_PRESENTATION_NONE:
746             rText.Erase();
747             break;
748         case SFX_ITEM_PRESENTATION_NAMELESS:
749         case SFX_ITEM_PRESENTATION_COMPLETE:
750         {
751             sal_uInt16 nCnt = GetNumCols();
752             if ( nCnt > 1 )
753             {
754                 rText = String::CreateFromInt32(nCnt);
755                 rText += ' ';
756                 rText += SW_RESSTR( STR_COLUMNS );
757                 if ( COLADJ_NONE != GetLineAdj() )
758                 {
759                     sal_uInt16 nWdth = sal_uInt16(GetLineWidth());
760                     rText += ' ';
761                     rText += SW_RESSTR( STR_LINE_WIDTH );
762                     rText += ' ';
763                     rText += ::GetMetricText( nWdth, eCoreUnit,
764                                               SFX_MAPUNIT_POINT, pIntl );
765                 }
766             }
767             else
768                 rText.Erase();
769             return ePres;
770         }
771         default:;//prevent warning
772     }
773     return SFX_ITEM_PRESENTATION_NONE;
774 }
775 
776 //URL's und Maps
777 
778 
779 SfxItemPresentation SwFmtURL::GetPresentation
780 (
781     SfxItemPresentation ePres,
782     SfxMapUnit          /*eCoreUnit*/,
783     SfxMapUnit          /*ePresUnit*/,
784     String&             rText,
785     const IntlWrapper*        /*pIntl*/
786 )   const
787 {
788     rText.Erase();
789     switch ( ePres )
790     {
791         case SFX_ITEM_PRESENTATION_NONE:
792             break;
793         case SFX_ITEM_PRESENTATION_NAMELESS:
794         case SFX_ITEM_PRESENTATION_COMPLETE:
795         {
796             if ( pMap )
797                 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM("Client-Map"));
798             if ( sURL.Len() )
799             {
800                 if ( pMap )
801                     rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" - "));
802                 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM("URL: "));
803                 rText += sURL;
804                 if ( bIsServerMap )
805                     rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" (Server-Map)"));
806             }
807             if ( sTargetFrameName.Len() )
808             {
809                 rText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(", Target: "));
810                 rText += sTargetFrameName;
811             }
812             return ePres;
813         }
814         default:;//prevent warning
815     }
816     return SFX_ITEM_PRESENTATION_NONE;
817 }
818 
819 
820 //SwFmtEditInReadonly
821 
822 
823 SfxItemPresentation SwFmtEditInReadonly::GetPresentation
824 (
825     SfxItemPresentation ePres,
826     SfxMapUnit          /*eCoreUnit*/,
827     SfxMapUnit          /*ePresUnit*/,
828     String&             rText,
829     const IntlWrapper*        /*pIntl*/
830 )   const
831 {
832     rText.Erase();
833     switch ( ePres )
834     {
835         case SFX_ITEM_PRESENTATION_NONE:
836             rText.Erase();
837             break;
838         case SFX_ITEM_PRESENTATION_NAMELESS:
839         case SFX_ITEM_PRESENTATION_COMPLETE:
840         {
841             if ( GetValue() )
842                 rText = SW_RESSTR(STR_EDIT_IN_READONLY);
843             return ePres;
844         }
845         default:;//prevent warning
846     }
847     return SFX_ITEM_PRESENTATION_NONE;
848 }
849 
850 
851 SfxItemPresentation SwFmtLayoutSplit::GetPresentation
852 (
853     SfxItemPresentation ePres,
854     SfxMapUnit          /*eCoreUnit*/,
855     SfxMapUnit          /*ePresUnit*/,
856     String&             rText,
857     const IntlWrapper*        /*pIntl*/
858 )   const
859 {
860     switch ( ePres )
861     {
862         case SFX_ITEM_PRESENTATION_NONE:
863             rText.Erase();
864             return SFX_ITEM_PRESENTATION_NONE;
865         case SFX_ITEM_PRESENTATION_NAMELESS:
866         case SFX_ITEM_PRESENTATION_COMPLETE:
867         {
868             if ( GetValue() )
869                 rText = SW_RESSTR(STR_LAYOUT_SPLIT);
870             return ePres;
871         }
872         default:;//prevent warning
873     }
874     return SFX_ITEM_PRESENTATION_NONE;
875 }
876 
877 SfxItemPresentation SwFmtRowSplit::GetPresentation
878 (
879     SfxItemPresentation /*ePres*/,
880     SfxMapUnit          /*eCoreUnit*/,
881     SfxMapUnit          /*ePresUnit*/,
882     String&             /*rText*/,
883     const IntlWrapper*        /*pIntl*/
884 )   const
885 {
886     return SFX_ITEM_PRESENTATION_NONE;
887 }
888 
889 
890 SfxItemPresentation SwFmtFtnEndAtTxtEnd::GetPresentation
891 (
892     SfxItemPresentation ePres,
893     SfxMapUnit          /*eCoreUnit*/,
894     SfxMapUnit          /*ePresUnit*/,
895     String&             rText,
896     const IntlWrapper*        /*pIntl*/
897 )   const
898 {
899     switch ( ePres )
900     {
901         case SFX_ITEM_PRESENTATION_NONE:
902             rText.Erase();
903             break;
904 
905         case SFX_ITEM_PRESENTATION_NAMELESS:
906         case SFX_ITEM_PRESENTATION_COMPLETE:
907             {
908                 switch( GetValue() )
909                 {
910                 case FTNEND_ATPGORDOCEND:
911 //                  rText = SW_RESSTR( STR_LAYOUT_FTN );
912                     break;
913 
914                 case FTNEND_ATTXTEND:
915                     break;
916 
917                 case FTNEND_ATTXTEND_OWNNUMSEQ:
918                     {
919 //  String      sPrefix;
920 //  String      sSuffix;
921 //  SvxNumberType   aFmt;
922 //  sal_uInt16      nOffset;
923 //                      rText +=
924                     }
925                     break;
926                 }
927             }
928             break;
929 
930         default:
931             ePres = SFX_ITEM_PRESENTATION_NONE;
932             break;
933     }
934     return ePres;
935 }
936 
937 SfxItemPresentation SwFmtChain::GetPresentation
938 (
939     SfxItemPresentation ePres,
940     SfxMapUnit          /*eCoreUnit*/,
941     SfxMapUnit          /*ePresUnit*/,
942     String&             rText,
943     const IntlWrapper*        /*pIntl*/
944 )   const
945 {
946     switch ( ePres )
947     {
948         case SFX_ITEM_PRESENTATION_NONE:
949             rText.Erase();
950             return SFX_ITEM_PRESENTATION_NONE;
951         case SFX_ITEM_PRESENTATION_NAMELESS:
952         case SFX_ITEM_PRESENTATION_COMPLETE:
953         {
954             if ( GetPrev() || GetNext() )
955             {
956                 rText = SW_RESSTR(STR_CONNECT1);
957                 if ( GetPrev() )
958                 {
959                     rText += GetPrev()->GetName();
960                     if ( GetNext() )
961                         rText += SW_RESSTR(STR_CONNECT2);
962                 }
963                 if ( GetNext() )
964                     rText += GetNext()->GetName();
965             }
966             return ePres;
967         }
968         default:;//prevent warning
969     }
970     return SFX_ITEM_PRESENTATION_NONE;
971 }
972 
973 
974 SfxItemPresentation SwFmtLineNumber::GetPresentation
975 (
976     SfxItemPresentation ePres,
977     SfxMapUnit          /*eCoreUnit*/,
978     SfxMapUnit          /*ePresUnit*/,
979     String&             rText,
980     const IntlWrapper*    /*pIntl*/
981 )   const
982 {
983     switch ( ePres )
984     {
985         case SFX_ITEM_PRESENTATION_NONE:
986             rText.Erase();
987             return SFX_ITEM_PRESENTATION_NONE;
988         case SFX_ITEM_PRESENTATION_NAMELESS:
989         case SFX_ITEM_PRESENTATION_COMPLETE:
990         {
991             if ( IsCount() )
992                 rText += SW_RESSTR(STR_LINECOUNT);
993             else
994                 rText += SW_RESSTR(STR_DONTLINECOUNT);
995             if ( GetStartValue() )
996             {
997                 rText += ' ';
998                 rText += SW_RESSTR(STR_LINCOUNT_START);
999                 rText += String::CreateFromInt32(GetStartValue());
1000             }
1001             return ePres;
1002         }
1003         default:;//prevent warning
1004     }
1005     return SFX_ITEM_PRESENTATION_NONE;
1006 }
1007 
1008 SfxItemPresentation SwTextGridItem::GetPresentation
1009 (
1010     SfxItemPresentation ePres,
1011     SfxMapUnit          /*eCoreUnit*/,
1012     SfxMapUnit          /*ePresUnit*/,
1013     String&             rText,
1014     const IntlWrapper*  /*pIntl*/
1015 )   const
1016 {
1017     switch ( ePres )
1018     {
1019         case SFX_ITEM_PRESENTATION_NONE:
1020             rText.Erase();
1021             return SFX_ITEM_PRESENTATION_NONE;
1022         case SFX_ITEM_PRESENTATION_NAMELESS:
1023         case SFX_ITEM_PRESENTATION_COMPLETE:
1024         {
1025             sal_uInt16 nId = 0;
1026 
1027             switch ( GetGridType() )
1028             {
1029             case GRID_NONE :
1030                 nId = STR_GRID_NONE;
1031                 break;
1032             case GRID_LINES_ONLY :
1033                 nId = STR_GRID_LINES_ONLY;
1034                 break;
1035             case GRID_LINES_CHARS :
1036                 nId = STR_GRID_LINES_CHARS;
1037                 break;
1038             }
1039             if ( nId )
1040                 rText += SW_RESSTR( nId );
1041             return ePres;
1042         }
1043         default:;//prevent warning
1044     }
1045 
1046     return SFX_ITEM_PRESENTATION_NONE;
1047 }
1048 
1049 
1050 //SwHeaderAndFooterEatSpacingItem
1051 
1052 
1053 SfxItemPresentation SwHeaderAndFooterEatSpacingItem::GetPresentation
1054 (
1055     SfxItemPresentation /*ePres*/,
1056     SfxMapUnit          /*eCoreUnit*/,
1057     SfxMapUnit          /*ePresUnit*/,
1058     String&             /*rText*/,
1059     const IntlWrapper*        /*pIntl*/
1060 )   const
1061 {
1062 //    rText.Erase();
1063 //    switch ( ePres )
1064 //    {
1065 //        case SFX_ITEM_PRESENTATION_NONE:
1066 //            rText.Erase();
1067 //            break;
1068 //        case SFX_ITEM_PRESENTATION_NAMELESS:
1069 //        case SFX_ITEM_PRESENTATION_COMPLETE:
1070 //        {
1071 //            if ( GetValue() )
1072 //                rText = SW_RESSTR(STR_EDIT_IN_READONLY);
1073 //            return ePres;
1074 //        }
1075 //    }
1076     return SFX_ITEM_PRESENTATION_NONE;
1077 }
1078 
1079 
1080 // ---------------------- Grafik-Attribute --------------------------
1081 
1082 SfxItemPresentation SwMirrorGrf::GetPresentation(
1083     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1084     String& rText, const IntlWrapper* /*pIntl*/ ) const
1085 {
1086     switch ( ePres )
1087     {
1088     case SFX_ITEM_PRESENTATION_NAMELESS:
1089     case SFX_ITEM_PRESENTATION_COMPLETE:
1090         {
1091             sal_uInt16 nId;
1092             switch( GetValue() )
1093             {
1094             case RES_MIRROR_GRAPH_DONT:     nId = STR_NO_MIRROR;    break;
1095             case RES_MIRROR_GRAPH_VERT: nId = STR_VERT_MIRROR;  break;
1096             case RES_MIRROR_GRAPH_HOR:  nId = STR_HORI_MIRROR;  break;
1097             case RES_MIRROR_GRAPH_BOTH: nId = STR_BOTH_MIRROR;  break;
1098             default:                    nId = 0;    break;
1099             }
1100             if ( nId )
1101             {
1102                 rText = SW_RESSTR( nId );
1103                 if (bGrfToggle)
1104                     rText += SW_RESSTR( STR_MIRROR_TOGGLE );
1105             }
1106         }
1107         break;
1108     default:
1109         ePres = SFX_ITEM_PRESENTATION_NONE;
1110         rText.Erase();
1111         break;
1112     }
1113     return ePres;
1114 }
1115 
1116 
1117 SfxItemPresentation SwRotationGrf::GetPresentation(
1118     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1119     String &rText, const IntlWrapper* /*pIntl*/) const
1120 {
1121     switch( ePres )
1122     {
1123     case SFX_ITEM_PRESENTATION_NAMELESS:
1124     case SFX_ITEM_PRESENTATION_COMPLETE:
1125         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1126             rText = SW_RESSTR( STR_ROTATION );
1127         else if( rText.Len() )
1128             rText.Erase();
1129         ( rText += UniString::CreateFromInt32( GetValue() )) += '\xB0';
1130         break;
1131 
1132     default:
1133         ePres = SFX_ITEM_PRESENTATION_NONE;
1134         rText.Erase();
1135         break;
1136     }
1137     return ePres;
1138 }
1139 
1140 SfxItemPresentation SwLuminanceGrf::GetPresentation(
1141     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1142     String &rText, const IntlWrapper* /*pIntl*/) const
1143 {
1144     switch( ePres )
1145     {
1146     case SFX_ITEM_PRESENTATION_NAMELESS:
1147     case SFX_ITEM_PRESENTATION_COMPLETE:
1148         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1149             rText = SW_RESSTR( STR_LUMINANCE );
1150         else if( rText.Len() )
1151             rText.Erase();
1152         ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1153         break;
1154 
1155     default:
1156         ePres = SFX_ITEM_PRESENTATION_NONE;
1157         rText.Erase();
1158         break;
1159     }
1160     return ePres;
1161 }
1162 
1163 SfxItemPresentation SwContrastGrf::GetPresentation(
1164     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1165     String &rText, const IntlWrapper* /*pIntl*/) const
1166 {
1167     switch( ePres )
1168     {
1169     case SFX_ITEM_PRESENTATION_NAMELESS:
1170     case SFX_ITEM_PRESENTATION_COMPLETE:
1171         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1172             rText = SW_RESSTR( STR_CONTRAST );
1173         else if( rText.Len() )
1174             rText.Erase();
1175         ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1176         break;
1177 
1178     default:
1179         ePres = SFX_ITEM_PRESENTATION_NONE;
1180         rText.Erase();
1181         break;
1182     }
1183     return ePres;
1184 }
1185 
1186 SfxItemPresentation SwChannelGrf::GetPresentation(
1187     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1188     String &rText, const IntlWrapper* /*pIntl*/) const
1189 {
1190     switch( ePres )
1191     {
1192     case SFX_ITEM_PRESENTATION_NAMELESS:
1193     case SFX_ITEM_PRESENTATION_COMPLETE:
1194         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1195         {
1196             sal_uInt16 nId;
1197             switch ( Which() )
1198             {
1199             case RES_GRFATR_CHANNELR:   nId = STR_CHANNELR; break;
1200             case RES_GRFATR_CHANNELG:   nId = STR_CHANNELG; break;
1201             case RES_GRFATR_CHANNELB:   nId = STR_CHANNELB; break;
1202             default:                    nId = 0; break;
1203             }
1204             if( nId )
1205                 rText = SW_RESSTR( nId );
1206             else if( rText.Len() )
1207                 rText.Erase();
1208         }
1209         else if( rText.Len() )
1210             rText.Erase();
1211         ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1212         break;
1213 
1214     default:
1215         ePres = SFX_ITEM_PRESENTATION_NONE;
1216         rText.Erase();
1217         break;
1218     }
1219     return ePres;
1220 }
1221 
1222 SfxItemPresentation SwGammaGrf::GetPresentation(
1223     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1224     String &rText, const IntlWrapper* /*pIntl*/) const
1225 {
1226     switch( ePres )
1227     {
1228     case SFX_ITEM_PRESENTATION_NAMELESS:
1229     case SFX_ITEM_PRESENTATION_COMPLETE:
1230         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1231             rText = SW_RESSTR( STR_GAMMA );
1232         else if( rText.Len() )
1233             rText.Erase();
1234         ( rText += UniString::CreateFromDouble( GetValue() )) += '%';
1235         break;
1236 
1237     default:
1238         ePres = SFX_ITEM_PRESENTATION_NONE;
1239         rText.Erase();
1240         break;
1241     }
1242     return ePres;
1243 }
1244 
1245 SfxItemPresentation SwInvertGrf::GetPresentation(
1246     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1247     String &rText, const IntlWrapper* /*pIntl*/) const
1248 {
1249     rText.Erase();
1250     switch( ePres )
1251     {
1252     case SFX_ITEM_PRESENTATION_NAMELESS:
1253     case SFX_ITEM_PRESENTATION_COMPLETE:
1254         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1255         {
1256             sal_uInt16 nId = 0 != GetValue() ? STR_INVERT : STR_INVERT_NOT;
1257             rText = SW_RESSTR( nId );
1258         }
1259         break;
1260 
1261     default:
1262         ePres = SFX_ITEM_PRESENTATION_NONE;
1263         break;
1264     }
1265     return ePres;
1266 }
1267 
1268 SfxItemPresentation SwTransparencyGrf::GetPresentation(
1269     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1270     String &rText, const IntlWrapper* /*pIntl*/) const
1271 {
1272     switch( ePres )
1273     {
1274     case SFX_ITEM_PRESENTATION_NAMELESS:
1275     case SFX_ITEM_PRESENTATION_COMPLETE:
1276         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1277             rText = SW_RESSTR( STR_TRANSPARENCY );
1278         else if( rText.Len() )
1279             rText.Erase();
1280         ( rText += UniString::CreateFromInt32( GetValue() )) += '%';
1281         break;
1282 
1283     default:
1284         ePres = SFX_ITEM_PRESENTATION_NONE;
1285         rText.Erase();
1286         break;
1287     }
1288     return ePres;
1289 }
1290 
1291 SfxItemPresentation SwDrawModeGrf::GetPresentation(
1292     SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
1293     String &rText, const IntlWrapper* /*pIntl*/) const
1294 {
1295     rText.Erase();
1296     switch( ePres )
1297     {
1298     case SFX_ITEM_PRESENTATION_NAMELESS:
1299     case SFX_ITEM_PRESENTATION_COMPLETE:
1300         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
1301         {
1302             sal_uInt16 nId;
1303             switch ( GetValue() )
1304             {
1305 
1306             case GRAPHICDRAWMODE_GREYS:     nId = STR_DRAWMODE_GREY; break;
1307             case GRAPHICDRAWMODE_MONO:      nId = STR_DRAWMODE_BLACKWHITE; break;
1308             case GRAPHICDRAWMODE_WATERMARK: nId = STR_DRAWMODE_WATERMARK; break;
1309             default:                        nId = STR_DRAWMODE_STD; break;
1310             }
1311             (rText = SW_RESSTR( STR_DRAWMODE ) ) += SW_RESSTR( nId );
1312         }
1313         break;
1314 
1315     default:
1316         ePres = SFX_ITEM_PRESENTATION_NONE;
1317         break;
1318     }
1319     return ePres;
1320 }
1321 
1322 SfxItemPresentation SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation ePres,
1323                                     SfxMapUnit /*eCoreMetric*/,
1324                                     SfxMapUnit /*ePresMetric*/,
1325                                     String &rText,
1326                                     const IntlWrapper*    /*pIntl*/ ) const
1327 {
1328     rText.Erase();
1329     switch( ePres )
1330     {
1331         case SFX_ITEM_PRESENTATION_NAMELESS:
1332         break;
1333         case SFX_ITEM_PRESENTATION_COMPLETE:
1334             {
1335                 sal_uInt16 nId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW;
1336                 rText = SW_RESSTR( nId );
1337             }
1338         break;
1339 
1340         default:
1341             ePres = SFX_ITEM_PRESENTATION_NONE;
1342         break;
1343     }
1344     return ePres;
1345 }
1346 
1347