diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-04-05 20:32:07 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-04-21 22:35:59 +0200 |
commit | 006b35d50024b1932d84380b5d2fec1f7066bccd (patch) | |
tree | 70d16adbb3954c585b00f86e0ebd1dff3f17ac1d /sw/source/filter/ww8/docxattributeoutput.cxx | |
parent | 66465fe341a25652cf0eb06b8e4e24e18ea8ed3c (diff) |
tdf#154703 NFC sw framePr: flatten TextBoxIsFramePr and fix typo
Change-Id: I0fd30cb62c3676a1c7088636798bd4e6d3a18c50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150071
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2e456a8018fb..43cfa953a041 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -973,27 +973,27 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor bool DocxAttributeOutput::TextBoxIsFramePr(const SwFrameFormat& rFrameFormat) { - uno::Reference< drawing::XShape > xShape; - const SdrObject* pSdrObj = rFrameFormat.FindRealSdrObject(); - if (pSdrObj) - xShape.set(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); - uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY); - uno::Reference< beans::XPropertySetInfo > xPropSetInfo; - if (xPropertySet.is()) - xPropSetInfo = xPropertySet->getPropertySetInfo(); - uno::Any aFrameProperties ; - if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) - { - uno::Sequence< beans::PropertyValue > propList; - xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; - auto pProp = std::find_if(std::cbegin(propList), std::cend(propList), - [](const beans::PropertyValue& rProp) { return rProp.Name == "ParaFrameProperties"; }); - if (pProp != std::cend(propList)) - aFrameProperties = pProp->Value; - } - bool bFrameProperties = false; - aFrameProperties >>= bFrameProperties; - return bFrameProperties; + SdrObject* pSdrObj = const_cast<SdrObject*>(rFrameFormat.FindRealSdrObject()); + if (!pSdrObj) + return false; + + uno::Reference<beans::XPropertySet> xPropertySet(pSdrObj->getUnoShape(), uno::UNO_QUERY); + if (!xPropertySet.is()) + return false; + + uno::Reference<beans::XPropertySetInfo> xPropSetInfo(xPropertySet->getPropertySetInfo()); + if (!xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) + return false; + + bool bRet = false; + uno::Sequence<beans::PropertyValue> propList; + xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; + auto pProp = std::find_if(std::cbegin(propList), std::cend(propList), + [](const beans::PropertyValue& rProp) { return rProp.Name == "ParaFrameProperties"; }); + if (pProp != std::cend(propList)) + pProp->Value >>= bRet; + + return bRet; } void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) |