tdf#41542 rename variable to match LO5.4 terminology
Changing /Allow_*Spacing_*Without_*Borders/I to AllowPaddingWithoutBorders related to tdf#103275 where "spacing to contents" is to be changed to Padding. Rename this already in LO53 to simplify potential backports and laying other groundwork for fixing this bug. Also, I can easily see setting AllowPaddingWithoutBorders globally in 5.3 for the purpose of being able to share documents when the UI in LO5.4 permits creation of padding without borders. Otherwise older versions will display significantly different formatting. Change-Id: I253173274f824a019ebc09a039c471d170c1be73 Reviewed-on: https://gerrit.libreoffice.org/30372 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
This commit is contained in:
parent
f19f88a0d4
commit
bb615bc146
@ -39,7 +39,7 @@ enum class DocumentSettingId
|
||||
ADD_FLY_OFFSETS,
|
||||
ADD_VERTICAL_FLY_OFFSETS,
|
||||
|
||||
ALLOW_SPACING_WITHOUT_BORDERS,
|
||||
ALLOW_PADDING_WITHOUT_BORDERS,
|
||||
OLD_NUMBERING,
|
||||
|
||||
ADD_EXT_LEADING,
|
||||
|
@ -55,7 +55,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
|
||||
|
||||
mbAddFlyOffsets(false),
|
||||
mbAddVerticalFlyOffsets(false),
|
||||
mbAllowSpacingWithoutBorders( false ),
|
||||
mbAllowPaddingWithoutBorders( false ),
|
||||
mbUseHiResolutionVirtualDevice(true),
|
||||
mbMathBaselineAlignment(false), // default for *old* documents is 'off'
|
||||
mbStylesNoDefault(false),
|
||||
@ -147,7 +147,7 @@ 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_SPACING_WITHOUT_BORDERS: return mbAllowSpacingWithoutBorders;
|
||||
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,8 +223,8 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
|
||||
case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS:
|
||||
mbAddVerticalFlyOffsets = value;
|
||||
break;
|
||||
case DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS:
|
||||
mbAllowSpacingWithoutBorders = value;
|
||||
case DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS:
|
||||
mbAllowPaddingWithoutBorders = value;
|
||||
break;
|
||||
case DocumentSettingId::ADD_EXT_LEADING:
|
||||
mbAddExternalLeading = value;
|
||||
|
@ -109,7 +109,7 @@ class DocumentSettingManager :
|
||||
bool mbUseVirtualDevice : 1;
|
||||
bool mbAddFlyOffsets : 1;
|
||||
bool mbAddVerticalFlyOffsets : 1;
|
||||
bool mbAllowSpacingWithoutBorders : 1; // tdf#41542
|
||||
bool mbAllowPaddingWithoutBorders : 1; // tdf#41542
|
||||
bool mbAddExternalLeading : 1;
|
||||
bool mbUseHiResolutionVirtualDevice : 1;
|
||||
bool mbOldLineSpacing : 1; // #i11859#
|
||||
|
@ -1829,15 +1829,14 @@ SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
|
||||
m_bCachedJoinedWithPrev = false;
|
||||
m_bCachedJoinedWithNext = false;
|
||||
|
||||
bool bAllowSpacingWithoutBorders = false;
|
||||
bool bAllowPaddingWithoutBorders = false;
|
||||
if( (pConstructor->GetType() & SwFrameType::Fly)
|
||||
&& pConstructor->IsLayoutFrame()
|
||||
&& pConstructor->GetLower() && pConstructor->GetLower()->IsTextFrame() )
|
||||
{
|
||||
const SwFrameFormat* pFormat = static_cast<const SwLayoutFrame*>(pConstructor)->GetFormat();
|
||||
bAllowSpacingWithoutBorders = pFormat->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS);
|
||||
bAllowPaddingWithoutBorders = pConstructor->getRootFrame()->GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
|
||||
}
|
||||
m_bBorderDist = bool(pConstructor->GetType() & SwFrameType::Cell) || bAllowSpacingWithoutBorders;
|
||||
m_bBorderDist = bool(pConstructor->GetType() & SwFrameType::Cell) || bAllowPaddingWithoutBorders;
|
||||
}
|
||||
|
||||
SwBorderAttrs::~SwBorderAttrs()
|
||||
|
@ -1967,7 +1967,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
|
||||
sal_Int32 nLineWidth=0;
|
||||
const SfxPoolItem* pItem;
|
||||
bool bFirstLine = true;
|
||||
const bool bAllowSpacingWithoutBorders = rFormat.getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS);
|
||||
const bool bAllowPaddingWithoutBorders = rFormat.getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
|
||||
if (SfxItemState::SET == rFormat.GetItemState(RES_BOX, true, &pItem))
|
||||
{
|
||||
static const o3tl::enumarray<SvxBoxItemLine, sal_uInt16> aExhperProp =
|
||||
@ -2035,7 +2035,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
|
||||
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(
|
||||
static_cast<const SvxBoxItem*>(pItem)->GetDistance( n ) ));
|
||||
}
|
||||
else if( bAllowSpacingWithoutBorders )
|
||||
else if( bAllowPaddingWithoutBorders )
|
||||
{
|
||||
rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(static_cast<const SvxBoxItem*>(pItem)->GetDistance( n )) );
|
||||
}
|
||||
@ -2046,7 +2046,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
|
||||
if( bFirstLine ) // no valid line found
|
||||
{
|
||||
rPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
|
||||
if( !bAllowSpacingWithoutBorders )
|
||||
if( !bAllowPaddingWithoutBorders )
|
||||
{
|
||||
rPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 );
|
||||
rPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 );
|
||||
|
@ -1959,7 +1959,7 @@ 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_SPACING_WITHOUT_BORDERS, true);
|
||||
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS, true);
|
||||
|
||||
// COMPATIBILITY FLAGS END
|
||||
|
||||
|
@ -90,7 +90,7 @@ enum SwDocumentSettingsPropertyHandles
|
||||
HANDLE_IS_LABEL_DOC,
|
||||
HANDLE_IS_ADD_FLY_OFFSET,
|
||||
HANDLE_IS_ADD_VERTICAL_FLY_OFFSET,
|
||||
HANDLE_ALLOW_SPACING_WITHOUT_BORDERS,
|
||||
HANDLE_ALLOW_PADDING_WITHOUT_BORDERS,
|
||||
HANDLE_IS_ADD_EXTERNAL_LEADING,
|
||||
HANDLE_OLD_NUMBERING,
|
||||
HANDLE_OUTLINELEVEL_YIELDS_NUMBERING,
|
||||
@ -167,7 +167,7 @@ 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("AllowSpacingWithoutBorders"), HANDLE_ALLOW_SPACING_WITHOUT_BORDERS, 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,10 +569,10 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
|
||||
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS, bTmp);
|
||||
}
|
||||
break;
|
||||
case HANDLE_ALLOW_SPACING_WITHOUT_BORDERS:
|
||||
case HANDLE_ALLOW_PADDING_WITHOUT_BORDERS:
|
||||
{
|
||||
bool bTmp = *o3tl::doAccess<bool>(rValue);
|
||||
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS, bTmp);
|
||||
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS, bTmp);
|
||||
}
|
||||
break;
|
||||
case HANDLE_IS_ADD_EXTERNAL_LEADING:
|
||||
@ -1063,9 +1063,9 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS);
|
||||
}
|
||||
break;
|
||||
case HANDLE_ALLOW_SPACING_WITHOUT_BORDERS:
|
||||
case HANDLE_ALLOW_PADDING_WITHOUT_BORDERS:
|
||||
{
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_SPACING_WITHOUT_BORDERS);
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
|
||||
}
|
||||
break;
|
||||
case HANDLE_IS_ADD_EXTERNAL_LEADING:
|
||||
|
@ -299,7 +299,7 @@ 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("AllowSpacingWithoutBorders", 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user