20#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
21#include <com/sun/star/beans/XPropertySet.hpp>
22#include <com/sun/star/container/XNameAccess.hpp>
57#include <LibreOfficeKit/LibreOfficeKitEnums.h>
67#include <stlsheet.hxx>
73#define ShellClass_ScFormatShell
74#define ShellClass_TableFont
75#define ShellClass_FormatForSelection
92 case SID_ALIGN_ANY_HDEFAULT: eHJustify = SvxCellHorJustify::Standard;
break;
93 case SID_ALIGN_ANY_LEFT: eHJustify = SvxCellHorJustify::Left;
break;
94 case SID_ALIGN_ANY_HCENTER: eHJustify = SvxCellHorJustify::Center;
break;
95 case SID_ALIGN_ANY_RIGHT: eHJustify = SvxCellHorJustify::Right;
break;
96 case SID_ALIGN_ANY_JUSTIFIED: eHJustify = SvxCellHorJustify::Block;
break;
97 default: OSL_FAIL(
"lclConvertSlotToHAlign - invalid slot" );
107 case SID_ALIGN_ANY_VDEFAULT: eVJustify = SvxCellVerJustify::Standard;
break;
108 case SID_ALIGN_ANY_TOP: eVJustify = SvxCellVerJustify::Top;
break;
109 case SID_ALIGN_ANY_VCENTER: eVJustify = SvxCellVerJustify::Center;
break;
110 case SID_ALIGN_ANY_BOTTOM: eVJustify = SvxCellVerJustify::Bottom;
break;
111 default: OSL_FAIL(
"lclConvertSlotToVAlign - invalid slot" );
124 SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
125 ToolbarId::Objectbar_Format);
151 const sal_uInt16 nSlotId = rReq.
GetSlot();
158 if ( (nSlotId == SID_STYLE_PREVIEW)
159 || (nSlotId == SID_STYLE_END_PREVIEW) )
161 if (nSlotId == SID_STYLE_PREVIEW)
165 if ( pArgs && (pFamItem = pArgs->
GetItemIfSet( SID_STYLE_FAMILY )) )
169 if (pArgs && SfxItemState::SET == pArgs->
GetItemState( nSlotId,
true, &pNameItem ))
171 if ( eFamily == SfxStyleFamily::Para )
182 ScRange aRange( nCol, nRow, nTab );
195 rNewSet.
Put( aItemSet,
false );
218 rNewSet.
Put( aItemSet,
false );
224 else if (nSlotId == SID_CLASSIFICATION_APPLY)
227 if (pArgs && pArgs->
GetItemState(nSlotId,
false, &pItem) == SfxItemState::SET)
231 auto eType = SfxClassificationPolicyType::IntellectualProperty;
234 const OUString& rType = pNameItem->GetValue();
240 SAL_WARN(
"sc.ui",
"missing parameter for SID_CLASSIFICATION_APPLY");
244 OSL_FAIL(
"Unknown slot (ScViewShell::ExecuteStyle)" );
253 sal_uInt16 nSlot = rReq.
GetSlot();
263 case SID_NUMBER_TYPE_FORMAT:
264 case SID_NUMBER_TWODEC:
265 case SID_NUMBER_SCIENTIFIC:
266 case SID_NUMBER_DATE:
267 case SID_NUMBER_CURRENCY:
268 case SID_NUMBER_PERCENT:
269 case SID_NUMBER_STANDARD:
270 case SID_NUMBER_FORMAT:
271 case SID_NUMBER_INCDEC:
272 case SID_NUMBER_DECDEC:
273 case SID_NUMBER_THOUSANDS:
274 case FID_DEFINE_NAME:
277 case FID_INSERT_NAME:
278 case SID_SPELL_DIALOG:
279 case SID_HANGUL_HANJA_CONVERSION:
293 case SID_NUMBER_TWODEC:
298 if ((
nType & SvNumFormatType::NUMBER) && nNumberFormat == 4)
306 case SID_NUMBER_SCIENTIFIC:
307 if (
nType & SvNumFormatType::SCIENTIFIC)
314 case SID_NUMBER_DATE:
315 if (
nType & SvNumFormatType::DATE)
322 case SID_NUMBER_TIME:
323 if (
nType & SvNumFormatType::TIME)
330 case SID_NUMBER_CURRENCY:
334 if ( pReqArgs->
HasItem( SID_NUMBER_CURRENCY, &pItem ) )
344 if ( nOldFormat != nNewFormat )
361 if (
nType & SvNumFormatType::CURRENCY )
369 case SID_NUMBER_PERCENT:
370 if (
nType & SvNumFormatType::PERCENT)
377 case SID_NUMBER_STANDARD:
381 case SID_NUMBER_INCDEC:
385 case SID_NUMBER_DECDEC:
389 case SID_NUMBER_THOUSANDS:
393 bool bThousand(
false);
395 sal_uInt16 nPrecision(0);
396 sal_uInt16 nLeadZeroes(0);
406 pFormatter->
GetFormatSpecialInfo(nCurrentNumberFormat, bThousand, bNegRed, nPrecision, nLeadZeroes);
407 bThousand = !bThousand;
409 nCurrentNumberFormat,
421 case SID_NUMBER_FORMAT:
441 if(!(
eType == SvNumFormatType::ALL
442 ||
eType == SvNumFormatType::NUMBER
443 ||
eType == SvNumFormatType::PERCENT
444 ||
eType == SvNumFormatType::CURRENCY
445 ||
eType == SvNumFormatType::SCIENTIFIC
446 ||
eType == SvNumFormatType::TIME
447 ||
eType == SvNumFormatType::FRACTION))
450 if(SfxItemState::SET == pReqArgs->
GetItemState(nSlot,
true, &pItem) && pEntry)
453 sal_uInt16 aLen = aCode.getLength();
454 std::unique_ptr<OUString[]> sFormat(
new OUString[4] );
455 OUStringBuffer sTmpStr;
457 sal_uInt16 nStrCount(0);
465 sFormat[nStrCount] = sTmpStr.makeStringAndClear();
470 sTmpStr.append(cChar);
479 const bool bThousand =
static_cast<bool>(sFormat[0].toInt32());
480 const bool bNegRed =
static_cast<bool>(sFormat[1].toInt32());
481 const sal_uInt16 nPrecision =
static_cast<sal_uInt16
>(sFormat[2].toInt32());
482 const sal_uInt16 nLeadZeroes =
static_cast<sal_uInt16
>(sFormat[3].toInt32());
485 nCurrentNumberFormat,
496 case SID_ATTR_NUMBERFORMAT_VALUE:
508 aNewSet.
Put( *pItem );
514 case SID_NUMBER_TYPE_FORMAT:
518 if ( pReqArgs->
GetItemState( nSlot,
true, &pItem ) == SfxItemState::SET )
562 OSL_FAIL(
"ExecuteEdit: invalid slot");
572 sal_uInt16 nSlot = rReq.
GetSlot();
579 case SID_ALIGN_ANY_HDEFAULT:
580 case SID_ALIGN_ANY_LEFT:
581 case SID_ALIGN_ANY_HCENTER:
582 case SID_ALIGN_ANY_RIGHT:
583 case SID_ALIGN_ANY_JUSTIFIED:
586 case SID_ALIGN_ANY_VDEFAULT:
587 case SID_ALIGN_ANY_TOP:
588 case SID_ALIGN_ANY_VCENTER:
589 case SID_ALIGN_ANY_BOTTOM:
602 case SID_ATTR_ALIGN_HOR_JUSTIFY:
603 case SID_ATTR_ALIGN_VER_JUSTIFY:
604 case SID_ATTR_ALIGN_INDENT:
605 case SID_ATTR_ALIGN_HYPHENATION:
606 case SID_ATTR_ALIGN_DEGREES:
607 case SID_ATTR_ALIGN_LOCKPOS:
608 case SID_ATTR_ALIGN_MARGIN:
609 case SID_ATTR_ALIGN_STACKED:
613 case SID_H_ALIGNCELL:
621 case SID_V_ALIGNCELL:
625 OSL_FAIL(
"ExecuteAlignment: invalid slot" );
631 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
632 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
633 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
634 rBindings.
Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
645 rBindings.
Invalidate( SID_ALIGN_ANY_HDEFAULT );
647 rBindings.
Invalidate( SID_ALIGN_ANY_HCENTER );
649 rBindings.
Invalidate( SID_ALIGN_ANY_JUSTIFIED );
650 rBindings.
Invalidate( SID_ALIGN_ANY_VDEFAULT );
652 rBindings.
Invalidate( SID_ALIGN_ANY_VCENTER );
666 sal_uInt16 nSlot = rReq.
GetSlot();
667 std::optional<SfxAllItemSet> pNewSet;
671 if ( (nSlot == SID_ATTR_CHAR_WEIGHT)
672 ||(nSlot == SID_ATTR_CHAR_POSTURE)
673 ||(nSlot == SID_ATTR_CHAR_UNDERLINE)
674 ||(nSlot == SID_ULINE_VAL_NONE)
675 ||(nSlot == SID_ULINE_VAL_SINGLE)
676 ||(nSlot == SID_ULINE_VAL_DOUBLE)
677 ||(nSlot == SID_ULINE_VAL_DOTTED) )
683 case SID_ATTR_CHAR_WEIGHT:
686 SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
698 aOldSetItem.GetItemSet().Put( pAttrs->
GetItemSet(),
false );
706 pNewSet->Put( aSetItem.GetItemSet(),
false );
710 case SID_ATTR_CHAR_POSTURE:
713 SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
725 aOldSetItem.GetItemSet().Put( pAttrs->
GetItemSet(),
false );
733 pNewSet->Put( aSetItem.GetItemSet(),
false );
737 case SID_ATTR_CHAR_UNDERLINE:
746 pNewSet->Put( rUnderline,rUnderline.
Which() );
748 else if (
auto pTextLineItem =
dynamic_cast<const SvxTextLineItem*
>( &rUnderline) )
751 SvxUnderlineItem aNewItem( pTextLineItem->GetLineStyle(), pTextLineItem->Which() );
752 aNewItem.
SetColor( pTextLineItem->GetColor() );
754 pNewSet->Put( aNewItem, aNewItem.Which() );
765 pNewSet->Put( aUnderline,aUnderline.Which() );
770 case SID_ULINE_VAL_NONE:
773 case SID_ULINE_VAL_SINGLE:
774 case SID_ULINE_VAL_DOUBLE:
775 case SID_ULINE_VAL_DOTTED:
781 case SID_ULINE_VAL_SINGLE:
784 case SID_ULINE_VAL_DOUBLE:
787 case SID_ULINE_VAL_DOTTED:
816 eHorJustify = pHorJustify->GetValue();
820 eVerJustify = pVerJustify->GetValue();
826 rReq.
SetSlot( SID_H_ALIGNCELL );
828 !pHorJustify || (eHorJustify != SvxCellHorJustify::Left) ?
829 SvxCellHorJustify::Left : SvxCellHorJustify::Standard, SID_H_ALIGNCELL ) );
834 rReq.
SetSlot( SID_H_ALIGNCELL );
836 !pHorJustify || (eHorJustify != SvxCellHorJustify::Right) ?
837 SvxCellHorJustify::Right : SvxCellHorJustify::Standard, SID_H_ALIGNCELL ) );
841 case SID_ALIGNCENTERHOR:
842 rReq.
SetSlot( SID_H_ALIGNCELL );
844 !pHorJustify || (eHorJustify != SvxCellHorJustify::Center) ?
845 SvxCellHorJustify::Center : SvxCellHorJustify::Standard, SID_H_ALIGNCELL ) );
850 rReq.
SetSlot( SID_H_ALIGNCELL );
852 !pHorJustify || (eHorJustify != SvxCellHorJustify::Block) ?
853 SvxCellHorJustify::Block : SvxCellHorJustify::Standard, SID_H_ALIGNCELL ) );
858 rReq.
SetSlot( SID_V_ALIGNCELL );
860 !pVerJustify || (eVerJustify != SvxCellVerJustify::Top) ?
861 SvxCellVerJustify::Top : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) );
865 case SID_ALIGNBOTTOM:
866 rReq.
SetSlot( SID_V_ALIGNCELL );
868 !pVerJustify || (eVerJustify != SvxCellVerJustify::Bottom) ?
869 SvxCellVerJustify::Bottom : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) );
873 case SID_ALIGNCENTERVER:
874 rReq.
SetSlot( SID_V_ALIGNCELL );
876 !pVerJustify || (eVerJustify != SvxCellVerJustify::Center) ?
877 SvxCellVerJustify::Center : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) );
891 rReq.
Done( *pNewSet );
906 sal_uInt16 nSlot = rReq.
GetSlot();
914 case SID_GROW_FONT_SIZE:
915 case SID_SHRINK_FONT_SIZE:
931 if ( nSlot == SID_GROW_FONT_SIZE )
940 rBindings.
Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
944 case SID_ATTR_CHAR_ENDPREVIEW_FONT:
950 case SID_ATTR_CHAR_COLOR:
951 case SID_ATTR_CHAR_FONT:
952 case SID_ATTR_CHAR_FONTHEIGHT:
956 case SID_BACKGROUND_COLOR:
961 pTabViewShell->
ApplyAttr( aBrushItem,
false );
965 case SID_ATTR_ALIGN_LINEBREAK:
973 aNewSet.
Put( aBreakItem,aBreakItem.
Which() );
974 rReq.
Done( aNewSet );
980 case SID_SCATTR_CELLPROTECTION:
988 ScProtectionAttr aProtectionItem( !bProtect, bHideFormula, bHideCell, bHidePrint );
989 pTabViewShell->
ApplyAttr( aProtectionItem );
992 aNewSet.
Put( aProtectionItem, aProtectionItem.
Which());
993 aNewSet.
Put(
SfxBoolItem( SID_SCATTR_CELLPROTECTION, !bProtect ) );
994 rReq.
Done( aNewSet );
1005 case SID_ATTR_CHAR_PREVIEW_FONT:
1008 sal_uInt16 nWhich = rPool.
GetWhich( nSlot );
1024 ScRange aRange( nCol, nRow, nTab );
1031 case SID_ATTR_CHAR_OVERLINE:
1032 case SID_ATTR_CHAR_STRIKEOUT:
1033 case SID_ATTR_ALIGN_LINEBREAK:
1034 case SID_ATTR_CHAR_CONTOUR:
1035 case SID_ATTR_CHAR_SHADOWED:
1036 case SID_ATTR_CHAR_RELIEF:
1039 rBindings.
Update( nSlot );
1041 case SID_ATTR_CHAR_COLOR:
1042 case SID_SCATTR_PROTECTION :
1047 rBindings.
Update( nSlot );
1052 case SID_ATTR_CHAR_FONT:
1053 case SID_ATTR_CHAR_FONTHEIGHT:
1056 SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
1057 if (nSlot == SID_ATTR_CHAR_FONT)
1062 sal_uInt16 nWhich = rPool.
GetWhich( nSlot );
1068 rBindings.
Update( nSlot );
1072 case SID_FRAME_LINESTYLE:
1075 const ::editeng::SvxBorderLine* pLine =
1076 pNewAttrs->
Get( SID_FRAME_LINESTYLE ).
1086 pLine->GetBorderLineStyle());
1087 pDefLine->
SetWidth( pLine->GetWidth( ) );
1101 SvxBorderLineStyle::SOLID );
1108 case SID_FRAME_LINECOLOR:
1112 Color aColor = pNewAttrs->
Get( SID_FRAME_LINECOLOR ).GetValue();
1129 case SID_ATTR_BORDER_OUTER:
1130 case SID_ATTR_BORDER:
1151 aBoxItem.
SetLine( pDefLine, SvxBoxItemLine::TOP );
1153 aBoxItem.
SetLine( pDefLine, SvxBoxItemLine::BOTTOM );
1155 aBoxItem.
SetLine( pDefLine, SvxBoxItemLine::LEFT );
1157 aBoxItem.
SetLine( pDefLine, SvxBoxItemLine::RIGHT );
1158 aNewSet.
Put( aBoxItem );
1166 aBoxInfoItem.
SetLine( pDefLine, SvxBoxInfoItemLine::HORI );
1168 aBoxInfoItem.
SetLine( pDefLine, SvxBoxInfoItemLine::VERT );
1169 aNewSet.
Put( aBoxInfoItem );
1175 aBoxInfoItem.
SetLine(
nullptr, SvxBoxInfoItemLine::HORI );
1176 aBoxInfoItem.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
1177 aNewSet.
Put( aBoxInfoItem );
1180 aOldSet.
Put( rBorderAttr );
1185 case SID_ATTR_BORDER_DIAG_TLBR:
1186 case SID_ATTR_BORDER_DIAG_BLTR:
1192 if(SID_ATTR_BORDER_DIAG_TLBR == nSlot)
1220 case SID_BACKGROUND_COLOR:
1222 const SvxColorItem& rNewColorItem = pNewAttrs->
Get( SID_BACKGROUND_COLOR );
1230 pTabViewShell->
ApplyAttr( aBrushItem,
false );
1234 case SID_ATTR_BRUSH:
1246 case SID_ATTR_BORDER_SHADOW:
1250 pTabViewShell->
ApplyAttr( rNewShadowItem );
1290 case SID_BACKGROUND_COLOR:
1299 case SID_FRAME_LINESTYLE:
1300 case SID_FRAME_LINECOLOR:
1306 bool bColDisable =
false, bStyleDisable =
false;
1307 std::shared_ptr<SvxBoxItem> aBoxItem(std::make_shared<SvxBoxItem>(
ATTR_BORDER));
1308 std::shared_ptr<SvxBoxInfoItem> aInfoItem(std::make_shared<SvxBoxInfoItem>(
ATTR_BORDER_INNER));
1312 if( aBoxItem->GetTop() )
1315 aCol = aBoxItem->GetTop()->GetColor() ;
1317 aLine.
SetWidth( aBoxItem->GetTop()->GetWidth());
1321 if( aBoxItem->GetBottom() )
1326 aCol = aBoxItem->GetBottom()->GetColor() ;
1328 aLine.
SetWidth( aBoxItem->GetBottom()->GetWidth());
1333 if(aCol != aBoxItem->GetBottom()->GetColor() )
1335 if( aLine != *aBoxItem->GetBottom() )
1336 bStyleDisable =
true;
1340 if( aBoxItem->GetLeft() )
1345 aCol = aBoxItem->GetLeft()->GetColor() ;
1347 aLine.
SetWidth( aBoxItem->GetLeft()->GetWidth());
1352 if(aCol != aBoxItem->GetLeft()->GetColor() )
1354 if( aLine != *aBoxItem->GetLeft() )
1355 bStyleDisable =
true;
1359 if( aBoxItem->GetRight() )
1364 aCol = aBoxItem->GetRight()->GetColor() ;
1366 aLine.
SetWidth( aBoxItem->GetRight()->GetWidth());
1371 if(aCol != aBoxItem->GetRight()->GetColor() )
1373 if( aLine != *aBoxItem->GetRight() )
1374 bStyleDisable =
true;
1378 if( aInfoItem->GetVert())
1383 aCol = aInfoItem->GetVert()->GetColor() ;
1385 aLine.
SetWidth( aInfoItem->GetVert()->GetWidth());
1390 if(aCol != aInfoItem->GetVert()->GetColor() )
1392 if( aLine != *aInfoItem->GetVert() )
1393 bStyleDisable =
true;
1397 if( aInfoItem->GetHori())
1402 aCol = aInfoItem->GetHori()->GetColor() ;
1404 aLine.
SetWidth( aInfoItem->GetHori()->GetWidth());
1409 if(aCol != aInfoItem->GetHori()->GetColor() )
1411 if( aLine != *aInfoItem->GetHori() )
1412 bStyleDisable =
true;
1416 if( !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::VERT )
1417 || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::HORI )
1418 || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::LEFT )
1419 || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::RIGHT )
1420 || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::TOP )
1421 || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) )
1424 bStyleDisable =
true;
1427 if(SID_FRAME_LINECOLOR == nWhich)
1462 case SID_ATTR_BRUSH:
1467 case SID_SCATTR_CELLPROTECTION:
1509 if ( eState == SfxItemState::DONTCARE )
1531 sal_uInt16 nWhich = 0;
1532 bool bJustifyStd =
false;
1536 reinterpret_cast<const SfxPoolItem**
>(&pHorJustify) );
1539 case SfxItemState::SET:
1541 switch ( pHorJustify->GetValue() )
1543 case SvxCellHorJustify::Standard:
1546 case SvxCellHorJustify::Left:
1547 nWhich = SID_ALIGNLEFT;
1550 case SvxCellHorJustify::Right:
1551 nWhich = SID_ALIGNRIGHT;
1554 case SvxCellHorJustify::Center:
1555 nWhich = SID_ALIGNCENTERHOR;
1558 case SvxCellHorJustify::Block:
1559 nWhich = SID_ALIGNBLOCK;
1562 case SvxCellHorJustify::Repeat:
1570 case SfxItemState::DONTCARE:
1587 else if ( bJustifyStd )
1594 bJustifyStd =
false;
1603 reinterpret_cast<const SfxPoolItem**
>(&pVerJustify) );
1607 case SfxItemState::SET:
1609 eVerJustify = pVerJustify->GetValue();
1611 switch ( eVerJustify )
1613 case SvxCellVerJustify::Top:
1614 nWhich = SID_ALIGNTOP;
1617 case SvxCellVerJustify::Bottom:
1618 nWhich = SID_ALIGNBOTTOM;
1621 case SvxCellVerJustify::Center:
1622 nWhich = SID_ALIGNCENTERVER;
1625 case SvxCellVerJustify::Standard:
1633 case SfxItemState::DONTCARE:
1649 else if ( bJustifyStd )
1661 std::shared_ptr<SvxBoxItem> aBoxItem(std::make_shared<SvxBoxItem>(
ATTR_BORDER));
1662 std::shared_ptr<SvxBoxInfoItem> aInfoItem(std::make_shared<SvxBoxInfoItem>(
ATTR_BORDER_INNER));
1693 case SID_H_ALIGNCELL:
1697 case SID_V_ALIGNCELL:
1703 case SID_ALIGN_ANY_HDEFAULT:
1704 case SID_ALIGN_ANY_LEFT:
1705 case SID_ALIGN_ANY_HCENTER:
1706 case SID_ALIGN_ANY_RIGHT:
1707 case SID_ALIGN_ANY_JUSTIFIED:
1708 rSet.
Put(
SfxBoolItem( nWhich, bHasHAlign && (eHAlign == lclConvertSlotToHAlign( nWhich )) ) );
1710 case SID_ALIGN_ANY_VDEFAULT:
1711 case SID_ALIGN_ANY_TOP:
1712 case SID_ALIGN_ANY_VCENTER:
1713 case SID_ALIGN_ANY_BOTTOM:
1714 rSet.
Put(
SfxBoolItem( nWhich, bHasVAlign && (eVAlign == lclConvertSlotToVAlign( nWhich )) ) );
1747 case SID_NUMBER_THOUSANDS:
1749 bool bEnable = (SfxItemState::DONTCARE != eItemState);
1752 bEnable = ((
nType != SvNumFormatType::ALL) && (
nType &
1753 (SvNumFormatType::NUMBER |
1754 SvNumFormatType::PERCENT |
1755 SvNumFormatType::CURRENCY |
1756 SvNumFormatType::FRACTION)));
1759 bool bThousand(
false );
1760 bool bNegRed(
false );
1761 sal_uInt16 nPrecision( 0 );
1762 sal_uInt16 nLeadZeroes( 0 );
1773 case SID_NUMBER_FORMAT:
1776 if(SfxItemState::DONTCARE != eItemState)
1778 bool bThousand(
false);
1779 bool bNegRed(
false);
1780 sal_uInt16 nPrecision(0);
1781 sal_uInt16 nLeadZeroes(0);
1786 if (pFormatEntry && (pFormatEntry->
GetType() & SvNumFormatType::SCIENTIFIC))
1790 bThousand = nIntegerDigits > 0 && ((nIntegerDigits % 3) == 0);
1793 static constexpr OUStringLiteral sBreak =
u",";
1794 const OUString sThousand = OUString::number(
static_cast<sal_Int32
>(bThousand));
1795 const OUString sNegRed = OUString::number(
static_cast<sal_Int32
>(bNegRed));
1796 const OUString sPrecision = OUString::number(nPrecision);
1797 const OUString sLeadZeroes = OUString::number(nLeadZeroes);
1798 const OUString sNatNum12 = OUString::number(
static_cast< sal_Int32
>( pFormatter->
IsNatNum12( nNumberFormat ) ) );
1800 aFormat += sThousand +
1815 OUString sPayload =
".uno:NumberFormat=" + aFormat;
1827 case SID_NUMBER_TYPE_FORMAT:
1829 sal_Int16 nFormatCategory = -1;
1830 if ( eItemState >= SfxItemState::DEFAULT )
1834 case SvNumFormatType::NUMBER:
1837 nFormatCategory = 0;
1839 nFormatCategory = 1;
1841 case SvNumFormatType::PERCENT:
1842 nFormatCategory = 2;
1844 case SvNumFormatType::CURRENCY:
1845 nFormatCategory = 3;
1847 case SvNumFormatType::DATE:
1849 case SvNumFormatType::DATETIME:
1850 nFormatCategory = 4;
1852 case SvNumFormatType::TIME:
1853 nFormatCategory = 5;
1855 case SvNumFormatType::SCIENTIFIC:
1856 nFormatCategory = 6;
1858 case SvNumFormatType::FRACTION:
1859 nFormatCategory = 7;
1861 case SvNumFormatType::LOGICAL:
1862 nFormatCategory = 8;
1864 case SvNumFormatType::TEXT:
1865 nFormatCategory = 9;
1868 nFormatCategory = -1;
1870 if( nFormatCategory == -1 )
1882 case SID_NUMBER_CURRENCY:
1885 case SID_NUMBER_SCIENTIFIC:
1888 case SID_NUMBER_DATE:
1891 case SID_NUMBER_PERCENT:
1894 case SID_NUMBER_TIME:
1897 case SID_NUMBER_TWODEC:
1900 case SID_NUMBER_STANDARD:
1912 bool bEditMode =
false;
1916 SC_MOD()->InputEnterHandler();
1919 sal_uInt16 nSlot = rReq.
GetSlot();
1922 case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
1923 case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
1925 bool bVert = (nSlot == SID_TEXTDIRECTION_TOP_TO_BOTTOM);
1935 case SID_ATTR_PARA_LEFT_TO_RIGHT:
1936 case SID_ATTR_PARA_RIGHT_TO_LEFT:
1939 SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB;
1953 bool bVertDontCare =
1956 bool bLeftRight = !bVertDontCare &&
1958 bool bTopBottom = !bVertDontCare && !bLeftRight &&
1963 if ( !bBidiDontCare )
1966 if ( eCellDir == SvxFrameDirection::Environment )
1969 else if ( eCellDir == SvxFrameDirection::Horizontal_RL_TB )
1970 eBidiDir = EEHorizontalTextDirection::R2L;
1972 eBidiDir = EEHorizontalTextDirection::L2R;
1984 case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
1985 case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
1986 if ( bDisableVerticalText )
1992 else if ( nWhich == SID_TEXTDIRECTION_LEFT_TO_RIGHT )
1999 case SID_ATTR_PARA_LEFT_TO_RIGHT:
2000 case SID_ATTR_PARA_RIGHT_TO_LEFT:
2001 if ( bDisableCTLFont )
2007 else if ( bBidiDontCare )
2009 else if ( nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT )
2031 if( pArgs && pArgs->
Count() >= 1 )
2032 bLock = pArgs->
Get(SID_FORMATPAINTBRUSH).GetValue();
2040 pView->
CopyToClip( pBrushDoc.get(),
false,
true );
2072 bool bFirstItem =
true;
2080 while (aMultiIter.
Next(nRow1, nRow2))
2089 nComboType = nThisType;
2091 else if (nComboType != nThisType)
2093 return SvNumFormatType::ALL;
sal_uInt16 GetValue() const
const OUString & GetValue() const
const ScDocument & GetDocument() const
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC void ApplySelectionPattern(const ScPatternAttr &rAttr, const ScMarkData &rMark, ScEditDataArray *pDataArray=nullptr, bool *pIsChanged=nullptr)
void SetPreviewSelection(const ScMarkData &rSel)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
void SetPreviewCellStyle(ScStyleSheet *pStyle)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
void SetPreviewFont(std::unique_ptr< SfxItemSet > pFontSet)
const ScMarkData & GetPreviewSelection() const
ScStyleSheet * GetPreviewCellStyle()
bool IsUndoEnabled() const
const ScPatternAttr * GetSelectionPattern(const ScMarkData &rMark)
static SC_DLLPUBLIC LanguageType eLnge
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMultiMarkArea() const
bool IsMultiMarked() const
const ScMultiSel & GetMultiSelData() const
void SetMarkArea(const ScRange &rRange)
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
bool Next(SCROW &rTop, SCROW &rBottom)
bool HasMarks(SCCOL nCol) const
void SetStyleSheet(ScStyleSheet *pNewStyle, bool bClearDirectFormat=true)
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
void ExecuteCellFormatDlg(SfxRequest &rReq, const OUString &rTabPage)
void UpdateInputHandlerCellAdjust(SvxCellHorJustify eJust)
::editeng::SvxBorderLine * GetDefaultFrameLine() const
void SetDefaultFrameLine(const ::editeng::SvxBorderLine *pLine)
void ResetBrushDocument()
void SetBrushDocument(ScDocumentUniquePtr pNew, bool bLock)
bool HasPaintBrush() const
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
ScDBFunc * GetView() const
ScSplitPos GetActivePart() const
SfxObjectShell * GetSfxDocShell() const
SfxBindings & GetBindings()
bool HasEditView(ScSplitPos eWhich) const
void SetNumFmtByStr(const OUString &rCode)
void ApplyUserItemSet(const SfxItemSet &rItemSet)
void SetSelectionFrameLines(const ::editeng::SvxBorderLine *pLine, bool bColorOnly)
void SetNumberFormat(SvNumFormatType nFormatType, sal_uLong nAdd=0)
SvtScriptType GetSelectionScriptType()
void ApplySelectionPattern(const ScPatternAttr &rAttr, bool bCursorOnly=false)
SC_DLLPUBLIC const ScPatternAttr * GetSelectionPattern()
void UpdateSelectionArea(const ScMarkData &rSel, ScPatternAttr *pAttr=nullptr)
bool AdjustBlockHeight(bool bPaint=true, ScMarkData *pMarkData=nullptr)
void ChangeNumFmtDecimals(bool bIncrement)
void GetSelectionFrame(std::shared_ptr< SvxBoxItem > &rLineOuter, std::shared_ptr< SvxBoxInfoItem > &rLineInner)
void ApplyAttr(const SfxPoolItem &rAttrItem, bool bAdjustBlockHeight=true)
SC_DLLPUBLIC bool CopyToClip(ScDocument *pClipDoc, bool bCut, bool bApi=false, bool bIncludeObjects=false, bool bStopEdit=true)
void ApplyAttributes(const SfxItemSet *pDialogSet, const SfxItemSet *pOldSet, bool bAdjustBlockHeight=true)
static void UnmarkFiltered(ScMarkData &rMark, const ScDocument &rDoc)
static void PutItemScript(SfxItemSet &rShellSet, const SfxItemSet &rCoreSet, sal_uInt16 nWhichId, SvtScriptType nScript)
void Update(sal_uInt16 nId)
void Invalidate(sal_uInt16 nId)
void SetValue(bool const bTheValue)
static SfxClassificationPolicyType stringToPolicyType(std::u16string_view rType)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
void SetWhich(sal_uInt16 nId)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void SetSlot(sal_uInt16 nNewSlot)
void AppendItem(const SfxPoolItem &)
void Done(bool bRemove=false)
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
SfxItemPool & GetPool() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual SfxInterface * GetInterface() const
virtual void Invalidate(sal_uInt16 nId=0)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
virtual SfxUndoManager * GetUndoManager()
SfxViewShell * GetViewShell() const
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void SetMaxUndoActionCount(size_t nMaxUndoActionCount)
SfxBindings & GetBindings()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
static bool IsCTLFontEnabled()
const editeng::SvxBorderLine * GetHori() const
const editeng::SvxBorderLine * GetVert() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
void setComplexColor(model::ComplexColor const &rComplexColor)
const Color & GetColor() const
void SetColor(const Color &rCol)
const model::ComplexColor & getComplexColor() const
const Color & GetValue() const
model::ComplexColor const & getComplexColor() const
sal_uInt32 GetHeight() const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
void SetLine(const editeng::SvxBorderLine *pNew)
void PutItemForScriptType(SvtScriptType nScriptType, const SfxPoolItem &rItem)
const SfxPoolItem * GetItemOfScript(SvtScriptType nScript) const
virtual SvxScriptSetItem * Clone(SfxItemPool *pPool=nullptr) const override
FontLineStyle GetLineStyle() const
void SetColor(const Color &rColor)
void SetLineStyle(FontLineStyle eNew)
void SetWidth(tools::Long nWidth)
void SetColor(const Color &rColor)
sal_uInt16 GetOutWidth() const
void SetBorderLineStyle(SvxBorderLineStyle nNew)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
EEHorizontalTextDirection
#define LANGUAGE_DONTKNOW
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
bool IsVerticalTextEnabled()
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
#define SFX_OBJECTBAR_OBJECT
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SfxBoolItem > ATTR_VERTICAL_ASIAN(137)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
constexpr TypedWhichId< SvxLanguageItem > ATTR_LANGUAGE_FORMAT(147)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SvxFrameDirectionItem > ATTR_WRITINGDIR(138)
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
#define SFX_IMPL_INTERFACE(Class, SuperClass)
const sal_uInt32 nFontInc
const sal_uInt32 nFontMaxSz
#define SV_COUNTRY_LANGUAGE_OFFSET