summaryrefslogtreecommitdiff
path: root/reportdesign/source/filter/xml/xmlColumn.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-02 12:06:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-02 20:07:00 +0200
commitff7e960701ccacbd62bd2251f26561eeba8ebe8a (patch)
tree1adb4b20e453804203cb95721c7d5bc92795e1e6 /reportdesign/source/filter/xml/xmlColumn.cxx
parent4acb0e7f05fa7fe05f990786e0483e20962af1d9 (diff)
loplugin:flatten in reportdesign
Change-Id: I6d8b2730cede4453e7afd581cc24ed101ca6c81b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91557 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source/filter/xml/xmlColumn.cxx')
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.cxx76
1 files changed, 38 insertions, 38 deletions
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
index 92bf2e01da1e..753dfbe1b35c 100644
--- a/reportdesign/source/filter/xml/xmlColumn.cxx
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -112,50 +112,50 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLRowColumn::createF
void OXMLRowColumn::fillStyle(const OUString& _sStyleName)
{
- if ( !_sStyleName.isEmpty() )
+ if ( _sStyleName.isEmpty() )
+ return;
+
+ const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
+ if ( !pAutoStyles )
+ return;
+
+ PropertySetInfo* pInfo = new PropertySetInfo();
+ static PropertyMapEntry const pMap[] =
+ {
+ {OUString(PROPERTY_WIDTH), PROPERTY_ID_WIDTH, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0},
+ {OUString(PROPERTY_HEIGHT), PROPERTY_ID_HEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 },
+ {OUString(PROPERTY_MINHEIGHT), PROPERTY_ID_MINHEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 },
+ {OUString(), 0, css::uno::Type(), 0, 0 }
+ };
+ pInfo->add(pMap);
+ Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
+ XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,_sStyleName)));
+ if ( pAutoStyle )
{
- const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
- if ( pAutoStyles )
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nWidth = 0;
+ xProp->getPropertyValue(PROPERTY_WIDTH) >>= nWidth;
+ m_pContainer->addWidth(nWidth);
+ }
+ else
+ {
+ pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,_sStyleName)));
+ if ( pAutoStyle )
{
- PropertySetInfo* pInfo = new PropertySetInfo();
- static PropertyMapEntry const pMap[] =
- {
- {OUString(PROPERTY_WIDTH), PROPERTY_ID_WIDTH, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0},
- {OUString(PROPERTY_HEIGHT), PROPERTY_ID_HEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 },
- {OUString(PROPERTY_MINHEIGHT), PROPERTY_ID_MINHEIGHT, ::cppu::UnoType<sal_Int32>::get() ,PropertyAttribute::BOUND,0 },
- {OUString(), 0, css::uno::Type(), 0, 0 }
- };
- pInfo->add(pMap);
- Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
- XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,_sStyleName)));
- if ( pAutoStyle )
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nHeight = 0;
+ sal_Int32 nMinHeight = 0;
+ xProp->getPropertyValue(PROPERTY_HEIGHT) >>= nHeight;
+ xProp->getPropertyValue(PROPERTY_MINHEIGHT) >>= nMinHeight;
+ if (nHeight == 0 && nMinHeight > 0)
{
- pAutoStyle->FillPropertySet(xProp);
- sal_Int32 nWidth = 0;
- xProp->getPropertyValue(PROPERTY_WIDTH) >>= nWidth;
- m_pContainer->addWidth(nWidth);
+ m_pContainer->addHeight(nMinHeight);
+ m_pContainer->addAutoHeight(true);
}
else
{
- pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,_sStyleName)));
- if ( pAutoStyle )
- {
- pAutoStyle->FillPropertySet(xProp);
- sal_Int32 nHeight = 0;
- sal_Int32 nMinHeight = 0;
- xProp->getPropertyValue(PROPERTY_HEIGHT) >>= nHeight;
- xProp->getPropertyValue(PROPERTY_MINHEIGHT) >>= nMinHeight;
- if (nHeight == 0 && nMinHeight > 0)
- {
- m_pContainer->addHeight(nMinHeight);
- m_pContainer->addAutoHeight(true);
- }
- else
- {
- m_pContainer->addHeight(nHeight);
- m_pContainer->addAutoHeight(false);
- }
- }
+ m_pContainer->addHeight(nHeight);
+ m_pContainer->addAutoHeight(false);
}
}
}