sw/inc/fmtfollowtextflow.hxx | 22 +++ sw/inc/unomid.h | 4 sw/inc/unoprnms.hxx | 1 sw/qa/extras/layout/data/tdf115094.docx |binary sw/qa/extras/layout/layout.cxx | 29 +++++ sw/qa/extras/ooxmlimport/data/tdf115094v2.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 8 + sw/source/core/attr/fmtfollowtextflow.cxx | 58 ++++++++++ sw/source/core/inc/anchoredobjectposition.hxx | 5 sw/source/core/inc/environmentofanchoredobject.hxx | 7 + sw/source/core/objectpositioning/anchoredobjectposition.cxx | 1 sw/source/core/objectpositioning/environmentofanchoredobject.cxx | 6 - sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx | 2 sw/source/core/unocore/unoframe.cxx | 17 ++ sw/source/core/unocore/unomap.cxx | 3 sw/source/core/unocore/unomap1.cxx | 3 sw/source/core/unocore/unomapproperties.hxx | 3 sw/source/uibase/utlui/attrdesc.cxx | 1 writerfilter/source/dmapper/GraphicImport.cxx | 5 writerfilter/source/dmapper/PropertyIds.cxx | 1 writerfilter/source/dmapper/PropertyIds.hxx | 1 21 files changed, 166 insertions(+), 11 deletions(-)
New commits: commit c3c80b6b63e998fd3117b5039e65a2ee9df90954 Author: Patrick Jaap <patrick.j...@tu-dresden.de> AuthorDate: Wed Nov 14 16:25:45 2018 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Dec 10 14:20:43 2018 +0100 tdf#115094 Part II: OOXML Feature: Add layoutInCell to Doc model Change-Id: I50dcc2363982f8e6b68f10b0b724b59e9430d6c5 Reviewed-on: https://gerrit.libreoffice.org/63380 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx index 6cbc6dfe39e9..ff3aa9f9b32b 100644 --- a/sw/inc/fmtfollowtextflow.hxx +++ b/sw/inc/fmtfollowtextflow.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_SW_INC_FMTFOLLOWTEXTFLOW_HXX #define INCLUDED_SW_INC_FMTFOLLOWTEXTFLOW_HXX +#include <sal/log.hxx> #include <svl/eitem.hxx> #include "hintids.hxx" #include "format.hxx" @@ -28,9 +29,19 @@ class IntlWrapper; class SW_DLLPUBLIC SwFormatFollowTextFlow : public SfxBoolItem { +private: + bool mbLayoutInCell = false; + public: + SwFormatFollowTextFlow( bool bFlag = false ) - : SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag ) {} + : SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag ) + {} + + SwFormatFollowTextFlow( bool bFlag, bool _bLayoutInCell ) + : SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag ) + , mbLayoutInCell( _bLayoutInCell ) + {} /// "pure virtual methods" of SfxPoolItem @@ -41,7 +52,16 @@ public: OUString &rText, const IntlWrapper& rIntl ) const override; + bool GetLayoutInCell() const { return mbLayoutInCell; } + + + bool PutValue(const css::uno::Any& rVal, sal_uInt8 aInt) override; + + bool QueryValue(css::uno::Any& rVal, sal_uInt8 aInt = 0) const override; + void dumpAsXml(struct _xmlTextWriter* pWriter) const override; + + bool operator==(const SfxPoolItem& rItem) const override; }; inline const SwFormatFollowTextFlow &SwAttrSet::GetFollowTextFlow(bool bInP) const diff --git a/sw/inc/unomid.h b/sw/inc/unomid.h index 020da9d7e08e..06e84c99acb1 100644 --- a/sw/inc/unomid.h +++ b/sw/inc/unomid.h @@ -147,6 +147,10 @@ // SwFormatWrapInfluenceOnObjPos #define MID_WRAP_INFLUENCE 0 +// SwFormatFollowTextFlow +#define MID_FOLLOW_TEXT_FLOW 0 +#define MID_FTF_LAYOUT_IN_CELL 1 + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index a168bbc38498..3e0383961b7a 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -743,6 +743,7 @@ #define UNO_NAME_IS_SPLIT_ALLOWED "IsSplitAllowed" #define UNO_NAME_CHAR_HIDDEN "CharHidden" #define UNO_NAME_IS_FOLLOWING_TEXT_FLOW "IsFollowingTextFlow" +#define UNO_NAME_IS_LAYOUT_IN_CELL "IsLayoutInCell" #define UNO_NAME_WIDTH_TYPE "WidthType" #define UNO_NAME_SCRIPT_URL "ScriptURL" #define UNO_NAME_RUNTIME_UID "RuntimeUID" diff --git a/sw/qa/extras/layout/data/tdf115094.docx b/sw/qa/extras/layout/data/tdf115094.docx new file mode 100644 index 000000000000..49a7c9194f1a Binary files /dev/null and b/sw/qa/extras/layout/data/tdf115094.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 2fea76b5399a..633a31f3b30b 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -63,6 +63,7 @@ public: void testTdf120287b(); void testTdf120287c(); void testTdf116989(); + void testTdf115094(); CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST(testRedlineFootnotes); @@ -98,6 +99,7 @@ public: CPPUNIT_TEST(testTdf120287b); CPPUNIT_TEST(testTdf120287c); CPPUNIT_TEST(testTdf116989); + CPPUNIT_TEST(testTdf115094); CPPUNIT_TEST_SUITE_END(); private: @@ -2632,6 +2634,33 @@ void SwLayoutWriter::testTdf116989() } } +void SwLayoutWriter::testTdf115094() +{ + createDoc("tdf115094.docx"); + xmlDocPtr pXmlDoc = parseLayoutDump(); + + sal_Int32 nTopOfD1 + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/infos/bounds", + "top") + .toInt32(); + sal_Int32 nTopOfD1Anchored = getXPath(pXmlDoc, + "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/" + "txt[2]/anchored/fly/infos/bounds", + "top") + .toInt32(); + CPPUNIT_ASSERT_LESS(nTopOfD1Anchored, nTopOfD1); + sal_Int32 nTopOfB2 + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/infos/bounds", + "top") + .toInt32(); + sal_Int32 nTopOfB2Anchored = getXPath(pXmlDoc, + "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/" + "txt[1]/anchored/fly/infos/bounds", + "top") + .toInt32(); + CPPUNIT_ASSERT_LESS(nTopOfB2Anchored, nTopOfB2); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlimport/data/tdf115094v2.docx b/sw/qa/extras/ooxmlimport/data/tdf115094v2.docx new file mode 100644 index 000000000000..49a7c9194f1a Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf115094v2.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 877a645da288..2882d9ff0778 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -269,6 +269,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf115094, "tdf115094.docx") CPPUNIT_ASSERT_EQUAL(xText1.get(), xText2.get()); } +DECLARE_OOXMLIMPORT_TEST(testTdf115094v2, "tdf115094v2.docx") +{ + // Introduce new attribute "layoutInCell" + + CPPUNIT_ASSERT(getProperty<bool>(getShapeByName("Grafik 18"), "IsLayoutInCell")); + CPPUNIT_ASSERT(getProperty<bool>(getShapeByName("Grafik 19"), "IsLayoutInCell")); +} + // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/attr/fmtfollowtextflow.cxx b/sw/source/core/attr/fmtfollowtextflow.cxx index b30df30e6e45..f8247d60f925 100644 --- a/sw/source/core/attr/fmtfollowtextflow.cxx +++ b/sw/source/core/attr/fmtfollowtextflow.cxx @@ -18,6 +18,8 @@ */ #include <fmtfollowtextflow.hxx> +#include <unomid.h> + SfxPoolItem* SwFormatFollowTextFlow::Clone( SfxItemPool * ) const @@ -25,4 +27,60 @@ SfxPoolItem* SwFormatFollowTextFlow::Clone( SfxItemPool * ) const return new SwFormatFollowTextFlow(*this); } + +bool SwFormatFollowTextFlow::PutValue(const css::uno::Any& rVal, sal_uInt8 aInt) +{ + switch( aInt ) + { + case MID_FOLLOW_TEXT_FLOW : + { + bool bTheValue = bool(); + if (rVal >>= bTheValue) + { + SetValue( bTheValue ); + return true; + } + break; + } + case MID_FTF_LAYOUT_IN_CELL : + { + bool bTheValue = bool(); + if (rVal >>= bTheValue) + { + mbLayoutInCell = bTheValue; + return true; + } + break; + } + } + SAL_WARN("sw.ui", "SfxBoolItem::PutValue(): Wrong type"); + return false; +} + + +bool SwFormatFollowTextFlow::QueryValue(css::uno::Any& rVal, sal_uInt8 aInt) const +{ + switch( aInt ) + { + case MID_FOLLOW_TEXT_FLOW : + { + rVal <<= GetValue(); + break; + } + case MID_FTF_LAYOUT_IN_CELL : + { + rVal <<= GetLayoutInCell(); + break; + } + } + return true; +} + +bool SwFormatFollowTextFlow::operator==(const SfxPoolItem& rItem) const +{ + assert(dynamic_cast<const SwFormatFollowTextFlow*>(&rItem) != nullptr); + return SfxBoolItem::operator==(rItem) + && mbLayoutInCell == static_cast<SwFormatFollowTextFlow const*>(&rItem)->mbLayoutInCell; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx index 74705465d54a..1e6c63af00bc 100644 --- a/sw/source/core/inc/anchoredobjectposition.hxx +++ b/sw/source/core/inc/anchoredobjectposition.hxx @@ -56,6 +56,7 @@ namespace objectpositioning const SwFrameFormat* mpFrameFormat; // #i62875# bool mbFollowTextFlow; + bool mbLayoutInCell = false; // #i62875# // for compatibility option <DoNotCaptureDrawObjsOnPage> bool mbDoNotCaptureAnchoredObj; @@ -109,6 +110,10 @@ namespace objectpositioning { return mbFollowTextFlow; } + bool DoesObjLayoutInCell() const + { + return mbLayoutInCell; + } // virtual methods providing data for to character anchored objects. virtual bool IsAnchoredToChar() const; diff --git a/sw/source/core/inc/environmentofanchoredobject.hxx b/sw/source/core/inc/environmentofanchoredobject.hxx index aa3d5a2a5be5..69a5955d3075 100644 --- a/sw/source/core/inc/environmentofanchoredobject.hxx +++ b/sw/source/core/inc/environmentofanchoredobject.hxx @@ -29,6 +29,7 @@ namespace objectpositioning { private: const bool mbFollowTextFlow; + const bool mbLayoutInCell = false; public: /** constructor @@ -36,8 +37,12 @@ namespace objectpositioning @param _bFollowTextFlow input parameter - indicates, if the anchored object, for which this environment is instantiated, follow the text flow or not + @param _bLayoutInCell + input parameter - indicates, if the anchored object should be + layed out within a (table) cell */ - SwEnvironmentOfAnchoredObject( const bool _bFollowTextFlow ); + SwEnvironmentOfAnchoredObject( const bool _bFollowTextFlow, + const bool _bLayoutInCell = false ); /** destructor */ diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 2ddd1a61efb5..5cd671c934ce 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -112,6 +112,7 @@ void SwAnchoredObjectPosition::GetInfoAboutObj() // #i62875# - determine attribute value of <Follow-Text-Flow> { mbFollowTextFlow = mpFrameFormat->GetFollowTextFlow().GetValue(); + mbLayoutInCell = mpFrameFormat->GetFollowTextFlow().GetLayoutInCell(); } // determine, if anchored object has not to be captured on the page. diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx index 8e00bf3c592e..e84917477a2b 100644 --- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx +++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx @@ -25,8 +25,10 @@ using namespace objectpositioning; SwEnvironmentOfAnchoredObject::SwEnvironmentOfAnchoredObject( - const bool _bFollowTextFlow ) + const bool _bFollowTextFlow, + const bool _bLayoutInCell ) : mbFollowTextFlow( _bFollowTextFlow ) + , mbLayoutInCell( _bLayoutInCell ) {} SwEnvironmentOfAnchoredObject::~SwEnvironmentOfAnchoredObject() @@ -68,7 +70,7 @@ const SwLayoutFrame& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFram { const SwFrame* pVertEnvironmentLayFrame = &_rVertOrientFrame; - if ( !mbFollowTextFlow ) + if ( !mbFollowTextFlow && !mbLayoutInCell) { // No exception any more for page alignment. // the page frame determines the vertical layout environment. diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index b065c3068607..4347c125ee90 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -165,7 +165,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() const bool bWrapThrough = rSurround.GetSurround() == css::text::WrapTextMode_THROUGH; // new class <SwEnvironmentOfAnchoredObject> - SwEnvironmentOfAnchoredObject aEnvOfObj( DoesObjFollowsTextFlow() ); + SwEnvironmentOfAnchoredObject aEnvOfObj( DoesObjFollowsTextFlow(), DoesObjLayoutInCell() ); // #i18732# - grow only, if object has to follow the text flow const bool bGrow = DoesObjFollowsTextFlow() && diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 93cf268e765a..84504a532f37 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -918,11 +918,22 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI // #i18732# const ::uno::Any* pFollowTextFlow = nullptr; - GetProperty(RES_FOLLOW_TEXT_FLOW, 0, pFollowTextFlow); - if ( pFollowTextFlow ) + const ::uno::Any* pLayOutinCell = nullptr; + GetProperty(RES_FOLLOW_TEXT_FLOW, MID_FOLLOW_TEXT_FLOW, pFollowTextFlow); + GetProperty(RES_FOLLOW_TEXT_FLOW, MID_FTF_LAYOUT_IN_CELL, pLayOutinCell); + + if ( pFollowTextFlow || pLayOutinCell) { SwFormatFollowTextFlow aFormatFollowTextFlow; - aFormatFollowTextFlow.PutValue(*pFollowTextFlow, 0); + if( pFollowTextFlow ) + { + aFormatFollowTextFlow.PutValue(*pFollowTextFlow, MID_FOLLOW_TEXT_FLOW); + } + + if ( pLayOutinCell ) + { + aFormatFollowTextFlow.PutValue(*pLayOutinCell, MID_FTF_LAYOUT_IN_CELL); + } rToSet.Put(aFormatFollowTextFlow); } diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 1c242d610de7..ba31f396b3e2 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -306,7 +306,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_OPAQUE), RES_OPAQUE, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(UNO_NAME_ANCHOR_POSITION), FN_ANCHOR_POSITION, cppu::UnoType<css::awt::Point>::get(), PropertyAttribute::READONLY, 0}, // #i26791# - { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, + { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FOLLOW_TEXT_FLOW}, + { OUString(UNO_NAME_IS_LAYOUT_IN_CELL), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FTF_LAYOUT_IN_CELL}, // #i28701# { OUString(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, cppu::UnoType<sal_Int8>::get(), PROPERTY_NONE, MID_WRAP_INFLUENCE}, // #i28749# diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx index de331a18cbf8..9dc0cceae98e 100644 --- a/sw/source/core/unocore/unomap1.cxx +++ b/sw/source/core/unocore/unomap1.cxx @@ -453,7 +453,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetFrameStylePropertyM { OUString(UNO_NAME_IS_AUTO_UPDATE), FN_UNO_IS_AUTO_UPDATE, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0}, // #i18732# - { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, + { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FOLLOW_TEXT_FLOW}, + { OUString(UNO_NAME_IS_LAYOUT_IN_CELL), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FTF_LAYOUT_IN_CELL}, // #i28701# { OUString(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, cppu::UnoType<sal_Int8>::get(), PROPERTY_NONE, MID_WRAP_INFLUENCE}, { OUString(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 }, diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx index 56a183111640..2c95e73326b3 100644 --- a/sw/source/core/unocore/unomapproperties.hxx +++ b/sw/source/core/unocore/unomapproperties.hxx @@ -320,7 +320,8 @@ { OUString(UNO_LINK_DISPLAY_NAME), FN_PARAM_LINK_DISPLAY_NAME, cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0xbf}, \ { OUString(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, cppu::UnoType<css::container::XNameContainer>::get(), PropertyAttribute::MAYBEVOID, 0 },\ { OUString(UNO_NAME_Z_ORDER), FN_UNO_Z_ORDER, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0}, \ - { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, \ + { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FOLLOW_TEXT_FLOW}, \ + { OUString(UNO_NAME_IS_LAYOUT_IN_CELL), RES_FOLLOW_TEXT_FLOW, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_FTF_LAYOUT_IN_CELL}, \ { OUString(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, cppu::UnoType<sal_Int8>::get(), PROPERTY_NONE, MID_WRAP_INFLUENCE}, \ { OUString(UNO_NAME_TITLE), FN_UNO_TITLE, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, \ { OUString(UNO_NAME_DESCRIPTION), FN_UNO_DESCRIPTION, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, \ diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index 5ad9260f5739..e69c13419bf0 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -845,6 +845,7 @@ void SwFormatFollowTextFlow::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFollowTextFlow")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("layoutInCell"), BAD_CAST(OString::boolean(GetLayoutInCell()).getStr())); xmlTextWriterEndElement(pWriter); } diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 3241990b8061..76b7797c161a 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1263,6 +1263,11 @@ uno::Reference<text::XTextContent> GraphicImport::createGraphicObject(uno::Refer if( m_pImpl->rDomainMapper.IsInTable() && m_pImpl->bLayoutInCell && m_pImpl->nWrap != text::WrapTextMode_THROUGH ) xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_FOLLOW_TEXT_FLOW ), uno::makeAny(true)); + if( m_pImpl->rDomainMapper.IsInTable() && m_pImpl->bLayoutInCell ) + { + xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_LAYOUT_IN_CELL ), + uno::makeAny(true)); + } xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_SURROUND_CONTOUR ), uno::makeAny(m_pImpl->bContour)); diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 0842f9554b99..d47fec1613d0 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -350,6 +350,7 @@ OUString getPropertyName( PropertyIds eId ) case PROP_RUBY_TEXT: sName = "RubyText"; break; case PROP_RUBY_ADJUST: sName = "RubyAdjust"; break; case PROP_RUBY_POSITION: sName = "RubyPosition"; break; + case PROP_LAYOUT_IN_CELL: sName = "IsLayoutInCell"; break; } assert(sName.getLength()>0); return sName; diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 6b694db5f072..f8047b0aa76c 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -348,6 +348,7 @@ enum PropertyIds ,PROP_RUBY_TEXT ,PROP_RUBY_ADJUST ,PROP_RUBY_POSITION + ,PROP_LAYOUT_IN_CELL }; //Returns the UNO string equivalent to eId. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits