sw: various small cleanups

Change-Id: I1eb56649fb9913cb32397c1ef49634a0d202f1a1
This commit is contained in:
Miklos Vajna
2017-01-25 09:06:59 +01:00
parent 19663d39f4
commit cb55ffa649
6 changed files with 22 additions and 36 deletions

View File

@@ -100,22 +100,22 @@ public:
std::vector<SfxClassificationCategory> m_aCategories; std::vector<SfxClassificationCategory> m_aCategories;
OUString m_aPolicyAuthorityName; OUString m_aPolicyAuthorityName;
bool m_bInPolicyAuthorityName; bool m_bInPolicyAuthorityName = false;
OUString m_aPolicyName; OUString m_aPolicyName;
bool m_bInPolicyName; bool m_bInPolicyName = false;
OUString m_aProgramID; OUString m_aProgramID;
bool m_bInProgramID; bool m_bInProgramID = false;
OUString m_aScale; OUString m_aScale;
bool m_bInScale; bool m_bInScale = false;
OUString m_aConfidentalityValue; OUString m_aConfidentalityValue;
bool m_bInConfidentalityValue; bool m_bInConfidentalityValue = false;
OUString m_aIdentifier; OUString m_aIdentifier;
bool m_bInIdentifier; bool m_bInIdentifier = false;
OUString m_aValue; OUString m_aValue;
bool m_bInValue; bool m_bInValue = false;
/// Pointer to a value in m_aCategories, the currently parsed category. /// Pointer to a value in m_aCategories, the currently parsed category.
SfxClassificationCategory* m_pCategory; SfxClassificationCategory* m_pCategory = nullptr;
SfxClassificationParser(); SfxClassificationParser();
@@ -138,17 +138,7 @@ public:
throw (xml::sax::SAXException, uno::RuntimeException, std::exception) override; throw (xml::sax::SAXException, uno::RuntimeException, std::exception) override;
}; };
SfxClassificationParser::SfxClassificationParser() SfxClassificationParser::SfxClassificationParser() = default;
: m_bInPolicyAuthorityName(false)
, m_bInPolicyName(false)
, m_bInProgramID(false)
, m_bInScale(false)
, m_bInConfidentalityValue(false)
, m_bInIdentifier(false)
, m_bInValue(false)
, m_pCategory(nullptr)
{
}
void SAL_CALL SfxClassificationParser::startDocument() throw (xml::sax::SAXException, uno::RuntimeException, std::exception) void SAL_CALL SfxClassificationParser::startDocument() throw (xml::sax::SAXException, uno::RuntimeException, std::exception)
{ {

View File

@@ -684,7 +684,7 @@ void DocxTableStyleExport::SetSerializer(const sax_fastparser::FSHelperPtr& pSer
m_pImpl->m_pSerializer = pSerializer; 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<Impl>()) : m_pImpl(o3tl::make_unique<Impl>())
{ {
m_pImpl->m_pDoc = pDoc; m_pImpl->m_pDoc = pDoc;

View File

@@ -33,7 +33,7 @@ public:
void CnfStyle(css::uno::Sequence<css::beans::PropertyValue>& rAttributeList); void CnfStyle(css::uno::Sequence<css::beans::PropertyValue>& rAttributeList);
void SetSerializer(const sax_fastparser::FSHelperPtr& pSerializer); void SetSerializer(const sax_fastparser::FSHelperPtr& pSerializer);
DocxTableStyleExport(SwDoc* pDoc, sax_fastparser::FSHelperPtr pSerializer); DocxTableStyleExport(SwDoc* pDoc, const sax_fastparser::FSHelperPtr& pSerializer);
~DocxTableStyleExport(); ~DocxTableStyleExport();
}; };

View File

@@ -484,12 +484,10 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
long nHeight; long nHeight;
if (pFormat) if (pFormat)
{ {
const SvxFontItem& rFont = ItemGet< SvxFontItem >(*pFormat, const auto& rFont = ItemGet<SvxFontItem>(*pFormat, GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
sFamilyName = rFont.GetFamilyName(); sFamilyName = rFont.GetFamilyName();
const SvxFontHeightItem& rHeight = ItemGet< SvxFontHeightItem >(*pFormat, const auto& rHeight = ItemGet<SvxFontHeightItem>(*pFormat, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
nHeight = rHeight.GetHeight(); nHeight = rHeight.GetHeight();
} }
else else
@@ -499,12 +497,10 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/,
const SfxItemPool* pPool = rNode.GetSwAttrSet().GetPool(); const SfxItemPool* pPool = rNode.GetSwAttrSet().GetPool();
pPool = pPool ? pPool : &m_rExport.m_pDoc->GetAttrPool(); pPool = pPool ? pPool : &m_rExport.m_pDoc->GetAttrPool();
const SvxFontItem& rFont = DefaultItemGet< SvxFontItem >(*pPool, const auto& rFont = DefaultItemGet<SvxFontItem>(*pPool, GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
GetWhichOfScript(RES_CHRATR_FONT,nRubyScript));
sFamilyName = rFont.GetFamilyName(); sFamilyName = rFont.GetFamilyName();
const SvxFontHeightItem& rHeight = DefaultItemGet< SvxFontHeightItem > const auto& rHeight = DefaultItemGet<SvxFontHeightItem>(*pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
(*pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
nHeight = rHeight.GetHeight(); nHeight = rHeight.GetHeight();
} }
nHeight = (nHeight + 5)/10; nHeight = (nHeight + 5)/10;

View File

@@ -14,14 +14,14 @@ namespace writerfilter
namespace rtftok namespace rtftok
{ {
RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes, RTFSprms aSprms) RTFReferenceProperties::RTFReferenceProperties(const RTFSprms& rAttributes, const RTFSprms& rSprms)
: m_aAttributes(aAttributes), : m_aAttributes(rAttributes),
m_aSprms(aSprms) m_aSprms(rSprms)
{ {
} }
RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes) RTFReferenceProperties::RTFReferenceProperties(const RTFSprms& rAttributes)
: m_aAttributes(aAttributes) : m_aAttributes(rAttributes)
{ {
} }

View File

@@ -21,8 +21,8 @@ class RTFReferenceProperties
: public writerfilter::Reference<Properties> : public writerfilter::Reference<Properties>
{ {
public: public:
RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms); RTFReferenceProperties(const RTFSprms& rAttributes, const RTFSprms& rSprms);
explicit RTFReferenceProperties(RTFSprms rAttributes); explicit RTFReferenceProperties(const RTFSprms& rAttributes);
virtual ~RTFReferenceProperties(); virtual ~RTFReferenceProperties();
virtual void resolve(Properties& rHandler) override; virtual void resolve(Properties& rHandler) override;
RTFSprms& getAttributes() RTFSprms& getAttributes()