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 | |
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')
-rw-r--r-- | sw/source/core/text/frmform.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 42 |
2 files changed, 22 insertions, 22 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 41b18363aed2..2f3024f1bb0a 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1227,7 +1227,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine, } // bPrev is set whether Reformat.Start() was called because of Prev(). -// Else, wo don't know whether we can limit the repaint or not. +// Else, we don't know whether we can limit the repaint or not. bool SwTextFrame::FormatLine( SwTextFormatter &rLine, const bool bPrev ) { OSL_ENSURE( ! IsVertical() || IsSwapped(), 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 ) |