summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-04 15:05:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-06 09:28:10 +0200
commit12a3f5cefeaeb842507dd8038597fb77ca929dd1 (patch)
treec1d496a275fceb1b2fda406f13acca71d9e6947a /sc
parentab9b38a4064141705aa3a3de9a5d73b465ad3af3 (diff)
rework as a shared_ptr
mostly to try and track down a crash on exit of sw uwriter under windows Change-Id: Id67e93863056da319dd8225038d60a7f5783b103 Reviewed-on: https://gerrit.libreoffice.org/39604 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/source/core/data/documen9.cxx4
-rw-r--r--sc/source/ui/docshell/docsh2.cxx8
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx9
4 files changed, 13 insertions, 14 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index e54fb190a96c..a2d496538124 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -348,7 +348,7 @@ private:
ScChangeViewSettings* pChangeViewSettings;
ScScriptTypeData* pScriptTypeData;
ScRefreshTimerControl* pRefreshTimerControl;
- rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharacters;
+ std::shared_ptr<SvxForbiddenCharactersTable> xForbiddenCharacters;
ScDBData* mpAnonymousDBData;
ScFieldEditEngine* pCacheFieldEditEngine;
@@ -1972,8 +1972,8 @@ public:
ScChangeViewSettings* GetChangeViewSettings() const { return pChangeViewSettings; }
SC_DLLPUBLIC void SetChangeViewSettings(const ScChangeViewSettings& rNew);
- const rtl::Reference<SvxForbiddenCharactersTable>& GetForbiddenCharacters();
- void SetForbiddenCharacters(const rtl::Reference<SvxForbiddenCharactersTable>& rNew);
+ const std::shared_ptr<SvxForbiddenCharactersTable>& GetForbiddenCharacters();
+ void SetForbiddenCharacters(const std::shared_ptr<SvxForbiddenCharactersTable>& rNew);
CharCompressType GetAsianCompression() const;
bool IsValidAsianCompression() const;
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 60928ff8ae4b..b62441e8037b 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -625,12 +625,12 @@ void ScDocument::SetImportingXML( bool bVal )
SetLoadingMedium(bVal);
}
-const rtl::Reference<SvxForbiddenCharactersTable>& ScDocument::GetForbiddenCharacters()
+const std::shared_ptr<SvxForbiddenCharactersTable>& ScDocument::GetForbiddenCharacters()
{
return xForbiddenCharacters;
}
-void ScDocument::SetForbiddenCharacters(const rtl::Reference<SvxForbiddenCharactersTable>& rNew)
+void ScDocument::SetForbiddenCharacters(const std::shared_ptr<SvxForbiddenCharactersTable>& rNew)
{
xForbiddenCharacters = rNew;
if ( pEditEngine )
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index e656dc49ce72..4055666e2201 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -115,20 +115,20 @@ void ScDocShell::InitItems()
PutItem( SvxColorListItem( XColorList::GetStdColorList(), SID_COLOR_TABLE ) );
}
- if ( !aDocument.GetForbiddenCharacters().is() ||
+ if ( !aDocument.GetForbiddenCharacters() ||
!aDocument.IsValidAsianCompression() || !aDocument.IsValidAsianKerning() )
{
// get settings from SvxAsianConfig
SvxAsianConfig aAsian;
- if ( !aDocument.GetForbiddenCharacters().is() )
+ if (!aDocument.GetForbiddenCharacters())
{
// set forbidden characters if necessary
uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
if (aLocales.getLength())
{
- rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable =
- new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() );
+ std::shared_ptr<SvxForbiddenCharactersTable> xForbiddenTable(
+ new SvxForbiddenCharactersTable(comphelper::getProcessComponentContext()));
const lang::Locale* pLocales = aLocales.getConstArray();
for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index 2ad3874ea97f..732487b0defc 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -24,19 +24,18 @@
using namespace ::com::sun::star;
-static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh )
+static std::shared_ptr<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh )
{
- rtl::Reference<SvxForbiddenCharactersTable> xRet;
+ std::shared_ptr<SvxForbiddenCharactersTable> xRet;
if ( pDocSh )
{
ScDocument& rDoc = pDocSh->GetDocument();
xRet = rDoc.GetForbiddenCharacters();
- if ( !xRet.is() )
+ if (!xRet)
{
// create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
// so changes can be stored.
-
- xRet = new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() );
+ xRet.reset(new SvxForbiddenCharactersTable(comphelper::getProcessComponentContext()));
rDoc.SetForbiddenCharacters( xRet );
}
}