20#include <com/sun/star/util/CellProtection.hpp>
24#include <editeng/editeng.hxx>
31#include <libxml/xmlwriter.h>
49bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxBorderLine* pOther )
57 sal_uInt16 nThisSize = pThis->GetScaledWidth();
58 sal_uInt16 nOtherSize = pOther->GetScaledWidth();
60 if (nThisSize > nOtherSize)
62 else if (nThisSize < nOtherSize)
66 if ( pOther->GetInWidth() && !pThis->GetInWidth() )
68 else if ( pThis->GetInWidth() && !pOther->GetInWidth() )
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);
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);
195 bool bHCell,
bool bHPrint):
197 bProtection(bProtect),
198 bHideFormula(bHFormula),
219 nMemberId &= ~CONVERT_TWIPS;
224 util::CellProtection aProtection;
229 rVal <<= aProtection;
241 OSL_FAIL(
"Wrong MemberID!");
252 nMemberId &= ~CONVERT_TWIPS;
257 util::CellProtection aProtection;
258 if ( rVal >>= aProtection )
268 OSL_FAIL(
"exception - wrong argument");
273 bRet = (rVal >>= bVal);
if (bRet)
bProtection=bVal;
break;
275 bRet = (rVal >>= bVal);
if (bRet)
bHideFormula=bVal;
break;
277 bRet = (rVal >>= bVal);
if (bRet)
bHideCell=bVal;
break;
279 bRet = (rVal >>= bVal);
if (bRet)
bHidePrint=bVal;
break;
281 OSL_FAIL(
"Wrong MemberID!");
289 const OUString aStrYes (
ScResId(STR_YES) );
290 const OUString aStrNo (
ScResId(STR_NO) );
292 const OUString aValue =
"("
314 const OUString aStrYes (
ScResId(STR_YES) );
315 const OUString aStrNo (
ScResId(STR_NO) );
319 case SfxItemPresentation::Nameless:
323 case SfxItemPresentation::Complete:
324 rText =
ScResId(STR_PROTECTION)
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);
420 uno::Reference<sheet::XHeaderFooterContent> xCont(xContent);
429 uno::Reference<sheet::XHeaderFooterContent> xContent;
430 if ( rVal >>= xContent )
472 OSL_FAIL(
"exception - wrong argument");
480 assert(SfxPoolItem::operator==(rItem));
510 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"ScPageHFItem"));
514 (void)xmlTextWriterEndElement(pWriter);
548 case SfxItemPresentation::Complete:
552 rText =
ScResId(STR_VOBJ_CHART) + aDel;
556 rText =
ScResId(STR_VOBJ_OBJECT) + aDel;
560 rText =
ScResId(STR_VOBJ_DRAWINGS) + aDel;
566 case SfxItemPresentation::Nameless:
568 rText +=
ScResId(STR_VOBJ_MODE_SHOW);
570 rText +=
ScResId(STR_VOBJ_MODE_HIDE);
615 assert(SfxPoolItem::operator==(rCmp));
621void lclAppendScalePageCount( OUString& rText, sal_uInt16 nPages )
626 OUString aPages(
ScResId(STR_SCATTR_PAGE_SCALE_PAGES, nPages));
627 rText += aPages.replaceFirst(
"%1", OUString::number( nPages ) );
630 rText +=
ScResId( STR_SCATTR_PAGE_SCALE_AUTO );
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 );
649 case SfxItemPresentation::Nameless:
653 case SfxItemPresentation::Complete:
654 rText =
aName +
" (" + aValue +
")";
658 OSL_FAIL(
"ScPageScaleToItem::GetPresentation - unknown presentation mode" );
671 OSL_FAIL(
"ScPageScaleToItem::QueryValue - unknown member ID" );
685 OSL_FAIL(
"ScPageScaleToItem::PutValue - unknown member ID" );
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);
716 maIndex( std::move(aIndex) )
726 if (!SfxPoolItem::operator==(rCmp))
758 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"ScCondFormatItem"));
759 for (
const auto& nItem :
maIndex)
761 std::string aStrVal = std::to_string(nItem);
762 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(aStrVal.c_str()));
763 (void)xmlTextWriterEndElement(pWriter);
765 (void)xmlTextWriterEndElement(pWriter);
784 if (bRet && ePresentation == SfxItemPresentation::Complete)
785 rText =
ScResId(STR_TEXTORIENTANGLE) +
" " + rText;
888 case SfxItemPresentation::Complete:
889 rText =
ScResId(STR_INDENTCELL);
891 case SfxItemPresentation::Nameless:
bool ScHasPriority(const ::editeng::SvxBorderLine *pThis, const ::editeng::SvxBorderLine *pOther)
General Help Function.
const sal_uInt8 SC_MID_PAGE_SCALETO_HEIGHT
Member ID for "page scale to height" value in QueryValue() and PutValue().
const sal_uInt8 SC_MID_PAGE_SCALETO_WIDTH
Member ID for "page scale to width" value in QueryValue() and PutValue().
@ DpCollapse
dp table output
@ DpExpand
dp compact layout collapse button
@ 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
static bool EETextObjEqual(const EditTextObject *pObj1, const EditTextObject *pObj2)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
ScHyphenateCell(bool bHyphenate=false)
virtual ScHyphenateCell * Clone(SfxItemPool *pPool=nullptr) const override
ScIndentItem(sal_uInt16 nIndent=0)
virtual ScIndentItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &rIntl) const override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
virtual ScLineBreakCell * Clone(SfxItemPool *pPool=nullptr) const override
ScLineBreakCell(bool bLineBreak=false)
virtual bool operator==(const SfxPoolItem &) const override
ScMergeAttr()
Item - Implementations.
SCCOL GetColMerge() const
SCROW GetRowMerge() const
virtual ~ScMergeAttr() override
virtual ScMergeAttr * Clone(SfxItemPool *pPool=nullptr) const override
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
ScMergeFlagAttr()
MergeFlag.
bool HasPivotToggle() const
bool HasPivotButton() const
virtual ~ScMergeFlagAttr() override
bool HasAutoFilter() const
bool IsHorOverlapped() const
bool IsOverlapped() const
ScMergeFlagAttr * Clone(SfxItemPool *pPool=nullptr) const override
bool HasPivotMultiFieldPopupButton() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
bool HasPivotPopupButton() const
bool IsVerOverlapped() const
const EditTextObject * GetCenterArea() const
std::unique_ptr< EditTextObject > pCenterArea
virtual ScPageHFItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetLeftArea(const EditTextObject &rNew)
ScPageHFItem(sal_uInt16 nWhich)
ScPageHFItem - Dates from the Head and Foot lines.
std::unique_ptr< EditTextObject > pRightArea
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
std::unique_ptr< EditTextObject > pLeftArea
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
void SetCenterArea(const EditTextObject &rNew)
void SetRightArea(const EditTextObject &rNew)
const EditTextObject * GetLeftArea() const
virtual bool operator==(const SfxPoolItem &) const override
const EditTextObject * GetRightArea() const
virtual ~ScPageHFItem() override
Contains the "scale to width/height" attribute in page styles.
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
virtual bool operator==(const SfxPoolItem &rCmp) const override
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual bool QueryValue(css::uno::Any &rAny, sal_uInt8 nMemberId=0) const override
sal_uInt16 GetHeight() const
virtual ScPageScaleToItem * Clone(SfxItemPool *=nullptr) const override
virtual ~ScPageScaleToItem() override
sal_uInt16 GetWidth() const
ScPageScaleToItem()
Default c'tor sets the width and height to 0.
virtual bool PutValue(const css::uno::Any &rAny, sal_uInt8 nMemberId) override
bool GetHideFormula() const
void SetHideFormula(bool bHFormula)
void SetHidePrint(bool bHPrint)
ScProtectionAttr()
Protection.
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
static SfxPoolItem * CreateDefault()
virtual bool operator==(const SfxPoolItem &) const override
void SetProtection(bool bProtect)
bool bProtection
protect cell
bool bHideFormula
hide formula
virtual ~ScProtectionAttr() override
bool GetHidePrint() const
void SetHideCell(bool bHCell)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual ScProtectionAttr * Clone(SfxItemPool *pPool=nullptr) const override
bool GetProtection() const
OUString GetValueText() const
bool bHidePrint
don't print cell
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
ScRotateValueItem(Degree100 nAngle)
virtual ScRotateValueItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &rIntl) const override
virtual ScShrinkToFitCell * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
ScShrinkToFitCell(bool bShrink=false)
virtual ScVerticalStackCell * Clone(SfxItemPool *pPool=nullptr) const override
ScVerticalStackCell(bool bStack=false)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
ScViewObjectModeItem(sal_uInt16 nWhich)
ScViewObjectModeItem - Display Mode of View Objects.
virtual sal_uInt16 GetValueCount() const override
virtual ~ScViewObjectModeItem() override
virtual ScViewObjectModeItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const override
Degree100 GetValue() const
virtual bool operator==(const SfxPoolItem &) const=0
const Value & front() const
std::pair< const_iterator, bool > insert(Value &&x)
OUString EditResId(TranslateId aId)
struct _xmlTextWriter * xmlTextWriterPtr
OUString GetMetricText(tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl)
TranslateId GetMetricId(MapUnit eUnit)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
#define SID_SCATTR_PAGE_DRAWINGS
constexpr TypedWhichId< ScShrinkToFitCell > ATTR_SHRINKTOFIT(140)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
#define SID_SCATTR_PAGE_OBJECTS
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
#define SID_SCATTR_PAGE_CHARTS
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)