[Libreoffice-commits] .: 13 commits - sw/inc sw/qa sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri May 20 08:37:39 PDT 2011
sw/inc/swdll.hxx | 28 +--------
sw/qa/core/filters-test.cxx | 2
sw/qa/core/swdoc-test.cxx | 2
sw/source/core/bastyp/init.cxx | 45 ++++++++++-----
sw/source/core/doc/acmplwrd.cxx | 2
sw/source/core/doc/number.cxx | 66 ++++++++++++-----------
sw/source/core/docnode/swthreadjoiner.cxx | 10 ++-
sw/source/core/draw/drawdoc.cxx | 4 -
sw/source/core/edit/acorrect.cxx | 2
sw/source/core/edit/autofmt.cxx | 2
sw/source/core/graphic/ndgrf.cxx | 4 -
sw/source/core/inc/swthreadjoiner.hxx | 2
sw/source/core/undo/unins.cxx | 1
sw/source/filter/basflt/fltini.cxx | 20 +++---
sw/source/filter/basflt/iodetect.cxx | 6 +-
sw/source/filter/html/swhtml.cxx | 20 +++---
sw/source/filter/html/wrthtml.cxx | 24 ++++----
sw/source/filter/ww1/fltshell.cxx | 4 -
sw/source/filter/ww8/wrtww8gr.cxx | 10 +--
sw/source/filter/ww8/ww8graf2.cxx | 2
sw/source/ui/app/docsh.cxx | 4 -
sw/source/ui/app/docsh2.cxx | 8 +-
sw/source/ui/app/docshdrw.cxx | 2
sw/source/ui/app/docshini.cxx | 2
sw/source/ui/app/docst.cxx | 4 -
sw/source/ui/app/swdll.cxx | 36 ++++++++++--
sw/source/ui/app/swdllimpl.hxx | 42 ++++++++++++++
sw/source/ui/app/swmodul1.cxx | 29 +++++-----
sw/source/ui/app/swmodule.cxx | 15 ++---
sw/source/ui/chrdlg/pardlg.cxx | 4 -
sw/source/ui/config/optpage.cxx | 6 +-
sw/source/ui/config/viewopt.cxx | 6 +-
sw/source/ui/dbui/dbmgr.cxx | 4 -
sw/source/ui/dbui/mmdocselectpage.cxx | 2
sw/source/ui/dbui/mmoutputpage.cxx | 6 +-
sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 2
sw/source/ui/dialog/uiregionsw.cxx | 8 +-
sw/source/ui/dochdl/gloshdl.cxx | 12 ++--
sw/source/ui/dochdl/swdtflvr.cxx | 8 +-
sw/source/ui/docvw/edtwin.cxx | 16 ++---
sw/source/ui/docvw/extedit.cxx | 2
sw/source/ui/docvw/romenu.cxx | 2
sw/source/ui/fmtui/tmpdlg.cxx | 4 -
sw/source/ui/lingu/olmenu.cxx | 2
sw/source/ui/misc/glossary.cxx | 26 ++++-----
sw/source/ui/misc/glshell.cxx | 4 -
sw/source/ui/misc/pggrid.cxx | 6 +-
sw/source/ui/shells/drawdlg.cxx | 2
sw/source/ui/shells/drawsh.cxx | 2
sw/source/ui/shells/drwtxtsh.cxx | 2
sw/source/ui/shells/textsh.cxx | 14 ++--
sw/source/ui/shells/textsh1.cxx | 16 ++---
sw/source/ui/table/tabledlg.cxx | 4 -
sw/source/ui/uiview/srcview.cxx | 8 +-
sw/source/ui/uiview/view2.cxx | 6 +-
sw/source/ui/uno/SwXFilterOptions.cxx | 2
sw/source/ui/uno/dlelstnr.cxx | 4 -
sw/source/ui/uno/unoatxt.cxx | 6 +-
sw/source/ui/uno/unodoc.cxx | 6 +-
sw/source/ui/uno/unomailmerge.cxx | 2
sw/source/ui/uno/unomodule.cxx | 4 -
sw/source/ui/vba/vbaapplication.cxx | 4 -
sw/source/ui/wrtsh/wrtsh1.cxx | 2
63 files changed, 335 insertions(+), 267 deletions(-)
New commits:
commit c7224910e394eb7fdf8612559aee07d3aa4f03bd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 20 09:38:26 2011 +0100
add this for better singleton behaviour
diff --git a/sw/source/ui/app/swdllimpl.hxx b/sw/source/ui/app/swdllimpl.hxx
new file mode 100644
index 0000000..7472436
--- /dev/null
+++ b/sw/source/ui/app/swdllimpl.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm at redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm at redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SWDLL_IMPL_INCLUDE
+#define SWDLL_IMPL_INCLUDE
+
+class SwDLL
+{
+public:
+ static void RegisterFactories();
+ static void RegisterInterfaces();
+ static void RegisterControls();
+
+ SwDLL();
+ ~SwDLL();
+};
+
+#endif
commit f63a4a87d8a0d0a777375d7fbe2a57600b7a80ab
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 20 09:08:41 2011 +0100
tweak globals to be well-behaved singleton
diff --git a/sw/inc/swdll.hxx b/sw/inc/swdll.hxx
index ee4f5d5..67c11e9 100644
--- a/sw/inc/swdll.hxx
+++ b/sw/inc/swdll.hxx
@@ -28,40 +28,18 @@
#ifndef SW_SWDLL_HXX
#define SW_SWDLL_HXX
-class StatusBar;
-
#include <sfx2/sfxdefs.hxx>
#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-
-//-------------------------------------------------------------------------
-
-class SwDLL
-
/**
* This class is a wrapper for a Load-On-Demand-DLL. One instance
* per SfxApplication will be created for the runtime of
* SfxApplication-subclass::Main().
- *
- * Remember: Do export this class! It is used by the application.
*/
-
+namespace SwGlobals
{
-
- static void RegisterFactories();
- static void RegisterInterfaces();
- static void RegisterControls();
-public:
- // Ctor/Dtor must be linked to the application
- SwDLL();
- ~SwDLL();
-
- static void Init(); // called directly after loading the DLL
- static void Exit(); // called directly befor unloading the DLL
-};
-
-//-------------------------------------------------------------------------
+ void ensure();
+}
#define SW_DLL() ( *(SwModule**) GetAppData(SHL_WRITER) )
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 3c6ec0a..253e666 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -206,7 +206,7 @@ FiltersTest::FiltersTest()
InitVCL(xSM);
- //This is a bit of a fudge, we do this to ensure that SwDLL::Init, which is
+ //This is a bit of a fudge, we do this to ensure that SwGlobals::ensure, which is
//a private symbol to us, gets called
m_xWriterComponent =
xSM->createInstance(rtl::OUString(
diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx
index e4de51f..e0def7a 100644
--- a/sw/qa/core/swdoc-test.cxx
+++ b/sw/qa/core/swdoc-test.cxx
@@ -207,7 +207,7 @@ SwDocTest::SwDocTest()
InitVCL(xSM);
- SwDLL::Init();
+ SwGlobals::ensure();
ErrorHandler::RegisterDisplay(&aWndFunc);
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 4765844..25156a1 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1872,7 +1872,7 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
// dann lasse doch mal das AutoCorrect auf den akt. TextNode los
void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
{
- SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get().GetAutoCorrect();
long aSvxFlags = pATst->GetFlags( );
bool bReplaceQuote = ( aSvxFlags & ChgQuotes ) > 0;
bool bReplaceSglQuote = ( aSvxFlags & ChgSglQuotes ) > 0;
diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx
index d3a55d9..f99ea47 100644
--- a/sw/source/ui/app/swdll.cxx
+++ b/sw/source/ui/app/swdll.cxx
@@ -46,6 +46,8 @@
#include <cfgid.h>
#include <unotools/moduleoptions.hxx>
+#include <comphelper/scoped_disposing_ptr.hxx>
+#include <comphelper/processfactory.hxx>
#include <svx/fmobjfac.hxx>
#include <svx/svdfield.hxx>
@@ -53,7 +55,32 @@
#include <unomid.h>
-void SwDLL::Init()
+#include "swdllimpl.hxx"
+
+namespace
+{
+ //Holds a SwDLL and release it on exit, or dispose of the
+ //default XComponent, whichever comes first
+ class SwDLLInstance : public comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>
+ {
+ public:
+ SwDLLInstance() : comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>(::com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), ::com::sun::star::uno::UNO_QUERY_THROW), new SwDLL)
+ {
+ }
+ };
+
+ struct theSwDLLInstance : public rtl::Static<SwDLLInstance, theSwDLLInstance> {};
+}
+
+namespace SwGlobals
+{
+ void ensure()
+ {
+ theSwDLLInstance::get();
+ }
+}
+
+SwDLL::SwDLL()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDLL" );
@@ -115,11 +142,8 @@ void SwDLL::Init()
RegisterControls();
}
-void SwDLL::Exit()
+SwDLL::~SwDLL()
{
- // called directly befor unloading the DLL
- // do whatever you want, Sw-DLL is accessible
-
// Pool has to be deleted before statics are
SW_MOD()->RemoveAttrPool();
@@ -128,10 +152,12 @@ void SwDLL::Exit()
::_FinitCore();
// sign out Objekt-Factory
SdrObjFactory::RemoveMakeObjectHdl(LINK(&aSwObjectFactory, SwObjectFactory, MakeObject ));
+#if 0
// the SwModule must be destroyed
SwModule** ppShlPtr = (SwModule**) GetAppData(SHL_WRITER);
delete (*ppShlPtr);
(*ppShlPtr) = NULL;
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 533e415..d3efbbe 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -147,6 +147,8 @@ sal_Bool bNoInterrupt = sal_False;
#include <unomid.h>
+#include "swdllimpl.hxx"
+
using namespace com::sun::star;
@@ -202,12 +204,9 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors
// replace SvxAutocorrect with SwAutocorrect
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- if( pACfg )
- {
- const SvxAutoCorrect* pOld = pACfg->GetAutoCorrect();
- pACfg->SetAutoCorrect(new SwAutoCorrect( *pOld ));
- }
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect();
+ rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld ));
StartListening( *SFX_APP() );
@@ -254,8 +253,6 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser()
SwModule::~SwModule()
{
- SetPool(0);
- SfxItemPool::Free(pAttrPool);
delete pErrorHdl;
EndListening( *SFX_APP() );
}
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 8d8aa1c..fbebe8d 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -185,7 +185,7 @@ uno::Reference<uno::XInterface> SAL_CALL SwXFilterOptions_createInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
return (::cppu::OWeakObject*) new SwXFilterOptions;
}
diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx
index 8eaa899..0505141 100644
--- a/sw/source/ui/uno/dlelstnr.cxx
+++ b/sw/source/ui/uno/dlelstnr.cxx
@@ -155,9 +155,9 @@ void SAL_CALL SwLinguServiceEventListener::disposing(
{
SolarMutexGuard aGuard;
- if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
+ if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
xLngSvcMgr = 0;
- if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
+ if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
xGCIterator = 0;
}
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index db0727e..8ddba45 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -76,7 +76,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(
{
//the module may not be loaded
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
static uno::Reference< uno::XInterface > xAText = (cppu::OWeakObject*)new SwXAutoTextContainer();;
return xAText;
}
@@ -415,12 +415,12 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwDoc* pGDoc = pGlosGroup->GetDoc();
// Bis es eine Option dafuer gibt, base util::URL loeschen
- if(pCfg->IsSaveRelFile())
+ if(rCfg.IsSaveRelFile())
{
INetURLObject aTemp(pGlosGroup->GetFileName());
pGlosGroup->SetBaseURL( aTemp.GetMainURL(INetURLObject::NO_DECODE));
diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx
index 400c2c5..070c429 100644
--- a/sw/source/ui/uno/unodoc.cxx
+++ b/sw/source/ui/uno/unodoc.cxx
@@ -66,7 +66,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -95,7 +95,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -122,7 +122,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 32a83bd..6d6f166 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -1241,7 +1241,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(
SolarMutexGuard aGuard;
//the module may not be loaded
- SwDLL::Init();
+ SwGlobals::ensure();
uno::Reference< uno::XInterface > xRef = (cppu::OWeakObject *) new SwXMailMerge();
return xRef;
}
diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx
index 12f4736..7391b48 100644
--- a/sw/source/ui/uno/unomodule.cxx
+++ b/sw/source/ui/uno/unomodule.cxx
@@ -71,7 +71,7 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons
uno::Reference< uno::XInterface > xThis(static_cast< frame::XNotifyingDispatch* >(this));
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
sal_Int16 aState = frame::DispatchResultState::DONTKNOW;
@@ -138,7 +138,7 @@ REFERENCE< XDISPATCH > SAL_CALL SwUnoModule::queryDispatch(
REFERENCE< XDISPATCH > xReturn;
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
if ( pSlot )
xReturn = REFERENCE< XDISPATCH >(static_cast< XDISPATCH* >(this), uno::UNO_QUERY);
commit 2e34cd887e51b49fd35b35e42c4b409051569c7b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 20 09:06:56 2011 +0100
return by ref instead of pointer
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 2d55c66..768c72c 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -424,7 +424,7 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
{
pImpl->RemoveDocument(rDoc);
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
const sal_Bool bDelete = !pACorr->GetSwFlags().bAutoCmpltKeepList;
for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 210e055..bee215f 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -456,7 +456,7 @@ void SwAutoCorrExceptWord::CheckChar( const SwPosition& rPos, sal_Unicode cChr )
rPos.nContent.GetIndex() == nCntnt )
{
// die akt. Autokorrektur besorgen:
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
// dann in die Liste aufnehmen:
if( CptlSttWrd & nFlags )
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 1f01c14..f00f233 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -126,7 +126,7 @@ const SfxFilter* SwIoSystem::GetFilterOfFormat(const String& rFmtNm,
if( pFltCnt )
{
SfxFilterMatcher aMatcher( pFltCnt->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
while ( pFilter )
{
@@ -234,7 +234,7 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
}
SfxFilterMatcher aMatcher( rFltContainer.GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFltr = aIter.First();
while ( pFltr )
{
@@ -298,7 +298,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const String& rFileName,
return 0;
SfxFilterMatcher aMatcher( pFCntnr->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
if ( !pFilter )
return 0;
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 3cef695..1a3fa6a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -338,16 +338,16 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
memset( &aAttrTab, 0, sizeof( _HTMLAttrTable ));
// Die Font-Groessen 1-7 aus der INI-Datei lesen
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- aFontHeights[0] = pHtmlOptions->GetFontSize( 0 ) * 20;
- aFontHeights[1] = pHtmlOptions->GetFontSize( 1 ) * 20;
- aFontHeights[2] = pHtmlOptions->GetFontSize( 2 ) * 20;
- aFontHeights[3] = pHtmlOptions->GetFontSize( 3 ) * 20;
- aFontHeights[4] = pHtmlOptions->GetFontSize( 4 ) * 20;
- aFontHeights[5] = pHtmlOptions->GetFontSize( 5 ) * 20;
- aFontHeights[6] = pHtmlOptions->GetFontSize( 6 ) * 20;
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ aFontHeights[0] = rHtmlOptions.GetFontSize( 0 ) * 20;
+ aFontHeights[1] = rHtmlOptions.GetFontSize( 1 ) * 20;
+ aFontHeights[2] = rHtmlOptions.GetFontSize( 2 ) * 20;
+ aFontHeights[3] = rHtmlOptions.GetFontSize( 3 ) * 20;
+ aFontHeights[4] = rHtmlOptions.GetFontSize( 4 ) * 20;
+ aFontHeights[5] = rHtmlOptions.GetFontSize( 5 ) * 20;
+ aFontHeights[6] = rHtmlOptions.GetFontSize( 6 ) * 20;
- bKeepUnknown = pHtmlOptions->IsImportUnknown();
+ bKeepUnknown = rHtmlOptions.IsImportUnknown();
if(bReadNewDoc)
{
@@ -365,7 +365,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
pDoc->set(IDocumentSettingAccess::HTML_MODE, true);
pCSS1Parser = new SwCSS1Parser( pDoc, aFontHeights, sBaseURL, IsNewDoc() );
- pCSS1Parser->SetIgnoreFontFamily( pHtmlOptions->IsIgnoreFontFamily() );
+ pCSS1Parser->SetIgnoreFontFamily( rHtmlOptions.IsIgnoreFontFamily() );
if( bReadUTF8 )
{
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 6f1e6a4..0e78fae 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -127,20 +127,20 @@ SwHTMLWriter::~SwHTMLWriter()
sal_uLong SwHTMLWriter::WriteStream()
{
// neue Konfiguration setzen
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
// die Fontgroessen 1-7
- aFontHeights[0] = pHtmlOptions->GetFontSize( 0 ) * 20;
- aFontHeights[1] = pHtmlOptions->GetFontSize( 1 ) * 20;
- aFontHeights[2] = pHtmlOptions->GetFontSize( 2 ) * 20;
- aFontHeights[3] = pHtmlOptions->GetFontSize( 3 ) * 20;
- aFontHeights[4] = pHtmlOptions->GetFontSize( 4 ) * 20;
- aFontHeights[5] = pHtmlOptions->GetFontSize( 5 ) * 20;
- aFontHeights[6] = pHtmlOptions->GetFontSize( 6 ) * 20;
+ aFontHeights[0] = rHtmlOptions.GetFontSize( 0 ) * 20;
+ aFontHeights[1] = rHtmlOptions.GetFontSize( 1 ) * 20;
+ aFontHeights[2] = rHtmlOptions.GetFontSize( 2 ) * 20;
+ aFontHeights[3] = rHtmlOptions.GetFontSize( 3 ) * 20;
+ aFontHeights[4] = rHtmlOptions.GetFontSize( 4 ) * 20;
+ aFontHeights[5] = rHtmlOptions.GetFontSize( 5 ) * 20;
+ aFontHeights[6] = rHtmlOptions.GetFontSize( 6 ) * 20;
// ueberhaupt Styles ausgeben
// (dann auch obere und untere Absatz-Abstaende)
- nExportMode = pHtmlOptions->GetExportMode();
+ nExportMode = rHtmlOptions.GetExportMode();
nHTMLMode = GetHtmlMode(0);
if( HTML_CFG_WRITER==nExportMode ||
HTML_CFG_NS40==nExportMode )
@@ -187,7 +187,7 @@ sal_uLong SwHTMLWriter::WriteStream()
sal_Bool bWriteUTF8 = bWriteClipboardDoc;
eDestEnc = bWriteUTF8 ? RTL_TEXTENCODING_UTF8
- : pHtmlOptions->GetTextEncoding();
+ : rHtmlOptions.GetTextEncoding();
const sal_Char *pCharSet =
rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
@@ -195,10 +195,10 @@ sal_uLong SwHTMLWriter::WriteStream()
// Nur noch fuer den MS-IE ziehen wir den Export von Styles vor.
bCfgPreferStyles = HTML_CFG_MSIE==nExportMode;
- bCfgStarBasic = pHtmlOptions->IsStarBasic();
+ bCfgStarBasic = rHtmlOptions.IsStarBasic();
bCfgFormFeed = !IsHTMLMode(HTMLMODE_PRINT_EXT);
- bCfgCpyLinkedGrfs = pHtmlOptions->IsSaveGraphicsLocal();
+ bCfgCpyLinkedGrfs = rHtmlOptions.IsSaveGraphicsLocal();
// die HTML-Vorlage holen
sal_Bool bOldHTMLMode = sal_False;
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 7b06465..f41e10b 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -580,8 +580,8 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if( pFlt->GetUserData().EqualsAscii( "HTML") )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( !pHtmlOpt->IsStarBasic() && pHtmlOpt->IsStarBasicWarning() && HasBasic() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
{
uno::Reference< XLibraryContainer > xLibCont(GetBasicContainer(), UNO_QUERY);
uno::Reference< XNameAccess > xLib;
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 35e971c..fa6dfa1 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -636,7 +636,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
case SID_AUTO_CORRECT_DLG:
{
- SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
SwAutoCompleteWord& rACW = SwDoc::GetAutoCompleteWords();
bool bOldLocked = rACW.IsLockWordLstLocked(),
@@ -801,7 +801,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
SfxObjectFactory &rFact = GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
@@ -1585,11 +1585,11 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
// A EnterBasicCall is not needed here, because nothing is called and
// there can't be any Dok-Basic, that has not yet been loaded inside
// of an HTML document.
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
//#59620# HasBasic() shows, that there already is a BasicManager at the DocShell.
// That was always generated in HTML-Import, when there are
// Macros in the source code.
- if( pHtmlOptions && pHtmlOptions->IsStarBasic() && HasBasic())
+ if( rHtmlOptions.IsStarBasic() && HasBasic())
{
BasicManager *pBasicMan = GetBasicManager();
if( pBasicMan && (pBasicMan != SFX_APP()->GetBasicManager()) )
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 874a8eb..94f4669 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -202,8 +202,8 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY4:
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
rSet.DisableItem( nWhich );
else
{
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 1429bc1..5677a5d 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <boost/scoped_ptr.hpp>
#include <hintids.hxx>
#include <sfx2/request.hxx>
@@ -81,14 +82,14 @@ using namespace ::com::sun::star::view;
using namespace ::com::sun::star::lang;
-void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
+void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell* pSh )
{
// in FrameSets the actual visibility can differ from the ViewOption's setting
- sal_Bool bVScrollChanged = pPref->IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
- sal_Bool bHScrollChanged = pPref->IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
- sal_Bool bVAlignChanged = pPref->IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
+ sal_Bool bVScrollChanged = rPref.IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
+ sal_Bool bHScrollChanged = rPref.IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
+ sal_Bool bVAlignChanged = rPref.IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
- pSh->SetUIOptions(*pPref);
+ pSh->SetUIOptions(rPref);
const SwViewOption* pNewPref = pSh->GetViewOptions();
// Scrollbars on / off
@@ -199,24 +200,24 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
bReadonly = pDocSh->IsReadOnly();
else //Use existing option if DocShell missing
bReadonly = pSh->GetViewOptions()->IsReadonly();
- SwViewOption* pViewOpt;
- if(!bViewOnly)
- pViewOpt = new SwViewOption( *pPref );
+ boost::scoped_ptr<SwViewOption> xViewOpt;
+ if (!bViewOnly)
+ xViewOpt.reset(new SwViewOption(*pPref));
else
- pViewOpt = new SwViewOption( rUsrPref );
- pViewOpt->SetReadonly( bReadonly );
- if( !(*pSh->GetViewOptions() == *pViewOpt) )
+ xViewOpt.reset(new SwViewOption(rUsrPref));
+ xViewOpt->SetReadonly( bReadonly );
+ if( !(*pSh->GetViewOptions() == *xViewOpt) )
{
//is maybe only a ViewShell
pSh->StartAction();
- pSh->ApplyViewOptions( *pViewOpt );
- ((SwWrtShell*)pSh)->SetReadOnlyAvailable(pViewOpt->IsCursorInProtectedArea());
+ pSh->ApplyViewOptions( *xViewOpt );
+ ((SwWrtShell*)pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
pSh->EndAction();
}
if ( pSh->GetViewOptions()->IsReadonly() != bReadonly )
pSh->SetReadonlyOption(bReadonly);
- lcl_SetUIPrefs(pViewOpt, pCurrView, pSh);
+ lcl_SetUIPrefs(*xViewOpt, pCurrView, pSh);
// in the end the Idle-Flag is set again
pPref->SetIdle(sal_True);
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 86f5f31..5e85e3f 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -105,8 +105,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!bDrawParaDlg && (!bHtmlMode || pHtmlOpt->IsPrintLayoutExtension()))
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!bDrawParaDlg && (!bHtmlMode || rHtmlOpt.IsPrintLayoutExtension()))
{
OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index de768a1..afe6d06 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -317,7 +317,7 @@ void SwViewOption::Init( Window *pWin )
sal_Bool SwViewOption::IsAutoCompleteWords() const
{
- const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
return rFlags.bAutoCmpltCollectWords;
}
@@ -334,8 +334,8 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
if(!pShell || PTR_CAST(SwWebDocShell, pShell))
{
nRet = HTMLMODE_ON;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- switch ( pHtmlOpt->GetExportMode() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ switch ( rHtmlOpt.GetExportMode() )
{
case HTML_CFG_MSIE_40:
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 88a5fa6..8268d5d 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -858,8 +858,8 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset="));
sBodyMimeType += ::rtl::OUString::createFromAscii(
rtl_getBestMimeCharsetFromTextEncoding( eEncoding ));
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
else
sBodyMimeType =
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 10fb625..d9865dd 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -151,7 +151,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
SfxObjectFactory &rFact = m_pWizard->GetSwView()->GetDocShell()->GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 1019b06..8a6eaab 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1065,7 +1065,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
//the method SwIOSystemGetFilterOfFormat( ) returns the template filter
//because it uses the same user data :-(
SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
String sFilterUserData( String::CreateFromAscii( FILTER_WW8 ));
while ( pFilter )
@@ -1083,8 +1083,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
case MM_DOCTYPE_HTML:
{
bAsBody = true;
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
break;
case MM_DOCTYPE_TEXT:
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index a4af121..3614cf2 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -481,7 +481,7 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
void SwSpellDialogChildWindow::AddAutoCorrection(
const String& rOld, const String& rNew, LanguageType eLanguage)
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
pACorr->PutText( rOld, rNew, eLanguage );
}
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 85c2c49..08105bb 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1526,8 +1526,8 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
@@ -2206,8 +2206,8 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
{
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index 8289840..69fb2fc 100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -361,10 +361,10 @@ sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortNam
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
const sal_uInt16 nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName,
- pCfg->IsSaveRelFile(), pOnlyTxt );
+ rCfg.IsSaveRelFile(), pOnlyTxt );
if(nSuccess == (sal_uInt16) -1 )
{
InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute();
@@ -441,8 +441,8 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
sal_Bool bCancel = sal_False;
// search for text block
// - don't prefer current group depending on configuration setting
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- sal_uInt16 nFound = !pCfg->IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
// if not found then search in all groups
if( nFound == (sal_uInt16) -1 )
{
@@ -794,9 +794,9 @@ sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName )
SwReader aReader( *pMed, rName );
if( aReader.HasGlossaries( *pR ) )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
bRet = aReader.ReadGlossaries( *pR, *pGlossary,
- pCfg->IsSaveRelFile() );
+ rCfg.IsSaveRelFile() );
}
}
}
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index afbab3c..cd256d0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1403,7 +1403,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
rView.GetViewFrame()->GetBindings().GetRecorder();
if ( !xRecorder.is() )
{
- pACfg = SvxAutoCorrCfg::Get();
+ pACfg = &SvxAutoCorrCfg::Get();
pACorr = pACfg->GetAutoCorrect();
}
@@ -4829,8 +4829,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
// works on the last input character, this is escpecially in Korean text often done
// quotes that are inside of the string are not replaced!
const sal_Unicode aCh = sRecord.GetChar(sRecord.Len() - 1);
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
if(pACorr &&
(( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
@@ -4888,14 +4888,14 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
rView.GetViewFrame()->GetBindings().GetRecorder();
if(!xRecorder.is())
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACfg && pACorr &&
- ( pACfg->IsAutoTextTip() ||
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr &&
+ ( rACfg.IsAutoTextTip() ||
pACorr->GetSwFlags().bAutoCompleteWords ) &&
rSh.GetPrevAutoCorrWord( *pACorr, sWord ) )
{
- ShowAutoTextCorrectQuickHelp(sWord, pACfg, pACorr, sal_True);
+ ShowAutoTextCorrectQuickHelp(sWord, &rACfg, pACorr, sal_True);
}
}
}
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index ec3b136..93f1915 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -206,8 +206,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SvtCJKOptions aCJKOptions;
if(nHtmlMode & HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!rHtmlOpt.IsPrintLayoutExtension())
RemoveTabPage(TP_PARA_EXT);
RemoveTabPage(TP_PARA_ASIAN);
RemoveTabPage(TP_TABULATOR);
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 1e0b5ac..4aa38a8 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -271,9 +271,9 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aNameED.SetMaxTextLen(LONG_LENGTH);
FreeResource();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
- aShowExampleCB.Check( pCfg->IsAutoTextPreview());
+ aShowExampleCB.Check( rCfg.IsAutoTextPreview());
ShowPreviewHdl(&aShowExampleCB);
bIsDocReadOnly = pSh->GetView().GetDocShell()->IsReadOnly() ||
@@ -294,8 +294,8 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
SwGlossaryDlg::~SwGlossaryDlg()
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ rCfg.SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
aCategoryBox.Clear();
aEditBtn.SetPopupMenu(0);
@@ -626,7 +626,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
SfxFilterMatcher aMatcher( String::CreateFromAscii(SwDocShell::Factory().GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
while ( pFilter )
{
@@ -823,12 +823,12 @@ void SwGlossaryDlg::Init()
aCategoryBox.SetUpdateMode( sal_True );
aCategoryBox.Update();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- aFileRelCB.Check( pCfg->IsSaveRelFile() );
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ aFileRelCB.Check( rCfg.IsSaveRelFile() );
aFileRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aNetRelCB.Check( pCfg->IsSaveRelNet() );
+ aNetRelCB.Check( rCfg.IsSaveRelNet() );
aNetRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aInsertTipCB.Check( pCfg->IsAutoTextTip() );
+ aInsertTipCB.Check( rCfg.IsAutoTextTip() );
aInsertTipCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
}
@@ -883,14 +883,14 @@ IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG )
IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox )
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
sal_Bool bCheck = pBox->IsChecked();
if( pBox == &aInsertTipCB )
- pCfg->SetAutoTextTip(bCheck);
+ rCfg.SetAutoTextTip(bCheck);
else if(pBox == &aFileRelCB)
- pCfg->SetSaveRelFile(bCheck);
+ rCfg.SetSaveRelFile(bCheck);
else
- pCfg->SetSaveRelNet(bCheck);
+ rCfg.SetSaveRelNet(bCheck);
return 0;
}
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index 4bc35a1..480d815 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -109,7 +109,7 @@ void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet )
sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
const String& rShortNm, const String& rLongNm )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwTextBlocks * pBlock = ::GetGlossaries()->GetGroupDoc( rGroupName );
SvxMacro aStart(aEmptyStr, aEmptyStr);
@@ -120,7 +120,7 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
pGlosHdl->GetMacros( rShortNm, aStart, aEnd, pBlock );
sal_uInt16 nRet = rSh.SaveGlossaryDoc( *pBlock, rLongNm, rShortNm,
- pCfg->IsSaveRelFile(),
+ rCfg.IsSaveRelFile(),
pBlock->IsOnlyTextBlock( rShortNm ) );
if(aStart.GetMacName().Len() || aEnd.GetMacName().Len() )
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 5c43f8a..5a2b40b 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -172,9 +172,9 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
: CHAR_HARDHYPHEN;
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACorr && pACfg->IsAutoFmtByInput() &&
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr && rACfg.IsAutoFmtByInput() &&
pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
@@ -513,8 +513,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Bool bSingleCol = sal_False;
if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if( HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport ||
HTML_CFG_MSIE_40 == nExport ||
@@ -799,8 +799,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSet.DisableItem( nWhich );
else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
rSet.DisableItem(nWhich);
}
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 930d518..d9debe2 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -604,7 +604,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
case FN_AUTOFORMAT_REDLINE_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
aFlags.bWithRedlining = sal_True;
@@ -648,7 +648,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_AUTOFORMAT_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
rWrtSh.AutoFormat( &aFlags );
@@ -657,11 +657,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case FN_AUTOFORMAT_AUTO:
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !pACfg->IsAutoFmtByInput();
- if( bSet != pACfg->IsAutoFmtByInput() )
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !rACfg.IsAutoFmtByInput();
+ if( bSet != rACfg.IsAutoFmtByInput() )
{
- pACfg->SetAutoFmtByInput( bSet );
+ rACfg.SetAutoFmtByInput( bSet );
GetView().GetViewFrame()->GetBindings().Invalidate( nSlot );
if ( !pItem )
rReq.AppendItem( SfxBoolItem( GetPool().GetWhich(nSlot), bSet ) );
@@ -673,7 +673,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
// erstmal auf Blank defaulten
sal_Unicode cChar = ' ';
- rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get()->GetAutoCorrect(), cChar );
+ rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get().GetAutoCorrect(), cChar );
rReq.Done();
}
break;
@@ -1424,7 +1424,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_AUTOFORMAT_AUTO:
{
- rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get()->IsAutoFmtByInput() ));
+ rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get().IsAutoFmtByInput() ));
}
break;
case FN_GLOSSARY_DLG:
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 50f10d2..6cbd218 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1527,8 +1527,8 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet )
void SwTextFlowPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pItem;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_Bool bFlowAllowed = !bHtmlMode || pHtmlOpt->IsPrintLayoutExtension();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_Bool bFlowAllowed = !bHtmlMode || rHtmlOpt.IsPrintLayoutExtension();
if(bFlowAllowed)
{
// Einfuegen der vorhandenen Seitenvorlagen in die Listbox
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index b078885..9223715 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -197,9 +197,9 @@ rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding)
rtl_TextEncoding eRet = eLoadEncoding;
if(RTL_TEXTENCODING_DONTKNOW == eRet)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
eRet = rtl_getTextEncodingFromMimeCharset( pCharSet );
}
return eRet;
@@ -779,9 +779,9 @@ void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
void SwSrcView::Load(SwDocShell* pDocShell)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
aEditWin.SetReadonly(pDocShell->IsReadOnly());
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 462a6d0..a199d19 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -165,12 +165,12 @@ SwVbaApplication::ListGalleries( const uno::Any& index ) throw (uno::RuntimeExce
sal_Bool SAL_CALL SwVbaApplication::getDisplayAutoCompleteTips() throw (css::uno::RuntimeException)
{
- return SvxAutoCorrCfg::Get()->IsAutoTextTip();
+ return SvxAutoCorrCfg::Get().IsAutoTextTip();
}
void SAL_CALL SwVbaApplication::setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) throw (css::uno::RuntimeException)
{
- SvxAutoCorrCfg::Get()->SetAutoTextTip( _displayAutoCompleteTips );
+ SvxAutoCorrCfg::Get().SetAutoTextTip( _displayAutoCompleteTips );
}
sal_Int32 SAL_CALL SwVbaApplication::getEnableCancelKey() throw (css::uno::RuntimeException)
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 06956ef..162fa14 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -144,7 +144,7 @@ using namespace com::sun::star;
SvxAutoCorrect* lcl_IsAutoCorr()
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
commit a5d56df8be209f9f5601a9985b32e03df23d5a7d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 20 10:36:02 2011 +0100
fix merge conflicts
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 069e79b..5c90202 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -745,7 +745,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
must reside in the same undo group.*/
// record only if it's NOT already present in autocorrection
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
String aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ;
String aNewWord( aSuggestions[ nAltIdx ] );
commit e8aad427dd2f7454c4f06d3b29a41690dd0ea512
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 19 23:26:29 2011 +0100
adjust for return by ref instead of pointer
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index aece9b7..afb1b39 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -386,7 +386,7 @@ Size SwGrfNode::GetTwipSize() const
sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
{
Graphic aGraphic;
- if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), rStrm ) )
+ if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), rStrm ) )
{
const String aUserData( aGrfObj.GetUserData() );
@@ -879,7 +879,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
if ( pStrm )
{
- GraphicFilter::GetGraphicFilter()->ImportGraphic( aTmpGrf, String(), *pStrm );
+ GraphicFilter::GetGraphicFilter().ImportGraphic( aTmpGrf, String(), *pStrm );
delete pStrm;
}
}
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 55dda61..abe88cb 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -1081,7 +1081,7 @@ void SwFltShell::NextPage()
SwFltShell& SwFltShell::AddGraphic( const String& rPicName )
{
// embedded:
- GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
Graphic aGraphic;
// one of: GFF_NOT GFF_BMP GFF_GIF GFF_JPG GFF_PCD GFF_PCX GFF_PNG
// GFF_TIF GFF_XBM GFF_DXF GFF_MET GFF_PCT GFF_SGF GFF_SVM GFF_WMF
@@ -1090,7 +1090,7 @@ SwFltShell& SwFltShell::AddGraphic( const String& rPicName )
URIHelper::SmartRel2Abs(
INetURLObject(GetBaseURL()), rPicName,
URIHelper::GetMaybeFileHdl()) );
- switch (pFilter->ImportGraphic(aGraphic, aDir))
+ switch (rFilter.ImportGraphic(aGraphic, aDir))
{
case GRFILTER_OK:
*this << aGraphic;
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 1bb7fa6..7c58068 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -183,14 +183,14 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
if ( pGraphicStream && !pGraphicStream->GetError() )
{
Graphic aGr1;
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- if( pGF->ImportGraphic( aGr1, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ if( rGF.ImportGraphic( aGr1, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
Graphic aGr2;
delete pGraphicStream;
pGraphicStream =
::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( pRet->GetObjRef() ) );
- if( pGF->ImportGraphic( aGr2, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ if( rGF.ImportGraphic( aGr2, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
if ( aGr1 == aGr2 )
bGraphicNeeded = false;
@@ -775,8 +775,8 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
if ( pGraphicStream && !pGraphicStream->GetError() )
{
Graphic aGr;
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- if( pGF->ImportGraphic( aGr, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ if( rGF.ImportGraphic( aGr, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile aMtf;
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 74c9a49..637bfe0 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -252,7 +252,7 @@ extern void WW8PicShadowToReal( WW8_PIC_SHADOW* pPicS, WW8_PIC* pPic );
bool SwWW8ImplReader::GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc)
{
- return 0 == GraphicFilter::GetGraphicFilter()->ImportGraphic(rGraphic, aEmptyStr, rSrc,
+ return 0 == GraphicFilter::GetGraphicFilter().ImportGraphic(rGraphic, aEmptyStr, rSrc,
GRFILTER_FORMAT_DONTKNOW);
}
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index b7db95c..6d9434f 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1864,8 +1864,8 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
//!!! check at FileSystem - only then it make sense to test graphics !!!
Graphic aGrf;
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
- nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, pFlt );
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
+ nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, &rFlt );
if( nRet )
{
switch( nAction )
@@ -2195,9 +2195,9 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
if( bCheckForGrf )
{
//!!! check at FileSystem - only then it makes sense to test the graphics !!!
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( aBkmk.GetURL(), aEmptyStr,
- aGrf, pFlt );
+ aGrf, &rFlt );
if( !nRet && SW_PASTESDR_SETATTR == nAction &&
SOT_FORMAT_FILE == nFmt &&
// only at frame selection
diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx
index bf39575..cf5236c 100644
--- a/sw/source/ui/docvw/extedit.cxx
+++ b/sw/source/ui/docvw/extedit.cxx
@@ -120,7 +120,7 @@ void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh)
osl::File::move(tempFileBase, tempFileName);
//Write Graphic to the Temp File
- GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt));
String aFilter(rGF.GetExportFormatShortName(nFilter));
String sPath(tempFileName.getStr());
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index a717da3..3be790a 100644
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -429,7 +429,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
aURL.SetSmartURL( aName );
aDlgHelper.SetFileName( aURL.GetName() );
- GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
const sal_uInt16 nCount = rGF.GetExportFormatCount();
String aExt( aURL.GetExtension() );
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 2aa0514..5483aa6 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -222,7 +222,7 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter,
else
{
if( !pFlt )
- pFlt = GraphicFilter::GetGraphicFilter();
+ pFlt = &GraphicFilter::GetGraphicFilter();
nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt );
}
@@ -420,11 +420,11 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
rSh.StartUndo(UNDO_INSERT, &aRewriter);
- int nError = InsertGraphic( aFileName, aFilterName, bAsLink, GraphicFilter::GetGraphicFilter() );
+ int nError = InsertGraphic( aFileName, aFilterName, bAsLink, &GraphicFilter::GetGraphicFilter() );
// Format ist ungleich Current Filter, jetzt mit auto. detection
if( nError == GRFILTER_FORMATERROR )
- nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, GraphicFilter::GetGraphicFilter() );
+ nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, &GraphicFilter::GetGraphicFilter() );
if ( rSh.IsFrmSelected() )
{
SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat );
commit 30d68ca191029bcab3b15401c195b6b3634ed526
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 17 22:01:05 2011 +0100
adjust for return by reference
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 77f213e..ce74a58 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -729,7 +729,7 @@ void _InitCore()
pGlobalOLEExcludeList = new SvPtrarr;
- const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
SwDoc::pACmpltWords = new SwAutoCompleteWord( rAFlags.nAutoCmpltListLen,
rAFlags.nAutoCmpltWordLen );
}
commit 1b98800c5e251b565e39c2573b278171ddd781b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 17 22:00:23 2011 +0100
use non-leaky singleton pattern here
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index d51ba38..77f213e 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -134,6 +134,8 @@
#include <fmtmeta.hxx>
+#include <rtl/instance.hxx>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -446,7 +448,6 @@ SwCheckIt* pCheckIt = 0;
CharClass* pAppCharClass = 0;
CollatorWrapper* pCollator = 0, *pCaseCollator = 0;
-::utl::TransliterationWrapper* pTransWrp = 0;
/******************************************************************************
* void _InitCore()
@@ -881,21 +882,37 @@ CollatorWrapper& GetAppCaseCollator()
return *pCaseCollator;
}
-const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
+namespace
{
- if( !pTransWrp )
+ class TransWrp
{
- uno::Reference<
- lang::XMultiServiceFactory > xMSF =
- ::comphelper::getProcessServiceFactory();
+ private:
+ boost::scoped_ptr< ::utl::TransliterationWrapper > xTransWrp;
+ public:
+ TransWrp()
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF =
+ ::comphelper::getProcessServiceFactory();
+
+ xTransWrp.reset(new ::utl::TransliterationWrapper( xMSF,
+ i18n::TransliterationModules_IGNORE_CASE |
+ i18n::TransliterationModules_IGNORE_KANA |
+ i18n::TransliterationModules_IGNORE_WIDTH ));
+
+ xTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
+ }
+ const ::utl::TransliterationWrapper& getTransliterationWrapper() const
+ {
+ return *xTransWrp;
+ }
+ };
+
+ class theTransWrp : public rtl::Static<TransWrp, theTransWrp> {};
+}
- pTransWrp = new ::utl::TransliterationWrapper( xMSF,
- i18n::TransliterationModules_IGNORE_CASE |
- i18n::TransliterationModules_IGNORE_KANA |
- i18n::TransliterationModules_IGNORE_WIDTH );
- pTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
- }
- return *pTransWrp;
+const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
+{
+ return theTransWrp::get().getTransliterationWrapper();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7f40a32450854fe3ae32086ec3dd823b58dcc5a7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 17 21:29:32 2011 +0100
adjust to ensure rename
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 4599fab..533e415 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -185,7 +185,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
{
SetName( String::CreateFromAscii("StarWriter") );
pSwResMgr = GetResMgr();
- SvxErrorHandler::Get();
+ SvxErrorHandler::ensure();
pErrorHdl = new SfxErrorHandler( RID_SW_ERRHDL,
ERRCODE_AREA_SW,
ERRCODE_AREA_SW_END,
commit b8eb4bb828111a30fca0fca7e90c2229c61318f7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 17 11:36:37 2011 +0100
valgrind: use non-leaky singleton pattern here
diff --git a/sw/source/core/docnode/swthreadjoiner.cxx b/sw/source/core/docnode/swthreadjoiner.cxx
index 15df350..b549458 100644
--- a/sw/source/core/docnode/swthreadjoiner.cxx
+++ b/sw/source/core/docnode/swthreadjoiner.cxx
@@ -30,6 +30,8 @@
#include <finalthreadmanager.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
/** Testing
@@ -38,11 +40,15 @@
using namespace ::com::sun::star;
uno::Reference< util::XJobManager > SwThreadJoiner::mpThreadJoiner;
-osl::Mutex* SwThreadJoiner::mpGetJoinerMutex = new osl::Mutex();
+
+namespace
+{
+ class theJoinerMutex : public rtl::Static<osl::Mutex, theJoinerMutex> {};
+}
uno::Reference< util::XJobManager >& SwThreadJoiner::GetThreadJoiner()
{
- osl::MutexGuard aGuard(*mpGetJoinerMutex);
+ osl::MutexGuard aGuard(theJoinerMutex::get());
if ( !mpThreadJoiner.is() )
{
diff --git a/sw/source/core/inc/swthreadjoiner.hxx b/sw/source/core/inc/swthreadjoiner.hxx
index 950479f..2289ecc 100644
--- a/sw/source/core/inc/swthreadjoiner.hxx
+++ b/sw/source/core/inc/swthreadjoiner.hxx
@@ -29,7 +29,6 @@
#define _SWTHREADJOINER_HXX
#include "com/sun/star/util/XJobManager.hpp"
-#include <osl/mutex.hxx>
/** Testing
@@ -45,7 +44,6 @@ class SwThreadJoiner
private:
static ::com::sun::star::uno::Reference< ::com::sun::star::util::XJobManager > mpThreadJoiner;
- static osl::Mutex* mpGetJoinerMutex;
SwThreadJoiner();
};
commit 2d219ec8df10d74af7e57f824112df624fa96c68
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 16 23:54:45 2011 +0100
adjust for modified singleton
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 1abe913..35a662e 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -78,7 +78,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SvxColorTableItem* pColItem = ( SvxColorTableItem* )
( pDocSh->GetItem( SID_COLOR_TABLE ) );
XColorTable *pXCol = pColItem ? pColItem->GetColorTable() :
- XColorTable::GetStdColorTable();
+ &XColorTable::GetStdColorTable();
SetColorTable( pXCol );
if ( !pColItem )
@@ -93,7 +93,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SetObjectShell( pDocSh );
}
else
- SetColorTable( XColorTable::GetStdColorTable() );
+ SetColorTable( &XColorTable::GetStdColorTable() );
// copy all the default values to the SdrModel
SfxItemPool* pSdrPool = pD->GetAttrPool().GetSecondaryPool();
diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx
index a6beb59..215dc56 100644
--- a/sw/source/ui/app/docshdrw.cxx
+++ b/sw/source/ui/app/docshdrw.cxx
@@ -64,7 +64,7 @@ void SwDocShell::InitDraw()
rOutliner.SetHyphenator( xHyphenator );
}
else
- PutItem( SvxColorTableItem( XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
+ PutItem( SvxColorTableItem( &XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
}
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 23943b7..cd947b4 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -434,7 +434,7 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
{
XColorTable* pTable = pColItem->GetColorTable();
// when a new Table was created, it has to be deleted as well.
- if((void*)pTable != (void*)(XColorTable::GetStdColorTable()) )
+ if(pTable != &XColorTable::GetStdColorTable())
delete pTable;
}
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 4602efe..0864d35 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1978,11 +1978,11 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
aDeletedColorLB.InsertEntry(sAuthor);
aChangedColorLB.InsertEntry(sAuthor);
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
sal_uInt16 i;
- for( i = 0; i < pColorTbl->Count(); ++i )
+ for( i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 41ab7de..4fc9e26 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -149,11 +149,11 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aDisplayCB.SetClickHdl(LINK(this, SwTextGridPage, DisplayGridHdl));
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
aColorLB.InsertAutomaticEntry();
- for( sal_uInt16 i = 0; i < pColorTbl->Count(); ++i )
+ for( sal_uInt16 i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
aColorLB.InsertEntry( aColor, sName );
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index 9e82ea6..d3f5152 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -101,7 +101,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
OSL_ENSURE(pDlg, "Dialogdiet fail!");
const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
- if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+ if(pColorItem->GetColorTable() == &XColorTable::GetStdColorTable())
pDlg->DontDeleteColorTable();
if (pDlg->Execute() == RET_OK)
{
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 6152846..be3917f 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -464,7 +464,7 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 830c67b..0dd4f92 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -304,7 +304,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
commit 365e4143442aeee1e29e5b1e841a9989a953b41a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 16 23:33:23 2011 +0100
valgrind/config leaks: make this a well behaved singleton
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 168a431..a977649 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1045,15 +1045,7 @@ namespace numfunc
class SwDefBulletConfig : private utl::ConfigItem
{
public:
- static SwDefBulletConfig* getInstance()
- {
- if ( mpInstance == 0 )
- {
- mpInstance = new SwDefBulletConfig;
- }
-
- return mpInstance;
- }
+ static SwDefBulletConfig& getInstance();
inline const String& GetFontname() const
{
@@ -1089,8 +1081,9 @@ namespace numfunc
return mnLevelChars[p_nListLevel];
}
- private:
SwDefBulletConfig();
+ ~SwDefBulletConfig();
+ private:
/** sets internal default bullet configuration data to default values
@@ -1124,8 +1117,6 @@ namespace numfunc
virtual void Notify( const uno::Sequence<rtl::OUString>& aPropertyNames );
virtual void Commit();
- static SwDefBulletConfig* mpInstance;
-
// default bullet list configuration data
String msFontname;
bool mbUserDefinedFontname;
@@ -1137,7 +1128,16 @@ namespace numfunc
Font* mpFont;
};
- SwDefBulletConfig* SwDefBulletConfig::mpInstance = 0;
+ namespace
+ {
+ class theSwDefBulletConfig
+ : public rtl::Static<SwDefBulletConfig, theSwDefBulletConfig>{};
+ }
+
+ SwDefBulletConfig& SwDefBulletConfig::getInstance()
+ {
+ return theSwDefBulletConfig::get();
+ }
SwDefBulletConfig::SwDefBulletConfig()
: ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/DefaultBulletList")) ),
@@ -1156,6 +1156,11 @@ namespace numfunc
EnableNotification( GetPropNames() );
}
+ SwDefBulletConfig::~SwDefBulletConfig()
+ {
+ delete mpFont;
+ }
+
void SwDefBulletConfig::SetToDefault()
{
msFontname = String::CreateFromAscii("OpenSymbol");
@@ -1276,22 +1281,22 @@ namespace numfunc
const String& GetDefBulletFontname()
{
- return SwDefBulletConfig::getInstance()->GetFontname();
+ return SwDefBulletConfig::getInstance().GetFontname();
}
bool IsDefBulletFontUserDefined()
{
- return SwDefBulletConfig::getInstance()->IsFontnameUserDefined();
+ return SwDefBulletConfig::getInstance().IsFontnameUserDefined();
}
const Font& GetDefBulletFont()
{
- return SwDefBulletConfig::getInstance()->GetFont();
+ return SwDefBulletConfig::getInstance().GetFont();
}
sal_Unicode GetBulletChar( sal_uInt8 nLevel )
{
- return SwDefBulletConfig::getInstance()->GetChar( nLevel );
+ return SwDefBulletConfig::getInstance().GetChar( nLevel );
}
/** class containing configuration data about user interface behavior
@@ -1304,24 +1309,17 @@ namespace numfunc
class SwNumberingUIBehaviorConfig : private utl::ConfigItem
{
public:
- static SwNumberingUIBehaviorConfig* getInstance()
- {
- if ( mpInstance == 0 )
- {
- mpInstance = new SwNumberingUIBehaviorConfig();
- }
-
- return mpInstance;
- }
+ static SwNumberingUIBehaviorConfig& getInstance();
inline sal_Bool ChangeIndentOnTabAtFirstPosOfFirstListItem() const
{
return mbChangeIndentOnTabAtFirstPosOfFirstListItem;
}
- private:
SwNumberingUIBehaviorConfig();
+ private:
+
/** sets internal configuration data to default values
@author OD
@@ -1347,13 +1345,19 @@ namespace numfunc
virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames );
virtual void Commit();
- static SwNumberingUIBehaviorConfig* mpInstance;
-
// configuration data
sal_Bool mbChangeIndentOnTabAtFirstPosOfFirstListItem;
};
- SwNumberingUIBehaviorConfig* SwNumberingUIBehaviorConfig::mpInstance = 0;
+ namespace
+ {
+ class theSwNumberingUIBehaviorConfig : public rtl::Static<SwNumberingUIBehaviorConfig, theSwNumberingUIBehaviorConfig>{};
+ }
+
+ SwNumberingUIBehaviorConfig& SwNumberingUIBehaviorConfig::getInstance()
+ {
+ return theSwNumberingUIBehaviorConfig::get();
+ }
SwNumberingUIBehaviorConfig::SwNumberingUIBehaviorConfig()
: ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/UserInterfaceBehavior")) ),
@@ -1422,7 +1426,7 @@ namespace numfunc
sal_Bool ChangeIndentOnTabAtFirstPosOfFirstListItem()
{
- return SwNumberingUIBehaviorConfig::getInstance()->ChangeIndentOnTabAtFirstPosOfFirstListItem();
+ return SwNumberingUIBehaviorConfig::getInstance().ChangeIndentOnTabAtFirstPosOfFirstListItem();
}
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
commit 94b3fd5b16b716425ea914ea0e1b8cff2cc4e2d0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 16 12:50:34 2011 +0100
valgrind: leak in undo
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 66fb10b..b0df3b4 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -215,6 +215,7 @@ SwUndoInsert::~SwUndoInsert()
else if( pTxt ) // der eingefuegte Text
delete pTxt;
delete pRedlData;
+ delete pUndoTxt;
}
commit 5de12c482cdb7947707b2c20f55494479470c981
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 10 22:12:27 2011 +0100
config leaks: fix up stale unloader
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 0e21da0..17440ac 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -77,8 +77,7 @@ using rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star;
-SwRead ReadAscii = 0, /*ReadSwg = 0, ReadSw3 = 0,*/
- ReadHTML = 0, ReadXML = 0;
+SwRead ReadAscii = 0, ReadHTML = 0, ReadXML = 0;
Reader* GetRTFReader();
Reader* GetWW8Reader();
@@ -96,7 +95,7 @@ SwReaderWriterEntry aReaderWriter[] =
SwReaderWriterEntry( 0, 0, sal_True ),
SwReaderWriterEntry( &::GetWW8Reader, 0, sal_True ),
SwReaderWriterEntry( 0, &::GetXMLWriter, sal_True ),
- SwReaderWriterEntry( 0, &::GetASCWriter, sal_True ),
+ SwReaderWriterEntry( 0, &::GetASCWriter, sal_False ),
SwReaderWriterEntry( 0, &::GetASCWriter, sal_True )
};
@@ -147,16 +146,15 @@ void _InitFilter()
void _FinitFilter()
{
- // die Reader vernichten
- for( sal_uInt16 n = 0; n < MAXFILTER; ++n )
- {
- SwReaderWriterEntry& rEntry = aReaderWriter[n];
- if( rEntry.bDelReader && rEntry.pReader )
- delete rEntry.pReader, rEntry.pReader = NULL;
- }
+ // die Reader vernichten
+ for( sal_uInt16 n = 0; n < MAXFILTER; ++n )
+ {
+ SwReaderWriterEntry& rEntry = aReaderWriter[n];
+ if( rEntry.bDelReader && rEntry.pReader )
+ delete rEntry.pReader, rEntry.pReader = NULL;
+ }
}
-
/* */
namespace SwReaderWriter {
More information about the Libreoffice-commits
mailing list