summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx28
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hxx11
2 files changed, 31 insertions, 8 deletions
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 490f3ad60f27..6bcd6f24fc7e 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -61,16 +61,30 @@ using namespace com::sun::star::util;
using ::rtl::Uri;
namespace {
+ static ResMgr* pXSLTResMgr = nullptr;
-std::unique_ptr<ResMgr> getXSLTDialogResMgr() {
- return std::unique_ptr<ResMgr>(
- ResMgr::CreateResMgr(
- "xsltdlg", Application::GetSettings().GetUILanguageTag()));
+ ResMgr* getXSLTDialogResMgr()
+ {
+ return pXSLTResMgr;
+ }
+}
+
+EnsureResMgr::EnsureResMgr()
+{
+ if (!pXSLTResMgr)
+ {
+ m_xResMgr.reset(ResMgr::CreateResMgr("xsltdlg", Application::GetSettings().GetUILanguageTag()));
+ pXSLTResMgr = m_xResMgr.get();
+ }
}
+EnsureResMgr::~EnsureResMgr()
+{
+ if (m_xResMgr)
+ pXSLTResMgr = nullptr;
}
-#define RESID(x) ResId(x, *getXSLTDialogResMgr().get())
+#define RESID(x) ResId(x, *getXSLTDialogResMgr())
#define RESIDSTR(x) RESID(x).toString()
XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent,
@@ -246,7 +260,7 @@ void XMLFilterSettingsDialog::onNew()
aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";
// execute XML Filter Dialog
- ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr().get(), mxContext, &aTempInfo );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
if ( aDlg->Execute() == RET_OK )
{
// insert the new filter
@@ -265,7 +279,7 @@ void XMLFilterSettingsDialog::onEdit()
filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
// execute XML Filter Dialog
- ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr().get(), mxContext, pOldInfo );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
if ( aDlg->Execute() == RET_OK )
{
filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
index 24617d0261fd..5105c67936c2 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
@@ -55,11 +55,20 @@ public:
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
};
+class EnsureResMgr
+{
+ std::unique_ptr<ResMgr> m_xResMgr;
+public:
+ EnsureResMgr();
+ ~EnsureResMgr();
+};
+
class HeaderBar;
class XMLFilterListBox : public SvTabListBox
{
private:
+ EnsureResMgr m_aEnsureResMgr;
VclPtr<HeaderBar> m_pHeaderBar;
DECL_LINK( TabBoxScrollHdl_Impl, SvTreeListBox*, void );
@@ -118,7 +127,7 @@ private:
OUString createUniqueInterfaceName( const OUString& rInterfaceName );
private:
-
+ EnsureResMgr maEnsureResMgr;
css::uno::Reference< css::uno::XComponentContext > mxContext;
css::uno::Reference< css::container::XNameContainer > mxFilterContainer;
css::uno::Reference< css::container::XNameContainer > mxTypeDetection;