tdf#76349 writer: make 1column-as-page break a compatibility option
Unable to find/create a proof .doc document, so only implementing this for .docx Change-Id: I3a0cb2ddf7b3aeecc9200e595f70d8c88af4b122 Reviewed-on: https://gerrit.libreoffice.org/28501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
committed by
Michael Stahl
parent
1fe51b1982
commit
93d7fc90b5
@@ -52,6 +52,7 @@ enum class DocumentSettingId
|
||||
|
||||
IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
|
||||
DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
|
||||
TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
|
||||
DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
|
||||
OUTLINE_LEVEL_YIELDS_OUTLINE_RULE,
|
||||
|
||||
|
BIN
sw/qa/extras/odfimport/data/tdf76349_1columnBreak.odt
Normal file
BIN
sw/qa/extras/odfimport/data/tdf76349_1columnBreak.odt
Normal file
Binary file not shown.
@@ -637,6 +637,16 @@ DECLARE_ODFIMPORT_TEST(testTdf76322_columnBreakInHeader, "tdf76322_columnBreakIn
|
||||
CPPUNIT_ASSERT_EQUAL( OUString("Test1"), parseDump("/root/page[1]/header/section/column[2]/body/txt/text()") );
|
||||
}
|
||||
|
||||
DECLARE_ODFIMPORT_TEST(testTdf76349_1columnBreak, "tdf76349_1columnBreak.odt")
|
||||
{
|
||||
//single-column breaks should only be treated as page breaks for MS formats - should be only one page here.
|
||||
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
|
||||
uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
|
||||
xCursor->jumpToLastPage();
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
|
||||
}
|
||||
|
||||
DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt")
|
||||
{
|
||||
// Background of the formula frame was white (0xffffff), not green.
|
||||
|
@@ -81,6 +81,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
|
||||
mbClippedPictures(false),
|
||||
mbBackgroundParaOverDrawings(false),
|
||||
mbTabOverMargin(false),
|
||||
mbTreatSingleColumnBreakAsPageBreak(false),
|
||||
mbSurroundTextWrapSmall(false),
|
||||
mbPropLineSpacingShrinksFirstLine(true),
|
||||
mbSubtractFlys(false),
|
||||
@@ -175,6 +176,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
|
||||
case DocumentSettingId::CLIPPED_PICTURES: return mbClippedPictures;
|
||||
case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
|
||||
case DocumentSettingId::TAB_OVER_MARGIN: return mbTabOverMargin;
|
||||
case DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK: return mbTreatSingleColumnBreakAsPageBreak;
|
||||
case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
|
||||
case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine;
|
||||
case DocumentSettingId::SUBTRACT_FLYS: return mbSubtractFlys;
|
||||
@@ -339,6 +341,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
|
||||
mbTabOverMargin = value;
|
||||
break;
|
||||
|
||||
case DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
|
||||
mbTreatSingleColumnBreakAsPageBreak = value;
|
||||
break;
|
||||
|
||||
case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL:
|
||||
mbSurroundTextWrapSmall = value;
|
||||
break;
|
||||
|
@@ -147,6 +147,7 @@ class DocumentSettingManager :
|
||||
bool mbClippedPictures;
|
||||
bool mbBackgroundParaOverDrawings;
|
||||
bool mbTabOverMargin;
|
||||
bool mbTreatSingleColumnBreakAsPageBreak;
|
||||
bool mbSurroundTextWrapSmall;
|
||||
bool mbPropLineSpacingShrinksFirstLine; // fdo#79602
|
||||
bool mbSubtractFlys; // tdf#86578
|
||||
|
@@ -1135,10 +1135,12 @@ bool SwFlowFrame::IsPageBreak( bool bAct ) const
|
||||
}
|
||||
|
||||
//for compatibility, also break at column break if no columns exist
|
||||
const IDocumentSettingAccess& rIDSA = m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess();
|
||||
const bool bTreatSingleColumnBreakAsPageBreak = rIDSA.get(DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK);
|
||||
const SvxBreak eBreak = pSet->GetBreak().GetBreak();
|
||||
if ( eBreak == SvxBreak::PageBefore ||
|
||||
eBreak == SvxBreak::PageBoth ||
|
||||
(eBreak == SvxBreak::ColumnBefore && !m_rThis.FindColFrame()) )
|
||||
( bTreatSingleColumnBreakAsPageBreak && eBreak == SvxBreak::ColumnBefore && !m_rThis.FindColFrame() ))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
|
@@ -130,6 +130,7 @@ enum SwDocumentSettingsPropertyHandles
|
||||
HANDLE_EMBED_FONTS,
|
||||
HANDLE_EMBED_SYSTEM_FONTS,
|
||||
HANDLE_TAB_OVER_MARGIN,
|
||||
HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
|
||||
HANDLE_SURROUND_TEXT_WRAP_SMALL,
|
||||
HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
|
||||
HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
|
||||
@@ -205,6 +206,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
|
||||
{ OUString("EmbedFonts"), HANDLE_EMBED_FONTS, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("TreatSingleColumnBreakAsPageBreak"), HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0},
|
||||
{ OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0},
|
||||
@@ -817,6 +819,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
|
||||
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, bTmp);
|
||||
}
|
||||
break;
|
||||
case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
|
||||
{
|
||||
bool bTmp = *o3tl::doAccess<bool>(rValue);
|
||||
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, bTmp);
|
||||
}
|
||||
break;
|
||||
case HANDLE_SURROUND_TEXT_WRAP_SMALL:
|
||||
{
|
||||
bool bTmp = *o3tl::doAccess<bool>(rValue);
|
||||
@@ -1242,6 +1250,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TAB_OVER_MARGIN );
|
||||
}
|
||||
break;
|
||||
case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
|
||||
{
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK );
|
||||
}
|
||||
break;
|
||||
case HANDLE_SURROUND_TEXT_WRAP_SMALL:
|
||||
{
|
||||
rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::SURROUND_TEXT_WRAP_SMALL );
|
||||
|
@@ -291,6 +291,7 @@ void WriterFilter::setTargetDocument(const uno::Reference< lang::XComponent >& x
|
||||
xSettings->setPropertyValue("InvertBorderSpacing", uno::makeAny(true));
|
||||
xSettings->setPropertyValue("CollapseEmptyCellPara", uno::makeAny(true));
|
||||
xSettings->setPropertyValue("TabOverflow", uno::makeAny(true));
|
||||
xSettings->setPropertyValue("TreatSingleColumnBreakAsPageBreak", uno::makeAny(true));
|
||||
xSettings->setPropertyValue("UnbreakableNumberings", uno::makeAny(true));
|
||||
|
||||
xSettings->setPropertyValue("FloattableNomargins", uno::makeAny(true));
|
||||
|
Reference in New Issue
Block a user