23#include <svx/strings.hrc>
24#include <svx/svxids.hrc>
27#include <bitmaps.hlst>
45#include <com/sun/star/lang/XServiceInfo.hpp>
50using ::com::sun::star::uno::Reference;
51using ::com::sun::star::lang::XServiceInfo;
52using ::com::sun::star::uno::UNO_QUERY;
73 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW,
74 SID_ATTR_ALIGN_MARGIN, SID_ATTR_ALIGN_MARGIN,
75 SID_ATTR_BORDER_CONNECT, SID_ATTR_BORDER_CONNECT,
76 SID_SW_COLLAPSING_BORDERS, SID_SW_COLLAPSING_BORDERS,
77 SID_ATTR_BORDER_DIAG_TLBR, SID_ATTR_BORDER_DIAG_BLTR>);
81int lcl_twipsToPt(sal_Int64 nTwips)
109 case SvxBorderLineStyle::NONE:
112 case SvxBorderLineStyle::SOLID:
113 case SvxBorderLineStyle::DOTTED:
114 case SvxBorderLineStyle::DASHED:
115 case SvxBorderLineStyle::FINE_DASHED:
116 case SvxBorderLineStyle::DASH_DOT:
117 case SvxBorderLineStyle::DASH_DOT_DOT:
121 case SvxBorderLineStyle::DOUBLE:
return 15;
122 case SvxBorderLineStyle::DOUBLE_THIN:
return 15;
123 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
return 20;
124 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
return 15;
125 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
return 15;
126 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
return 20;
127 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
return 15;
128 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
return 15;
130 case SvxBorderLineStyle::EMBOSSED:
return 15;
131 case SvxBorderLineStyle::ENGRAVED:
return 15;
133 case SvxBorderLineStyle::OUTSET:
return 10;
134 case SvxBorderLineStyle::INSET:
return 10;
150 , mrLbColor(rLbColor)
195 case SvxShadowLocation::NONE:
198 case SvxShadowLocation::BottomRight:
201 case SvxShadowLocation::TopRight:
204 case SvxShadowLocation::BottomLeft:
207 case SvxShadowLocation::TopLeft:
238 , mrRightWrp(rMfRight)
240 , mrBottomWrp(rMfBottom)
288 :
SfxTabPage(pPage, pController,
"cui/ui/borderpage.ui",
"BorderPage", &rCoreAttrs)
291 , mnBoxSlot(SID_ATTR_BORDER_OUTER)
292 , mnShadowSlot(SID_ATTR_BORDER_SHADOW)
293 , mbHorEnabled(false)
294 , mbVerEnabled(false)
295 , mbTLBREnabled(false)
296 , mbBLTREnabled(false)
297 , mbUseMarginItem(false)
298 , mbLeftModified(false)
299 , mbRightModified(false)
300 , mbTopModified(false)
301 , mbBottomModified(false)
303 , mbRemoveAdjacentCellBorders(false)
305 , m_xWndPresets(new
ValueSet(nullptr))
306 , m_xWndPresetsWin(new
weld::CustomWeld(*m_xBuilder,
"presets", *m_xWndPresets))
307 , m_xUserDefFT(m_xBuilder->weld_label(
"userdefft"))
308 , m_xFrameSelWin(new
weld::CustomWeld(*m_xBuilder,
"framesel", m_aFrameSel))
309 , m_xLbLineStyle(new
SvtLineListBox(m_xBuilder->weld_menu_button(
"linestylelb")))
310 , m_xLbLineColor(new
ColorListBox(m_xBuilder->weld_menu_button(
"linecolorlb"),
312 , m_xLineWidthLB(m_xBuilder->weld_combo_box(
"linewidthlb"))
313 , m_xLineWidthMF(m_xBuilder->weld_metric_spin_button(
"linewidthmf", FieldUnit::POINT))
314 , m_xSpacingFrame(m_xBuilder->weld_container(
"spacing"))
315 , m_xLeftFT(m_xBuilder->weld_label(
"leftft"))
316 , m_xLeftMF(m_xBuilder->weld_metric_spin_button(
"leftmf", FieldUnit::MM))
317 , m_xRightFT(m_xBuilder->weld_label(
"rightft"))
318 , m_xRightMF(m_xBuilder->weld_metric_spin_button(
"rightmf", FieldUnit::MM))
319 , m_xTopFT(m_xBuilder->weld_label(
"topft"))
320 , m_xTopMF(m_xBuilder->weld_metric_spin_button(
"topmf", FieldUnit::MM))
321 , m_xBottomFT(m_xBuilder->weld_label(
"bottomft"))
322 , m_xBottomMF(m_xBuilder->weld_metric_spin_button(
"bottommf", FieldUnit::MM))
323 , m_xSynchronizeCB(m_xBuilder->weld_check_button(
"sync"))
324 , m_xShadowFrame(m_xBuilder->weld_container(
"shadow"))
325 , m_xWndShadows(
new ValueSet(
nullptr))
326 , m_xWndShadowsWin(
new weld::CustomWeld(*m_xBuilder,
"shadows", *m_xWndShadows))
327 , m_xFtShadowSize(m_xBuilder->weld_label(
"distanceft"))
328 , m_xEdShadowSize(m_xBuilder->weld_metric_spin_button(
"distancemf", FieldUnit::MM))
329 , m_xFtShadowColor(m_xBuilder->weld_label(
"shadowcolorft"))
330 , m_xLbShadowColor(
new ColorListBox(m_xBuilder->weld_menu_button(
"shadowcolorlb"),
331 [
this]{ return GetDialogController()->getDialog(); }))
332 , m_xPropertiesFrame(m_xBuilder->weld_container(
"properties"))
333 , m_xMergeWithNextCB(m_xBuilder->weld_check_button(
"mergewithnext"))
334 , m_xMergeAdjacentBordersCB(m_xBuilder->weld_check_button(
"mergeadjacent"))
335 , m_xRemoveAdjacentCellBordersCB(m_xBuilder->weld_check_button(
"rmadjcellborders"))
336 , m_xRemoveAdjacentCellBordersFT(m_xBuilder->weld_label(
"rmadjcellbordersft"))
338 static std::vector<OUString> aBorderImageIds;
340 if (aBorderImageIds.empty())
344 aBorderImageIds.insert(aBorderImageIds.end(), {
345 RID_SVXBMP_CELL_NONE_32,
346 RID_SVXBMP_CELL_ALL_32,
347 RID_SVXBMP_CELL_LR_32,
348 RID_SVXBMP_CELL_TB_32,
349 RID_SVXBMP_CELL_L_32,
350 RID_SVXBMP_CELL_DIAG_32
355 aBorderImageIds.insert(aBorderImageIds.end(), {
356 RID_SVXBMP_CELL_NONE,
364 aBorderImageIds.insert(aBorderImageIds.end(), {
366 RID_SVXBMP_HOR_OUTER,
369 RID_SVXBMP_HOR_OUTER2,
371 RID_SVXBMP_VER_OUTER,
374 RID_SVXBMP_VER_OUTER2,
375 RID_SVXBMP_TABLE_NONE,
376 RID_SVXBMP_TABLE_OUTER,
377 RID_SVXBMP_TABLE_OUTERH,
378 RID_SVXBMP_TABLE_ALL,
379 RID_SVXBMP_TABLE_OUTER2
383 for (
auto const & rImageId : aBorderImageIds)
384 m_aBorderImgVec.emplace_back(StockImage::Yes, rImageId);
386 static std::vector<OUString> aShadowImageIds;
387 if (aShadowImageIds.empty())
391 aShadowImageIds.insert(aShadowImageIds.end(), {
392 RID_SVXBMP_SHADOWNONE_32,
393 RID_SVXBMP_SHADOW_BOT_RIGHT_32,
394 RID_SVXBMP_SHADOW_TOP_RIGHT_32,
395 RID_SVXBMP_SHADOW_BOT_LEFT_32,
396 RID_SVXBMP_SHADOW_TOP_LEFT_32
401 aShadowImageIds.insert(aShadowImageIds.end(), {
402 RID_SVXBMP_SHADOWNONE,
403 RID_SVXBMP_SHADOW_BOT_RIGHT,
404 RID_SVXBMP_SHADOW_TOP_RIGHT,
405 RID_SVXBMP_SHADOW_BOT_LEFT,
406 RID_SVXBMP_SHADOW_TOP_LEFT
411 for (
auto const & rImageId : aShadowImageIds)
412 m_aShadowImgVec.emplace_back(StockImage::Yes, rImageId);
417 SetExchangeSupport();
422 mbUseMarginItem = rCoreAttrs.GetItemState(
GetWhich(SID_ATTR_ALIGN_MARGIN)) != SfxItemState::UNKNOWN;
426 std::vector<sal_Int32> aUsedStyles =
p->GetList();
427 for (
int aUsedStyle : aUsedStyles)
431 if (
const SfxInt64Item* p = rCoreAttrs.GetItemIfSet(SID_ATTR_BORDER_DEFAULT_WIDTH))
434 SetLineWidth(
p->GetValue());
440 if( mbUseMarginItem )
447 case FieldUnit::PICA:
448 case FieldUnit::INCH:
449 case FieldUnit::FOOT:
450 case FieldUnit::MILE:
451 eFUnit = FieldUnit::POINT;
457 eFUnit = FieldUnit::MM;
468 eFUnit = FieldUnit::MM;
476 sal_uInt16 nWhich =
GetWhich( SID_ATTR_BORDER_INNER,
false );
477 bool bIsDontCare =
true;
479 if ( rCoreAttrs.GetItemState( nWhich ) >= SfxItemState::DEFAULT )
483 static_cast<const SvxBoxInfoItem*
>(&( rCoreAttrs.Get( nWhich ) ));
487 mbTLBREnabled = rCoreAttrs.GetItemState(
GetWhich(SID_ATTR_BORDER_DIAG_TLBR)) != SfxItemState::UNKNOWN;
488 mbBLTREnabled = rCoreAttrs.GetItemState(
GetWhich(SID_ATTR_BORDER_DIAG_BLTR)) != SfxItemState::UNKNOWN;
504 m_xSpacingFrame->hide();
506 bIsDontCare = !pBoxInfo->
IsValid( SvxBoxInfoItemValidFlags::DISABLE );
508 if(!mbUseMarginItem && eFUnit == FieldUnit::MM && MapUnit::MapTwip == rCoreAttrs.GetPool()->GetMetric(
GetWhich( SID_ATTR_BORDER_INNER ) ))
520 nFlags |= FrameSelFlags::InnerHorizontal;
522 nFlags |= FrameSelFlags::InnerVertical;
524 nFlags |= FrameSelFlags::DiagonalTLBR;
526 nFlags |= FrameSelFlags::DiagonalBLTR;
528 nFlags |= FrameSelFlags::DontCare;
529 m_aFrameSel.Initialize( nFlags );
540 FillLineListBox_Impl();
543 SetLineWidth(m_xLineWidthMF->get_value(FieldUnit::NONE));
547 if (rCoreAttrs.HasItem(
GetWhich(SID_ATTR_PARA_GRABBAG), &pItem))
550 auto it = pGrabBag->
GetGrabBag().find(
"DialogUseCharAttr");
553 bool bDialogUseCharAttr =
false;
554 it->second >>= bDialogUseCharAttr;
555 if (bDialogUseCharAttr)
557 mnShadowSlot = SID_ATTR_CHAR_SHADOW;
558 mnBoxSlot = SID_ATTR_CHAR_BOX;
564 if( bSupportsShadow )
565 m_xShadowControls.reset(
new ShadowControlsWrapper(*m_xWndShadows, *m_xEdShadowSize, *m_xLbShadowColor));
567 HideShadowControls();
570 m_xMarginControls.reset(
new MarginControlsWrapper(*m_xLeftMF, *m_xRightMF, *m_xTopMF, *m_xBottomMF));
573 m_xMergeWithNextCB->hide();
575 m_xMergeAdjacentBordersCB->hide();
579 Reference< XServiceInfo > xSI( pDocSh->GetModel(), UNO_QUERY );
581 bIsCalcDoc = xSI->supportsService(
"com.sun.star.sheet.SpreadsheetDocument");
585 m_xRemoveAdjacentCellBordersCB->connect_toggled(
LINK(
this,
SvxBorderTabPage, RemoveAdjacentCellBorderHdl_Impl));
586 m_xRemoveAdjacentCellBordersCB->show();
587 m_xRemoveAdjacentCellBordersCB->set_sensitive(
false);
591 m_xRemoveAdjacentCellBordersCB->hide();
592 m_xRemoveAdjacentCellBordersFT->hide();
611 return std::make_unique<SvxBorderTabPage>(pPage, pController, *rAttrSet);
640 sal_uInt16 nBorderDiagId = pPool->
GetWhich(SID_ATTR_BORDER_DIAG_TLBR);
649 sal_uInt16 nBorderDiagId = pPool->
GetWhich(SID_ATTR_BORDER_DIAG_BLTR);
668 sal_uInt16 nAlignMarginId = pPool->
GetWhich(SID_ATTR_ALIGN_MARGIN);
676 sal_uInt16 nMergeAdjacentBordersId = pPool->
GetWhich(SID_SW_COLLAPSING_BORDERS);
678 if (!pMergeAdjacentBorders)
684 sal_uInt16 nMergeWithNextId = pPool->
GetWhich(SID_ATTR_BORDER_CONNECT);
699 pBoxInfoItem =
GetItem( *
rSet, SID_ATTR_BORDER_INNER,
false );
701 eCoreUnit = pPool->
GetMetric( nWhichBox );
703 if ( pBoxItem && pBoxInfoItem )
726 if ( pBoxInfoItem->
IsDist() )
731 if( !bIsAnyBorderVisible || !pBoxInfoItem->
IsMinDist() )
735 m_xTopMF->set_min(0, FieldUnit::NONE);
751 bool bDiffDist = (nDefDist != nLeftDist ||
752 nDefDist != nRightDist ||
753 nDefDist != nTopDist ||
754 nDefDist != nBottomDist);
800 MapUnit::MapTwip, FieldUnit::POINT ));
821 if( bWidthEq && bColorEq )
839 if (
m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::NONE)
849 pHtmlModeItem = pShell->GetItem(SID_HTML_MODE);
853 sal_uInt16 nHtmlMode = pHtmlModeItem->
GetValue();
859 if( !(
nSWMode & SwBorderModes::TABLE) )
870 LinesChanged_Impl(
nullptr );
901 return DeactivateRC::LeavePage;
906 bool bAttrsChanged =
false;
917 rCoreAttrs->
Put(aLineItem);
918 bAttrsChanged =
true;
929 rCoreAttrs->
Put(aLineItem);
930 bAttrsChanged =
true;
940 bAttrsChanged =
true;
950 bAttrsChanged =
true;
959 sal_uInt16 nMergeAdjacentBordersId = pPool->
GetWhich(SID_SW_COLLAPSING_BORDERS);
960 rCoreAttrs->
ClearItem(nMergeAdjacentBordersId);
966 std::unique_ptr<SfxBoolItem> xNewItem(
static_cast<SfxBoolItem*
>(pOldItem->Clone()));
967 xNewItem->SetValue(
static_cast<bool>(
nState));
968 rCoreAttrs->
Put(std::move(xNewItem));
971 bAttrsChanged =
true;
979 sal_uInt16 nMergeWithNextId = pPool->
GetWhich(SID_ATTR_BORDER_CONNECT);
986 std::unique_ptr<SfxBoolItem> xNewItem(
static_cast<SfxBoolItem*
>(pOldItem->Clone()));
987 xNewItem->SetValue(
static_cast<bool>(
nState));
988 rCoreAttrs->
Put(std::move(xNewItem));
991 bAttrsChanged =
true;
996 sal_uInt16 nBoxInfoWhich = pPool->
GetWhich( SID_ATTR_BORDER_INNER,
false );
1007 std::pair<svx::FrameBorderType,SvxBoxItemLine> eTypes1[] = {
1014 for (std::pair<svx::FrameBorderType,SvxBoxItemLine>
const &
i : eTypes1)
1021 std::pair<svx::FrameBorderType,SvxBoxInfoItemLine> eTypes2[] = {
1025 for (std::pair<svx::FrameBorderType,SvxBoxInfoItemLine>
const & j : eTypes2)
1048 m_xLeftMF->get_value_changed_from_saved() ||
1049 m_xRightMF->get_value_changed_from_saved() ||
1050 m_xTopMF->get_value_changed_from_saved() ||
1056 (pOldBoxInfoItem && !pOldBoxInfoItem->
IsValid(SvxBoxInfoItemValidFlags::DISTANCE))
1071 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
1091 if ( SfxItemState::DEFAULT == rOldSet.
GetItemState( nBoxWhich,
false ))
1093 bPut = aBoxItem !=
static_cast<const SvxBoxItem&
>(rOldSet.
Get(nBoxWhich));
1095 if( SfxItemState::DEFAULT == rOldSet.
GetItemState( nBoxInfoWhich,
false ) )
1098 rOldSet.
Get(nBoxInfoWhich));
1102 bPut |= (aBoxInfoItem != rOldBoxInfo );
1107 if ( !pOldBoxItem || *pOldBoxItem != aBoxItem )
1109 rCoreAttrs->
Put( aBoxItem );
1110 bAttrsChanged =
true;
1114 if ( !pOld || *
static_cast<const SvxBoxInfoItem*
>(pOld) != aBoxInfoItem )
1116 rCoreAttrs->
Put( aBoxInfoItem );
1117 bAttrsChanged =
true;
1126 return bAttrsChanged;
1134#define IID_PRE_CELL_NONE 1
1135#define IID_PRE_CELL_ALL 2
1136#define IID_PRE_CELL_LR 3
1137#define IID_PRE_CELL_TB 4
1138#define IID_PRE_CELL_L 5
1139#define IID_PRE_CELL_DIAG 6
1140#define IID_PRE_HOR_NONE 7
1141#define IID_PRE_HOR_OUTER 8
1142#define IID_PRE_HOR_HOR 9
1143#define IID_PRE_HOR_ALL 10
1144#define IID_PRE_HOR_OUTER2 11
1145#define IID_PRE_VER_NONE 12
1146#define IID_PRE_VER_OUTER 13
1147#define IID_PRE_VER_VER 14
1148#define IID_PRE_VER_ALL 15
1149#define IID_PRE_VER_OUTER2 16
1150#define IID_PRE_TABLE_NONE 17
1151#define IID_PRE_TABLE_OUTER 18
1152#define IID_PRE_TABLE_OUTERH 19
1153#define IID_PRE_TABLE_ALL 20
1154#define IID_PRE_TABLE_OUTER2 21
1189 m_aFrameSel.HideAllBorders();
1190 m_aFrameSel.DeselectAllBorders();
1193 sal_uInt16 nLine = GetPresetImageId( m_xWndPresets->GetSelectedItemId() ) - 1;
1199 switch( ppeStates[ nLine ][
nBorder ] )
1201 case SHOW: m_aFrameSel.SelectBorder( eBorder );
break;
1203 case DONT: m_aFrameSel.SetBorderDontCare( eBorder );
break;
1208 if( m_aFrameSel.IsAnyBorderSelected() )
1211 if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::NONE)
1212 m_xLbLineStyle->SelectEntry(SvxBorderLineStyle::SOLID);
1215 SelStyleHdl_Impl(*m_xLbLineStyle);
1216 SelColHdl_Impl(*m_xLbLineColor);
1220 m_xWndPresets->SetNoSelection();
1222 LinesChanged_Impl(
nullptr );
1223 UpdateRemoveAdjCellBorderCB( nLine + 1 );
1228 bool bEnable = m_xWndShadows->GetSelectedItemId() > 1;
1229 m_xFtShadowSize->set_sensitive(bEnable);
1230 m_xEdShadowSize->set_sensitive(bEnable);
1231 m_xFtShadowColor->set_sensitive(bEnable);
1232 m_xLbShadowColor->set_sensitive(bEnable);
1237 NamedColor aNamedColor = rColorBox.GetSelectedEntry();
1243 sal_Int32
nPos = m_xLineWidthLB->get_active();
1244 sal_Int32 nRemovedType = 0;
1245 if (m_xLineWidthLB->get_values_changed_from_saved()) {
1246 nRemovedType = m_aLineWidths.size() - m_xLineWidthLB->get_count();
1249 SetLineWidth(m_aLineWidths[
nPos + nRemovedType], nRemovedType);
1252 ModifyWidthMFHdl_Impl(*m_xLineWidthMF);
1257 sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
1260 if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
1261 m_xLineWidthMF->set_min(110, FieldUnit::NONE);
1263 m_xLineWidthMF->set_min(5, FieldUnit::NONE);
1267 m_xLineWidthMF->get_digits(),
1268 FieldUnit::POINT, MapUnit::MapTwip ));
1269 m_xLbLineStyle->SetWidth( nVal );
1271 m_aFrameSel.SetStyleToSelection( nVal,
1272 m_xLbLineStyle->GetSelectEntryStyle() );
1277 sal_Int64 nOldWidth = m_xLineWidthMF->get_value(FieldUnit::NONE);
1280 if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
1281 m_xLineWidthMF->set_min(110, FieldUnit::NONE);
1283 m_xLineWidthMF->set_min(5, FieldUnit::NONE);
1287 m_xLineWidthMF->get_digits(),
1291 const sal_Int64 nOldMinWidth =
lcl_GetMinLineWidth(m_aFrameSel.getCurrentStyleLineStyle());
1292 const sal_Int64 nNewMinWidth =
lcl_GetMinLineWidth(m_xLbLineStyle->GetSelectEntryStyle());
1296 sal_Int64 nNewWidth = (nOldMinWidth == nOldWidth) ? nNewMinWidth : nOldWidth;
1300 bool bNewDoubleHairline = m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN && !m_xLineWidthMF->get_visible() &&
1306 if (nOldWidth != nNewWidth)
1310 m_xLineWidthMF->get_digits(),
1313 SetLineWidth(nNewWidthPt);
1316 if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
1318 for (
size_t i = 0;
i < 3;
i++)
1320 m_xLineWidthLB->save_values_by_id(OUString::number(
i));
1321 m_xLineWidthLB->remove_id(OUString::number(
i));
1323 if (m_xLineWidthLB->get_active_id().isEmpty())
1324 m_xLineWidthLB->set_active_id(
"3");
1328 if (m_xLineWidthLB->get_values_changed_from_saved())
1330 for (
size_t i = 0;
i < 3;
i++)
1331 m_xLineWidthLB->append(
i, OUString::number(
i), m_xLineWidthLB->get_saved_values(
i));
1332 m_xLineWidthLB->removeSavedValues();
1337 m_aFrameSel.SetStyleToSelection( nNewWidth,
1338 m_xLbLineStyle->GetSelectEntryStyle() );
1372 "SvxBorderTabPage::GetPresetImageId - wrong index" );
1373 return ppnImgIds[ nLine ][ nValueSetIdx - 1 ];
1381 RID_SVXSTR_TABLE_PRESET_NONE,
1382 RID_SVXSTR_PARA_PRESET_ALL,
1383 RID_SVXSTR_PARA_PRESET_LEFTRIGHT,
1384 RID_SVXSTR_PARA_PRESET_TOPBOTTOM,
1385 RID_SVXSTR_PARA_PRESET_ONLYLEFT,
1386 RID_SVXSTR_PARA_PRESET_DIAGONAL,
1388 RID_SVXSTR_TABLE_PRESET_NONE,
1389 RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
1390 RID_SVXSTR_HOR_PRESET_ONLYHOR,
1391 RID_SVXSTR_TABLE_PRESET_OUTERALL,
1392 RID_SVXSTR_TABLE_PRESET_OUTERINNER,
1394 RID_SVXSTR_TABLE_PRESET_NONE,
1395 RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
1396 RID_SVXSTR_VER_PRESET_ONLYVER,
1397 RID_SVXSTR_TABLE_PRESET_OUTERALL,
1398 RID_SVXSTR_TABLE_PRESET_OUTERINNER,
1400 RID_SVXSTR_TABLE_PRESET_NONE,
1401 RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
1402 RID_SVXSTR_TABLE_PRESET_OUTERHORI,
1403 RID_SVXSTR_TABLE_PRESET_OUTERALL,
1404 RID_SVXSTR_TABLE_PRESET_OUTERINNER
1437 { RID_CUISTR_SHADOW_STYLE_NONE, RID_CUISTR_SHADOW_STYLE_BOTTOMRIGHT, RID_CUISTR_SHADOW_STYLE_TOPRIGHT, RID_CUISTR_SHADOW_STYLE_BOTTOMLEFT, RID_CUISTR_SHADOW_STYLE_TOPLEFT };
1466 [nWidth](
const int val) ->
bool { return val == nWidth; } );
1484 return SvxBorderLine::threeDMediumColor( aMain );
1489 using namespace ::com::sun::star::table::BorderLineStyle;
1496 }
const aLines[] = {
1515 { SvxBorderLineStyle::EMBOSSED, &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor, &
lcl_mediumColor },
1516 { SvxBorderLineStyle::ENGRAVED, &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor, &
lcl_mediumColor },
1518 { SvxBorderLineStyle::OUTSET, &SvxBorderLine::lightColor, &SvxBorderLine::darkColor, &
sameDistColor },
1519 { SvxBorderLineStyle::INSET, &SvxBorderLine::darkColor, &SvxBorderLine::lightColor, &
sameDistColor }
1524 for (
size_t i = 0;
i < std::size(aLines); ++
i)
1530 SvxBorderLine::getWidthImpl(aLines[
i].mnStyle),
1533 aLines[
i].mpColor1Fn,
1534 aLines[
i].mpColor2Fn,
1535 aLines[
i].mpColorDistFn);
1547 if (!mbUseMarginItem && m_xLeftMF->get_visible())
1549 bool bLineSet = m_aFrameSel.IsAnyBorderVisible();
1550 bool bSpaceModified = mbLeftModified ||
1559 m_xLeftMF->set_value(nMinValue, FieldUnit::NONE);
1560 m_xRightMF->set_value(nMinValue, FieldUnit::NONE);
1561 m_xTopMF->set_value(nMinValue, FieldUnit::NONE);
1562 m_xBottomMF->set_value(nMinValue, FieldUnit::NONE);
1567 m_xLeftMF->set_min(0, FieldUnit::NONE);
1568 m_xRightMF->set_min(0, FieldUnit::NONE);
1569 m_xTopMF->set_min(0, FieldUnit::NONE);
1570 m_xBottomMF->set_min(0, FieldUnit::NONE);
1573 SvxBoxInfoItemValidFlags nValid = SvxBoxInfoItemValidFlags::TOP|SvxBoxInfoItemValidFlags::BOTTOM|SvxBoxInfoItemValidFlags::LEFT|SvxBoxInfoItemValidFlags::RIGHT;
1575 m_xLeftFT->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::LEFT) );
1576 m_xRightFT->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::RIGHT) );
1577 m_xTopFT->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::TOP) );
1578 m_xBottomFT->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::BOTTOM) );
1579 m_xLeftMF->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::LEFT) );
1580 m_xRightMF->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::RIGHT) );
1581 m_xTopMF->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::TOP) );
1582 m_xBottomMF->set_sensitive(
bool(nValid & SvxBoxInfoItemValidFlags::BOTTOM) );
1583 m_xSynchronizeCB->set_sensitive(m_xRightMF->get_sensitive() || m_xTopMF->get_sensitive() ||
1584 m_xBottomMF->get_sensitive() || m_xLeftMF->get_sensitive());
1592 if (&rField == m_xLeftMF.get())
1593 mbLeftModified =
true;
1594 else if (&rField == m_xRightMF.get())
1595 mbRightModified =
true;
1596 else if (&rField == m_xTopMF.get())
1597 mbTopModified =
true;
1598 else if (&rField == m_xBottomMF.get())
1599 mbBottomModified =
true;
1603 const auto nVal = rField.get_value(FieldUnit::NONE);
1604 if (&rField != m_xLeftMF.get())
1605 m_xLeftMF->set_value(nVal, FieldUnit::NONE);
1606 if (&rField != m_xRightMF.get())
1607 m_xRightMF->set_value(nVal, FieldUnit::NONE);
1608 if (&rField != m_xTopMF.get())
1609 m_xTopMF->set_value(nVal, FieldUnit::NONE);
1610 if (&rField != m_xBottomMF.get())
1611 m_xBottomMF->set_value(nVal, FieldUnit::NONE);
1617 mbSync = rBox.get_active();
1622 mbRemoveAdjacentCellBorders = rBox.get_active();
1632 if( !pOldBoxInfoItem || !pOldBoxItem )
1634 std::pair<svx::FrameBorderType, SvxBoxInfoItemValidFlags> eTypes1[] = {
1641 SvxBoxItemLine::TOP,
1642 SvxBoxItemLine::BOTTOM,
1643 SvxBoxItemLine::LEFT,
1644 SvxBoxItemLine::RIGHT,
1648 bool bBorderDeletionReq =
false;
1649 for (
size_t i=0;
i < std::size( eTypes1 ); ++
i )
1651 if( pOldBoxItem->
GetLine( eTypes2[
i] ) || !( pOldBoxInfoItem->
IsValid( eTypes1[
i].second ) ) )
1655 bBorderDeletionReq =
true;
1662 bBorderDeletionReq =
true;
1666 if( !bBorderDeletionReq )
1682 if (
nSWMode == SwBorderModes::PARA )
1688 else if (
nSWMode == SwBorderModes::TABLE )
1701 nSWMode = SwBorderModes::TABLE;
#define IID_PRE_TABLE_OUTER2
static sal_Int64 lcl_GetMinLineWidth(SvxBorderLineStyle aStyle)
#define IID_PRE_HOR_OUTER2
#define IID_PRE_TABLE_NONE
IMPL_LINK(SvxBorderTabPage, SelColHdl_Impl, ColorListBox &, rColorBox, void)
#define IID_PRE_TABLE_OUTERH
static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton &rField)
static Color lcl_mediumColor(Color aMain, Color)
#define IID_PRE_TABLE_OUTER
#define IID_PRE_VER_OUTER2
#define IID_PRE_CELL_NONE
#define IID_PRE_VER_OUTER
IMPL_LINK_NOARG(SvxBorderTabPage, SelPreHdl_Impl, ValueSet *, void)
#define IID_PRE_CELL_DIAG
#define IID_PRE_HOR_OUTER
#define IID_PRE_TABLE_ALL
const sal_uInt16 BORDER_PRESET_COUNT
const sal_uInt16 BORDER_SHADOW_COUNT
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
sal_uInt16 GetValue() const
Color const & GetSelectEntryColor() const
bool IsValueChangedFromSaved() const
void SelectEntry(const NamedColor &rColor)
bool IsNoSelection() const
weld::MetricSpinButton & mrTopWrp
SvxMarginItem GetControlValue(const SvxMarginItem &rItem) const
weld::MetricSpinButton & mrBottomWrp
bool get_value_changed_from_saved() const
void SetControlDontKnow()
void SetControlValue(const SvxMarginItem &rItem)
weld::MetricSpinButton & mrLeftWrp
MarginControlsWrapper(weld::MetricSpinButton &rMfLeft, weld::MetricSpinButton &rMfRight, weld::MetricSpinButton &rMfTop, weld::MetricSpinButton &rMfBottom)
weld::MetricSpinButton & mrRightWrp
const std::map< OUString, css::uno::Any > & GetGrabBag() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
static bool IsSlot(sal_uInt16 nId)
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxItemSet & GetItemSet() const
SfxOkDialogController * GetDialogController() const
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void SetControlValue(const SvxShadowItem &rItem)
void SetControlDontKnow()
ShadowControlsWrapper(ValueSet &rVsPos, weld::MetricSpinButton &rMfSize, ColorListBox &rLbColor)
weld::MetricSpinButton & mrMfSize
SvxShadowItem GetControlValue(const SvxShadowItem &rItem) const
bool get_value_changed_from_saved() const
const Color & GetWindowTextColor() const
Color(* ColorDistFunc)(Color, Color)
Color(* ColorFunc)(Color)
static const sal_Int16 VeryThin
static const sal_Int16 ExtraThick
static const sal_Int16 Thin
static const sal_Int16 Medium
static const sal_Int16 Hairline
static const sal_Int16 Thick
sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const
std::unique_ptr< ShadowControlsWrapper > m_xShadowControls
void FillLineListBox_Impl()
SvxBorderTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
std::vector< Image > m_aShadowImgVec
bool mbRemoveAdjacentCellBorders
SwBorderModes nSWMode
table, textframe, paragraph
std::unique_ptr< weld::CustomWeld > m_xFrameSelWin
std::unique_ptr< weld::CustomWeld > m_xWndShadowsWin
std::unique_ptr< weld::CustomWeld > m_xWndPresetsWin
std::unique_ptr< ValueSet > m_xWndShadows
std::unique_ptr< ValueSet > m_xWndPresets
std::unique_ptr< weld::Container > m_xPropertiesFrame
properties - "Merge with next paragraph" in Writer
std::vector< Image > m_aBorderImgVec
std::unique_ptr< weld::Container > m_xShadowFrame
svx::FrameSelector m_aFrameSel
tools::Long nMinValue
minimum distance
std::unique_ptr< weld::ComboBox > m_xLineWidthLB
static const std::vector< int > m_aLineWidths
std::unique_ptr< weld::CheckButton > m_xMergeWithNextCB
void SetLineWidth(sal_Int64 nWidth, sal_Int32 nRemovedType=0)
TranslateId GetPresetStringId(sal_uInt16 nValueSetIdx) const
std::unique_ptr< ColorListBox > m_xLbLineColor
std::unique_ptr< MarginControlsWrapper > m_xMarginControls
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
std::unique_ptr< weld::MetricSpinButton > m_xEdShadowSize
virtual void PageCreated(const SfxAllItemSet &aSet) override
bool mbTLBREnabled
true = Top-left to bottom-right border enabled.
bool mbHorEnabled
true = Inner horizontal border enabled.
bool mbBLTREnabled
true = Bottom-left to top-right border enabled.
virtual ~SvxBorderTabPage() override
virtual void Reset(const SfxItemSet *) override
std::set< SvxBorderLineStyle > maUsedBorderStyles
std::unique_ptr< SvtLineListBox > m_xLbLineStyle
static const WhichRangesContainer pRanges
bool IsBorderLineStyleAllowed(SvxBorderLineStyle nStyle) const
std::unique_ptr< weld::Label > m_xFtShadowSize
std::unique_ptr< weld::Label > m_xFtShadowColor
void HideShadowControls()
std::unique_ptr< weld::CheckButton > m_xMergeAdjacentBordersCB
void ResetFrameLine_Impl(svx::FrameBorderType eBorder, const editeng::SvxBorderLine *pCurLine, bool bValid)
share for individual Frame-/Core-Line
std::unique_ptr< weld::CheckButton > m_xRemoveAdjacentCellBordersCB
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
virtual void ChangesApplied() override
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthMF
void UpdateRemoveAdjCellBorderCB(sal_uInt16 nPreset)
std::unique_ptr< ColorListBox > m_xLbShadowColor
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
bool mbVerEnabled
true = Inner vertical border enabled.
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
std::unique_ptr< weld::Label > m_xUserDefFT
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xSynchronizeCB
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
bool IsHorEnabled() const
void EnableVer(bool bEnable)
void SetMinDist(bool bNew)
void SetDefDist(sal_uInt16 nNew)
const editeng::SvxBorderLine * GetHori() const
sal_uInt16 GetDefDist() const
bool IsVerEnabled() const
const editeng::SvxBorderLine * GetVert() const
void EnableHor(bool bEnable)
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
void SetRemoveAdjacentCellBorder(bool bSet)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
sal_uInt16 GetSmallestDistance() const
const editeng::SvxBorderLine * GetRight() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetBottom() const
void SetLine(const editeng::SvxBorderLine *pNew)
void SetLeftMargin(sal_Int16 nLeft)
void SetBottomMargin(sal_Int16 nBottom)
void SetRightMargin(sal_Int16 nRight)
void SetTopMargin(sal_Int16 nTop)
sal_Int16 GetRightMargin() const
sal_Int16 GetTopMargin() const
sal_Int16 GetBottomMargin() const
sal_Int16 GetLeftMargin() const
sal_uInt16 GetWidth() const
const Color & GetColor() const
void SetLocation(SvxShadowLocation eNew)
SvxShadowLocation GetLocation() const
void SetWidth(sal_uInt16 nNew)
void SetColor(const Color &rNew)
bool IsNoSelection() const
void SelectItem(sal_uInt16 nItemId)
sal_uInt16 GetSelectedItemId() const
bool IsValueChangedFromSaved() const
const editeng::SvxBorderLine * GetFrameBorderStyle(FrameBorderType eBorder) const
void DeselectAllBorders()
bool IsAnyBorderVisible() const
void SetBorderDontCare(FrameBorderType eBorder)
bool GetVisibleWidth(tools::Long &rnWidth, SvxBorderLineStyle &rnStyle) const
void ShowBorder(FrameBorderType eBorder, const editeng::SvxBorderLine *pStyle)
FrameBorderState GetFrameBorderState(FrameBorderType eBorder) const
bool IsBorderEnabled(FrameBorderType eBorder) const
bool GetVisibleColor(Color &rColor) const
void SelectAllVisibleBorders()
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
Color sameDistColor(Color, Color rDefault)
Color sameColor(Color rMain)
OUString CuiResId(TranslateId aKey)
#define DBG_ASSERT(sCon, aError)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
#define SVX_HIDESHADOWCTL
#define LINK(Instance, Class, Member)
tools::Long const nBorder
static constexpr auto Items
FrameBorderType GetFrameBorderTypeFromIndex(size_t nIndex)
const int FRAMEBORDERTYPE_COUNT
double ConvertDoubleValue(double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
model::ComplexColor getComplexColor()
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)