[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 28 15:24:58 UTC 2021
sw/source/filter/xml/wrtxml.cxx | 42 ++++++++++++++++++++--------------------
sw/source/filter/xml/wrtxml.hxx | 2 -
2 files changed, 23 insertions(+), 21 deletions(-)
New commits:
commit 082394a8ff125a7a7a009f60a0002d1d4c2ca7fb
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 28 11:33:33 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 28 17:24:19 2021 +0200
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 at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
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;
More information about the Libreoffice-commits
mailing list