[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 18 commits - cui/source cui/uiconfig editeng/source include/editeng include/svtools include/xmloff offapi/com schema/libreoffice sw/inc sw/qa sw/source writerfilter/source writerperfect/qa xmloff/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 1 07:20:57 UTC 2021
cui/source/inc/page.hxx | 5
cui/source/tabpages/page.cxx | 97 +
cui/uiconfig/ui/pageformatpage.ui | 1082 ++++++------
editeng/source/items/frmitems.cxx | 19
include/editeng/lrspitem.hxx | 8
include/editeng/memberids.h | 1
include/svtools/rtfkeywd.hxx | 1
include/xmloff/xmltoken.hxx | 1
offapi/com/sun/star/style/PageProperties.idl | 7
schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng | 12
sw/inc/IDocumentSettingAccess.hxx | 1
sw/inc/unoprnms.hxx | 1
sw/qa/core/layout/layout.cxx | 85
sw/qa/extras/odfexport/data/gutter-left.odt |binary
sw/qa/extras/odfexport/odfexport.cxx | 13
sw/qa/extras/ooxmlexport/data/gutter-left.docx |binary
sw/qa/extras/ooxmlexport/data/gutter-top.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 27
sw/qa/extras/rtfexport/data/gutter-left.rtf | 4
sw/qa/extras/rtfexport/data/gutter-top.rtf | 4
sw/qa/extras/rtfexport/rtfexport4.cxx | 29
sw/qa/extras/ww8export/data/gutter-left.doc |binary
sw/qa/extras/ww8export/data/gutter-top.doc |binary
sw/qa/extras/ww8export/ww8export3.cxx | 27
sw/qa/uibase/dochdl/dochdl.cxx | 28
sw/source/core/doc/DocumentSettingManager.cxx | 13
sw/source/core/inc/DocumentSettingManager.hxx | 2
sw/source/core/inc/frmtool.hxx | 1
sw/source/core/layout/frmtool.cxx | 37
sw/source/core/layout/pagedesc.cxx | 1
sw/source/core/layout/paintfrm.cxx | 27
sw/source/core/unocore/unomap1.cxx | 1
sw/source/filter/ww8/docxattributeoutput.cxx | 12
sw/source/filter/ww8/docxexport.cxx | 5
sw/source/filter/ww8/rtfattributeoutput.cxx | 5
sw/source/filter/ww8/rtfexport.cxx | 7
sw/source/filter/ww8/wrtww8.cxx | 5
sw/source/filter/ww8/ww8atr.cxx | 8
sw/source/filter/ww8/ww8par.cxx | 5
sw/source/filter/ww8/ww8par.hxx | 5
sw/source/filter/ww8/ww8par6.cxx | 12
sw/source/filter/ww8/ww8scan.cxx | 5
sw/source/uibase/app/docst.cxx | 30
sw/source/uibase/app/docstyle.cxx | 2
sw/source/uibase/dochdl/swdtflvr.cxx | 48
sw/source/uibase/uno/SwXDocumentSettings.cxx | 16
writerfilter/source/dmapper/DomainMapper.cxx | 1
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 1
writerfilter/source/dmapper/PropertyIds.cxx | 3
writerfilter/source/dmapper/PropertyIds.hxx | 1
writerfilter/source/dmapper/PropertyMap.cxx | 2
writerfilter/source/dmapper/PropertyMap.hxx | 2
writerfilter/source/dmapper/SettingsTable.cxx | 6
writerfilter/source/dmapper/SettingsTable.hxx | 1
writerfilter/source/rtftok/rtfdispatchflag.cxx | 3
writerfilter/source/rtftok/rtfdispatchvalue.cxx | 5
writerperfect/qa/unit/EPUBExportTest.cxx | 3
xmloff/source/core/xmltoken.cxx | 1
xmloff/source/style/PageMasterStyleMap.cxx | 3
xmloff/source/token/tokens.txt | 1
61 files changed, 1173 insertions(+), 568 deletions(-)
New commits:
commit 353aa3a125ba8387210e0ebcd240bd58744ebaf0
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu May 14 10:19:21 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 09:20:07 2021 +0200
CppunitTest_writerperfect_epubexport: don't try to load flagged abw format
master opens this as-is, this branch would first show you a dialog, we
cancel that in headless mode, and then loading fails, but that's not an
interesting failure.
Change-Id: I6ff83e320738fb33ee88d10f9b2cfabff91de8ed
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index e6ca36fed947..6875fcf1a9de 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -869,9 +869,12 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testSimpleRuby)
CPPUNIT_TEST_FIXTURE(EPUBExportTest, testAbi11105)
{
+// Disable the test on this branch, .abw is flagged as EXOTIC, so loading would fail.
+#if 0
// This crashed because the paragraph style "P5" which had a master-page-name
// appeared in a table cell messed up page spans.
createDoc("abi11105.abw", {});
+#endif
}
}
commit 1857f1fdeff76260ec96a041cf50e04e9425a4cd
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Feb 25 11:04:01 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 08:58:10 2021 +0200
sw: fix incorrect loop condition in SwTransferable::isComplex()
We're not consuming hints in that loop, so we want to end when the
iteration ended, not when the list of hints is empty.
Change-Id: I2cb735c03c3551f7b0be8b314183780eedff9ecf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111519
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/qa/uibase/dochdl/dochdl.cxx b/sw/qa/uibase/dochdl/dochdl.cxx
index 88ad5f7545d0..3efcef17f530 100644
--- a/sw/qa/uibase/dochdl/dochdl.cxx
+++ b/sw/qa/uibase/dochdl/dochdl.cxx
@@ -10,10 +10,14 @@
#include <swmodeltestbase.hxx>
#include <vcl/transfer.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
#include <docsh.hxx>
#include <swdtflvr.hxx>
#include <wrtsh.hxx>
+#include <view.hxx>
/// Covers sw/source/uibase/dochdl/ fixes.
class SwUibaseDochdlTest : public SwModelTestBase
@@ -46,6 +50,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testSelectPasteFormat)
CPPUNIT_ASSERT_EQUAL(SotClipboardFormatId::EMBED_SOURCE, nFormat);
}
+CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testComplexSelection)
+{
+ // Given a document where a text node has hints, but no as-char images.
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->Insert2("abc");
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
+ SfxItemSet aSet(pWrtShell->GetView().GetPool(),
+ svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{});
+ // Bold, italic, underline.
+ aSet.Put(SvxWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT));
+ aSet.Put(SvxPostureItem(ITALIC_NORMAL, RES_CHRATR_POSTURE));
+ aSet.Put(SvxUnderlineItem(LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE));
+ pWrtShell->SetAttrSet(aSet);
+ uno::Reference<datatransfer::XTransferable2> xTransfer = new SwTransferable(*pWrtShell);
+
+ // When checking if the selection is complex, then there should be no crash.
+ // Without the accompanying fix in place, this test would have crashed, because we read past the
+ // end of the hints array.
+ CPPUNIT_ASSERT(!xTransfer->isComplex());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 48c0d492485e..60043a036c76 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -441,7 +441,7 @@ sal_Bool SAL_CALL SwTransferable::isComplex()
{
if (pTextNode->HasHints())
{
- for (size_t nHint = 0; pTextNode->GetSwpHints().Count(); ++nHint)
+ for (size_t nHint = 0; nHint < pTextNode->GetSwpHints().Count(); ++nHint)
{
SwTextAttr* pHint = pTextNode->GetSwpHints().Get(nHint);
if (pHint->Which() == RES_TXTATR_FLYCNT)
commit c4d8cbe296b8f26a89732c72fd2a1b2c8497fa21
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Feb 23 10:04:03 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 08:57:51 2021 +0200
sw lok: simplify SwTransferable::isComplex()
Commit 169a87563a3940299811d874b4df0ad13591771c (LOK: Implement
getSelectionType, 2019-06-24) implemented detecting complex selections
by copying the selection to a new SwDoc, which probably had two
benefits: first, the created SwPaM instance didn't touch the document;
second, this means no bounds has to be set when scanning nodes: the
entire document is the selection.
Later commit 7fe30d1cb00c576469d6cbe5606268a9cdf35bd3 (LOK: detect
Graphics in isComplex for Writer, 2019-06-25) got rid of the SwPaM
(which would register itself into text nodes), so now it's possible to
not touch the document, even if we work on the original document.
Instead, solve the partial scanning by iterating over the list of
selections. This is meant to be faster, and also less likely to crash in
case some internal document model invariant is broken.
No testcase, testComplexSelection in CppunitTest_desktop_lib already
covers thie behavior.
Change-Id: Ia528c06a48defd06c5e34ed7d61621e5ce10bb06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111377
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 894d9049bcfd..48c0d492485e 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -118,6 +118,7 @@
#include <iodetect.hxx>
#include <unotextrange.hxx>
#include <unoframe.hxx>
+#include <txatbase.hxx>
#include <vcl/uitest/logger.hxx>
#include <vcl/uitest/eventdescription.hxx>
@@ -426,33 +427,34 @@ namespace
sal_Bool SAL_CALL SwTransferable::isComplex()
{
- // Copy into a new Doc so we don't mess with the existing one.
- //FIXME: We *should* be able to avoid this and improve the performance.
- m_pClpDocFac.reset(new SwDocFac);
- SwDoc& rTmpDoc = lcl_GetDoc(*m_pClpDocFac);
-
- rTmpDoc.getIDocumentFieldsAccess()
- .LockExpFields(); // never update fields - leave text as it is
- lclOverWriteDoc(*m_pWrtShell, rTmpDoc);
-
sal_Int32 nTextLength = 0;
- const SwNode* pEndOfContent = &m_pWrtShell->GetDoc()->GetNodes().GetEndOfContent();
- SwNodes& aNodes = rTmpDoc.GetNodes();
- for( sal_uLong nIndex = 0; nIndex < aNodes.Count(); ++nIndex)
+ SwNodes& aNodes = m_pWrtShell->GetDoc()->GetNodes();
+ for (SwPaM& rPaM : m_pWrtShell->GetCursor()->GetRingContainer())
{
- SwNode& rNd = *aNodes[nIndex];
- if (&rNd == pEndOfContent)
- break;
+ for (sal_uLong nIndex = rPaM.GetMark()->nNode.GetIndex();
+ nIndex <= rPaM.GetPoint()->nNode.GetIndex(); ++nIndex)
+ {
+ SwNode& rNd = *aNodes[nIndex];
- if (rNd.IsOLENode() || rNd.IsGrfNode())
- return true; // Complex
+ SwTextNode* pTextNode = rNd.GetTextNode();
+ if (pTextNode)
+ {
+ if (pTextNode->HasHints())
+ {
+ for (size_t nHint = 0; pTextNode->GetSwpHints().Count(); ++nHint)
+ {
+ SwTextAttr* pHint = pTextNode->GetSwpHints().Get(nHint);
+ if (pHint->Which() == RES_TXTATR_FLYCNT)
+ {
+ return true; // Complex
+ }
+ }
+ }
- SwTextNode* pTextNode = rNd.GetTextNode();
- if (pTextNode)
- {
- nTextLength += pTextNode->GetText().getLength();
- if (nTextLength >= 1024 * 512)
- return true; // Complex
+ nTextLength += pTextNode->GetText().getLength();
+ if (nTextLength >= 1024 * 512)
+ return true; // Complex
+ }
}
}
commit db2be921e277e6231c43bf64166cb1154579135f
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 8 16:49:45 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 08:57:35 2021 +0200
tdf#91920 sw page gutter margin: handle mirrored margins
- SwPageDesc::Mirror: generate "right gutter margin" from gutter margin
for mirrored pages, we just lost the gutter margin here previously
- SwBorderAttrs::CalcRight: handle right gutter margin, so gutter
increases the right margin, not the left margin on mirrored pages
- lcl_CalcBorderRect: similar to left and top margins, compensate for
right margin gutter as well, so borders are independent from the gutter
margin (Word compat)
Change-Id: Ie4d3459ab6edcc60b20c2fed08dbf45060ca9828
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110585
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 0d147f6204c7..a3968e39a186 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -289,6 +289,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
nLeftMargin ( 0 ),
nRightMargin ( 0 ),
m_nGutterMargin(0),
+ m_nRightGutterMargin(0),
nPropFirstLineOffset( 100 ),
nPropLeftMargin( 100 ),
nPropRightMargin( 100 ),
@@ -309,6 +310,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const tools::Long nLeft, const tools::Long nRigh
nLeftMargin ( nLeft ),
nRightMargin ( nRight ),
m_nGutterMargin(0),
+ m_nRightGutterMargin(0),
nPropFirstLineOffset( 100 ),
nPropLeftMargin( 100 ),
nPropRightMargin( 100 ),
@@ -483,6 +485,7 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const
nFirstLineOffset == rOther.GetTextFirstLineOffset() &&
nTxtLeft == rOther.GetTextLeft() &&
m_nGutterMargin == rOther.GetGutterMargin() &&
+ m_nRightGutterMargin == rOther.GetRightGutterMargin() &&
nLeftMargin == rOther.GetLeft() &&
nRightMargin == rOther.GetRight() &&
nPropFirstLineOffset == rOther.GetPropTextFirstLineOffset() &&
@@ -607,6 +610,8 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRightMargin"), BAD_CAST(OString::number(nRightMargin).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nGutterMargin"),
BAD_CAST(OString::number(m_nGutterMargin).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nRightGutterMargin"),
+ BAD_CAST(OString::number(m_nRightGutterMargin).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropFirstLineOffset"), BAD_CAST(OString::number(nPropFirstLineOffset).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropLeftMargin"), BAD_CAST(OString::number(nPropLeftMargin).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropRightMargin"), BAD_CAST(OString::number(nPropRightMargin).getStr()));
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index 9b3ec7734a8e..0510ee47d521 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -53,6 +53,8 @@ class EDITENG_DLLPUBLIC SvxLRSpaceItem final : public SfxPoolItem
tools::Long nRightMargin; // The unproblematic right edge
/// The amount of extra space added to the left margin.
tools::Long m_nGutterMargin;
+ /// The amount of extra space added to the right margin, on mirrored pages.
+ tools::Long m_nRightGutterMargin;
sal_uInt16 nPropFirstLineOffset, nPropLeftMargin, nPropRightMargin;
short nFirstLineOffset; // First-line indent _always_ relative to nTxtLeft
@@ -120,6 +122,8 @@ public:
{ nFirstLineOffset = nValue; }
void SetGutterMargin(const tools::Long nGutterMargin) { m_nGutterMargin = nGutterMargin; }
tools::Long GetGutterMargin() const { return m_nGutterMargin; }
+ void SetRightGutterMargin(const tools::Long nRightGutterMargin) { m_nRightGutterMargin = nRightGutterMargin; }
+ tools::Long GetRightGutterMargin() const { return m_nRightGutterMargin; }
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
virtual boost::property_tree::ptree dumpAsJSON() const override;
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 09acdec7a0c4..fc780f476ba8 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -9,6 +9,8 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/style/PageStyleLayout.hpp>
+
#include <vcl/gdimtf.hxx>
#include <svx/svdpage.hxx>
@@ -319,6 +321,35 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterTopMargin)
CPPUNIT_ASSERT_EQUAL(nGutterTwips, nNewTop - nOldTop);
}
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMirrorMargin)
+{
+ SwDoc* pDoc = createSwDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->InsertPageBreak();
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPage = pLayout->GetLower();
+ tools::Long nOldLeft = pPage->getFramePrintArea().Left();
+ SwFrame* pPage2 = pPage->GetNext();
+ tools::Long nOldRight = pPage2->getFramePrintArea().Right();
+
+ uno::Reference<beans::XPropertySet> xStandard(getStyles("PageStyles")->getByName("Standard"),
+ uno::UNO_QUERY);
+ xStandard->setPropertyValue("PageStyleLayout", uno::makeAny(style::PageStyleLayout_MIRRORED));
+ sal_Int32 nGutterMm100 = 2000;
+ xStandard->setPropertyValue("GutterMargin", uno::makeAny(nGutterMm100));
+
+ tools::Long nNewLeft = pPage->getFramePrintArea().Left();
+ tools::Long nGutterTwips = convertMm100ToTwip(nGutterMm100);
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nNewLeft - nOldLeft);
+ tools::Long nNewRight = pPage2->getFramePrintArea().Right();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1134
+ // - Actual : 0
+ // i.e. the gutter was missing on the second, mirrored page.
+ CPPUNIT_ASSERT_EQUAL(nGutterTwips, nOldRight - nNewRight);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 3c8677f7181a..c5e5a1896233 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2263,6 +2263,19 @@ tools::Long SwBorderAttrs::CalcRight( const SwFrame* pCaller ) const
nRight += static_cast<const SwTextFrame*>(pCaller)->GetTextNodeForParaProps()->GetLeftMarginWithNum();
}
+ if (pCaller->IsPageFrame() && m_rLR)
+ {
+ const auto pPageFrame = static_cast<const SwPageFrame*>(pCaller);
+ bool bGutterAtTop = pPageFrame->GetFormat()->getIDocumentSettingAccess().get(
+ DocumentSettingId::GUTTER_AT_TOP);
+ if (!bGutterAtTop)
+ {
+ // Decrease the print area: the right space is the sum of right and right gutter
+ // margins.
+ nRight += m_rLR->GetRightGutterMargin();
+ }
+ }
+
return nRight;
}
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index fc8b7b08787e..28b126598b34 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -151,6 +151,7 @@ void SwPageDesc::Mirror()
const SvxLRSpaceItem &rLR = m_Master.GetLRSpace();
aLR.SetLeft( rLR.GetRight() );
aLR.SetRight( rLR.GetLeft() );
+ aLR.SetRightGutterMargin(rLR.GetGutterMargin());
SfxItemSet aSet( *m_Master.GetAttrSet().GetPool(),
m_Master.GetAttrSet().GetRanges() );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index df52c93ce51f..a464a4640fb6 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1286,19 +1286,28 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame,
if (pFrame->IsPageFrame() && rAttrs.GetLRSpace())
{
tools::Long nGutterMargin = rAttrs.GetLRSpace()->GetGutterMargin();
+ tools::Long nRightGutterMargin = rAttrs.GetLRSpace()->GetRightGutterMargin();
const auto pPageFrame = static_cast<const SwPageFrame*>(pFrame);
bool bGutterAtTop = pPageFrame->GetFormat()->getIDocumentSettingAccess().get(
DocumentSettingId::GUTTER_AT_TOP);
- if (nGutterMargin && !bGutterAtTop)
- {
- // Paint the left border based on the left margin, ignoring the gutter margin.
- (rRect.*fnRect->fnSubLeft)(nGutterMargin);
- }
- else if (nGutterMargin)
+ if (bGutterAtTop)
{
// Paint the top border based on the top margin, ignoring the gutter margin.
(rRect.*fnRect->fnSubTop)(nGutterMargin);
}
+ else
+ {
+ if (nGutterMargin)
+ {
+ // Paint the left border based on the left margin, ignoring the gutter margin.
+ (rRect.*fnRect->fnSubLeft)(nGutterMargin);
+ }
+ if (nRightGutterMargin)
+ {
+ // Paint the right border based on the right margin, ignoring the gutter margin.
+ (rRect.*fnRect->fnAddRight)(nRightGutterMargin);
+ }
+ }
}
const SvxBoxItem &rBox = rAttrs.GetBox();
commit d12dc5511cef4f867e0acd76448d543dde2c0abf
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 8 09:46:50 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 08:57:16 2021 +0200
tdf#91920 sw page gutter margin, from top: add UI
- read from sw::DocumentSettingManager::mbGutterAtTop
- improve the preview widget to take gutter position into account
- also change it when the gutter position widget changes
- write it back to sw::DocumentSettingManager::mbGutterAtTop on
modification
- always check if the dialog's input item set has SID_ATTR_CHAR_GRABBAG,
otherwise do nothing to keep Calc/Impress unchanged
Change-Id: I05ef864bf7ac18f4c6829d78312044560e6402d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110488
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index d4a39f9b68e3..1a2e8fb506c4 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -123,6 +123,8 @@ private:
std::unique_ptr<weld::CheckButton> m_xRegisterCB;
std::unique_ptr<weld::Label> m_xRegisterFT;
std::unique_ptr<weld::ComboBox> m_xRegisterLB;
+ std::unique_ptr<weld::Label> m_xGutterPositionFT;
+ std::unique_ptr<weld::ComboBox> m_xGutterPositionLB;
std::unique_ptr<weld::Label> m_xInsideLbl;
std::unique_ptr<weld::Label> m_xOutsideLbl;
std::unique_ptr<weld::Label> m_xPrintRangeQueryText;
@@ -130,6 +132,7 @@ private:
void Init_Impl();
DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void);
+ DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox&, void);
DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void);
DECL_LINK(SwapOrientation_Impl, weld::Button&, void);
void SwapFirstValues_Impl( bool bSet );
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 9a4ee5003f59..cc3cbcff0bb2 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -52,6 +52,8 @@
#include <svx/xdef.hxx>
#include <svx/unobrushitemhelper.hxx>
#include <svx/SvxNumOptionsTabPageHelper.hxx>
+#include <sal/log.hxx>
+#include <svl/grabbagitem.hxx>
// static ----------------------------------------------------------------
@@ -175,6 +177,8 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController*
, m_xRegisterCB(m_xBuilder->weld_check_button("checkRegisterTrue"))
, m_xRegisterFT(m_xBuilder->weld_label("labelRegisterStyle"))
, m_xRegisterLB(m_xBuilder->weld_combo_box("comboRegisterStyle"))
+ , m_xGutterPositionFT(m_xBuilder->weld_label("labelGutterPosition"))
+ , m_xGutterPositionLB(m_xBuilder->weld_combo_box("comboGutterPosition"))
// Strings stored in UI
, m_xInsideLbl(m_xBuilder->weld_label("labelInner"))
, m_xOutsideLbl(m_xBuilder->weld_label("labelOuter"))
@@ -305,6 +309,7 @@ void SvxPageDescPage::Init_Impl()
{
// adjust the handler
m_xLayoutBox->connect_changed(LINK(this, SvxPageDescPage, LayoutHdl_Impl));
+ m_xGutterPositionLB->connect_changed(LINK(this, SvxPageDescPage, GutterPositionHdl_Impl));
m_xPaperSizeBox->connect_changed(LINK(this, SvxPageDescPage, PaperSizeSelect_Impl));
m_xPaperWidthEdit->connect_value_changed( LINK(this, SvxPageDescPage, PaperSizeModify_Impl));
@@ -326,7 +331,7 @@ void SvxPageDescPage::Init_Impl()
void SvxPageDescPage::Reset( const SfxItemSet* rSet )
{
SfxItemPool* pPool = rSet->GetPool();
- DBG_ASSERT( pPool, "Where is the pool?" );
+ SAL_WARN_IF(!pPool, "cui.tabpages", "Where is the pool?");
MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
// adjust margins (right/left)
@@ -358,6 +363,27 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(rULSpace.GetLower()), eUnit )) );
}
+ if (rSet->HasItem(SID_ATTR_CHAR_GRABBAG, &pItem))
+ {
+ const auto& rGrabBagItem = static_cast<const SfxGrabBagItem&>(*pItem);
+ bool bGutterAtTop{};
+ auto it = rGrabBagItem.GetGrabBag().find("GutterAtTop");
+ if (it != rGrabBagItem.GetGrabBag().end())
+ {
+ it->second >>= bGutterAtTop;
+ }
+
+ if (bGutterAtTop)
+ {
+ m_xGutterPositionLB->set_active(1);
+ }
+ else
+ {
+ // Left.
+ m_xGutterPositionLB->set_active(0);
+ }
+ }
+
// general page data
SvxNumType eNumType = SVX_NUM_ARABIC;
bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape );
@@ -480,6 +506,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_xGutterMarginLbl->hide();
m_xGutterMarginEdit->hide();
+ m_xGutterPositionFT->hide();
+ m_xGutterPositionLB->hide();
break;
}
@@ -498,6 +526,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_xGutterMarginLbl->hide();
m_xGutterMarginEdit->hide();
+ m_xGutterPositionFT->hide();
+ m_xGutterPositionLB->hide();
break;
}
@@ -532,6 +562,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_xVertBox->save_state();
m_xHorzBox->save_state();
m_xAdaptBox->save_state();
+ m_xGutterPositionLB->save_value();
CheckMarginEdits( true );
@@ -617,6 +648,29 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
bModified = false;
}
+ if (rOldSet.HasItem(SID_ATTR_CHAR_GRABBAG))
+ {
+ // Set gutter position.
+ SfxGrabBagItem aGrabBagItem(
+ static_cast<const SfxGrabBagItem&>(rOldSet.Get(SID_ATTR_CHAR_GRABBAG)));
+ if (m_xGutterPositionLB->get_value_changed_from_saved())
+ {
+ bool bGutterAtTop = m_xGutterPositionLB->get_active() == 1;
+ aGrabBagItem.GetGrabBag()["GutterAtTop"] <<= bGutterAtTop;
+ bModified = true;
+ }
+
+ if (bModified)
+ {
+ pOld = rOldSet.GetItem(SID_ATTR_CHAR_GRABBAG);
+
+ if (!pOld || static_cast<const SfxGrabBagItem&>(*pOld) != aGrabBagItem)
+ rSet->Put(aGrabBagItem);
+ else
+ bModified = false;
+ }
+ }
+
bool bMod = false;
if (m_xTopMarginEdit->get_value_changed_from_saved())
@@ -817,6 +871,11 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl, weld::ComboBox&, void)
UpdateExample_Impl( true );
}
+IMPL_LINK_NOARG(SvxPageDescPage, GutterPositionHdl_Impl, weld::ComboBox&, void)
+{
+ UpdateExample_Impl(true);
+}
+
IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, weld::Widget&, void)
{
// tdf#124226 disconnect so not called again, unless Reset occurs
@@ -1022,10 +1081,20 @@ void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground )
m_aBspWin.SetSize( aSize );
// Margins
- m_aBspWin.SetTop( GetCoreValue( *m_xTopMarginEdit, MapUnit::MapTwip ) );
+ bool bGutterAtTop = m_xGutterPositionLB->get_active() == 1;
+ tools::Long nTop = GetCoreValue(*m_xTopMarginEdit, MapUnit::MapTwip);
+ if (bGutterAtTop)
+ {
+ nTop += GetCoreValue(*m_xGutterMarginEdit, MapUnit::MapTwip);
+ }
+ m_aBspWin.SetTop(nTop);
m_aBspWin.SetBottom( GetCoreValue( *m_xBottomMarginEdit, MapUnit::MapTwip ) );
- m_aBspWin.SetLeft(GetCoreValue(*m_xLeftMarginEdit, MapUnit::MapTwip)
- + GetCoreValue(*m_xGutterMarginEdit, MapUnit::MapTwip));
+ tools::Long nLeft = GetCoreValue(*m_xLeftMarginEdit, MapUnit::MapTwip);
+ if (!bGutterAtTop)
+ {
+ nLeft += GetCoreValue(*m_xGutterMarginEdit, MapUnit::MapTwip);
+ }
+ m_aBspWin.SetLeft(nLeft);
m_aBspWin.SetRight( GetCoreValue( *m_xRightMarginEdit, MapUnit::MapTwip ) );
// Layout
diff --git a/cui/uiconfig/ui/pageformatpage.ui b/cui/uiconfig/ui/pageformatpage.ui
index 1710c6c7a925..e7aa3f01f6e0 100644
--- a/cui/uiconfig/ui/pageformatpage.ui
+++ b/cui/uiconfig/ui/pageformatpage.ui
@@ -18,187 +18,30 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment2">
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="column_spacing">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<child>
<!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid2">
+ <object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="column_spacing">12</property>
+ <property name="row_spacing">3</property>
+ <property name="column_spacing">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid3">
+ <object class="GtkLabel" id="labelFormat">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="labelFormat">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelFormat">_Format:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboPageFormat</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboPageFormat">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelWidth">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelWidth">_Width:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinWidth</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinWidth">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">start</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelHeight">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelHeight">_Height:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinHeight</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinHeight">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">start</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelOrientation">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelOrientation">_Orientation:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">radiobuttonPortrait</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobuttonPortrait">
- <property name="label" translatable="yes" context="pageformatpage|radiobuttonPortrait">_Portrait</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="valign">center</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <accessibility>
- <relation type="member-of" target="labelOrientation"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobuttonLandscape">
- <property name="label" translatable="yes" context="pageformatpage|radiobuttonLandscape">L_andscape</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="valign">center</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobuttonPortrait</property>
- <accessibility>
- <relation type="member-of" target="labelOrientation"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelTextFlow">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes" context="pageformatpage|labelTextFlow">_Text direction:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboTextFlowBox</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboTextFlowBox">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="label" translatable="yes" context="pageformatpage|labelFormat">_Format:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboPageFormat</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -206,65 +49,207 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkComboBoxText" id="comboPageFormat">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
- <child>
- <object class="GtkDrawingArea" id="drawingareaPageDirection">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="vexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelPaperTray">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelPaperTray">Paper _tray:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboPaperTray</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboPaperTray">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="labelWidth">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelWidth">_Width:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinWidth</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinWidth">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelHeight">_Height:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinHeight</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelOrientation">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelOrientation">_Orientation:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radiobuttonPortrait</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radiobuttonPortrait">
+ <property name="label" translatable="yes" context="pageformatpage|radiobuttonPortrait">_Portrait</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="valign">center</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <accessibility>
+ <relation type="member-of" target="labelOrientation"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radiobuttonLandscape">
+ <property name="label" translatable="yes" context="pageformatpage|radiobuttonLandscape">L_andscape</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radiobuttonPortrait</property>
+ <accessibility>
+ <relation type="member-of" target="labelOrientation"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelTextFlow">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelTextFlow">_Text direction:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboTextFlowBox</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboTextFlowBox">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkDrawingArea" id="drawingareaPageDirection">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelPaperTray">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelPaperTray">Paper _tray:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboPaperTray</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboPaperTray">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
</object>
</child>
@@ -299,177 +284,170 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment4">
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="row_spacing">3</property>
+ <property name="column_spacing">6</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid6">
+ <object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">6</property>
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkBox" id="box3">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="labelLeftMargin">
<property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="labelLeftMargin">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelLeftMargin">Left:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargLeft</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelInner">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelInner">I_nner:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargLeft</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinMargLeft">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelLeftMargin">Left:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargLeft</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="box2">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="labelInner">
<property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="labelRightMargin">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelRightMargin">Right:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargRight</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelOuter">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelOuter">O_uter:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargRight</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinMargRight">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelInner">I_nner:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargLeft</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinMargLeft">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="labelTopMargin">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="labelRightMargin">
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelTopMargin">Top:</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelRightMargin">Right:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargTop</property>
+ <property name="mnemonic_widget">spinMargRight</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="spinMargTop">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelBottomMargin">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="labelOuter">
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelBottomMargin">Bottom:</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelOuter">O_uter:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargBot</property>
+ <property name="mnemonic_widget">spinMargRight</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinMargBot">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinMargRight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelTopMargin">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelTopMargin">Top:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargTop</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinMargTop">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelBottomMargin">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelBottomMargin">Bottom:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargBot</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinMargBot">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
</child>
<child>
<object class="GtkLabel" id="labelGutterMargin">
@@ -529,186 +507,204 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="alignment5">
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid7">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="row_spacing">3</property>
+ <property name="column_spacing">6</property>
<property name="hexpand">True</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid7">
+ <object class="GtkLabel" id="labelPageLayout">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="labelPageLayout">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelPageLayout">_Page layout:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboPageLayout</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelPageNumbers">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="pageformatpage|labelPageNumbers">Page numbers:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboLayoutFormat</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkRegisterTrue">
- <property name="label" translatable="yes" context="pageformatpage|checkRegisterTrue">Use page li_ne-spacing</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="tooltip_text" translatable="yes" context="pageformatpage|checkRegisterTrue" comments="xdds">Enables page line-spacing (register-true) using the selected Reference Style</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="checkRegisterTrue-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|checkRegisterTrue">If enabled, then all paragraph styles with the option page line-spacing activated will be affected, assuming the line spacing of the Reference Style. This will align them to an invisible vertical page grid, regardless of their font size, so that each line is the same height.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboPageLayout">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="pageformatpage|liststorePageLayout">Right and left</item>
- <item translatable="yes" context="pageformatpage|liststorePageLayout">Mirrored</item>
- <item translatable="yes" context="pageformatpage|liststorePageLayout">Only right</item>
- <item translatable="yes" context="pageformatpage|liststorePageLayout">Only left</item>
- </items>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboLayoutFormat">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelTblAlign">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes" context="pageformatpage|labelTblAlign">Table alignment:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">checkbuttonHorz</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbuttonHorz">
- <property name="label" translatable="yes" context="pageformatpage|checkbuttonHorz">Hori_zontal</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbuttonVert">
- <property name="label" translatable="yes" context="pageformatpage|checkbuttonVert">_Vertical</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkAdaptBox">
- <property name="label" translatable="yes" context="pageformatpage|checkAdaptBox">_Fit object to paper format</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelRegisterStyle">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes" context="pageformatpage|labelRegisterStyle">Reference _Style:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboRegisterStyle</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboRegisterStyle">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelPageLayout">_Page layout:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboPageLayout</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelPageNumbers">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelPageNumbers">Page numbers:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboLayoutFormat</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkRegisterTrue">
+ <property name="label" translatable="yes" context="pageformatpage|checkRegisterTrue">Use page li_ne-spacing</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="no_show_all">True</property>
+ <property name="tooltip_text" translatable="yes" context="pageformatpage|checkRegisterTrue" comments="xdds">Enables page line-spacing (register-true) using the selected Reference Style</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="checkRegisterTrue-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|checkRegisterTrue">If enabled, then all paragraph styles with the option page line-spacing activated will be affected, assuming the line spacing of the Reference Style. This will align them to an invisible vertical page grid, regardless of their font size, so that each line is the same height.</property>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
</child>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboPageLayout">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes" context="pageformatpage|liststorePageLayout">Right and left</item>
+ <item translatable="yes" context="pageformatpage|liststorePageLayout">Mirrored</item>
+ <item translatable="yes" context="pageformatpage|liststorePageLayout">Only right</item>
+ <item translatable="yes" context="pageformatpage|liststorePageLayout">Only left</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboLayoutFormat">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelTblAlign">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelTblAlign">Table alignment:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">checkbuttonHorz</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbuttonHorz">
+ <property name="label" translatable="yes" context="pageformatpage|checkbuttonHorz">Hori_zontal</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="no_show_all">True</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbuttonVert">
+ <property name="label" translatable="yes" context="pageformatpage|checkbuttonVert">_Vertical</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="no_show_all">True</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkAdaptBox">
+ <property name="label" translatable="yes" context="pageformatpage|checkAdaptBox">_Fit object to paper format</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="no_show_all">True</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelRegisterStyle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelRegisterStyle">Reference _Style:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboRegisterStyle</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboRegisterStyle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelGutterPosition">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="pageformatpage|labelGutterPosition">Gutter position:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">comboGutterPosition</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboGutterPosition">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes" context="pageformatpage|liststoreGutterPosition">Left</item>
+ <item translatable="yes" context="pageformatpage|liststoreGutterPosition">Top</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
</child>
</object>
</child>
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index be6a2ffbf1cc..66f08263ee55 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -974,6 +974,11 @@ void sw::DocumentSettingManager::dumpAsXml(xmlTextWriterPtr pWriter) const
BAD_CAST(OString::boolean(mbFrameAutowidthWithMorePara).getStr()));
xmlTextWriterEndElement(pWriter);
+ xmlTextWriterStartElement(pWriter, BAD_CAST("mbGutterAtTop"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+ BAD_CAST(OString::boolean(mbGutterAtTop).getStr()));
+ xmlTextWriterEndElement(pWriter);
+
xmlTextWriterEndElement(pWriter);
}
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 1f12447c90ee..fb16bd4a02d4 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -74,6 +74,7 @@
#include <paratr.hxx>
#include <tblafmt.hxx>
#include <sfx2/watermarkitem.hxx>
+#include <svl/grabbagitem.hxx>
#include <SwUndoFmt.hxx>
#include <strings.hrc>
#include <AccessibilityCheck.hxx>
@@ -611,6 +612,29 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, false ) , true, &pItem ) == SfxItemState::SET )
SwChartHelper::DoUpdateAllCharts( pDoc );
}
+
+ if (m_nFamily == SfxStyleFamily::Page)
+ {
+ const SfxPoolItem* pItem = nullptr;
+ if (aTmpSet.HasItem(SID_ATTR_CHAR_GRABBAG, &pItem))
+ {
+ const auto& rGrabBagItem = static_cast<const SfxGrabBagItem&>(*pItem);
+ bool bGutterAtTop{};
+ auto it = rGrabBagItem.GetGrabBag().find("GutterAtTop");
+ if (it != rGrabBagItem.GetGrabBag().end())
+ {
+ it->second >>= bGutterAtTop;
+ }
+ bool bOldGutterAtTop
+ = pDoc->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP);
+ if (bOldGutterAtTop != bGutterAtTop)
+ {
+ pDoc->getIDocumentSettingAccess().set(DocumentSettingId::GUTTER_AT_TOP,
+ bGutterAtTop);
+ pWrtShell->InvalidateLayout(/*bSizeChanged=*/true);
+ }
+ }
+ }
}
if(m_bNew)
@@ -874,6 +898,12 @@ void SwDocShell::Edit(
rSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
rSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST));
+
+ SfxGrabBagItem aGrabBag(SID_ATTR_CHAR_GRABBAG);
+ bool bGutterAtTop
+ = GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP);
+ aGrabBag.GetGrabBag()["GutterAtTop"] <<= bGutterAtTop;
+ rSet.Put(aGrabBag);
}
if (!bBasic)
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 9fb79c793a55..4ee4a2769b45 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -65,6 +65,7 @@
#include <svx/xfillit0.hxx>
#include <svx/xflftrit.hxx>
#include <svx/drawitem.hxx>
+#include <editeng/eeitem.hxx>
// The Format names in the list of all names have the
// following family as their first character:
@@ -481,6 +482,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument,
SID_SWREGISTER_MODE, SID_SWREGISTER_MODE,
SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR,
SID_ATTR_NUMBERING_RULE, SID_ATTR_NUMBERING_RULE,
+ SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG,
SID_ATTR_AUTO_STYLE_UPDATE, SID_ATTR_AUTO_STYLE_UPDATE,
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO,
FN_COND_COLL, FN_COND_COLL>{}),
commit 61ee52a13e57474d5440726d3375e73b4d226c80
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Feb 5 17:27:26 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 08:55:20 2021 +0200
tdf#91920 sw page gutter margin, from top: add RTF export
The documentation for \gutterprl is "Parallel gutter.", but it seems
that's what Word use to convert between RTF and DOCX's <w:gutterAtTop/>.
Change-Id: I06d80f234c6f52950db8a047bfc88910b808977d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110484
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx
index 1f96630cb4f8..b02395e45a5d 100644
--- a/include/svtools/rtfkeywd.hxx
+++ b/include/svtools/rtfkeywd.hxx
@@ -1223,5 +1223,6 @@
#define LO_STRING_SVTOOLS_RTF_SBAUTO "\\sbauto"
#define LO_STRING_SVTOOLS_RTF_SAAUTO "\\saauto"
#define LO_STRING_SVTOOLS_RTF_HTMAUTSP "\\htmautsp"
+#define LO_STRING_SVTOOLS_RTF_GUTTERPRL "\\gutterprl"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/rtfexport/data/gutter-top.rtf b/sw/qa/extras/rtfexport/data/gutter-top.rtf
new file mode 100644
index 000000000000..9c9a78ce2d03
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/gutter-top.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720\gutterprl
+\pard\plain Half inch gutter on the top\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 56b5c33139b1..9f91fe097686 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -400,6 +400,20 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterLeft)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
}
+CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
+{
+ load(mpTestDocumentPath, "gutter-top.rtf");
+ reload(mpFilter, "gutter-left.rtf");
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(
+ xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ bool bGutterAtTop{};
+ xSettings->getPropertyValue("GutterAtTop") >>= bGutterAtTop;
+ // Without the accompanying fix in place, this test would have failed, becase the gutter was
+ // at the left.
+ CPPUNIT_ASSERT(bGutterAtTop);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 7f4ceb97dd5f..616f28ab0aa7 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -726,6 +726,13 @@ ErrCode RtfExport::ExportDocument_Impl()
// Mirror margins?
if ((UseOnPage::Mirror & m_rDoc.GetPageDesc(0).ReadUseOn()) == UseOnPage::Mirror)
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGMIRROR);
+
+ // Gutter at top?
+ if (m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP))
+ {
+ Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_GUTTERPRL);
+ }
+
// Init sections
m_pSections = new MSWordSections(*this);
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index 8797a08442d8..30f97530a56c 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -1224,6 +1224,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_longerSpaceSequence,
new RTFValue(0));
break;
+ case RTF_GUTTERPRL:
+ m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_gutterAtTop, new RTFValue(1));
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle flag '" << keywordToString(nKeyword) << "'");
commit cf1bfa868ebd40ac4f7463bc1c8e94a33e7f74b4
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list