diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-28 11:33:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-28 17:24:19 +0200 |
commit | 082394a8ff125a7a7a009f60a0002d1d4c2ca7fb (patch) | |
tree | 7ec1422611081608543434bc27cf7906cb576b4a /sw | |
parent | a0f6d3865dd113f38fd3aa673075e9fecd06f3cd (diff) |
make this look less like it grew organically and more like it was planned
Change-Id: I944ca80e93db04389fb6fe1f88ffc70d067b78b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122768
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 42 | ||||
-rw-r--r-- | sw/source/filter/xml/wrtxml.hxx | 2 |
2 files changed, 23 insertions, 21 deletions
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index aa969c9d40e6..1bbee52b77aa 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -81,9 +81,27 @@ SwXMLWriter::~SwXMLWriter() { } -ErrCode SwXMLWriter::Write_(const uno::Reference < task::XStatusIndicator >& xStatusIndicator, - const OUString& aDocHierarchicalName, bool bNoEmbDS) +ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet) { + uno::Reference<task::XStatusIndicator> xStatusIndicator; + OUString aDocHierarchicalName; + bool bNoEmbDS(false); + + if (pMediumItemSet) + { + const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>( + pMediumItemSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL)); + if (pStatusBarItem) + pStatusBarItem->GetValue() >>= xStatusIndicator; + const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>( + pMediumItemSet->GetItem(SID_DOC_HIERARCHICALNAME)); + if (pDocHierarchItem) + aDocHierarchicalName = pDocHierarchItem->GetValue(); + const SfxBoolItem* pNoEmbDS = pMediumItemSet->GetItem(SID_NO_EMBEDDED_DS); + if (pNoEmbDS) + bNoEmbDS = pNoEmbDS->GetValue(); + } + // Get service factory uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); @@ -447,28 +465,12 @@ ErrCode SwXMLWriter::Write_(const uno::Reference < task::XStatusIndicator >& xSt ErrCode SwXMLWriter::WriteStorage() { - return Write_(uno::Reference<task::XStatusIndicator>(), OUString(), false); + return Write_(nullptr); } ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) { - uno::Reference < task::XStatusIndicator > xStatusIndicator; - OUString aName; - bool bNoEmbDS(false); - - const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>( - aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) ); - if ( pStatusBarItem ) - pStatusBarItem->GetValue() >>= xStatusIndicator; - const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>( - aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) ); - if ( pDocHierarchItem ) - aName = pDocHierarchItem->GetValue(); - const SfxBoolItem* pNoEmbDS = SfxItemSet::GetItem(aTargetMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false); - if (pNoEmbDS) - bNoEmbDS = pNoEmbDS->GetValue(); - - return Write_(xStatusIndicator, aName, bNoEmbDS); + return Write_(aTargetMedium.GetItemSet()); } ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx index 7e4ed6580c15..7b9c6fe08302 100644 --- a/sw/source/filter/xml/wrtxml.hxx +++ b/sw/source/filter/xml/wrtxml.hxx @@ -40,7 +40,7 @@ namespace com::sun::star { class SwXMLWriter : public StgWriter { - ErrCode Write_(const css::uno::Reference < css::task::XStatusIndicator>&, const OUString&, bool bNoEmbDS); + ErrCode Write_(const SfxItemSet* pMediumItemSet); using StgWriter::Write; |