diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-25 12:26:03 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-25 12:32:30 +0100 |
commit | f72947d5f651216f1ee004bee7f271c9e21c22dc (patch) | |
tree | 5477a486361f39af24542491669bb17c5a43044e /writerfilter/source | |
parent | 6de362e954ba2767d2970223add0173c8909483f (diff) |
writerfilter: whitespace fixes in TablePositionHandler
Change-Id: I0d4a624ee75e701966a2694642d71483c6ec572f
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/TablePositionHandler.cxx | 92 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TablePositionHandler.hxx | 80 |
2 files changed, 88 insertions, 84 deletions
diff --git a/writerfilter/source/dmapper/TablePositionHandler.cxx b/writerfilter/source/dmapper/TablePositionHandler.cxx index 82010958e466..4c08bc95c857 100644 --- a/writerfilter/source/dmapper/TablePositionHandler.cxx +++ b/writerfilter/source/dmapper/TablePositionHandler.cxx @@ -16,19 +16,21 @@ #include <com/sun/star/text/RelOrientation.hpp> #include "dmapperLoggers.hxx" -namespace writerfilter { -namespace dmapper { +namespace writerfilter +{ +namespace dmapper +{ using namespace ::com::sun::star; TablePositionHandler::TablePositionHandler() : LoggedProperties(dmapper_logger, "TablePositionHandler"), - m_aVertAnchor( "margin" ), - m_aYSpec( ), - m_aHorzAnchor( "text" ), - m_aXSpec( ), - m_nY( 0 ), - m_nX( 0 ), + m_aVertAnchor("margin"), + m_aYSpec(), + m_aHorzAnchor("text"), + m_aXSpec(), + m_nY(0), + m_nX(0), m_nLeftFromText(0), m_nRightFromText(0), m_nTopFromText(0), @@ -45,41 +47,41 @@ void TablePositionHandler::lcl_attribute(Id rName, Value& rVal) { switch (rName) { - case NS_ooxml::LN_CT_TblPPr_vertAnchor: - m_aVertAnchor = rVal.getString(); + case NS_ooxml::LN_CT_TblPPr_vertAnchor: + m_aVertAnchor = rVal.getString(); break; - case NS_ooxml::LN_CT_TblPPr_tblpYSpec: - m_aYSpec = rVal.getString(); + case NS_ooxml::LN_CT_TblPPr_tblpYSpec: + m_aYSpec = rVal.getString(); break; - case NS_ooxml::LN_CT_TblPPr_horzAnchor: - m_aHorzAnchor = rVal.getString(); + case NS_ooxml::LN_CT_TblPPr_horzAnchor: + m_aHorzAnchor = rVal.getString(); break; - case NS_ooxml::LN_CT_TblPPr_tblpXSpec: - m_aXSpec = rVal.getString(); + case NS_ooxml::LN_CT_TblPPr_tblpXSpec: + m_aXSpec = rVal.getString(); break; - case NS_ooxml::LN_CT_TblPPr_tblpY: - m_nY = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_tblpY: + m_nY = rVal.getInt(); break; - case NS_ooxml::LN_CT_TblPPr_tblpX: - m_nX = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_tblpX: + m_nX = rVal.getInt(); break; - case NS_ooxml::LN_CT_TblPPr_leftFromText: - m_nLeftFromText = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_leftFromText: + m_nLeftFromText = rVal.getInt(); break; - case NS_ooxml::LN_CT_TblPPr_rightFromText: - m_nRightFromText = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_rightFromText: + m_nRightFromText = rVal.getInt(); break; - case NS_ooxml::LN_CT_TblPPr_topFromText: - m_nTopFromText = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_topFromText: + m_nTopFromText = rVal.getInt(); break; - case NS_ooxml::LN_CT_TblPPr_bottomFromText: - m_nBottomFromText = rVal.getInt(); + case NS_ooxml::LN_CT_TblPPr_bottomFromText: + m_nBottomFromText = rVal.getInt(); break; - default: + default: #ifdef DEBUG_DOMAINMAPPER - dmapper_logger->element("unhandled"); + dmapper_logger->element("unhandled"); #endif - break; + break; } } @@ -124,23 +126,23 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con // Horizontal positioning sal_Int16 nHoriOrient = text::HoriOrientation::NONE; - if ( m_aXSpec == "center" ) + if (m_aXSpec == "center") nHoriOrient = text::HoriOrientation::CENTER; - else if ( m_aXSpec == "inside" ) + else if (m_aXSpec == "inside") nHoriOrient = text::HoriOrientation::INSIDE; - else if ( m_aXSpec == "left" ) + else if (m_aXSpec == "left") nHoriOrient = text::HoriOrientation::LEFT; - else if ( m_aXSpec == "outside" ) + else if (m_aXSpec == "outside") nHoriOrient = text::HoriOrientation::OUTSIDE; - else if ( m_aXSpec == "right" ) + else if (m_aXSpec == "right") nHoriOrient = text::HoriOrientation::RIGHT; sal_Int16 nHoriOrientRelation; - if ( m_aHorzAnchor == "margin" ) + if (m_aHorzAnchor == "margin") nHoriOrientRelation = text::RelOrientation::PAGE_PRINT_AREA; - else if ( m_aHorzAnchor == "page" ) + else if (m_aHorzAnchor == "page") nHoriOrientRelation = text::RelOrientation::PAGE_FRAME; - else if ( m_aHorzAnchor == "text" ) + else if (m_aHorzAnchor == "text") nHoriOrientRelation = text::RelOrientation::FRAME; pFrameProperties[12].Name = "HoriOrient"; @@ -153,21 +155,21 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con // Vertical positioning sal_Int16 nVertOrient = text::VertOrientation::NONE; - if ( m_aYSpec == "bottom" ) + if (m_aYSpec == "bottom") nVertOrient = text::VertOrientation::BOTTOM; - else if ( m_aYSpec == "center" ) + else if (m_aYSpec == "center") nVertOrient = text::VertOrientation::CENTER; - else if ( m_aYSpec == "top" ) + else if (m_aYSpec == "top") nVertOrient = text::VertOrientation::TOP; // TODO There are a few cases we can't map ATM. sal_Int16 nVertOrientRelation; - if ( m_aVertAnchor == "margin" ) + if (m_aVertAnchor == "margin") nVertOrientRelation = text::RelOrientation::PAGE_PRINT_AREA; - else if ( m_aVertAnchor == "page" ) + else if (m_aVertAnchor == "page") nVertOrientRelation = text::RelOrientation::PAGE_FRAME; - else if ( m_aVertAnchor == "text" ) + else if (m_aVertAnchor == "text") nVertOrientRelation = text::RelOrientation::FRAME; pFrameProperties[15].Name = "VertOrient"; diff --git a/writerfilter/source/dmapper/TablePositionHandler.hxx b/writerfilter/source/dmapper/TablePositionHandler.hxx index a264dff03882..bfd636e81fed 100644 --- a/writerfilter/source/dmapper/TablePositionHandler.hxx +++ b/writerfilter/source/dmapper/TablePositionHandler.hxx @@ -14,45 +14,47 @@ #include <boost/shared_ptr.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -namespace writerfilter { - namespace dmapper { - - /// Handler for floating table positioning - class WRITERFILTER_DLLPRIVATE TablePositionHandler - : public LoggedProperties - { - OUString m_aVertAnchor; - OUString m_aYSpec; - OUString m_aHorzAnchor; - OUString m_aXSpec; - sal_Int32 m_nY; - sal_Int32 m_nX; - sal_Int32 m_nLeftFromText; - sal_Int32 m_nRightFromText; - sal_Int32 m_nTopFromText; - sal_Int32 m_nBottomFromText; - - // Properties - virtual void lcl_attribute(Id Name, Value & val); - virtual void lcl_sprm(Sprm & sprm); - - public: - TablePositionHandler(); - virtual ~TablePositionHandler(); - - /** Compute the UNO properties for the frame containing the table based - on the received tokens. - - Note that the properties will need to be adjusted with the table - properties before actually using them. - */ - com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getTablePosition() const; - - bool operator== (const TablePositionHandler& rHandler) const; - }; - - typedef boost::shared_ptr<TablePositionHandler> TablePositionHandlerPtr; - } // namespace dmapper +namespace writerfilter +{ +namespace dmapper +{ + +/// Handler for floating table positioning +class WRITERFILTER_DLLPRIVATE TablePositionHandler + : public LoggedProperties +{ + OUString m_aVertAnchor; + OUString m_aYSpec; + OUString m_aHorzAnchor; + OUString m_aXSpec; + sal_Int32 m_nY; + sal_Int32 m_nX; + sal_Int32 m_nLeftFromText; + sal_Int32 m_nRightFromText; + sal_Int32 m_nTopFromText; + sal_Int32 m_nBottomFromText; + + // Properties + virtual void lcl_attribute(Id Name, Value& val); + virtual void lcl_sprm(Sprm& sprm); + +public: + TablePositionHandler(); + virtual ~TablePositionHandler(); + + /** Compute the UNO properties for the frame containing the table based + on the received tokens. + + Note that the properties will need to be adjusted with the table + properties before actually using them. + */ + com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getTablePosition() const; + + bool operator== (const TablePositionHandler& rHandler) const; +}; + +typedef boost::shared_ptr<TablePositionHandler> TablePositionHandlerPtr; +} // namespace dmapper } // namespace writerfilter #endif |