summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/border.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/border.cxx')
-rw-r--r--cui/source/tabpages/border.cxx159
1 files changed, 99 insertions, 60 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 64558279be60..ccb94fe46854 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -19,8 +19,6 @@
#include <sal/config.h>
-#include <string_view>
-
#include <sfx2/objsh.hxx>
#include <svx/strings.hrc>
#include <svx/svxids.hrc>
@@ -37,6 +35,7 @@
#include <vcl/fieldvalues.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
+#include <svx/dialmgr.hxx>
#include <svx/flagsdef.hxx>
#include <svl/grabbagitem.hxx>
#include <svl/intitem.hxx>
@@ -79,22 +78,19 @@ const WhichRangesContainer SvxBorderTabPage::pRanges(
namespace
{
-int lcl_twipsToPt(sal_Int64 nTwips)
+constexpr int twipsToPt100(sal_Int64 nTwips)
{
- return vcl::ConvertDoubleValue(nTwips, 0, FieldUnit::TWIP, MapUnit::MapPoint) * 100;
+ return o3tl::convert(nTwips * 100, o3tl::Length::twip, o3tl::Length::pt);
}
+constexpr int s_LineWidths[] = { twipsToPt100(SvxBorderLineWidth::Hairline),
+ twipsToPt100(SvxBorderLineWidth::VeryThin),
+ twipsToPt100(SvxBorderLineWidth::Thin),
+ twipsToPt100(SvxBorderLineWidth::Medium),
+ twipsToPt100(SvxBorderLineWidth::Thick),
+ twipsToPt100(SvxBorderLineWidth::ExtraThick),
+ -1 };
}
-const std::vector<int> SvxBorderTabPage::m_aLineWidths = {
- lcl_twipsToPt(SvxBorderLineWidth::Hairline),
- lcl_twipsToPt(SvxBorderLineWidth::VeryThin),
- lcl_twipsToPt(SvxBorderLineWidth::Thin),
- lcl_twipsToPt(SvxBorderLineWidth::Medium),
- lcl_twipsToPt(SvxBorderLineWidth::Thick),
- lcl_twipsToPt(SvxBorderLineWidth::ExtraThick),
- -1
-};
-
static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton& rField)
{
auto nMin = rField.denormalize(rField.get_min(FieldUnit::TWIP));
@@ -140,10 +136,10 @@ static sal_Int64 lcl_GetMinLineWidth(SvxBorderLineStyle aStyle)
}
// number of preset images to show
-const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5;
+const sal_uInt16 BORDER_PRESET_COUNT = 5;
// number of shadow images to show
-const sal_uInt16 SVX_BORDER_SHADOW_COUNT = 5;
+const sal_uInt16 BORDER_SHADOW_COUNT = 5;
ShadowControlsWrapper::ShadowControlsWrapper(ValueSet& rVsPos, weld::MetricSpinButton& rMfSize, ColorListBox& rLbColor)
: mrVsPos(rVsPos)
@@ -412,7 +408,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle
for (auto const & rImageId : aShadowImageIds)
m_aShadowImgVec.emplace_back(StockImage::Yes, rImageId);
- assert(m_aShadowImgVec.size() == SVX_BORDER_SHADOW_COUNT);
+ assert(m_aShadowImgVec.size() == BORDER_SHADOW_COUNT);
// this page needs ExchangeSupport
SetExchangeSupport();
@@ -422,19 +418,16 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle
is needed across various functions... */
mbUseMarginItem = rCoreAttrs.GetItemState(GetWhich(SID_ATTR_ALIGN_MARGIN)) != SfxItemState::UNKNOWN;
- const SfxPoolItem* pItem = nullptr;
- if (rCoreAttrs.HasItem(SID_ATTR_BORDER_STYLES, &pItem))
+ if (const SfxIntegerListItem* p = rCoreAttrs.GetItemIfSet(SID_ATTR_BORDER_STYLES))
{
- const SfxIntegerListItem* p = static_cast<const SfxIntegerListItem*>(pItem);
std::vector<sal_Int32> aUsedStyles = p->GetList();
for (int aUsedStyle : aUsedStyles)
maUsedBorderStyles.insert(static_cast<SvxBorderLineStyle>(aUsedStyle));
}
- if (rCoreAttrs.HasItem(SID_ATTR_BORDER_DEFAULT_WIDTH, &pItem))
+ if (const SfxInt64Item* p = rCoreAttrs.GetItemIfSet(SID_ATTR_BORDER_DEFAULT_WIDTH))
{
// The caller specifies default line width. Honor it.
- const SfxInt64Item* p = static_cast<const SfxInt64Item*>(pItem);
SetLineWidth(p->GetValue());
}
@@ -547,6 +540,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle
SetLineWidth(m_xLineWidthMF->get_value(FieldUnit::NONE));
// connections
+ const SfxPoolItem* pItem = nullptr;
if (rCoreAttrs.HasItem(GetWhich(SID_ATTR_PARA_GRABBAG), &pItem))
{
const SfxGrabBagItem* pGrabBag = static_cast<const SfxGrabBagItem*>(pItem);
@@ -577,8 +571,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle
// checkbox "Merge adjacent line styles" only visible for Writer dialog format.table
m_xMergeAdjacentBordersCB->hide();
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- if (pDocSh)
+ if (SfxObjectShell* pDocSh = SfxObjectShell::Current())
{
Reference< XServiceInfo > xSI( pDocSh->GetModel(), UNO_QUERY );
if ( xSI.is() )
@@ -641,7 +634,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::TLBR))
{
- sal_uInt16 nBorderDiagId = pPool->GetWhich(SID_ATTR_BORDER_DIAG_TLBR);
+ sal_uInt16 nBorderDiagId = pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_DIAG_TLBR);
if (const SvxLineItem* pLineItem = static_cast<const SvxLineItem*>(rSet->GetItem(nBorderDiagId)))
m_aFrameSel.ShowBorder(svx::FrameBorderType::TLBR, pLineItem->GetLine());
else
@@ -650,7 +643,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::BLTR))
{
- sal_uInt16 nBorderDiagId = pPool->GetWhich(SID_ATTR_BORDER_DIAG_BLTR);
+ sal_uInt16 nBorderDiagId = pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_DIAG_BLTR);
if (const SvxLineItem* pLineItem = static_cast<const SvxLineItem*>(rSet->GetItem(nBorderDiagId)))
m_aFrameSel.ShowBorder(svx::FrameBorderType::BLTR, pLineItem->GetLine());
else
@@ -659,7 +652,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
if (m_xShadowControls)
{
- sal_uInt16 nShadowId = pPool->GetWhich(mnShadowSlot);
+ sal_uInt16 nShadowId = pPool->GetWhichIDFromSlotID(mnShadowSlot);
const SfxPoolItem* pItem = rSet->GetItem(nShadowId);
if (pItem)
m_xShadowControls->SetControlValue(*static_cast<const SvxShadowItem*>(pItem));
@@ -669,7 +662,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
if (m_xMarginControls)
{
- sal_uInt16 nAlignMarginId = pPool->GetWhich(SID_ATTR_ALIGN_MARGIN);
+ sal_uInt16 nAlignMarginId = pPool->GetWhichIDFromSlotID(SID_ATTR_ALIGN_MARGIN);
const SfxPoolItem* pItem = rSet->GetItem(nAlignMarginId);
if (pItem)
m_xMarginControls->SetControlValue(*static_cast<const SvxMarginItem*>(pItem));
@@ -677,7 +670,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
m_xMarginControls->SetControlDontKnow();
}
- sal_uInt16 nMergeAdjacentBordersId = pPool->GetWhich(SID_SW_COLLAPSING_BORDERS);
+ sal_uInt16 nMergeAdjacentBordersId = pPool->GetWhichIDFromSlotID(SID_SW_COLLAPSING_BORDERS);
const SfxBoolItem *pMergeAdjacentBorders = static_cast<const SfxBoolItem*>(rSet->GetItem(nMergeAdjacentBordersId));
if (!pMergeAdjacentBorders)
m_xMergeAdjacentBordersCB->set_state(TRISTATE_INDET);
@@ -685,7 +678,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
m_xMergeAdjacentBordersCB->set_active(pMergeAdjacentBorders->GetValue());
m_xMergeAdjacentBordersCB->save_state();
- sal_uInt16 nMergeWithNextId = pPool->GetWhich(SID_ATTR_BORDER_CONNECT);
+ sal_uInt16 nMergeWithNextId = pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_CONNECT);
const SfxBoolItem *pMergeWithNext = static_cast<const SfxBoolItem*>(rSet->GetItem(nMergeWithNextId));
if (!pMergeWithNext)
m_xMergeWithNextCB->set_state(TRISTATE_INDET);
@@ -846,13 +839,15 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
SelStyleHdl_Impl(*m_xLbLineStyle);
}
- const SfxPoolItem* pItem;
- SfxObjectShell* pShell;
- if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem) ||
- ( nullptr != (pShell = SfxObjectShell::Current()) &&
- nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
+ const SfxUInt16Item* pHtmlModeItem = rSet->GetItemIfSet(SID_HTML_MODE, false);
+ if(!pHtmlModeItem)
+ {
+ if (SfxObjectShell* pShell = SfxObjectShell::Current())
+ pHtmlModeItem = pShell->GetItem(SID_HTML_MODE);
+ }
+ if(pHtmlModeItem)
{
- sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
+ sal_uInt16 nHtmlMode = pHtmlModeItem->GetValue();
if(nHtmlMode & HTMLMODE_ON)
{
// there are no shadows in Html-mode and only complete borders
@@ -958,7 +953,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
auto nState = m_xMergeAdjacentBordersCB->get_state();
if (nState == TRISTATE_INDET)
{
- sal_uInt16 nMergeAdjacentBordersId = pPool->GetWhich(SID_SW_COLLAPSING_BORDERS);
+ sal_uInt16 nMergeAdjacentBordersId = pPool->GetWhichIDFromSlotID(SID_SW_COLLAPSING_BORDERS);
rCoreAttrs->ClearItem(nMergeAdjacentBordersId);
}
else
@@ -978,7 +973,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
auto nState = m_xMergeWithNextCB->get_state();
if (nState == TRISTATE_INDET)
{
- sal_uInt16 nMergeWithNextId = pPool->GetWhich(SID_ATTR_BORDER_CONNECT);
+ sal_uInt16 nMergeWithNextId = pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_CONNECT);
rCoreAttrs->ClearItem(nMergeWithNextId);
}
else
@@ -995,7 +990,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
bool bPut = true;
sal_uInt16 nBoxWhich = GetWhich( mnBoxSlot );
- sal_uInt16 nBoxInfoWhich = pPool->GetWhich( SID_ATTR_BORDER_INNER, false );
+ sal_uInt16 nBoxInfoWhich = pPool->GetWhichIDFromSlotID( SID_ATTR_BORDER_INNER, false );
const SfxItemSet& rOldSet = GetItemSet();
SvxBoxItem aBoxItem ( nBoxWhich );
SvxBoxInfoItem aBoxInfoItem ( nBoxInfoWhich );
@@ -1236,15 +1231,19 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelSdwHdl_Impl, ValueSet*, void)
IMPL_LINK(SvxBorderTabPage, SelColHdl_Impl, ColorListBox&, rColorBox, void)
{
- Color aColor = rColorBox.GetSelectEntryColor();
- m_aFrameSel.SetColorToSelection(aColor);
+ NamedColor aNamedColor = rColorBox.GetSelectedEntry();
+ m_aFrameSel.SetColorToSelection(aNamedColor.m_aColor, aNamedColor.getComplexColor());
}
IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthLBHdl_Impl, weld::ComboBox&, void)
{
sal_Int32 nPos = m_xLineWidthLB->get_active();
+ sal_Int32 nRemovedType = 0;
+ if (m_xLineWidthLB->get_values_changed_from_saved()) {
+ nRemovedType = std::size(s_LineWidths) - m_xLineWidthLB->get_count();
+ }
- SetLineWidth(m_aLineWidths[nPos]);
+ SetLineWidth(s_LineWidths[nPos + nRemovedType], nRemovedType);
// Call the spinner handler to trigger all related modifications
ModifyWidthMFHdl_Impl(*m_xLineWidthMF);
@@ -1253,6 +1252,13 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthLBHdl_Impl, weld::ComboBox&, void)
IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthMFHdl_Impl, weld::MetricSpinButton&, void)
{
sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
+
+ // for DOUBLE_THIN line style we cannot allow thinner line width then 1.10pt
+ if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
+ m_xLineWidthMF->set_min(110, FieldUnit::NONE);
+ else
+ m_xLineWidthMF->set_min(5, FieldUnit::NONE);
+
nVal = static_cast<sal_Int64>(vcl::ConvertDoubleValue(
nVal,
m_xLineWidthMF->get_digits(),
@@ -1266,6 +1272,13 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthMFHdl_Impl, weld::MetricSpinButton&
IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
{
sal_Int64 nOldWidth = m_xLineWidthMF->get_value(FieldUnit::NONE);
+
+ // for DOUBLE_THIN line style we cannot allow thinner line width then 1.10pt
+ if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
+ m_xLineWidthMF->set_min(110, FieldUnit::NONE);
+ else
+ m_xLineWidthMF->set_min(5, FieldUnit::NONE);
+
nOldWidth = static_cast<sal_Int64>(vcl::ConvertDoubleValue(
nOldWidth,
m_xLineWidthMF->get_digits(),
@@ -1277,7 +1290,14 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
// auto change line-width if it doesn't correspond to minimal value
// let's change only in case when user has not changed the line-width into some custom value
- const sal_Int64 nNewWidth = (nOldMinWidth == nOldWidth)? nNewMinWidth : nOldWidth;
+ sal_Int64 nNewWidth = (nOldMinWidth == nOldWidth) ? nNewMinWidth : nOldWidth;
+
+ // if we had selected a predefined border width under SvxBorderLineWidth::Medium set the Medium as default
+ // otherwise if we had a custom border width under 1.10pt then set the spinner to the maximum allowed value for double border styles
+ bool bNewDoubleHairline = m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN && !m_xLineWidthMF->get_visible() &&
+ (nOldWidth == SvxBorderLineWidth::Hairline || nOldWidth == SvxBorderLineWidth::VeryThin || nOldWidth == SvxBorderLineWidth::Thin);
+ if (bNewDoubleHairline && nNewWidth < SvxBorderLineWidth::Medium)
+ nNewWidth = SvxBorderLineWidth::Medium;
// set value inside edit box
if (nOldWidth != nNewWidth)
@@ -1290,6 +1310,26 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
SetLineWidth(nNewWidthPt);
}
+ if (m_xLbLineStyle->GetSelectEntryStyle() == SvxBorderLineStyle::DOUBLE_THIN)
+ {
+ for (size_t i = 0; i < 3; i++)
+ {
+ m_xLineWidthLB->save_values_by_id(OUString::number(i));
+ m_xLineWidthLB->remove_id(OUString::number(i));
+ }
+ if (m_xLineWidthLB->get_active_id().isEmpty())
+ m_xLineWidthLB->set_active_id("3");
+ }
+ else
+ {
+ if (m_xLineWidthLB->get_values_changed_from_saved())
+ {
+ for (size_t i = 0; i < 3; i++)
+ m_xLineWidthLB->append(i, OUString::number(i), m_xLineWidthLB->get_saved_values(i));
+ m_xLineWidthLB->removeSavedValues();
+ }
+ }
+
// set value inside style box
m_aFrameSel.SetStyleToSelection( nNewWidth,
m_xLbLineStyle->GetSelectEntryStyle() );
@@ -1300,7 +1340,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const
{
// table with all sets of predefined border styles
- static const sal_uInt16 ppnImgIds[][ SVX_BORDER_PRESET_COUNT ] =
+ static const sal_uInt16 ppnImgIds[][ BORDER_PRESET_COUNT ] =
{
// simple cell without diagonal frame borders
{ IID_PRE_CELL_NONE, IID_PRE_CELL_ALL, IID_PRE_CELL_LR, IID_PRE_CELL_TB, IID_PRE_CELL_L },
@@ -1325,7 +1365,7 @@ sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const
else
nLine = 4;
- DBG_ASSERT( (1 <= nValueSetIdx) && (nValueSetIdx <= SVX_BORDER_PRESET_COUNT),
+ DBG_ASSERT( (1 <= nValueSetIdx) && (nValueSetIdx <= BORDER_PRESET_COUNT),
"SvxBorderTabPage::GetPresetImageId - wrong index" );
return ppnImgIds[ nLine ][ nValueSetIdx - 1 ];
}
@@ -1367,14 +1407,14 @@ void SvxBorderTabPage::FillPresetVS()
{
// basic initialization of the ValueSet
m_xWndPresets->SetStyle( m_xWndPresets->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
- m_xWndPresets->SetColCount( SVX_BORDER_PRESET_COUNT );
+ m_xWndPresets->SetColCount( BORDER_PRESET_COUNT );
// insert images and help texts
- for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_PRESET_COUNT; ++nVSIdx )
+ for( sal_uInt16 nVSIdx = 1; nVSIdx <= BORDER_PRESET_COUNT; ++nVSIdx )
{
m_xWndPresets->InsertItem( nVSIdx );
m_xWndPresets->SetItemImage(nVSIdx, m_aBorderImgVec[GetPresetImageId(nVSIdx) - 1]);
- m_xWndPresets->SetItemText( nVSIdx, CuiResId( GetPresetStringId( nVSIdx ) ) );
+ m_xWndPresets->SetItemText( nVSIdx, SvxResId( GetPresetStringId( nVSIdx ) ) );
}
// show the control
@@ -1387,14 +1427,14 @@ void SvxBorderTabPage::FillShadowVS()
{
// basic initialization of the ValueSet
m_xWndShadows->SetStyle( m_xWndShadows->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
- m_xWndShadows->SetColCount( SVX_BORDER_SHADOW_COUNT );
+ m_xWndShadows->SetColCount( BORDER_SHADOW_COUNT );
// string resource IDs for each image
- static const TranslateId pnStrIds[ SVX_BORDER_SHADOW_COUNT ] =
- { RID_SVXSTR_SHADOW_STYLE_NONE, RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT, RID_SVXSTR_SHADOW_STYLE_TOPRIGHT, RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT, RID_SVXSTR_SHADOW_STYLE_TOPLEFT };
+ static const TranslateId pnStrIds[ BORDER_SHADOW_COUNT ] =
+ { 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 };
// insert images and help texts
- for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_SHADOW_COUNT; ++nVSIdx )
+ for( sal_uInt16 nVSIdx = 1; nVSIdx <= BORDER_SHADOW_COUNT; ++nVSIdx )
{
m_xWndShadows->InsertItem( nVSIdx );
m_xWndShadows->SetItemImage(nVSIdx, m_aShadowImgVec[nVSIdx-1]);
@@ -1414,24 +1454,23 @@ void SvxBorderTabPage::FillValueSets()
FillShadowVS();
}
-void SvxBorderTabPage::SetLineWidth( sal_Int64 nWidth )
+void SvxBorderTabPage::SetLineWidth( sal_Int64 nWidth, sal_Int32 nRemovedType )
{
if ( nWidth >= 0 )
m_xLineWidthMF->set_value( nWidth, FieldUnit::POINT );
- auto it = std::find_if( m_aLineWidths.begin(), m_aLineWidths.end(),
- [nWidth](const int val) -> bool { return val == nWidth; } );
+ auto it = std::find( std::begin(s_LineWidths), std::end(s_LineWidths), nWidth );
- if ( it != m_aLineWidths.end() && *it >= 0 )
+ if ( it != std::end(s_LineWidths) && *it >= 0 )
{
// Select predefined value in combobox
m_xLineWidthMF->hide();
- m_xLineWidthLB->set_active(std::distance(m_aLineWidths.begin(), it));
+ m_xLineWidthLB->set_active(std::distance(std::begin(s_LineWidths), it) - nRemovedType);
}
else
{
// This is not one of predefined values. Show spinner
- m_xLineWidthLB->set_active(m_aLineWidths.size()-1);
+ m_xLineWidthLB->set_active(std::size(s_LineWidths) - nRemovedType -1);
m_xLineWidthMF->show();
}
}
@@ -1478,7 +1517,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
m_xLbLineStyle->SetSourceUnit( FieldUnit::TWIP );
- for (size_t i = 0; i < SAL_N_ELEMENTS(aLines); ++i)
+ for (size_t i = 0; i < std::size(aLines); ++i)
{
if (!IsBorderLineStyleAllowed(aLines[i].mnStyle))
continue;
@@ -1603,7 +1642,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset )
// Check if current selection involves deletion of at least one border
bool bBorderDeletionReq = false;
- for ( size_t i=0; i < SAL_N_ELEMENTS( eTypes1 ); ++i )
+ for ( size_t i=0; i < std::size( eTypes1 ); ++i )
{
if( pOldBoxItem->GetLine( eTypes2[i] ) || !( pOldBoxInfoItem->IsValid( eTypes1[i].second ) ) )
{