LibreOffice Module sc (master) 1
attrib.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/util/CellProtection.hpp>
21
22#include <scitems.hxx>
23
24#include <editeng/editeng.hxx>
25#include <editeng/editobj.hxx>
26#include <editeng/eerdll.hxx>
28#include <editeng/itemtype.hxx>
29#include <svl/itempool.hxx>
30
31#include <libxml/xmlwriter.h>
32
33#include <attrib.hxx>
34#include <global.hxx>
35#include <editutil.hxx>
36#include <mid.h>
37#include <globstr.hrc>
38#include <scresid.hxx>
39#include <textuno.hxx>
40
41using namespace com::sun::star;
42
43
45
49bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxBorderLine* pOther )
50{
51
52 if (!pThis)
53 return false;
54 if (!pOther)
55 return true;
56
57 sal_uInt16 nThisSize = pThis->GetScaledWidth();
58 sal_uInt16 nOtherSize = pOther->GetScaledWidth();
59
60 if (nThisSize > nOtherSize)
61 return true;
62 else if (nThisSize < nOtherSize)
63 return false;
64 else
65 {
66 if ( pOther->GetInWidth() && !pThis->GetInWidth() )
67 return true;
68 else if ( pThis->GetInWidth() && !pOther->GetInWidth() )
69 return false;
70 else
71 {
72 return true; // FIXME: What is this?
73 }
74 }
75}
76
84 nColMerge(0),
85 nRowMerge(0)
86{}
87
90 nColMerge(nCol),
91 nRowMerge(nRow)
92{}
93
96{
97 nColMerge = rItem.nColMerge;
98 nRowMerge = rItem.nRowMerge;
99}
100
102{
103}
104
105bool ScMergeAttr::operator==( const SfxPoolItem& rItem ) const
106{
107 return SfxPoolItem::operator==(rItem)
108 && (nColMerge == static_cast<const ScMergeAttr&>(rItem).nColMerge)
109 && (nRowMerge == static_cast<const ScMergeAttr&>(rItem).nRowMerge);
110}
111
113{
114 return new ScMergeAttr(*this);
115}
116
118{
119 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScMergeAttr"));
120 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("col-merge"), BAD_CAST(OString::number(GetColMerge()).getStr()));
121 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("row-merge"), BAD_CAST(OString::number(GetRowMerge()).getStr()));
122 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("merged"), BAD_CAST(OString::boolean(IsMerged()).getStr()));
123 (void)xmlTextWriterEndElement(pWriter);
124}
125
131{
132}
133
135 SfxInt16Item(ATTR_MERGE_FLAG, static_cast<sal_Int16>(nFlags))
136{
137}
138
140{
141}
142
144{
145 return new ScMergeFlagAttr(*this);
146}
147
149{
150 return bool(GetValue() & ScMF::Button);
151}
152
154{
155 return bool(GetValue() & ScMF::ButtonPopup);
156}
157
159{
160 auto nFlags = GetValue();
161 return (nFlags & ScMF::DpCollapse) || (nFlags & ScMF::DpExpand);
162}
163
165{
166 return bool(GetValue() & ScMF::ButtonPopup2);
167}
168
170{
171 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScMergeFlagAttr"));
172 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("overlapped"), BAD_CAST(OString::boolean(IsOverlapped()).getStr()));
173 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("hor_overlapped"), BAD_CAST(OString::boolean(IsHorOverlapped()).getStr()));
174 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("ver_overlapped"), BAD_CAST(OString::boolean(IsVerOverlapped()).getStr()));
175 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("autofilter"), BAD_CAST(OString::boolean(HasAutoFilter()).getStr()));
176 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("scenario"), BAD_CAST(OString::boolean(IsScenario()).getStr()));
177 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pivot-button"), BAD_CAST(OString::boolean(HasPivotButton()).getStr()));
178 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pivot-popup-button"), BAD_CAST(OString::boolean(HasPivotPopupButton()).getStr()));
179 (void)xmlTextWriterEndElement(pWriter);
180}
181
187 bProtection(true),
188 bHideFormula(false),
189 bHideCell(false),
190 bHidePrint(false)
191{
192}
193
194ScProtectionAttr::ScProtectionAttr( bool bProtect, bool bHFormula,
195 bool bHCell, bool bHPrint):
197 bProtection(bProtect),
198 bHideFormula(bHFormula),
199 bHideCell(bHCell),
200 bHidePrint(bHPrint)
201{
202}
203
206{
207 bProtection = rItem.bProtection;
209 bHideCell = rItem.bHideCell;
210 bHidePrint = rItem.bHidePrint;
211}
212
214{
215}
216
217bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
218{
219 nMemberId &= ~CONVERT_TWIPS;
220 switch ( nMemberId )
221 {
222 case 0 :
223 {
224 util::CellProtection aProtection;
225 aProtection.IsLocked = bProtection;
226 aProtection.IsFormulaHidden = bHideFormula;
227 aProtection.IsHidden = bHideCell;
228 aProtection.IsPrintHidden = bHidePrint;
229 rVal <<= aProtection;
230 break;
231 }
232 case MID_1 :
233 rVal <<= bProtection; break;
234 case MID_2 :
235 rVal <<= bHideFormula; break;
236 case MID_3 :
237 rVal <<= bHideCell; break;
238 case MID_4 :
239 rVal <<= bHidePrint; break;
240 default:
241 OSL_FAIL("Wrong MemberID!");
242 return false;
243 }
244
245 return true;
246}
247
248bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
249{
250 bool bRet = false;
251 bool bVal = false;
252 nMemberId &= ~CONVERT_TWIPS;
253 switch ( nMemberId )
254 {
255 case 0 :
256 {
257 util::CellProtection aProtection;
258 if ( rVal >>= aProtection )
259 {
260 bProtection = aProtection.IsLocked;
261 bHideFormula = aProtection.IsFormulaHidden;
262 bHideCell = aProtection.IsHidden;
263 bHidePrint = aProtection.IsPrintHidden;
264 bRet = true;
265 }
266 else
267 {
268 OSL_FAIL("exception - wrong argument");
269 }
270 break;
271 }
272 case MID_1 :
273 bRet = (rVal >>= bVal); if (bRet) bProtection=bVal; break;
274 case MID_2 :
275 bRet = (rVal >>= bVal); if (bRet) bHideFormula=bVal; break;
276 case MID_3 :
277 bRet = (rVal >>= bVal); if (bRet) bHideCell=bVal; break;
278 case MID_4 :
279 bRet = (rVal >>= bVal); if (bRet) bHidePrint=bVal; break;
280 default:
281 OSL_FAIL("Wrong MemberID!");
282 }
283
284 return bRet;
285}
286
288{
289 const OUString aStrYes ( ScResId(STR_YES) );
290 const OUString aStrNo ( ScResId(STR_NO) );
291
292 const OUString aValue = "("
293 + (bProtection ? aStrYes : aStrNo)
294 + ","
295 + (bHideFormula ? aStrYes : aStrNo)
296 + ","
297 + (bHideCell ? aStrYes : aStrNo)
298 + ","
299 + (bHidePrint ? aStrYes : aStrNo)
300 + ")";
301
302 return aValue;
303}
304
306 (
308 MapUnit /* eCoreMetric */,
309 MapUnit /* ePresMetric */,
310 OUString& rText,
311 const IntlWrapper& /* rIntl */
312 ) const
313{
314 const OUString aStrYes ( ScResId(STR_YES) );
315 const OUString aStrNo ( ScResId(STR_NO) );
316
317 switch ( ePres )
318 {
319 case SfxItemPresentation::Nameless:
320 rText = GetValueText();
321 break;
322
323 case SfxItemPresentation::Complete:
324 rText = ScResId(STR_PROTECTION)
325 + ": "
326 + (bProtection ? aStrYes : aStrNo)
327 + ", "
328 + ScResId(STR_FORMULAS)
329 + ": "
330 + (!bHideFormula ? aStrYes : aStrNo)
331 + ", "
332 + ScResId(STR_HIDE)
333 + ": "
334 + (bHideCell ? aStrYes : aStrNo)
335 + ", "
336 + ScResId(STR_PRINT)
337 + ": "
338 + (!bHidePrint ? aStrYes : aStrNo);
339 break;
340
341 default: break;
342 }
343
344 return true;
345}
346
348{
349 return SfxPoolItem::operator==(rItem)
350 && (bProtection == static_cast<const ScProtectionAttr&>(rItem).bProtection)
351 && (bHideFormula == static_cast<const ScProtectionAttr&>(rItem).bHideFormula)
352 && (bHideCell == static_cast<const ScProtectionAttr&>(rItem).bHideCell)
353 && (bHidePrint == static_cast<const ScProtectionAttr&>(rItem).bHidePrint);
354}
355
357{
358 return new ScProtectionAttr(*this);
359}
360
362{
363 bProtection = bProtect;
364}
365
367{
368 bHideFormula = bHFormula;
369}
370
372{
373 bHideCell = bHCell;
374}
375
377{
378 bHidePrint = bHPrint;
379}
380
382{
383 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScProtectionAttr"));
384 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("protection"), BAD_CAST(OString::boolean(GetProtection()).getStr()));
385 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("hide-formula"), BAD_CAST(OString::boolean(GetHideFormula()).getStr()));
386 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("hide-cell"), BAD_CAST(OString::boolean(GetHideCell()).getStr()));
387 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("hide-print"), BAD_CAST(OString::boolean(GetHidePrint()).getStr()));
388 (void)xmlTextWriterEndElement(pWriter);
389}
390
394ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP )
395 : SfxPoolItem ( nWhichP )
396{
397}
398
400 : SfxPoolItem ( rItem )
401{
402 if ( rItem.pLeftArea )
403 pLeftArea = rItem.pLeftArea->Clone();
404 if ( rItem.pCenterArea )
405 pCenterArea = rItem.pCenterArea->Clone();
406 if ( rItem.pRightArea )
407 pRightArea = rItem.pRightArea->Clone();
408}
409
411{
412}
413
414bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
415{
418 xContent->Init(pLeftArea.get(), pCenterArea.get(), pRightArea.get());
419
420 uno::Reference<sheet::XHeaderFooterContent> xCont(xContent);
421
422 rVal <<= xCont;
423 return true;
424}
425
426bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
427{
428 bool bRet = false;
429 uno::Reference<sheet::XHeaderFooterContent> xContent;
430 if ( rVal >>= xContent )
431 {
432 if ( xContent.is() )
433 {
436 if (pImp.is())
437 {
438 const EditTextObject* pImpLeft = pImp->GetLeftEditObject();
439 pLeftArea.reset();
440 if (pImpLeft)
441 pLeftArea = pImpLeft->Clone();
442
443 const EditTextObject* pImpCenter = pImp->GetCenterEditObject();
444 pCenterArea.reset();
445 if (pImpCenter)
446 pCenterArea = pImpCenter->Clone();
447
448 const EditTextObject* pImpRight = pImp->GetRightEditObject();
449 pRightArea.reset();
450 if (pImpRight)
451 pRightArea = pImpRight->Clone();
452
453 if ( !pLeftArea || !pCenterArea || !pRightArea )
454 {
455 // no Text with Null are left
457 if (!pLeftArea)
458 pLeftArea = aEngine.CreateTextObject();
459 if (!pCenterArea)
460 pCenterArea = aEngine.CreateTextObject();
461 if (!pRightArea)
462 pRightArea = aEngine.CreateTextObject();
463 }
464
465 bRet = true;
466 }
467 }
468 }
469
470 if (!bRet)
471 {
472 OSL_FAIL("exception - wrong argument");
473 }
474
475 return true;
476}
477
478bool ScPageHFItem::operator==( const SfxPoolItem& rItem ) const
479{
480 assert(SfxPoolItem::operator==(rItem));
481
482 const ScPageHFItem& r = static_cast<const ScPageHFItem&>(rItem);
483
484 return ScGlobal::EETextObjEqual(pLeftArea.get(), r.pLeftArea.get())
487}
488
490{
491 return new ScPageHFItem( *this );
492}
493
495{
496 pLeftArea = rNew.Clone();
497}
498
500{
501 pCenterArea = rNew.Clone();
502}
503
505{
506 pRightArea = rNew.Clone();
507}
509{
510 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScPageHFItem"));
511 GetLeftArea()->dumpAsXml(pWriter);
512 GetCenterArea()->dumpAsXml(pWriter);
513 GetRightArea()->dumpAsXml(pWriter);
514 (void)xmlTextWriterEndElement(pWriter);
515}
516
521 : SfxEnumItem( nWhichP, VOBJ_MODE_SHOW )
522{
523}
524
526 : SfxEnumItem( nWhichP, eMode )
527{
528}
529
531{
532}
533
535(
537 MapUnit /* eCoreUnit */,
538 MapUnit /* ePresUnit */,
539 OUString& rText,
540 const IntlWrapper& /* rIntl */
541) const
542{
543 OUString aDel(": ");
544 rText.clear();
545
546 switch ( ePres )
547 {
548 case SfxItemPresentation::Complete:
549 switch( Which() )
550 {
552 rText = ScResId(STR_VOBJ_CHART) + aDel;
553 break;
554
556 rText = ScResId(STR_VOBJ_OBJECT) + aDel;
557 break;
558
560 rText = ScResId(STR_VOBJ_DRAWINGS) + aDel;
561 break;
562
563 default: break;
564 }
565 [[fallthrough]];
566 case SfxItemPresentation::Nameless:
567 if (GetValue() == VOBJ_MODE_SHOW)
568 rText += ScResId(STR_VOBJ_MODE_SHOW);
569 else
570 rText += ScResId(STR_VOBJ_MODE_HIDE);
571 return true;
572
573 default: break;
574 // added to avoid warnings
575 }
576
577 return false;
578}
579
581{
582 return 2;
583}
584
586{
587 return new ScViewObjectModeItem( *this );
588}
589
592 mnWidth( 0 ),
593 mnHeight( 0 )
594{
595}
596
597ScPageScaleToItem::ScPageScaleToItem( sal_uInt16 nWidth, sal_uInt16 nHeight ) :
599 mnWidth( nWidth ),
600 mnHeight( nHeight )
601{
602}
603
605{
606}
607
609{
610 return new ScPageScaleToItem( *this );
611}
612
614{
615 assert(SfxPoolItem::operator==(rCmp));
616 const ScPageScaleToItem& rPageCmp = static_cast< const ScPageScaleToItem& >( rCmp );
617 return (mnWidth == rPageCmp.mnWidth) && (mnHeight == rPageCmp.mnHeight);
618}
619
620namespace {
621void lclAppendScalePageCount( OUString& rText, sal_uInt16 nPages )
622{
623 rText += ": ";
624 if( nPages )
625 {
626 OUString aPages(ScResId(STR_SCATTR_PAGE_SCALE_PAGES, nPages));
627 rText += aPages.replaceFirst( "%1", OUString::number( nPages ) );
628 }
629 else
630 rText += ScResId( STR_SCATTR_PAGE_SCALE_AUTO );
631}
632} // namespace
633
635 SfxItemPresentation ePres, MapUnit, MapUnit, OUString& rText, const IntlWrapper& ) const
636{
637 rText.clear();
638 if( !IsValid())
639 return false;
640
641 OUString aName( ScResId( STR_SCATTR_PAGE_SCALETO ) );
642 OUString aValue( ScResId( STR_SCATTR_PAGE_SCALE_WIDTH ) );
643 lclAppendScalePageCount( aValue, mnWidth );
644 aValue += ", " + ScResId( STR_SCATTR_PAGE_SCALE_HEIGHT );
645 lclAppendScalePageCount( aValue, mnHeight );
646
647 switch( ePres )
648 {
649 case SfxItemPresentation::Nameless:
650 rText = aValue;
651 return true;
652
653 case SfxItemPresentation::Complete:
654 rText = aName + " (" + aValue + ")";
655 return true;
656
657 default:
658 OSL_FAIL( "ScPageScaleToItem::GetPresentation - unknown presentation mode" );
659 }
660 return false;
661}
662
664{
665 bool bRet = true;
666 switch( nMemberId )
667 {
668 case SC_MID_PAGE_SCALETO_WIDTH: rAny <<= mnWidth; break;
669 case SC_MID_PAGE_SCALETO_HEIGHT: rAny <<= mnHeight; break;
670 default:
671 OSL_FAIL( "ScPageScaleToItem::QueryValue - unknown member ID" );
672 bRet = false;
673 }
674 return bRet;
675}
676
677bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId )
678{
679 bool bRet = false;
680 switch( nMemberId )
681 {
682 case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break;
683 case SC_MID_PAGE_SCALETO_HEIGHT: bRet = rAny >>= mnHeight; break;
684 default:
685 OSL_FAIL( "ScPageScaleToItem::PutValue - unknown member ID" );
686 }
687 return bRet;
688}
690{
691 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScPageScaleToItem"));
692 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("width"), BAD_CAST(OString::number(GetWidth()).getStr()));
693 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("height"), BAD_CAST(OString::number(GetHeight()).getStr()));
694 (void)xmlTextWriterEndElement(pWriter);
695}
696
699{
700}
701
704{
706}
707
710 maIndex( rIndex )
711{
712}
713
716 maIndex( std::move(aIndex) )
717{
718}
719
721{
722}
723
725{
726 if (!SfxPoolItem::operator==(rCmp))
727 return false;
728 auto const & other = static_cast<const ScCondFormatItem&>(rCmp);
729 if (maIndex.empty() && other.maIndex.empty())
730 return true;
731 // memcmp is faster than operator== on std::vector
732 return maIndex.size() == other.maIndex.size()
733 && memcmp(&maIndex.front(), &other.maIndex.front(), maIndex.size() * sizeof(sal_uInt32)) == 0;
734}
735
737{
738 auto const & other = static_cast<const ScCondFormatItem&>(rCmp);
739 if ( maIndex.size() < other.maIndex.size() )
740 return true;
741 if ( maIndex.size() > other.maIndex.size() )
742 return false;
743 if (maIndex.empty() && other.maIndex.empty())
744 return false;
745 // memcmp is faster than operator< on std::vector
746 // Note that on little-endian this results in a confusing ordering (256 < 1),
747 // which technically doesn't matter as the ordering may be arbitrary.
748 return memcmp(&maIndex.front(), &other.maIndex.front(), maIndex.size() * sizeof(sal_uInt32)) < 0;
749}
750
752{
753 return new ScCondFormatItem(maIndex);
754}
755
757{
758 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ScCondFormatItem"));
759 for (const auto& nItem : maIndex)
760 {
761 std::string aStrVal = std::to_string(nItem);
762 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(aStrVal.c_str()));
763 (void)xmlTextWriterEndElement(pWriter);
764 }
765 (void)xmlTextWriterEndElement(pWriter);
766}
767
770{
771}
772
774{
775 return new ScRotateValueItem(GetValue());
776}
777
779 MapUnit eCoreMetric, MapUnit ePresMetric,
780 OUString& rText,
781 const IntlWrapper& rWrapper) const
782{
783 bool bRet = SdrAngleItem::GetPresentation(SfxItemPresentation::Nameless, eCoreMetric, ePresMetric, rText, rWrapper);
784 if (bRet && ePresentation == SfxItemPresentation::Complete)
785 rText = ScResId(STR_TEXTORIENTANGLE) + " " + rText;
786 return bRet;
787}
788
790 : SfxBoolItem(ATTR_SHRINKTOFIT, bShrink)
791{
792}
793
795{
796 return new ScShrinkToFitCell(GetValue());
797}
798
801 OUString& rText,
802 const IntlWrapper&) const
803{
804 TranslateId pId = GetValue() ? STR_SHRINKTOFITCELL_ON : STR_SHRINKTOFITCELL_OFF;
805 rText = ScResId(pId);
806 return true;
807}
808
810 : SfxBoolItem(ATTR_STACKED, bStack)
811{
812}
813
815{
816 return new ScVerticalStackCell(GetValue());
817}
818
821 OUString& rText,
822 const IntlWrapper&) const
823{
824 TranslateId pId = GetValue() ? STR_VERTICALSTACKCELL_ON : STR_VERTICALSTACKCELL_OFF;
825 rText = ScResId(pId);
826 return true;
827}
828
830 : SfxBoolItem(ATTR_LINEBREAK, bStack)
831{
832}
833
835{
836 return new ScLineBreakCell(GetValue());
837}
838
841 OUString& rText,
842 const IntlWrapper&) const
843{
844 TranslateId pId = GetValue() ? STR_LINEBREAKCELL_ON : STR_LINEBREAKCELL_OFF;
845 rText = ScResId(pId);
846 return true;
847}
848
850 : SfxBoolItem(ATTR_HYPHENATE, bHyphenate)
851{
852}
853
855{
856 return new ScHyphenateCell(GetValue());
857}
858
861 OUString& rText,
862 const IntlWrapper&) const
863{
864 TranslateId pId = GetValue() ? STR_HYPHENATECELL_ON : STR_HYPHENATECELL_OFF;
865 rText = ScResId(pId);
866 return true;
867}
868
869ScIndentItem::ScIndentItem(sal_uInt16 nIndent)
870 : SfxUInt16Item(ATTR_INDENT, nIndent)
871{
872}
873
875{
876 return new ScIndentItem(GetValue());
877}
878
880 MapUnit eCoreUnit, MapUnit,
881 OUString& rText,
882 const IntlWrapper& rIntl) const
883{
884 auto nValue = GetValue();
885
886 switch (ePres)
887 {
888 case SfxItemPresentation::Complete:
889 rText = ScResId(STR_INDENTCELL);
890 [[fallthrough]];
891 case SfxItemPresentation::Nameless:
892 rText += GetMetricText( nValue, eCoreUnit, MapUnit::MapPoint, &rIntl ) +
893 " " + EditResId(GetMetricId(MapUnit::MapPoint));
894 return true;
895 default: ; //prevent warning
896 }
897 return false;
898}
899
900/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool ScHasPriority(const ::editeng::SvxBorderLine *pThis, const ::editeng::SvxBorderLine *pOther)
General Help Function.
Definition: attrib.cxx:49
const sal_uInt8 SC_MID_PAGE_SCALETO_HEIGHT
Member ID for "page scale to height" value in QueryValue() and PutValue().
Definition: attrib.hxx:226
const sal_uInt8 SC_MID_PAGE_SCALETO_WIDTH
Member ID for "page scale to width" value in QueryValue() and PutValue().
Definition: attrib.hxx:224
ScMF
Definition: attrib.hxx:34
@ DpCollapse
dp table output
@ DpExpand
dp compact layout collapse button
@ Button
autofilter arrow
@ ButtonPopup
@ ButtonPopup2
dp compact layout expand button
sal_uInt16 GetValue() const
std::unique_ptr< EditTextObject > CreateTextObject()
static rtl::Reference< SfxItemPool > CreatePool()
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const=0
virtual std::unique_ptr< EditTextObject > Clone() const=0
virtual ~ScCondFormatItem() override
Definition: attrib.cxx:720
virtual bool operator<(const SfxPoolItem &rCmp) const override
Definition: attrib.cxx:736
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:756
virtual ScCondFormatItem * Clone(SfxItemPool *=nullptr) const override
Definition: attrib.cxx:751
ScCondFormatIndexes maIndex
Definition: attrib.hxx:292
virtual bool operator==(const SfxPoolItem &rCmp) const override
Definition: attrib.cxx:724
static bool EETextObjEqual(const EditTextObject *pObj1, const EditTextObject *pObj2)
Definition: global.cxx:798
static rtl::Reference< ScHeaderFooterContentObj > getImplementation(const css::uno::Reference< css::sheet::XHeaderFooterContent > &rObj)
Definition: textuno.cxx:130
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:859
ScHyphenateCell(bool bHyphenate=false)
Definition: attrib.cxx:849
virtual ScHyphenateCell * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:854
ScIndentItem(sal_uInt16 nIndent=0)
Definition: attrib.cxx:869
virtual ScIndentItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:874
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:879
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:839
virtual ScLineBreakCell * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:834
ScLineBreakCell(bool bLineBreak=false)
Definition: attrib.cxx:829
virtual bool operator==(const SfxPoolItem &) const override
Definition: attrib.cxx:105
ScMergeAttr()
Item - Implementations.
Definition: attrib.cxx:82
SCCOL GetColMerge() const
Definition: attrib.hxx:71
bool IsMerged() const
Definition: attrib.hxx:74
SCROW GetRowMerge() const
Definition: attrib.hxx:72
virtual ~ScMergeAttr() override
Definition: attrib.cxx:101
virtual ScMergeAttr * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:112
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:117
SCCOL nColMerge
Definition: attrib.hxx:60
SCROW nRowMerge
Definition: attrib.hxx:61
ScMergeFlagAttr()
MergeFlag.
Definition: attrib.cxx:129
bool HasPivotToggle() const
Definition: attrib.cxx:158
bool HasPivotButton() const
Definition: attrib.cxx:148
virtual ~ScMergeFlagAttr() override
Definition: attrib.cxx:139
ScMF GetValue() const
Definition: attrib.hxx:100
bool HasAutoFilter() const
Definition: attrib.hxx:106
bool IsScenario() const
Definition: attrib.hxx:108
bool IsHorOverlapped() const
Definition: attrib.hxx:102
bool IsOverlapped() const
Definition: attrib.hxx:104
ScMergeFlagAttr * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:143
bool HasPivotMultiFieldPopupButton() const
Definition: attrib.cxx:164
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:169
bool HasPivotPopupButton() const
Definition: attrib.cxx:153
bool IsVerOverlapped() const
Definition: attrib.hxx:103
const EditTextObject * GetCenterArea() const
Definition: attrib.hxx:191
std::unique_ptr< EditTextObject > pCenterArea
Definition: attrib.hxx:176
virtual ScPageHFItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:489
void SetLeftArea(const EditTextObject &rNew)
Definition: attrib.cxx:494
ScPageHFItem(sal_uInt16 nWhich)
ScPageHFItem - Dates from the Head and Foot lines.
Definition: attrib.cxx:394
std::unique_ptr< EditTextObject > pRightArea
Definition: attrib.hxx:177
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: attrib.cxx:426
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: attrib.cxx:414
std::unique_ptr< EditTextObject > pLeftArea
Definition: attrib.hxx:175
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:508
void SetCenterArea(const EditTextObject &rNew)
Definition: attrib.cxx:499
void SetRightArea(const EditTextObject &rNew)
Definition: attrib.cxx:504
const EditTextObject * GetLeftArea() const
Definition: attrib.hxx:190
virtual bool operator==(const SfxPoolItem &) const override
Definition: attrib.cxx:478
const EditTextObject * GetRightArea() const
Definition: attrib.hxx:192
virtual ~ScPageHFItem() override
Definition: attrib.cxx:410
Contains the "scale to width/height" attribute in page styles.
Definition: attrib.hxx:230
sal_uInt16 mnHeight
Definition: attrib.hxx:267
bool IsValid() const
Definition: attrib.hxx:249
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
Definition: attrib.cxx:634
sal_uInt16 mnWidth
Definition: attrib.hxx:266
virtual bool operator==(const SfxPoolItem &rCmp) const override
Definition: attrib.cxx:613
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:689
virtual bool QueryValue(css::uno::Any &rAny, sal_uInt8 nMemberId=0) const override
Definition: attrib.cxx:663
sal_uInt16 GetHeight() const
Definition: attrib.hxx:248
virtual ScPageScaleToItem * Clone(SfxItemPool *=nullptr) const override
Definition: attrib.cxx:608
virtual ~ScPageScaleToItem() override
Definition: attrib.cxx:604
sal_uInt16 GetWidth() const
Definition: attrib.hxx:247
ScPageScaleToItem()
Default c'tor sets the width and height to 0.
Definition: attrib.cxx:590
virtual bool PutValue(const css::uno::Any &rAny, sal_uInt8 nMemberId) override
Definition: attrib.cxx:677
bool bHideCell
hide cell
Definition: attrib.hxx:122
bool GetHideFormula() const
Definition: attrib.hxx:150
void SetHideFormula(bool bHFormula)
Definition: attrib.cxx:366
void SetHidePrint(bool bHPrint)
Definition: attrib.cxx:376
ScProtectionAttr()
Protection.
Definition: attrib.cxx:185
bool GetHideCell() const
Definition: attrib.hxx:152
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:306
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: attrib.cxx:217
static SfxPoolItem * CreateDefault()
Definition: attrib.cxx:44
virtual bool operator==(const SfxPoolItem &) const override
Definition: attrib.cxx:347
void SetProtection(bool bProtect)
Definition: attrib.cxx:361
bool bProtection
protect cell
Definition: attrib.hxx:120
bool bHideFormula
hide formula
Definition: attrib.hxx:121
virtual ~ScProtectionAttr() override
Definition: attrib.cxx:213
bool GetHidePrint() const
Definition: attrib.hxx:154
void SetHideCell(bool bHCell)
Definition: attrib.cxx:371
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: attrib.cxx:248
virtual ScProtectionAttr * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:356
bool GetProtection() const
Definition: attrib.hxx:148
OUString GetValueText() const
Definition: attrib.cxx:287
bool bHidePrint
don't print cell
Definition: attrib.hxx:123
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: attrib.cxx:381
ScRotateValueItem(Degree100 nAngle)
Definition: attrib.cxx:768
virtual ScRotateValueItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:773
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:778
virtual ScShrinkToFitCell * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:794
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:799
ScShrinkToFitCell(bool bShrink=false)
Definition: attrib.cxx:789
virtual ScVerticalStackCell * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:814
ScVerticalStackCell(bool bStack=false)
Definition: attrib.cxx:809
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:819
ScViewObjectModeItem(sal_uInt16 nWhich)
ScViewObjectModeItem - Display Mode of View Objects.
Definition: attrib.cxx:520
virtual sal_uInt16 GetValueCount() const override
Definition: attrib.cxx:580
virtual ~ScViewObjectModeItem() override
Definition: attrib.cxx:530
virtual ScViewObjectModeItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: attrib.cxx:585
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrib.cxx:535
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const override
Degree100 GetValue() const
bool GetValue() const
sal_uInt16 Which() const
virtual bool operator==(const SfxPoolItem &) const=0
bool empty() const
size_type size() const
const Value & front() const
std::pair< const_iterator, bool > insert(Value &&x)
OUString EditResId(TranslateId aId)
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int16 nValue
ScVObjMode
Definition: global.hxx:368
@ VOBJ_MODE_SHOW
Definition: global.hxx:369
sal_Int32 nIndex
OUString aName
Mode eMode
OUString GetMetricText(tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl)
TranslateId GetMetricId(MapUnit eUnit)
MapUnit
#define MID_3
Definition: mid.h:25
#define MID_1
Definition: mid.h:23
#define MID_2
Definition: mid.h:24
#define MID_4
Definition: mid.h:26
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxItemPresentation
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
#define SID_SCATTR_PAGE_DRAWINGS
Definition: scitems.hxx:217
constexpr TypedWhichId< ScShrinkToFitCell > ATTR_SHRINKTOFIT(140)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
#define SID_SCATTR_PAGE_OBJECTS
Definition: scitems.hxx:216
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
#define SID_SCATTR_PAGE_CHARTS
Definition: scitems.hxx:215
constexpr TypedWhichId< ScPageScaleToItem > ATTR_PAGE_SCALETO(188)
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr TypedWhichId< ScHyphenateCell > ATTR_HYPHENATE(125)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
double mnWidth
double mnHeight
unsigned char sal_uInt8
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17