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