summaryrefslogtreecommitdiffstats
path: root/include/comphelper
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-07-25 14:21:33 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-25 14:37:17 +0200
commit592a02b2869aa04cb6d95cb3d491cd7c5455bd0a (patch)
tree942fcbfd8e582cf6b3d59c34565a2a75b503649d /include/comphelper
parentcid#1465512 Wrong operator used (diff)
downloadcore-592a02b2869aa04cb6d95cb3d491cd7c5455bd0a.tar.gz
core-592a02b2869aa04cb6d95cb3d491cd7c5455bd0a.zip
tdf#130559: don't export preview view data to ODS
... because trying to activate this view on load will throw and crash Unlike in Writer (SwPagePreview), Calc's ScPreviewShell overrides WriteUserDataSequence to export the view data. This was implemented in commit 1f51730f3c5b05c3afaa35431c925482e8152783. That does not give any clue why is this necessary, so I don't want to revert it. So to pass the flag to XViewDataSupplier::getViewData, this patch sets the flag in current context using comphelper::NewFlagContext. This allows to only skip providing the data conditionally. Change-Id: I95d70b30b0b8762d2b5c703c3e572064d0b2ef75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99441 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/SetFlagContextHelper.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/comphelper/SetFlagContextHelper.hxx b/include/comphelper/SetFlagContextHelper.hxx
index d209e398aeab..1f1e2743cea9 100644
--- a/include/comphelper/SetFlagContextHelper.hxx
+++ b/include/comphelper/SetFlagContextHelper.hxx
@@ -56,6 +56,14 @@ inline css::uno::Reference<css::uno::XCurrentContext> NoEnableJavaInteractionCon
return NewFlagContext("DontEnableJava");
}
+inline bool IsContextFlagActive(const OUString& sName)
+{
+ bool bFlag = false;
+ if (const auto xContext = css::uno::getCurrentContext())
+ xContext->getValueByName(sName) >>= bFlag;
+ return bFlag;
+}
+
} // namespace comphelper
#endif // INCLUDED_COMPHELPER_SETFLAGCONTEXTHELPER_HXX