summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-03-31 17:15:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-03-31 18:11:45 +0200
commit00748b30660abe34ae980cdc7b1a24ac305a90b2 (patch)
tree8a090d08bc42b2c33203a07bcb7011773ccdcfae /sw/source
parent950d42db9c70ce53ffb2dbfc155d63896fff7d71 (diff)
Introduce comphelper::ValueRestorationGuard extending FlagRestorationGuard
... to any value type. Change-Id: I808f4729478cb3f90a86ef30be8158ebc40a6b96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91428 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 62a35f1ab3b5..55b0a4169ac2 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1129,10 +1129,7 @@ void DocxSdrExport::writeOnlyTextOfFrame(ww8::Frame const* pParentFrame)
m_pImpl->setBodyPrAttrList(sax_fastparser::FastSerializerHelper::createAttrList());
::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
- auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
- m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
- ::comphelper::ScopeGuard const sg(
- [this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = nTextTyp; });
+ comphelper::ValueRestorationGuard vg(m_pImpl->getExport().m_nTextTyp, TXT_TXTBOX);
m_pImpl->getExport().WriteText();
}
@@ -1388,10 +1385,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho
{
::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
- auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
- m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
- ::comphelper::ScopeGuard const sg(
- [this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = nTextTyp; });
+ comphelper::ValueRestorationGuard vg(m_pImpl->getExport().m_nTextTyp, TXT_TXTBOX);
m_pImpl->getExport().WriteText();
if (m_pImpl->getParagraphSdtOpen())
{
@@ -1542,10 +1536,7 @@ void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bText
pFS->startElementNS(XML_w, XML_txbxContent);
{
::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
- auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
- m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
- ::comphelper::ScopeGuard const sg(
- [this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = nTextTyp; });
+ comphelper::ValueRestorationGuard vg(m_pImpl->getExport().m_nTextTyp, TXT_TXTBOX);
m_pImpl->getExport().WriteText();
if (m_pImpl->getParagraphSdtOpen())
{