summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/IDocumentSettingAccess.hxx1
-rw-r--r--sw/qa/extras/odfexport/data/tdf104596_breakingExample.odtbin64455 -> 0 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx6
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135595_HFtableWrap_c12.docxbin0 -> 74051 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx9
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx13
-rw-r--r--sw/source/core/inc/DocumentSettingManager.hxx1
-rw-r--r--sw/source/core/text/txtfly.cxx8
-rw-r--r--sw/source/filter/xml/xmlimp.cxx6
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx17
10 files changed, 16 insertions, 45 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 2f514bdcc62d..2ae267d08fe0 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -49,7 +49,6 @@ enum class DocumentSettingId
ADD_PARA_SPACING_TO_TABLE_CELLS,
USE_FORMER_OBJECT_POS,
USE_FORMER_TEXT_WRAPPING,
- ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, // change LO to match MS allowing wrapping around fly-frames anchored in tables in header & footnote
CONSIDER_WRAP_ON_OBJECT_POSITION,
IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
diff --git a/sw/qa/extras/odfexport/data/tdf104596_breakingExample.odt b/sw/qa/extras/odfexport/data/tdf104596_breakingExample.odt
deleted file mode 100644
index 19d0e85c42b7..000000000000
--- a/sw/qa/extras/odfexport/data/tdf104596_breakingExample.odt
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 715d9ad68d35..cb131ece62de 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -466,12 +466,6 @@ DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
-DECLARE_ODFEXPORT_TEST(testTdf104596_breakingExample, "tdf104596_breakingExample.odt")
-{
- //wrapping should be ignored on in-table flies for pre-LO7.1 documents. ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Fits on one page", 1, getPages() );
-}
-
DECLARE_ODFEXPORT_TEST(testTdf131621, "tdf131621.ott")
{
CPPUNIT_ASSERT_EQUAL(12, getShapes());
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135595_HFtableWrap_c12.docx b/sw/qa/extras/ooxmlexport/data/tdf135595_HFtableWrap_c12.docx
new file mode 100644
index 000000000000..00c1353d984d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135595_HFtableWrap_c12.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 01f0726f5296..e68dde7499e7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -111,6 +111,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap, "tdf135595_HFtableWrap.odt")
CPPUNIT_ASSERT_MESSAGE("Image must be contained inside the table cell", nRowHeight > 2000);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap_c12, "tdf135595_HFtableWrap_c12.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ // tdf#104596: ignore wrap exception apparently does not apply if it is not "layout in table cell".
+ // Should be only one page. Row height should be two lines at 722, not wrapped to three lines at 998.
+ sal_Int32 nRowHeight = getXPath(pXmlDoc, "//header/tab/row/infos/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_MESSAGE("Text must not wrap around header image", nRowHeight < 800);
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf123622, "tdf123622.docx")
{
uno::Reference<beans::XPropertySet> XPropsRight(getShape(1),uno::UNO_QUERY);
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 843b6067f3c6..6c3ee2e54150 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -98,8 +98,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbProtectBookmarks(false),
mbProtectFields(false),
mbHeaderSpacingBelowLastPara(false),
- mbFrameAutowidthWithMorePara(false),
- mbAllowWrapWhenAnchoredInTable(true) //tdf#104596
+ mbFrameAutowidthWithMorePara(false)
// COMPATIBILITY FLAGS END
{
@@ -229,7 +228,6 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
case DocumentSettingId::PROTECT_FIELDS: return mbProtectFields;
case DocumentSettingId::HEADER_SPACING_BELOW_LAST_PARA: return mbHeaderSpacingBelowLastPara;
case DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA: return mbFrameAutowidthWithMorePara;
- case DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE: return mbAllowWrapWhenAnchoredInTable;
default:
OSL_FAIL("Invalid setting id");
}
@@ -481,9 +479,6 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
case DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA:
mbFrameAutowidthWithMorePara = value;
break;
- case DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE:
- mbAllowWrapWhenAnchoredInTable = value;
- break;
default:
OSL_FAIL("Invalid setting id");
}
@@ -657,7 +652,6 @@ void sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSetti
// No mbProtectFields: this is false by default everywhere
mbHeaderSpacingBelowLastPara = rSource.mbHeaderSpacingBelowLastPara;
mbFrameAutowidthWithMorePara = rSource.mbFrameAutowidthWithMorePara;
- mbAllowWrapWhenAnchoredInTable = rSource.mbAllowWrapWhenAnchoredInTable;
}
sal_uInt32 sw::DocumentSettingManager::Getn32DummyCompatibilityOptions1() const
@@ -963,11 +957,6 @@ void sw::DocumentSettingManager::dumpAsXml(xmlTextWriterPtr pWriter) const
BAD_CAST(OString::boolean(mbFrameAutowidthWithMorePara).getStr()));
xmlTextWriterEndElement(pWriter);
- xmlTextWriterStartElement(pWriter, BAD_CAST("mbAllowWrapWhenAnchoredInTable"));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
- BAD_CAST(OString::boolean(mbAllowWrapWhenAnchoredInTable).getStr()));
- xmlTextWriterEndElement(pWriter);
-
xmlTextWriterEndElement(pWriter);
}
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index c8caa5081980..867e55f628f7 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -167,7 +167,6 @@ class DocumentSettingManager :
bool mbProtectFields;
bool mbHeaderSpacingBelowLastPara;
bool mbFrameAutowidthWithMorePara; //tdf#124423
- bool mbAllowWrapWhenAnchoredInTable;
public:
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index bb85fb4e085c..8556869c8726 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -43,6 +43,7 @@
#include <fmtsrnd.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
+#include <fmtfollowtextflow.hxx>
#include <pagedesc.hxx>
#include <sortedobjs.hxx>
#include <IDocumentDrawModelAccess.hxx>
@@ -839,8 +840,9 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
const bool bFooterHeader = nullptr != m_pCurrFrame->FindFooterOrHeader();
const IDocumentSettingAccess* pIDSA = &m_pCurrFrame->GetDoc().getIDocumentSettingAccess();
// #i40155# - check, if frame is marked not to wrap
+ const bool bAllowCompatWrap = m_pCurrFrame->IsInTab() && (bFooterHeader || m_pCurrFrame->IsInFootnote());
const bool bWrapAllowed = ( pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) ||
- (pIDSA->get(DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE) && m_pCurrFrame->IsInTab()) ||
+ bAllowCompatWrap ||
(!m_pCurrFrame->IsInFootnote() && !bFooterHeader));
m_bOn = false;
@@ -887,7 +889,9 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
!rIDDMA.IsVisibleLayerId( pAnchoredObj->GetDrawObj()->GetLayer() ) ||
!pAnchoredObj->ConsiderForTextWrap() ||
( mbIgnoreObjsInHeaderFooter && !bFooterHeader &&
- pAnchoredObj->GetAnchorFrame()->FindFooterOrHeader() ) )
+ pAnchoredObj->GetAnchorFrame()->FindFooterOrHeader() ) ||
+ ( bAllowCompatWrap && !pAnchoredObj->GetFrameFormat().GetFollowTextFlow().GetValue() )
+ )
{
continue;
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 3dd6ab11be76..c03a46d20545 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1358,7 +1358,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bPropLineSpacingShrinksFirstLine = false;
bool bSubtractFlysAnchoredAtFlys = false;
bool bCollapseEmptyCellPara = false;
- bool bIsSetAllowWrapWhenAnchoredInTable = false;
const PropertyValue* currentDatabaseDataSource = nullptr;
const PropertyValue* currentDatabaseCommand = nullptr;
@@ -1455,8 +1454,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bSubtractFlysAnchoredAtFlys = true;
else if (rValue.Name == "CollapseEmptyCellPara")
bCollapseEmptyCellPara = true;
- else if ( rValue.Name == "AllowWrapWhenAnchoredInTable" )
- bIsSetAllowWrapWhenAnchoredInTable = true;
}
catch( Exception& )
{
@@ -1627,9 +1624,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if (!bCollapseEmptyCellPara)
xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false));
- if (!bIsSetAllowWrapWhenAnchoredInTable)
- xProps->setPropertyValue("AllowWrapWhenAnchoredInTable", makeAny(false));
-
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
if( pPrinter )
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 3d103db1347c..9af674558e86 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -145,7 +145,6 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_PROTECT_FIELDS,
HANDLE_HEADER_SPACING_BELOW_LAST_PARA,
HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA,
- HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE,
};
}
@@ -238,7 +237,6 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("ProtectFields"), HANDLE_PROTECT_FIELDS, cppu::UnoType<bool>::get(), 0 },
{ OUString("HeaderSpacingBelowLastPara"), HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType<bool>::get(), 0 },
{ OUString("FrameAutowidthWithMorePara"), HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, cppu::UnoType<bool>::get(), 0 },
- { OUString("AllowWrapWhenAnchoredInTable"), HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, cppu::UnoType<bool>::get(), 0 },
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -994,15 +992,6 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
- case HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE:
- {
- bool bTmp;
- if (rValue >>= bTmp)
- {
- mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, bTmp);
- }
- }
- break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}
@@ -1494,12 +1483,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA);
}
break;
- case HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE:
- {
- rValue <<= mpDoc->getIDocumentSettingAccess().get(
- DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE);
- }
- break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}