diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-20 09:09:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-20 09:42:44 +0000 |
commit | 51b6a7c87ba27e181fb3634e96296b7307a8281f (patch) | |
tree | 2cbb9a515392af1b32dd813190f5fb7250339837 | |
parent | 5c5a6c3668c2112ce419f6b559105e915d9bd29d (diff) |
writerfilter: various small cleanups
Change-Id: I258a03909e2a166b8f1c077cf758974a06ad3403
Reviewed-on: https://gerrit.libreoffice.org/32215
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | sw/source/filter/ww8/rtfexportfilter.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfsdrexport.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SmartTagHandler.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TablePositionHandler.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilterDetection.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchdestination.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchflag.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchsymbol.cxx | 10 |
8 files changed, 14 insertions, 19 deletions
diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx index 81707231c7d2..f09a8c525702 100644 --- a/sw/source/filter/ww8/rtfexportfilter.cxx +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -47,7 +47,7 @@ sal_Bool RtfExportFilter::filter(const uno::Sequence< beans::PropertyValue >& aD // get SwDoc* uno::Reference< uno::XInterface > xIfc(m_xSrcDoc, uno::UNO_QUERY); - SwXTextDocument* pTextDoc = dynamic_cast< SwXTextDocument* >(xIfc.get()); + auto pTextDoc = dynamic_cast<SwXTextDocument*>(xIfc.get()); if (!pTextDoc) { return false; diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 848457b74143..838591a096ce 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -471,7 +471,7 @@ void RtfSdrExport::impl_writeGraphic() (void)GraphicConverter::Export(aStream, aGraphic, ConvertDataFormat::PNG); aStream.Seek(STREAM_SEEK_TO_END); sal_uInt32 nSize = aStream.Tell(); - const sal_uInt8* pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData()); + auto pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData()); Size aMapped(aGraphic.GetPrefSize()); @@ -531,7 +531,7 @@ sal_Int32 RtfSdrExport::StartShape() } } - const SdrTextObj* pTextObj = dynamic_cast<const SdrTextObj*>(m_pSdrObject); + auto pTextObj = dynamic_cast<const SdrTextObj*>(m_pSdrObject); if (pTextObj) { const OutlinerParaObject* pParaObj = nullptr; diff --git a/writerfilter/source/dmapper/SmartTagHandler.cxx b/writerfilter/source/dmapper/SmartTagHandler.cxx index d4bff8ce2722..4b1b308091dc 100644 --- a/writerfilter/source/dmapper/SmartTagHandler.cxx +++ b/writerfilter/source/dmapper/SmartTagHandler.cxx @@ -68,7 +68,7 @@ void SmartTagHandler::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_CT_SmartTagPr_attr: { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); - if (pProperties.get()) + if (pProperties) pProperties->resolve(*this); break; } diff --git a/writerfilter/source/dmapper/TablePositionHandler.cxx b/writerfilter/source/dmapper/TablePositionHandler.cxx index 4182c4fbe859..4536ac612526 100644 --- a/writerfilter/source/dmapper/TablePositionHandler.cxx +++ b/writerfilter/source/dmapper/TablePositionHandler.cxx @@ -24,9 +24,7 @@ using namespace ::com::sun::star; TablePositionHandler::TablePositionHandler() : LoggedProperties("TablePositionHandler"), m_aVertAnchor("margin"), - m_aYSpec(), m_aHorzAnchor("text"), - m_aXSpec(), m_nY(0), m_nX(0), m_nLeftFromText(0), diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx index f72323b8cc1a..dccd82302d3c 100644 --- a/writerfilter/source/filter/WriterFilterDetection.cxx +++ b/writerfilter/source/filter/WriterFilterDetection.cxx @@ -47,9 +47,7 @@ public: uno::Sequence<OUString> SAL_CALL WriterFilterDetection_getSupportedServiceNames() throw (uno::RuntimeException); -WriterFilterDetection::WriterFilterDetection() -{ -} +WriterFilterDetection::WriterFilterDetection() = default; OUString WriterFilterDetection::detect(uno::Sequence<beans::PropertyValue>& rDescriptor) throw (uno::RuntimeException, std::exception) { diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx b/writerfilter/source/rtftok/rtfdispatchdestination.cxx index 75d70199b01f..0c44e25b4dd2 100644 --- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx +++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx @@ -332,9 +332,8 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) case RTF_DPTXBXTEXT: { bool bPictureFrame = false; - for (std::size_t i = 0; i < m_aStates.top().aShape.aProperties.size(); ++i) + for (auto& rProperty : m_aStates.top().aShape.aProperties) { - std::pair<OUString, OUString>& rProperty = m_aStates.top().aShape.aProperties[i]; if (rProperty.first == "shapeType" && rProperty.second == OUString::number(ESCHER_ShpInst_PictureFrame)) { bPictureFrame = true; diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx index b99876edbc19..aa3c41ce05db 100644 --- a/writerfilter/source/rtftok/rtfdispatchflag.cxx +++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx @@ -889,10 +889,10 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) { m_aStates.top().aDrawingObject.xShape.set(getModelFactory()->createInstance("com.sun.star.text.TextFrame"), uno::UNO_QUERY); std::vector<beans::PropertyValue> aDefaults = RTFSdrImport::getTextFrameDefaults(false); - for (std::size_t i = 0; i < aDefaults.size(); ++i) + for (const auto& rDefault : aDefaults) { - if (!findPropertyName(m_aStates.top().aDrawingObject.aPendingProperties, aDefaults[i].Name)) - m_aStates.top().aDrawingObject.aPendingProperties.push_back(aDefaults[i]); + if (!findPropertyName(m_aStates.top().aDrawingObject.aPendingProperties, rDefault.Name)) + m_aStates.top().aDrawingObject.aPendingProperties.push_back(rDefault); } checkFirstRun(); Mapper().startShape(m_aStates.top().aDrawingObject.xShape); diff --git a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx index 6905f1c4d983..c85f957f7830 100644 --- a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx +++ b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx @@ -178,13 +178,13 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) { // There were no runs in the cell, so we need to send paragraph and character properties here. auto pPValue = std::make_shared<RTFValue>(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms); - m_aTableBufferStack.back().push_back(Buf_t(BUFFER_PROPS, pPValue, nullptr)); + m_aTableBufferStack.back().emplace_back(Buf_t(BUFFER_PROPS, pPValue, nullptr)); auto pCValue = std::make_shared<RTFValue>(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms); - m_aTableBufferStack.back().push_back(Buf_t(BUFFER_PROPS, pCValue, nullptr)); + m_aTableBufferStack.back().emplace_back(Buf_t(BUFFER_PROPS, pCValue, nullptr)); } RTFValue::Pointer_t pValue; - m_aTableBufferStack.back().push_back(Buf_t(BUFFER_CELLEND, pValue, nullptr)); + m_aTableBufferStack.back().emplace_back(Buf_t(BUFFER_CELLEND, pValue, nullptr)); m_bNeedPap = true; } break; @@ -218,7 +218,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) } } m_aTableBufferStack.pop_back(); - m_aTableBufferStack.back().push_back( + m_aTableBufferStack.back().emplace_back( Buf_t(BUFFER_NESTROW, RTFValue::Pointer_t(), pBuffer)); m_aNestedTableCellsSprms.clear(); @@ -322,7 +322,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) { bool bColumns = false; // If we have multiple columns RTFValue::Pointer_t pCols = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_cols); - if (pCols.get()) + if (pCols) { RTFValue::Pointer_t pNum = pCols->getAttributes().find(NS_ooxml::LN_CT_Columns_num); if (pNum.get() && pNum->getInt() > 1) |