Kaydet (Commit) 9130627e authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

tdf#41542 globally allow padding without borders: layout

Styles with borders do not have a requirement for visible borders
in order to apply padding in the ODF specs. This was only an
implementation design, so remove that layout restriction.
So, padding will be allowed now for any border (not just textframes/cells)
and it will be allowed for any format (not only those marked
with the compatibility setting AllowPaddingWithoutBorders - which
is now redefined to indicate whether the UI allows
creating borderless padding).

The global UI implementation to allow creating these types of documents
will come in 5.4.  Allow the layout already in 5.3 to enhance
compatibility between supported versions.

Change-Id: I75bab7cbfff23bf70406123f8531e2fea352ddda
Reviewed-on: https://gerrit.libreoffice.org/30434Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst c1ea561f
......@@ -242,6 +242,12 @@ DECLARE_ODFIMPORT_TEST(testOdtBorders, "borders_ooo33.odt")
} while(xParaEnum->hasMoreElements());
}
DECLARE_ODFIMPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPadding.odt")
{
// the page style's borderless padding should force this to 3 pages, not 1
CPPUNIT_ASSERT_EQUAL( 3, getPages() );
}
DECLARE_ODFIMPORT_TEST(testPageStyleLayoutDefault, "hello.odt")
{
uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default Style"), uno::UNO_QUERY);
......
......@@ -1829,13 +1829,7 @@ SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
m_bCachedJoinedWithPrev = false;
m_bCachedJoinedWithNext = false;
bool bAllowPaddingWithoutBorders = false;
if( (pConstructor->GetType() & SwFrameType::Fly)
&& pConstructor->IsLayoutFrame()
&& pConstructor->GetLower() && pConstructor->GetLower()->IsTextFrame() )
{
bAllowPaddingWithoutBorders = pConstructor->getRootFrame()->GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS);
}
bool bAllowPaddingWithoutBorders = true;
m_bBorderDist = bool(pConstructor->GetType() & SwFrameType::Cell) || bAllowPaddingWithoutBorders;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment