22#include <osl/diagnose.h>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30#include <com/sun/star/table/TableBorder.hpp>
31#include <com/sun/star/table/CellHoriJustify.hpp>
32#include <com/sun/star/table/CellOrientation.hpp>
33#include <com/sun/star/table/TableBorder2.hpp>
34#include <com/sun/star/awt/FontSlant.hpp>
41#include <unonames.hxx>
47#define SC_AF_FIELD_COUNT 16
62 return aAutoFormatMap_Impl;
120 return aAutoFieldMap_Impl;
138 size_t nPos = std::distance(itBeg, it);
156extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
190 uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
191 if ( xInterface.is() )
194 if ( pFormatObj && !pFormatObj->
IsInserted() )
201 throw container::ElementExistException();
205 pNew->SetName(
aName );
207 if (pFormats->
insert(std::move(pNew)) != pFormats->
end())
212 sal_uInt16 nNewIndex;
221 OSL_FAIL(
"AutoFormat could not be inserted");
222 throw uno::RuntimeException();
230 throw lang::IllegalArgumentException();
248 if (it == pFormats->
end())
250 throw container::NoSuchElementException();
280 throw lang::IndexOutOfBoundsException();
302 throw container::NoSuchElementException();
310 uno::Sequence<OUString>
aSeq(pFormats->
size());
311 OUString* pAry =
aSeq.getArray();
313 for (
const auto& rEntry : *pFormats)
315 pAry[
i] = rEntry.second->GetName();
389 if ( nIndex < 0 || nIndex >=
getCount() )
390 throw lang::IndexOutOfBoundsException();
430 throw uno::RuntimeException();
436 OSL_ENSURE(
pData,
"AutoFormat data not available");
439 pNew->SetName( aNewName );
442 it = pFormats->
insert(std::move(pNew));
443 if (it != pFormats->
end())
453 OSL_FAIL(
"AutoFormat could not be inserted");
468 const OUString& aPropertyName,
const uno::Any& aValue )
476 OSL_ENSURE(
pData,
"AutoFormat data not available");
480 pData->SetIncludeBackground( bBool );
482 pData->SetIncludeFrame( bBool );
484 pData->SetIncludeFont( bBool );
486 pData->SetIncludeJustify( bBool );
488 pData->SetIncludeValueFormat( bBool );
490 pData->SetIncludeWidthHeight( bBool );
507 OSL_ENSURE(
pData,
"AutoFormat data not available");
513 bValue =
pData->GetIncludeBackground();
515 bValue =
pData->GetIncludeFrame();
517 bValue =
pData->GetIncludeFont();
519 bValue =
pData->GetIncludeJustify();
521 bValue =
pData->GetIncludeValueFormat();
523 bValue =
pData->GetIncludeWidthHeight();
538 nFormatIndex( nFormat ),
539 nFieldIndex( nField )
557 const OUString& aPropertyName,
const uno::Any& aValue )
564 if ( !(pEntry && pEntry->
nWID && nFormatIndex < pFormats->
size()) )
575 switch( pEntry->
nWID )
579 table::CellOrientation eOrient;
580 if( aValue >>= eOrient )
584 case table::CellOrientation_STANDARD:
587 case table::CellOrientation_TOPBOTTOM:
591 case table::CellOrientation_BOTTOMTOP:
595 case table::CellOrientation_STACKED:
608 std::unique_ptr<SfxPoolItem> pNewItem(pItem->Clone());
609 bDone = pNewItem->PutValue( aValue, pEntry->
nMemberId );
621 switch (pEntry->
nWID)
625 table::TableBorder aBorder;
626 if ( aValue >>= aBorder )
640 table::TableBorder2 aBorder2;
641 if ( aValue >>= aBorder2 )
666 if ( pEntry && pEntry->
nWID && nFormatIndex < pFormats->
size() )
674 switch( pEntry->
nWID )
685 pItem->QueryValue( aVal, pEntry->
nMemberId );
691 switch (pEntry->
nWID)
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetAutoFieldMap()
number format (String/Language) ??? (in XNumberFormat only ReadOnly) table::TableBorder ?...
constexpr OUStringLiteral SCAUTOFORMATSOBJ_SERVICE
#define SC_AF_FIELD_COUNT
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ScAutoFormatsObj_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetAutoFormatMap()
static bool lcl_FindAutoFormatIndex(const ScAutoFormat &rFormats, std::u16string_view rName, sal_uInt16 &rOutIndex)
#define SC_AFMTOBJ_INVALID
static SC_DLLPUBLIC void Init()
DLL-init/exit-code must be linked to the DLL only.
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
static SC_DLLPUBLIC ScAutoFormat * GetAutoFormat()
static void AssignTableBorder2ToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
static void FillBoxItems(SvxBoxItem &rOuter, SvxBoxInfoItem &rInner, const css::table::TableBorder &rBorder)
static void AssignTableBorderToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Degree100 GetValue() const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
css::uno::Type const & get()
Sequence< sal_Int8 > aSeq
#define MID_FONT_CHAR_SET
#define MID_GRAPHIC_TRANSPARENT
#define MID_FONT_FAMILY_NAME
#define MID_FONT_STYLE_NAME
std::unique_ptr< sal_Int32[]> pData
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxOverlineItem > ATTR_FONT_OVERLINE(105)
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_VER_JUSTIFY_METHOD(133)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
constexpr TypedWhichId< SvxRotateModeItem > ATTR_ROTATE_MODE(136)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_HOR_JUSTIFY_METHOD(130)
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
#define MID_MARGIN_LO_MARGIN
#define MID_MARGIN_R_MARGIN
#define MID_MARGIN_L_MARGIN
#define MID_MARGIN_UP_MARGIN
constexpr OUStringLiteral SC_UNO_CJK_CFFAMIL
constexpr OUStringLiteral SC_UNO_CJK_CFPITCH
constexpr OUStringLiteral SC_UNO_CJK_CPOST
constexpr OUStringLiteral SC_UNONAME_INCJUST
constexpr OUStringLiteral SC_UNONAME_PRMARGIN
constexpr OUStringLiteral SC_UNONAME_INCBORD
constexpr OUStringLiteral SC_UNONAME_CFCHARS
constexpr OUStringLiteral SC_UNO_CJK_CFCHARS
constexpr OUStringLiteral SC_UNONAME_CELLVJUS_METHOD
constexpr OUStringLiteral SC_UNONAME_CSHADD
constexpr OUStringLiteral SC_UNO_CTL_CFNAME
constexpr OUStringLiteral SC_UNO_CJK_CWEIGHT
constexpr OUStringLiteral SC_UNONAME_WRAP
constexpr OUStringLiteral SC_UNONAME_CPOST
constexpr OUStringLiteral SC_UNO_CTL_CFFAMIL
constexpr OUStringLiteral SC_UNONAME_CFFAMIL
constexpr OUStringLiteral SC_UNONAME_INCFONT
constexpr OUStringLiteral SC_UNONAME_PLMARGIN
constexpr OUStringLiteral SC_UNO_CJK_CFSTYLE
constexpr OUStringLiteral SC_UNO_CTL_CWEIGHT
constexpr OUStringLiteral SC_UNONAME_CELLTRAN
constexpr OUStringLiteral SC_UNONAME_INCWIDTH
constexpr OUStringLiteral SC_UNONAME_CCOLOR
constexpr OUStringLiteral SC_UNO_CTL_CFPITCH
constexpr OUStringLiteral SC_UNONAME_CELLORI
constexpr OUStringLiteral SC_UNO_CTL_CFCHARS
constexpr OUStringLiteral SC_UNONAME_CFNAME
constexpr OUStringLiteral SC_UNONAME_CFONT
constexpr OUStringLiteral SC_UNONAME_INCNUM
constexpr OUStringLiteral SC_UNO_CJK_CHEIGHT
constexpr OUStringLiteral SC_UNONAME_PTMARGIN
constexpr OUStringLiteral SC_UNONAME_CCROSS
constexpr OUStringLiteral SC_UNO_CJK_CFNAME
constexpr OUStringLiteral SC_UNONAME_PBMARGIN
constexpr OUStringLiteral SC_UNONAME_CFPITCH
constexpr OUStringLiteral SC_UNONAME_COVER
constexpr OUStringLiteral SC_UNONAME_COUTL
constexpr OUStringLiteral SC_UNONAME_ROTANG
constexpr OUStringLiteral SC_UNO_CTL_CHEIGHT
constexpr OUStringLiteral SC_UNONAME_CELLVJUS
constexpr OUStringLiteral SC_UNONAME_ROTREF
constexpr OUStringLiteral SC_UNONAME_TBLBORD
constexpr OUStringLiteral SC_UNONAME_CELLBACK
constexpr OUStringLiteral SC_UNONAME_CWEIGHT
constexpr OUStringLiteral SC_UNO_CTL_CPOST
constexpr OUStringLiteral SC_UNONAME_CUNDER
constexpr OUStringLiteral SC_UNONAME_TBLBORD2
constexpr OUStringLiteral SC_UNONAME_INCBACK
constexpr OUStringLiteral SC_UNONAME_CHEIGHT
constexpr OUStringLiteral SC_UNONAME_CELLHJUS
constexpr OUStringLiteral SC_UNO_CTL_CFSTYLE
constexpr OUStringLiteral SC_UNONAME_CFSTYLE
constexpr OUStringLiteral SC_UNONAME_CELLHJUS_METHOD
#define SC_WID_UNO_TBLBORD2
#define SC_WID_UNO_TBLBORD
bool IsScItemWid(sal_uInt16 nWid)