tdf#41542 globally allow padding without borders: UI

This is the final fix for tdf#41542 - enabling the UI to adjust the
padding without requiring an enabled border line.

Because almost every document edited by LO5.3 will gain the setting
ALLOW_PADDING_WITHOUT_BORDERS = false, it cannot be kept as a
preventative compatibility setting. Otherwise any document edited
in 5.3 would act differently from any other document - not being
allowed to modify borderless padding for frames, even in 5.4+.
That would be a very confusing corner-case that is best avoided,
so removing all compatibility code (which currently has no use).

So, if an AllowPaddingWithoutBorders=false compatibility
situation is ever required in the future, do not
resurrect the name ALLOW_PADDING_WITHOUT_BORDRES. Additionally, code
will also be needed to send the compatibility setting for
each type of border (page, paragraph, character, header, frames, image).
See commit f013d4a1f4 as an example
of how to implement that for frames.

This commit means there is a lot of dead code now (m_bBorderDist and
mbAllowPaddingWithoutBorders are always true). LO5.7 seems like a good
target to clean that up - to allow time to easily fix any regressions.

Change-Id: I2d2091fa34f8b178a59347b35a81c944c9b24ed7
Reviewed-on: https://gerrit.libreoffice.org/31105
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
Justin Luth 2016-11-23 08:16:17 +03:00 committed by Miklos Vajna
parent 223607e036
commit 8a34ff14f1
10 changed files with 3 additions and 35 deletions

View file

@ -102,7 +102,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
mbTLBREnabled( false ),
mbBLTREnabled( false ),
mbUseMarginItem( false ),
mbAllowPaddingWithoutBorders( false ),
mbAllowPaddingWithoutBorders( true ),
mbSync(true),
mbRemoveAdjacentCellBorders( false ),
bIsCalcDoc( false )
@ -181,11 +181,6 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
m_pLineWidthMF->SetValue(p->GetValue());
}
if (rCoreAttrs.HasItem(SID_ALLOW_PADDING_WITHOUT_BORDERS, &pItem))
{
mbAllowPaddingWithoutBorders = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
// set metric
FieldUnit eFUnit = GetModuleFieldUnit( rCoreAttrs );

View file

@ -964,7 +964,7 @@
#define FN_SVX_SET_NUMBER ( SID_SVX_START + 1136 )
#define FN_SVX_SET_BULLET ( SID_SVX_START + 1137 )
#define FN_SVX_SET_OUTLINE ( SID_SVX_START + 1138 )
#define SID_ALLOW_PADDING_WITHOUT_BORDERS ( SID_SVX_START + 1139 )
#define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 )
#define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 )
// 1142 is used by editeng (SID_ATTR_CHAR_GRABBAG)

View file

@ -39,7 +39,6 @@ enum class DocumentSettingId
ADD_FLY_OFFSETS,
ADD_VERTICAL_FLY_OFFSETS,
ALLOW_PADDING_WITHOUT_BORDERS,
OLD_NUMBERING,
ADD_EXT_LEADING,

View file

@ -55,7 +55,6 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbAddFlyOffsets(false),
mbAddVerticalFlyOffsets(false),
mbAllowPaddingWithoutBorders( false ),
mbUseHiResolutionVirtualDevice(true),
mbMathBaselineAlignment(false), // default for *old* documents is 'off'
mbStylesNoDefault(false),
@ -147,7 +146,6 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
case DocumentSettingId::TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT);
case DocumentSettingId::ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS);
case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS: return mbAddVerticalFlyOffsets;
case DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS: return mbAllowPaddingWithoutBorders;
case DocumentSettingId::ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING);
case DocumentSettingId::USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE);
case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV);
@ -223,9 +221,6 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS:
mbAddVerticalFlyOffsets = value;
break;
case DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS:
mbAllowPaddingWithoutBorders = value;
break;
case DocumentSettingId::ADD_EXT_LEADING:
mbAddExternalLeading = value;
break;

View file

@ -109,7 +109,6 @@ class DocumentSettingManager :
bool mbUseVirtualDevice : 1;
bool mbAddFlyOffsets : 1;
bool mbAddVerticalFlyOffsets : 1;
bool mbAllowPaddingWithoutBorders : 1; // tdf#41542
bool mbAddExternalLeading : 1;
bool mbUseHiResolutionVirtualDevice : 1;
bool mbOldLineSpacing : 1; // #i11859#

View file

@ -1829,8 +1829,7 @@ SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
m_bCachedJoinedWithPrev = false;
m_bCachedJoinedWithNext = false;
bool bAllowPaddingWithoutBorders = true;
m_bBorderDist = bool(pConstructor->GetType() & SwFrameType::Cell) || bAllowPaddingWithoutBorders;
m_bBorderDist = true;
}
SwBorderAttrs::~SwBorderAttrs()

View file

@ -1959,7 +1959,6 @@ void SwWW8ImplReader::ImportDop()
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, true);
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL, true);
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, true);
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS, true);
// COMPATIBILITY FLAGS END

View file

@ -405,7 +405,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179
SID_HTML_MODE, SID_HTML_MODE, // [10414
SID_ALLOW_PADDING_WITHOUT_BORDERS, SID_ALLOW_PADDING_WITHOUT_BORDERS, // [11139
FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032
FN_SURROUND, FN_HORI_ORIENT, // [21303
FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306
@ -457,9 +456,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
aSet.Put( SfxBoolItem( FN_OLE_IS_MATH, xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) );
aSet.Put( SfxBoolItem( SID_ALLOW_PADDING_WITHOUT_BORDERS,
rSh.GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS) ) );
OString sDefPage;
if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, false, &pItem) == SfxItemState::SET)
sDefPage = OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);

View file

@ -90,7 +90,6 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_IS_LABEL_DOC,
HANDLE_IS_ADD_FLY_OFFSET,
HANDLE_IS_ADD_VERTICAL_FLY_OFFSET,
HANDLE_ALLOW_PADDING_WITHOUT_BORDERS,
HANDLE_IS_ADD_EXTERNAL_LEADING,
HANDLE_OLD_NUMBERING,
HANDLE_OUTLINELEVEL_YIELDS_NUMBERING,
@ -167,7 +166,6 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("IsLabelDocument"), HANDLE_IS_LABEL_DOC, cppu::UnoType<bool>::get(), 0},
{ OUString("AddFrameOffsets"), HANDLE_IS_ADD_FLY_OFFSET, cppu::UnoType<bool>::get(), 0},
{ OUString("AddVerticalFrameOffsets"), HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, cppu::UnoType<bool>::get(), 0},
{ OUString("AllowPaddingWithoutBorders"), HANDLE_ALLOW_PADDING_WITHOUT_BORDERS, cppu::UnoType<bool>::get(), 0},
{ OUString("AddExternalLeading"), HANDLE_IS_ADD_EXTERNAL_LEADING, cppu::UnoType<bool>::get(), 0},
{ OUString("UseOldNumbering"), HANDLE_OLD_NUMBERING, cppu::UnoType<bool>::get(), 0},
{ OUString("OutlineLevelYieldsNumbering"), HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, cppu::UnoType<bool>::get(), 0},
@ -569,12 +567,6 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS, bTmp);
}
break;
case HANDLE_ALLOW_PADDING_WITHOUT_BORDERS:
{
bool bTmp = *o3tl::doAccess<bool>(rValue);
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS, bTmp);
}
break;
case HANDLE_IS_ADD_EXTERNAL_LEADING:
{
bool bTmp = *o3tl::doAccess<bool>(rValue);
@ -1063,11 +1055,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS);
}
break;
case HANDLE_ALLOW_PADDING_WITHOUT_BORDERS:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
}
break;
case HANDLE_IS_ADD_EXTERNAL_LEADING:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_EXT_LEADING);

View file

@ -298,7 +298,6 @@ void WriterFilter::setTargetDocument(const uno::Reference< lang::XComponent >& x
xSettings->setPropertyValue("TabOverMargin", uno::makeAny(true));
xSettings->setPropertyValue("TreatSingleColumnBreakAsPageBreak", uno::makeAny(true));
xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::makeAny(true));
xSettings->setPropertyValue("AllowPaddingWithoutBorders", uno::makeAny(true));
}
void WriterFilter::setSourceDocument(const uno::Reference< lang::XComponent >& xDoc) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)