Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3886
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/86/3886/1
Get rid of GlobalEditData::GetStdRefDevice()
This avoids a crash on exit in a dbgutil build on OS X.
The horrible bOwnerOfRefDev crack screams out for boost::shared_ptr, I think?
Change-Id: Icf3ae3c28da0583a44472f36312b07766734bf7b
---
M editeng/source/editeng/eerdll.cxx
M editeng/source/editeng/eerdll2.hxx
M editeng/source/editeng/impedit2.cxx
3 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index c6a008d..704573a 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -79,7 +79,6 @@
}
GlobalEditData::GlobalEditData()
- :
m_aStdRefDevice(::com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(::comphelper::getProcessComponentContext(),
::com::sun::star::uno::UNO_QUERY_THROW))
{
ppDefItems = NULL;
}
@@ -186,16 +185,6 @@
xLanguageGuesser = linguistic2::LanguageGuessing::create(
comphelper::getProcessComponentContext() );
}
return xLanguageGuesser;
-}
-
-OutputDevice* GlobalEditData::GetStdRefDevice()
-{
- if ( !m_aStdRefDevice )
- {
- m_aStdRefDevice.reset(new VirtualDevice);
- m_aStdRefDevice->SetMapMode( MAP_TWIP );
- }
- return m_aStdRefDevice.get();
}
EditResId::EditResId( sal_uInt16 nId ):
diff --git a/editeng/source/editeng/eerdll2.hxx b/editeng/source/editeng/eerdll2.hxx
index ae592c3..2c53b96 100644
--- a/editeng/source/editeng/eerdll2.hxx
+++ b/editeng/source/editeng/eerdll2.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <editeng/forbiddencharacterstable.hxx>
#include <rtl/ref.hxx>
-#include <comphelper/scoped_disposing_ptr.hxx>
class SfxPoolItem;
@@ -32,7 +31,6 @@
private:
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLanguageGuessing > xLanguageGuesser;
- comphelper::scoped_disposing_solar_mutex_reset_ptr<OutputDevice> m_aStdRefDevice;
SfxPoolItem** ppDefItems;
rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable;
@@ -42,13 +40,11 @@
~GlobalEditData();
SfxPoolItem** GetDefItems();
- OutputDevice* GetStdRefDevice();
rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable();
void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable>
xForbiddenChars ) { xForbiddenCharsTable = xForbiddenChars; }
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing >
GetLanguageGuesser();
};
-
#endif //_EERDLL2_HXX
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index b46b23c..8bd7306 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -150,10 +150,8 @@
aOnlineSpellTimer.SetTimeout( 100 );
aOnlineSpellTimer.SetTimeoutHdl( LINK( this, ImpEditEngine, OnlineSpellHdl ) );
- pRefDev = EE_DLL().GetGlobalData()->GetStdRefDevice();
-
// Access data already from here on!
- SetRefDevice( pRefDev );
+ SetRefDevice( NULL );
InitDoc( sal_False );
bCallParaInsertedOrDeleted = true;
@@ -190,11 +188,16 @@
if ( bOwnerOfRefDev )
delete pRefDev;
- pRefDev = pRef;
- bOwnerOfRefDev = false;
-
if ( !pRef )
- pRefDev = EE_DLL().GetGlobalData()->GetStdRefDevice();
+ {
+ pRefDev = new VirtualDevice;
+ pRefDev->SetMapMode( MAP_TWIP );
+ bOwnerOfRefDev = true;
+ } else
+ {
+ pRefDev = pRef;
+ bOwnerOfRefDev = false;
+ }
nOnePixelInRef = (sal_uInt16)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width();
@@ -210,8 +213,7 @@
if ( GetRefDevice()->GetMapMode() == rMapMode )
return;
- // When RefDev == GlobalRefDev => create own!
- if ( !bOwnerOfRefDev && ( pRefDev == EE_DLL().GetGlobalData()->GetStdRefDevice() ) )
+ if ( !bOwnerOfRefDev )
{
pRefDev = new VirtualDevice;
pRefDev->SetMapMode( MAP_TWIP );
--
To view, visit https://gerrit.libreoffice.org/3886
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf3ae3c28da0583a44472f36312b07766734bf7b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Tor Lillqvist <tml@iki.fi>
Context
- [PATCH] Get rid of GlobalEditData::GetStdRefDevice() · Tor Lillqvist (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.