[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth
justin_luth at sil.org
Fri Nov 4 09:21:19 UTC 2016
sw/qa/extras/odfimport/data/tdf41542_borderlessPadding.odt |binary
sw/qa/extras/odfimport/odfimport.cxx | 6 ++++++
sw/source/core/layout/frmtool.cxx | 8 +-------
3 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 9130627e21dd7c52c5eee1acc4b71f86eb9f3118
Author: Justin Luth <justin_luth at sil.org>
Date: Mon Oct 31 11:59:09 2016 +0300
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/30434
Reviewed-by: Justin Luth <justin_luth at sil.org>
Tested-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/odfimport/data/tdf41542_borderlessPadding.odt b/sw/qa/extras/odfimport/data/tdf41542_borderlessPadding.odt
new file mode 100755
index 0000000..9585041
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf41542_borderlessPadding.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 90f1da1..9c21cad 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -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);
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 5149cb6..6aa488a 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -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;
}
More information about the Libreoffice-commits
mailing list