diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-31 15:05:48 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-04-04 10:05:27 +0000 |
commit | 3e242e732e0aba170870098e4ce51d49f979eab9 (patch) | |
tree | 8fa7398898a530ff99658502fb07ac44a9efd113 | |
parent | f25eca3f230c170b46d7ce9f40842161a50b1883 (diff) |
tdf#98987 sw: add AddVerticalFrameOffsets compat mode
The situation is the following: we have a text frame, with at least two
anchored objects: one is wrapped not-wrap-through, the other is. In case
the non-wrap-though one shifts the text content of the text frame right or
down, then layout may or may not want to re-consider what is the top
left corner of the text frame for anchoring purposes.
Regarding the x position, sw layout repositioned the anchor point
depending on the AddFrameOffsets compat mode: it's enabled for documents
imported from Word, disabled otherwise. Regarding the y position, no
repositioning was done, however the bugdoc shows that Word does the same
repositioning on the vertical axis as well.
Add a new AddVerticalFrameOffsets compat mode that enables vertical
repositioning as well, and enable that mode for documents imported from
DOCX.
Also (squashed in, as the second commit partly undoes what the first one
did):
tdf#99004 SwAnchoredObjectPosition: handle textboxes when determining surround
Writer TextBoxes are always wrapped "through", so that they can appear
inside their shapes. However, the surround of the shape may influence
its position. So when surround is asked for anchor position purposes,
take the surround of the TextBox's "parent" shape instead of the one of
the TextBox directly.
With this, the textbox in the bugdoc is properly positioned inside its
parent shape as expected. (The problem only happens when at least two
shapes are anchored to the same paragraph.)
(cherry picked from commits 911261a3a581b9f2f4262f1d5403d9be3bbecf63,
f5e0236566b913aebb1376d97c7d37a23c69bd84,
50223ea6e212b60b7d33839c2753c5601fb50f95 and
cd1b2f923e0b0be89a5d1c8cbc647133aac09ed5)
Conflicts:
sw/qa/extras/uiwriter/uiwriter.cxx
sw/source/core/inc/anchoredobjectposition.hxx
sw/source/core/objectpositioning/anchoredobjectposition.cxx
sw/source/core/text/txtfrm.cxx
sw/source/uibase/uno/SwXDocumentSettings.cxx
Change-Id: Idc5cad7d86662008a92ff3bf5fbb3806aa2c7b07
Reviewed-on: https://gerrit.libreoffice.org/23739
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sw/inc/IDocumentSettingAccess.hxx | 1 | ||||
-rw-r--r-- | sw/inc/textboxhelper.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf98987.docx | bin | 0 -> 19509 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf99004.docx | bin | 0 -> 18435 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 36 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentSettingManager.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentSettingManager.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/inc/anchoredobjectposition.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/objectpositioning/anchoredobjectposition.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 13 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilter.cxx | 1 |
15 files changed, 119 insertions, 7 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 73a5d547a993..96a4d363a846 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -37,6 +37,7 @@ enum class DocumentSettingId TAB_COMPAT, ADD_FLY_OFFSETS, + ADD_VERTICAL_FLY_OFFSETS, OLD_NUMBERING, diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx index f4fb97a3dc6d..6f597860c731 100644 --- a/sw/inc/textboxhelper.hxx +++ b/sw/inc/textboxhelper.hxx @@ -87,6 +87,8 @@ public: static css::uno::Any getByIndex(SdrPage* pPage, sal_Int32 nIndex, std::set<const SwFrameFormat*>& rTextBoxes) throw(css::lang::IndexOutOfBoundsException); /// Get the order of the shape, excluding TextBoxes. static sal_Int32 getOrdNum(const SdrObject* pObject, std::set<const SwFrameFormat*>& rTextBoxes); + /// If pTextBox is a textbox, then set rWrapThrough to the surround of its shape. + static void getShapeWrapThrough(const SwFrameFormat* pTextBox, bool& rWrapThrough); /// Saves the current shape -> textbox links in a map, so they can be restored later. static void saveLinks(const SwFrameFormats& rFormats, std::map<const SwFrameFormat*, const SwFrameFormat*>& rLinks); diff --git a/sw/qa/extras/uiwriter/data/tdf98987.docx b/sw/qa/extras/uiwriter/data/tdf98987.docx Binary files differnew file mode 100644 index 000000000000..3b24e341d41d --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf98987.docx diff --git a/sw/qa/extras/uiwriter/data/tdf99004.docx b/sw/qa/extras/uiwriter/data/tdf99004.docx Binary files differnew file mode 100644 index 000000000000..ef864407effc --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf99004.docx diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index e386bcb4ff12..f727c215a2b8 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -107,6 +107,8 @@ public: void testTdf96479(); void testTdf88453(); void testTdf88453Table(); + void testTdf98987(); + void testTdf99004(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -152,6 +154,8 @@ public: CPPUNIT_TEST(testTdf96479); CPPUNIT_TEST(testTdf88453); CPPUNIT_TEST(testTdf88453Table); + CPPUNIT_TEST(testTdf98987); + CPPUNIT_TEST(testTdf99004); CPPUNIT_TEST_SUITE_END(); private: @@ -1269,6 +1273,38 @@ void SwUiWriterTest::testTdf88453Table() CPPUNIT_ASSERT_EQUAL(3, getPages()); } +void SwUiWriterTest::testTdf98987() +{ + createDoc("tdf98987.docx"); + calcLayout(); + xmlDocPtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/sdrObject", "name", "Rectangle 1"); + sal_Int32 nRectangle1 = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/sdrObject", "name", "Rectangle 2"); + sal_Int32 nRectangle2 = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds", "top").toInt32(); + CPPUNIT_ASSERT(nRectangle1 < nRectangle2); + + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/sdrObject", "name", "Rectangle 3"); + sal_Int32 nRectangle3 = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); + // This failed: the 3rd rectangle had a smaller "top" value than the 2nd one, it even overlapped with the 1st one. + CPPUNIT_ASSERT(nRectangle2 < nRectangle3); +} + +void SwUiWriterTest::testTdf99004() +{ + createDoc("tdf99004.docx"); + calcLayout(); + xmlDocPtr pXmlDoc = parseLayoutDump(); + sal_Int32 nTextbox1Top = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "top").toInt32(); + sal_Int32 nTextBox1Height = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32(); + sal_Int32 nTextBox1Bottom = nTextbox1Top + nTextBox1Height; + + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/sdrObject", "name", "Rectangle 2"); + sal_Int32 nRectangle2Top = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds", "top").toInt32(); + // This was 3291 and 2531, should be now around 2472 and 2531, i.e. the two rectangles should not overlap anymore. + CPPUNIT_ASSERT(nTextBox1Bottom < nRectangle2Top); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 6970d1f8044e..02b927a55e3e 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -53,6 +53,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) // COMPATIBILITY FLAGS START mbAddFlyOffsets(false), + mbAddVerticalFlyOffsets(false), mbUseHiResolutionVirtualDevice(true), mbMathBaselineAlignment(false), // default for *old* documents is 'off' mbStylesNoDefault(false), @@ -125,6 +126,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES: return mbParaSpaceMaxAtPages; //(n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES); case DocumentSettingId::TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT); case DocumentSettingId::ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS); + case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS: return mbAddVerticalFlyOffsets; case DocumentSettingId::ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING); case DocumentSettingId::USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE); case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV); @@ -196,6 +198,9 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo case DocumentSettingId::ADD_FLY_OFFSETS: mbAddFlyOffsets = value; break; + case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS: + mbAddVerticalFlyOffsets = value; + break; case DocumentSettingId::ADD_EXT_LEADING: mbAddExternalLeading = value; break; diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 57c64f107b26..e50c2385477b 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -27,6 +27,7 @@ #include <mvsave.hxx> #include <sortedobjs.hxx> #include <cntfrm.hxx> +#include <fmtsrnd.hxx> #include <editeng/unoprnms.hxx> #include <editeng/charrotateitem.hxx> @@ -264,6 +265,15 @@ sal_Int32 SwTextBoxHelper::getOrdNum(const SdrObject* pObject, std::set<const Sw return pObject->GetOrdNum(); } +void SwTextBoxHelper::getShapeWrapThrough(const SwFrameFormat* pTextBox, bool& rWrapThrough) +{ + std::map<SwFrameFormat*, SwFrameFormat*> aMap = findShapes(pTextBox->GetDoc()); + std::map<SwFrameFormat*, SwFrameFormat*>::iterator it = aMap.find(const_cast<SwFrameFormat*>(pTextBox)); + if (it != aMap.end()) + // pTextBox is indeed a TextBox, it->second is its shape. + rWrapThrough = it->second->GetSurround().GetSurround() == SURROUND_THROUGHT; +} + SwFrameFormat* SwTextBoxHelper::findTextBox(uno::Reference<drawing::XShape> xShape) { SwXShape* pShape = dynamic_cast<SwXShape*>(xShape.get()); diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx index 9ff978c40b04..c83d6d86e619 100644 --- a/sw/source/core/inc/DocumentSettingManager.hxx +++ b/sw/source/core/inc/DocumentSettingManager.hxx @@ -108,6 +108,7 @@ class DocumentSettingManager : bool mbTabCompat : 1; bool mbUseVirtualDevice : 1; bool mbAddFlyOffsets : 1; + bool mbAddVerticalFlyOffsets : 1; bool mbAddExternalLeading : 1; bool mbUseHiResolutionVirtualDevice : 1; bool mbOldLineSpacing : 1; // #i11859# diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx index ec9617aa769a..0be1facae9df 100644 --- a/sw/source/core/inc/anchoredobjectposition.hxx +++ b/sw/source/core/inc/anchoredobjectposition.hxx @@ -126,9 +126,9 @@ namespace objectpositioning #i11860# */ - static SwTwips _GetTopForObjPos( const SwFrm& _rFrm, + SwTwips _GetTopForObjPos( const SwFrm& _rFrm, const SwRectFn& _fnRect, - const bool _bVert ); + const bool _bVert ) const; void _GetVertAlignmentValues( const SwFrm& _rVertOrientFrm, const SwFrm& _rPageAlignLayFrm, diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 824480ac454b..690d92406816 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -68,6 +68,8 @@ class SwTextFrm: public SwContentFrm SwTwips mnFlyAnchorOfst; // The x position for wrap-through flys anchored at this paragraph. SwTwips mnFlyAnchorOfstNoWrap; + /// The y position for wrap-through flys anchored at this paragraph. + SwTwips mnFlyAnchorVertOfstNoWrap; SwTwips mnFootnoteLine; // OD 2004-03-17 #i11860# - re-factoring of #i11859# // member for height of last line (value needed for proportional line spacing) @@ -642,6 +644,8 @@ public: mnFlyAnchorOfstNoWrap ); } + SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const; + inline SwTwips GetHeightOfLastLine() const { return mnHeightOfLastLine; diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index ee354ce558e6..aed0003a96f2 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -37,6 +37,7 @@ #include <ndtxt.hxx> #include <IDocumentSettingAccess.hxx> #include <textboxhelper.hxx> +#include <fmtsrnd.hxx> using namespace ::com::sun::star; using namespace objectpositioning; @@ -156,7 +157,7 @@ SwTwips SwAnchoredObjectPosition::ToCharTopOfLine() const */ SwTwips SwAnchoredObjectPosition::_GetTopForObjPos( const SwFrm& _rFrm, const SwRectFn& _fnRect, - const bool _bVert ) + const bool _bVert ) const { SwTwips nTopOfFrmForObjPos = (_rFrm.Frm().*_fnRect->fnGetTop)(); @@ -172,6 +173,17 @@ SwTwips SwAnchoredObjectPosition::_GetTopForObjPos( const SwFrm& _rFrm, { nTopOfFrmForObjPos += rTextFrm.GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + + const SwFormatSurround& rSurround = mpFrameFormat->GetSurround(); + bool bWrapThrough = rSurround.GetSurround() == SURROUND_THROUGHT; + // If the frame format is a TextBox of a draw shape, then use the + // surround of the original shape. + SwTextBoxHelper::getShapeWrapThrough(mpFrameFormat, bWrapThrough); + + // Get the offset between the top of the text frame and the top of + // the first line inside the frame that has more than just fly + // portions. + nTopOfFrmForObjPos += rTextFrm.GetBaseVertOffsetForFly(!bWrapThrough); } } @@ -685,10 +697,12 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie { nWidth = (_rHoriOrientFrm.Frm().*fnRect->fnGetWidth)(); - // When positioning TextBoxes, always ignore flys anchored at the - // text frame, as we do want to have the textbox overlap with its - // draw shape. - bool bIgnoreFlysAnchoredAtFrame = !_bObjWrapThrough || SwTextBoxHelper::isTextBox(&GetObject()); + bool bWrapThrough = _bObjWrapThrough; + // If the frame format is a TextBox of a draw shape, then use the + // surround of the original shape. + SwTextBoxHelper::getShapeWrapThrough(mpFrameFormat, bWrapThrough); + + bool bIgnoreFlysAnchoredAtFrame = !bWrapThrough; nOffset = _rHoriOrientFrm.IsTextFrm() ? static_cast<const SwTextFrm&>(_rHoriOrientFrm).GetBaseOfstForFly( bIgnoreFlysAnchoredAtFrame ) : 0; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index a4a707f9133a..8705945f3cf9 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -355,6 +355,7 @@ SwTextFrm::SwTextFrm(SwTextNode * const pNode, SwFrm* pSib ) , nThisLines( 0 ) , mnFlyAnchorOfst( 0 ) , mnFlyAnchorOfstNoWrap( 0 ) + , mnFlyAnchorVertOfstNoWrap( 0 ) , mnFootnoteLine( 0 ) , mnHeightOfLastLine( 0 ) // OD 2004-03-17 #i11860# , mnAdditionalFirstLineOffset( 0 ) @@ -2657,6 +2658,7 @@ void SwTextFrm::CalcBaseOfstForFly() // Get first 'real' line and adjust position and height of line rectangle // OD 08.09.2003 #110978#, #108749#, #110354# - correct behaviour, // if no 'real' line exists (empty paragraph with and without a dummy portion) + SwTwips nFlyAnchorVertOfstNoWrap = 0; { SwTwips nTop = (aFlyRect.*fnRect->fnGetTop)(); const SwLineLayout* pLay = GetPara(); @@ -2664,6 +2666,7 @@ void SwTextFrm::CalcBaseOfstForFly() while( pLay && pLay->IsDummy() && pLay->GetNext() ) { nTop += pLay->Height(); + nFlyAnchorVertOfstNoWrap += pLay->Height(); pLay = pLay->GetNext(); } if ( pLay ) @@ -2690,6 +2693,16 @@ void SwTextFrm::CalcBaseOfstForFly() mnFlyAnchorOfst = nRet1 - nLeft; mnFlyAnchorOfstNoWrap = nRet2 - nLeft; + + if (!pNode->getIDocumentSettingAccess()->get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS)) + return; + + mnFlyAnchorVertOfstNoWrap = nFlyAnchorVertOfstNoWrap; +} + +SwTwips SwTextFrm::GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const +{ + return bIgnoreFlysAnchoredAtThisFrame ? 0 : mnFlyAnchorVertOfstNoWrap; } /** diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 951b415ff565..06d7044fa563 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -22,6 +22,7 @@ #include <anchoredobject.hxx> #include <libxml/xmlwriter.h> #include <SwPortionHandler.hxx> +#include <svx/svdobj.hxx> class XmlPortionDumper:public SwPortionHandler { @@ -360,6 +361,14 @@ void SwFrm::dumpInfosAsXml( xmlTextWriterPtr writer ) const xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", Frm().Width() ); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", Frm().Height() ); xmlTextWriterEndElement( writer ); + + // output the Prt + xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", Prt().Left() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", Prt().Top() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", Prt().Width() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", Prt().Height() ); + xmlTextWriterEndElement( writer ); } // Hack: somehow conversion from "..." to va_list does @@ -419,6 +428,9 @@ void SwAnchoredObject::dumpAsXml( xmlTextWriterPtr writer ) const xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", GetObjBoundRect().Height() ); xmlTextWriterEndElement( writer ); + if (const SdrObject* pObject = GetDrawObj()) + pObject->dumpAsXml(writer); + xmlTextWriterEndElement( writer ); if ( bCreateWriter ) diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 7d513d4767f5..a6e454ef7be4 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -85,6 +85,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_PRINTER_INDEPENDENT_LAYOUT, HANDLE_IS_LABEL_DOC, HANDLE_IS_ADD_FLY_OFFSET, + HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, HANDLE_IS_ADD_EXTERNAL_LEADING, HANDLE_OLD_NUMBERING, // #111955# HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, @@ -159,6 +160,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() { OUString("PrinterIndependentLayout"), HANDLE_PRINTER_INDEPENDENT_LAYOUT, cppu::UnoType<sal_Int16>::get(), 0, 0}, { OUString("IsLabelDocument"), HANDLE_IS_LABEL_DOC, cppu::UnoType<bool>::get(), 0, 0}, { OUString("AddFrameOffsets"), HANDLE_IS_ADD_FLY_OFFSET, cppu::UnoType<bool>::get(), 0, 0}, + { OUString("AddVerticalFrameOffsets"), HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, cppu::UnoType<bool>::get(), 0, 0}, { OUString("AddExternalLeading"), HANDLE_IS_ADD_EXTERNAL_LEADING, cppu::UnoType<bool>::get(), 0, 0}, { OUString("UseOldNumbering"), HANDLE_OLD_NUMBERING, cppu::UnoType<bool>::get(), 0, 0}, // #111955# { OUString("OutlineLevelYieldsNumbering"), HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, cppu::UnoType<bool>::get(), 0, 0}, @@ -554,6 +556,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_FLY_OFFSETS, bTmp); } break; + case HANDLE_IS_ADD_VERTICAL_FLY_OFFSET: + { + bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue()); + mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS, bTmp); + } + break; case HANDLE_IS_ADD_EXTERNAL_LEADING: { bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue()); @@ -1024,6 +1032,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_FLY_OFFSETS); } break; + case HANDLE_IS_ADD_VERTICAL_FLY_OFFSET: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS); + } + break; case HANDLE_IS_ADD_EXTERNAL_LEADING: { rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_EXT_LEADING); diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 546b852f8060..4dffb4ca64e6 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -288,6 +288,7 @@ void WriterFilter::setTargetDocument(const uno::Reference< lang::XComponent >& x uno::Reference< beans::XPropertySet > xSettings(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); xSettings->setPropertyValue("AddFrameOffsets", uno::makeAny(sal_True)); + xSettings->setPropertyValue("AddVerticalFrameOffsets", uno::makeAny(sal_True)); xSettings->setPropertyValue("UseOldNumbering", uno::makeAny(sal_False)); xSettings->setPropertyValue("IgnoreFirstLineIndentInNumbering", uno::makeAny(sal_False)); xSettings->setPropertyValue("DoNotResetParaAttrsForNumFont", uno::makeAny(sal_False)); |