From cb55ffa649e73eb12e8edf79950a2494ac5e94b1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 25 Jan 2017 09:06:59 +0100 Subject: sw: various small cleanups Change-Id: I1eb56649fb9913cb32397c1ef49634a0d202f1a1 --- sfx2/source/view/classificationhelper.cxx | 28 +++++++--------------- sw/source/filter/ww8/docxtablestyleexport.cxx | 2 +- sw/source/filter/ww8/docxtablestyleexport.hxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 12 ++++------ .../source/rtftok/rtfreferenceproperties.cxx | 10 ++++---- .../source/rtftok/rtfreferenceproperties.hxx | 4 ++-- 6 files changed, 22 insertions(+), 36 deletions(-) diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 614ec9800a63..33323d64be96 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -100,22 +100,22 @@ public: std::vector m_aCategories; OUString m_aPolicyAuthorityName; - bool m_bInPolicyAuthorityName; + bool m_bInPolicyAuthorityName = false; OUString m_aPolicyName; - bool m_bInPolicyName; + bool m_bInPolicyName = false; OUString m_aProgramID; - bool m_bInProgramID; + bool m_bInProgramID = false; OUString m_aScale; - bool m_bInScale; + bool m_bInScale = false; OUString m_aConfidentalityValue; - bool m_bInConfidentalityValue; + bool m_bInConfidentalityValue = false; OUString m_aIdentifier; - bool m_bInIdentifier; + bool m_bInIdentifier = false; OUString m_aValue; - bool m_bInValue; + bool m_bInValue = false; /// Pointer to a value in m_aCategories, the currently parsed category. - SfxClassificationCategory* m_pCategory; + SfxClassificationCategory* m_pCategory = nullptr; SfxClassificationParser(); @@ -138,17 +138,7 @@ public: throw (xml::sax::SAXException, uno::RuntimeException, std::exception) override; }; -SfxClassificationParser::SfxClassificationParser() - : m_bInPolicyAuthorityName(false) - , m_bInPolicyName(false) - , m_bInProgramID(false) - , m_bInScale(false) - , m_bInConfidentalityValue(false) - , m_bInIdentifier(false) - , m_bInValue(false) - , m_pCategory(nullptr) -{ -} +SfxClassificationParser::SfxClassificationParser() = default; void SAL_CALL SfxClassificationParser::startDocument() throw (xml::sax::SAXException, uno::RuntimeException, std::exception) { diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index d87e80599842..210be3546852 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -684,7 +684,7 @@ void DocxTableStyleExport::SetSerializer(const sax_fastparser::FSHelperPtr& pSer m_pImpl->m_pSerializer = pSerializer; } -DocxTableStyleExport::DocxTableStyleExport(SwDoc* pDoc, sax_fastparser::FSHelperPtr pSerializer) +DocxTableStyleExport::DocxTableStyleExport(SwDoc* pDoc, const sax_fastparser::FSHelperPtr& pSerializer) : m_pImpl(o3tl::make_unique()) { m_pImpl->m_pDoc = pDoc; diff --git a/sw/source/filter/ww8/docxtablestyleexport.hxx b/sw/source/filter/ww8/docxtablestyleexport.hxx index cf73a4b1017b..3746203f8e4e 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.hxx +++ b/sw/source/filter/ww8/docxtablestyleexport.hxx @@ -33,7 +33,7 @@ public: void CnfStyle(css::uno::Sequence& rAttributeList); void SetSerializer(const sax_fastparser::FSHelperPtr& pSerializer); - DocxTableStyleExport(SwDoc* pDoc, sax_fastparser::FSHelperPtr pSerializer); + DocxTableStyleExport(SwDoc* pDoc, const sax_fastparser::FSHelperPtr& pSerializer); ~DocxTableStyleExport(); }; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 615bcb6b6b48..30942293853a 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -484,12 +484,10 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, long nHeight; if (pFormat) { - const SvxFontItem& rFont = ItemGet< SvxFontItem >(*pFormat, - GetWhichOfScript(RES_CHRATR_FONT,nRubyScript)); + const auto& rFont = ItemGet(*pFormat, GetWhichOfScript(RES_CHRATR_FONT,nRubyScript)); sFamilyName = rFont.GetFamilyName(); - const SvxFontHeightItem& rHeight = ItemGet< SvxFontHeightItem >(*pFormat, - GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript)); + const auto& rHeight = ItemGet(*pFormat, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript)); nHeight = rHeight.GetHeight(); } else @@ -499,12 +497,10 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, const SfxItemPool* pPool = rNode.GetSwAttrSet().GetPool(); pPool = pPool ? pPool : &m_rExport.m_pDoc->GetAttrPool(); - const SvxFontItem& rFont = DefaultItemGet< SvxFontItem >(*pPool, - GetWhichOfScript(RES_CHRATR_FONT,nRubyScript)); + const auto& rFont = DefaultItemGet(*pPool, GetWhichOfScript(RES_CHRATR_FONT,nRubyScript)); sFamilyName = rFont.GetFamilyName(); - const SvxFontHeightItem& rHeight = DefaultItemGet< SvxFontHeightItem > - (*pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript)); + const auto& rHeight = DefaultItemGet(*pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript)); nHeight = rHeight.GetHeight(); } nHeight = (nHeight + 5)/10; diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.cxx b/writerfilter/source/rtftok/rtfreferenceproperties.cxx index 7f43c5e376d0..3a00fd32aebe 100644 --- a/writerfilter/source/rtftok/rtfreferenceproperties.cxx +++ b/writerfilter/source/rtftok/rtfreferenceproperties.cxx @@ -14,14 +14,14 @@ namespace writerfilter namespace rtftok { -RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes, RTFSprms aSprms) - : m_aAttributes(aAttributes), - m_aSprms(aSprms) +RTFReferenceProperties::RTFReferenceProperties(const RTFSprms& rAttributes, const RTFSprms& rSprms) + : m_aAttributes(rAttributes), + m_aSprms(rSprms) { } -RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes) - : m_aAttributes(aAttributes) +RTFReferenceProperties::RTFReferenceProperties(const RTFSprms& rAttributes) + : m_aAttributes(rAttributes) { } diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.hxx b/writerfilter/source/rtftok/rtfreferenceproperties.hxx index caffc32e5244..192a439b6916 100644 --- a/writerfilter/source/rtftok/rtfreferenceproperties.hxx +++ b/writerfilter/source/rtftok/rtfreferenceproperties.hxx @@ -21,8 +21,8 @@ class RTFReferenceProperties : public writerfilter::Reference { public: - RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms); - explicit RTFReferenceProperties(RTFSprms rAttributes); + RTFReferenceProperties(const RTFSprms& rAttributes, const RTFSprms& rSprms); + explicit RTFReferenceProperties(const RTFSprms& rAttributes); virtual ~RTFReferenceProperties(); virtual void resolve(Properties& rHandler) override; RTFSprms& getAttributes() -- cgit